@sjcrh/proteinpaint-client 2.76.0 → 2.76.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/{2dmaf-74b99126.js → 2dmaf-593951c7.js} +1 -1
  2. package/dist/{AppHeader-cecb39c2.js → AppHeader-29b88e14.js} +1 -1
  3. package/dist/{ColorScale-21cab8d2.js → ColorScale-3d3c42dc.js} +1 -1
  4. package/dist/{DEanalysis-95bad59a.js → DEanalysis-f81e0f19.js} +1 -1
  5. package/dist/{Disco-a6e921a0.js → Disco-db386f7a.js} +1 -1
  6. package/dist/{Disco.UI-9ad999ed.js → Disco.UI-8ed9cb39.js} +1 -1
  7. package/dist/{DragControls-e3b6a937.js → DragControls-d6250d18.js} +1 -1
  8. package/dist/{DziViewer-354a790d.js → DziViewer-9352e224.js} +1 -1
  9. package/dist/{FilterRxComp-701a1480.js → FilterRxComp-0f35b322.js} +1 -1
  10. package/dist/{FilterStateless-54c0b763.js → FilterStateless-b1c6ee04.js} +1 -1
  11. package/dist/{HicApp-d5a946bf.js → HicApp-14b94b20.js} +1 -1
  12. package/dist/{OrbitControls-694652cd.js → OrbitControls-45f56ed4.js} +1 -1
  13. package/dist/{WSIViewer-dc7f8eb0.js → WSIViewer-80f60272.js} +1 -1
  14. package/dist/{adSandbox-f438e388.js → adSandbox-94424b88.js} +1 -1
  15. package/dist/app-2cd97738.js +1 -0
  16. package/dist/{app-3320ab6f.js → app-686b9547.js} +1 -1
  17. package/dist/app-f031940d.js +1 -0
  18. package/dist/app.js +1 -1
  19. package/dist/{bam-431875ef.js → bam-6631640f.js} +1 -1
  20. package/dist/barchart-3c5d734c.js +1 -0
  21. package/dist/{barchart.events-da29c90d.js → barchart.events-df44e666.js} +1 -1
  22. package/dist/{bars.renderer-dcfdd59b.js → bars.renderer-b232d882.js} +1 -1
  23. package/dist/{block-6aedd569.js → block-4134e823.js} +1 -1
  24. package/dist/block.lazyload-eda77d9b.js +1 -0
  25. package/dist/{block.legend-d3f61ef7.js → block.legend-d2b7f1cb.js} +1 -1
  26. package/dist/{block.mds-3ad17dfa.js → block.mds-ebe7b58d.js} +1 -1
  27. package/dist/{block.mds.cnv-857ba868.js → block.mds.cnv-99f0a414.js} +1 -1
  28. package/dist/{block.mds.expressionrank-7e3b208c.js → block.mds.expressionrank-96bf864b.js} +1 -1
  29. package/dist/{block.mds.expressionstat-f2d31c86.js → block.mds.expressionstat-dcab3fd1.js} +1 -1
  30. package/dist/{block.mds.geneboxplot-f0fbaf12.js → block.mds.geneboxplot-e5b2a4ce.js} +1 -1
  31. package/dist/{block.mds.junction-7f87f48f.js → block.mds.junction-534eef9b.js} +1 -1
  32. package/dist/{block.mds.svcnv-ac035c12.js → block.mds.svcnv-de6a3c7d.js} +1 -1
  33. package/dist/{block.mds.svcnv.share-886d9479.js → block.mds.svcnv.share-2c2c16db.js} +1 -1
  34. package/dist/{block.mds2-7852c1ee.js → block.mds2-373fcb4d.js} +1 -1
  35. package/dist/{block.svg-9b916fa6.js → block.svg-be5d741d.js} +1 -1
  36. package/dist/{block.tk.aicheck-6770e333.js → block.tk.aicheck-f2da5e81.js} +1 -1
  37. package/dist/{block.tk.ase-ee807e59.js → block.tk.ase-ef848944.js} +1 -1
  38. package/dist/{block.tk.bam-00fba6e8.js → block.tk.bam-11fcba17.js} +1 -1
  39. package/dist/{block.tk.bedgraphdot-7fda78e9.js → block.tk.bedgraphdot-a81b0709.js} +1 -1
  40. package/dist/{block.tk.bigwig.ui-cc1a42f3.js → block.tk.bigwig.ui-f8e5ba71.js} +1 -1
  41. package/dist/{block.tk.hicstraw-526470e3.js → block.tk.hicstraw-e7072b25.js} +1 -1
  42. package/dist/{block.tk.junction-b43a4cda.js → block.tk.junction-1c9a7854.js} +1 -1
  43. package/dist/{block.tk.junction.textmatrixui-a60ed78a.js → block.tk.junction.textmatrixui-ffecbb16.js} +1 -1
  44. package/dist/{block.tk.ld-d15bde41.js → block.tk.ld-274c3a82.js} +1 -1
  45. package/dist/{block.tk.menu-3aeb93c6.js → block.tk.menu-e970cd4a.js} +1 -1
  46. package/dist/{block.tk.pgv-9af2bd64.js → block.tk.pgv-f4d4dbf7.js} +1 -1
  47. package/dist/{boxplot-e17a17b7.js → boxplot-44d3b48f.js} +1 -1
  48. package/dist/{brainImaging-bf2ceee9.js → brainImaging-2eaa419d.js} +1 -1
  49. package/dist/{brush-aa175142.js → brush-bb4ae2fb.js} +1 -1
  50. package/dist/{categorical-a52014a1.js → categorical-db9b0175.js} +1 -1
  51. package/dist/{condition-c646e357.js → condition-4e788f7d.js} +1 -1
  52. package/dist/{controls-287e6efa.js → controls-3c1691d7.js} +1 -1
  53. package/dist/{controls.btns-79b805dd.js → controls.btns-5b1240c8.js} +1 -1
  54. package/dist/controls.config-81cd5749.js +1 -0
  55. package/dist/cuminc-c4db28f0.js +1 -0
  56. package/dist/{customdata.inputui-dc49d94b.js → customdata.inputui-f9234d1f.js} +1 -1
  57. package/dist/{dataDownload-3a3d4f33.js → dataDownload-a4dfa2d0.js} +1 -1
  58. package/dist/{databrowser.ui-d8d3f8fd.js → databrowser.ui-a64bab0c.js} +1 -1
  59. package/dist/{density-a82a8b1c.js → density-69a732f6.js} +1 -1
  60. package/dist/{dictionary-c5a19d90.js → dictionary-e2232e84.js} +1 -1
  61. package/dist/{drag-7b30ba17.js → drag-d8daa62f.js} +1 -1
  62. package/dist/{e2pca-82765817.js → e2pca-f9324654.js} +1 -1
  63. package/dist/{ep-d017ec2f.js → ep-a5c1ee3a.js} +1 -1
  64. package/dist/{facet-a9b44ef3.js → facet-98971c68.js} +1 -1
  65. package/dist/{fusion.parse-d40d0b9d.js → fusion.parse-466ded6d.js} +1 -1
  66. package/dist/{geneExpClustering-34c3f518.js → geneExpClustering-66c05fb1.js} +1 -1
  67. package/dist/{geneExpression-0d1b7244.js → geneExpression-5685eae2.js} +1 -1
  68. package/dist/{geneExpression-589f485b.js → geneExpression-b5d0261f.js} +1 -1
  69. package/dist/{geneExpression-7d14983f.js → geneExpression-ff46a389.js} +1 -1
  70. package/dist/{geneORA-903a780f.js → geneORA-f1a90d02.js} +1 -1
  71. package/dist/{geneVariant-92c4e870.js → geneVariant-1cf17b3b.js} +1 -1
  72. package/dist/{geneVariant-89601b34.js → geneVariant-d0b9e1cb.js} +1 -1
  73. package/dist/{genefusion.ui-7e22e811.js → genefusion.ui-89a727ea.js} +1 -1
  74. package/dist/{genesearch-a4e19f0d.js → genesearch-41cb55ce.js} +1 -1
  75. package/dist/{geneset-108a39d2.js → geneset-b63496eb.js} +1 -1
  76. package/dist/{genomeBrowser-12f86a36.js → genomeBrowser-ec8fbddc.js} +1 -1
  77. package/dist/{genomeBrowser.controls-d5067811.js → genomeBrowser.controls-2dcaf4f5.js} +1 -1
  78. package/dist/{groupsetting-b4416a96.js → groupsetting-3fef59f9.js} +1 -1
  79. package/dist/{gsea-543dab25.js → gsea-3075c82c.js} +1 -1
  80. package/dist/{hierCluster-26e14090.js → hierCluster-33a828a1.js} +1 -1
  81. package/dist/hierCluster.config-fa799d06.js +1 -0
  82. package/dist/{hierCluster.interactivity-e56f6542.js → hierCluster.interactivity-6d453881.js} +1 -1
  83. package/dist/{hierCluster.renderers-74a64cf5.js → hierCluster.renderers-6279d7fb.js} +1 -1
  84. package/dist/{html.legend-a3f4ebfe.js → html.legend-fac5cb07.js} +1 -1
  85. package/dist/{imagePlot-b9eae4ae.js → imagePlot-38254245.js} +1 -1
  86. package/dist/{lasso-f767f634.js → lasso-e8b9500e.js} +1 -1
  87. package/dist/{launch.adhoc-abca6af3.js → launch.adhoc-2799109b.js} +1 -1
  88. package/dist/{leftlabel.sample-24c2388d.js → leftlabel.sample-afcdcefd.js} +1 -1
  89. package/dist/{legacyDataset-e0e201ab.js → legacyDataset-3b08c91a.js} +1 -1
  90. package/dist/{log-99af3443.js → log-4d84c357.js} +1 -1
  91. package/dist/{lollipop-806f8fa4.js → lollipop-64c5cdfc.js} +1 -1
  92. package/dist/{maf-b06579e4.js → maf-fd4ffbd0.js} +1 -1
  93. package/dist/{maftimeline-4840a380.js → maftimeline-3e892da7.js} +1 -1
  94. package/dist/{matrix-00bb50ff.js → matrix-e371888a.js} +1 -1
  95. package/dist/{matrix.cells-914dd0c6.js → matrix.cells-eb4110a7.js} +1 -1
  96. package/dist/{matrix.cluster-783ceab0.js → matrix.cluster-0df274ed.js} +1 -1
  97. package/dist/{matrix.config-6ce74dfe.js → matrix.config-3ef822b9.js} +1 -1
  98. package/dist/{matrix.controls-7b2a6f95.js → matrix.controls-42bb2063.js} +1 -1
  99. package/dist/{matrix.data-dac4f1b7.js → matrix.data-27b8e3a9.js} +1 -1
  100. package/dist/{matrix.dom-4e10bbe9.js → matrix.dom-1bbe1f39.js} +1 -1
  101. package/dist/{matrix.groups-b9fca14a.js → matrix.groups-67606700.js} +1 -1
  102. package/dist/{matrix.interactivity-84169b43.js → matrix.interactivity-cdcc56c9.js} +1 -1
  103. package/dist/{matrix.layout-dd5a44fd.js → matrix.layout-857cd336.js} +1 -1
  104. package/dist/{matrix.legend-ac6d45e6.js → matrix.legend-09f6dc57.js} +1 -1
  105. package/dist/{matrix.renderers-78010275.js → matrix.renderers-d392fb69.js} +1 -1
  106. package/dist/{matrix.serieses-9b4fd744.js → matrix.serieses-b03b62aa.js} +1 -1
  107. package/dist/{matrix.sort-014d798d.js → matrix.sort-9440c86a.js} +1 -1
  108. package/dist/{matrix.sorterUi-9bf7e6f9.js → matrix.sorterUi-2c5eb35f.js} +1 -1
  109. package/dist/{mavb-c6be46fc.js → mavb-9d86df89.js} +1 -1
  110. package/dist/{mds.fimo-bff6a1ed.js → mds.fimo-bffccb9f.js} +1 -1
  111. package/dist/{mds.samplescatterplot-9a02b9fb.js → mds.samplescatterplot-b3908cc7.js} +1 -1
  112. package/dist/{mds.survivalplot-055549f4.js → mds.survivalplot-9ad7dabc.js} +1 -1
  113. package/dist/{metaboliteIntensity-fac92f8b.js → metaboliteIntensity-ec3176f4.js} +1 -1
  114. package/dist/niceNumLabels-5f45218a.js +1 -0
  115. package/dist/{nodrag-16ad4b03.js → nodrag-ab7d5a9f.js} +1 -1
  116. package/dist/{notify-224cccbd.js → notify-59f61230.js} +1 -1
  117. package/dist/{numeric-b0b17185.js → numeric-4853b665.js} +1 -1
  118. package/dist/{numeric.binary-1f9e93f2.js → numeric.binary-1dd9a2b4.js} +1 -1
  119. package/dist/{numeric.continuous-ebcd0567.js → numeric.continuous-ed132eea.js} +1 -1
  120. package/dist/{numeric.discrete-7b97044a.js → numeric.discrete-d780d076.js} +1 -1
  121. package/dist/{numeric.spline-1be88f3d.js → numeric.spline-abe07708.js} +1 -1
  122. package/dist/{numeric.toggle-7fa2a770.js → numeric.toggle-647423dd.js} +1 -1
  123. package/dist/oncomatrix-7ac995a2.js +1 -0
  124. package/dist/{parseData-21fe9822.js → parseData-567f3d70.js} +1 -1
  125. package/dist/{plot.2dvaf-18a35e4b.js → plot.2dvaf-4016e75e.js} +1 -1
  126. package/dist/plot.app-d6fe76e2.js +1 -0
  127. package/dist/plot.barplot-d2fc5020.js +1 -0
  128. package/dist/{plot.boxplot-fe3046c6.js → plot.boxplot-76229491.js} +1 -1
  129. package/dist/{plot.brainImaging-2ceb6023.js → plot.brainImaging-39b80a1c.js} +1 -1
  130. package/dist/{plot.disco-6011f87f.js → plot.disco-9a544f9a.js} +1 -1
  131. package/dist/{plot.dzi-6728a7c8.js → plot.dzi-f1658ebf.js} +1 -1
  132. package/dist/{plot.ssgq-5581dc56.js → plot.ssgq-aeb2dabc.js} +1 -1
  133. package/dist/{plot.vaf2cov-b2284c64.js → plot.vaf2cov-ba8332ed.js} +1 -1
  134. package/dist/{plot.wsi-9a9d4034.js → plot.wsi-2d802557.js} +1 -1
  135. package/dist/{profileBarchart-0476f1f8.js → profileBarchart-72adc533.js} +1 -1
  136. package/dist/{profileHome-32eb9b50.js → profileHome-37fd52e5.js} +1 -1
  137. package/dist/{profilePlot-c7e099e8.js → profilePlot-0b897a05.js} +1 -1
  138. package/dist/profilePolar-a7248d48.js +1 -0
  139. package/dist/profileRadar-1ba5d8fd.js +1 -0
  140. package/dist/profileRadarFacility-452e76ef.js +1 -0
  141. package/dist/{profileSummary-b114204f.js → profileSummary-7f0eacf0.js} +1 -1
  142. package/dist/{recover-49e09de0.js → recover-74f2e965.js} +1 -1
  143. package/dist/{regression.inputs-a761f40d.js → regression.inputs-ff00f74e.js} +1 -1
  144. package/dist/{regression.inputs.values.table-5929d25a.js → regression.inputs.values.table-1753d56b.js} +1 -1
  145. package/dist/{regression.results-69bc42d0.js → regression.results-6f85a5dc.js} +1 -1
  146. package/dist/{renderPvalueTable-dc5d15f2.js → renderPvalueTable-17558d6a.js} +1 -1
  147. package/dist/{sampleScatter-2d0ed680.js → sampleScatter-97917406.js} +1 -1
  148. package/dist/{sampleScatter.rendererThree-0b12ac61.js → sampleScatter.rendererThree-4649d1ec.js} +2 -2
  149. package/dist/{sampleView-484ab133.js → sampleView-f86dc5ea.js} +1 -1
  150. package/dist/{samplelst-689796e6.js → samplelst-4a5512df.js} +1 -1
  151. package/dist/{samplematrix-2b137a05.js → samplematrix-1192e5e2.js} +1 -1
  152. package/dist/{scatter-205e013f.js → scatter-cc1b0d07.js} +1 -1
  153. package/dist/{select2Terms-b21e184a.js → select2Terms-d4f6ed9e.js} +1 -1
  154. package/dist/{selectGenomeWithTklst-466995b4.js → selectGenomeWithTklst-b5cfd153.js} +1 -1
  155. package/dist/{singleCellCellType-5db730bb.js → singleCellCellType-d8c58253.js} +1 -1
  156. package/dist/{singleCellGeneExpression-7147a2d0.js → singleCellGeneExpression-b7209531.js} +1 -1
  157. package/dist/{singleCellPlot-73b2738f.js → singleCellPlot-e6f83b2a.js} +1 -1
  158. package/dist/{singlecell-bca774ed.js → singlecell-321dd973.js} +1 -1
  159. package/dist/{singlecell-24409b72.js → singlecell-879235b3.js} +1 -1
  160. package/dist/snp-541ec14d.js +1 -0
  161. package/dist/{snp-a8388ce4.js → snp-b046b7e6.js} +1 -1
  162. package/dist/snplocus-61ff1c10.js +1 -0
  163. package/dist/{spliceevent.a53ss.diagram-e2eab72b.js → spliceevent.a53ss.diagram-1a84db58.js} +1 -1
  164. package/dist/{spliceevent.exonskip.diagram-4d5df3a1.js → spliceevent.exonskip.diagram-da10648b.js} +1 -1
  165. package/dist/{spliceevent.exonskip.getdefault-a94aad6e.js → spliceevent.exonskip.getdefault-8028e522.js} +1 -1
  166. package/dist/{spliceevent.noeventdiagram-ea97b0fb.js → spliceevent.noeventdiagram-1d6d790d.js} +1 -1
  167. package/dist/{spliceevent.phrase-c5832470.js → spliceevent.phrase-2ca0ce59.js} +1 -1
  168. package/dist/{stattable-7c5ecc2f.js → stattable-c5f12d9c.js} +1 -1
  169. package/dist/{style.gdc-131f3c77.js → style.gdc-5b7d90c6.js} +1 -1
  170. package/dist/summary-0624f5e6.js +1 -0
  171. package/dist/{sunburst-533902a7.js → sunburst-30295714.js} +1 -1
  172. package/dist/{survival-e16e068f.js → survival-816e055a.js} +1 -1
  173. package/dist/{survival-92250664.js → survival-fcc7719f.js} +1 -1
  174. package/dist/{svg.download-35926549.js → svg.download-e89a7369.js} +1 -1
  175. package/dist/{svg.legend-8d490df2.js → svg.legend-c93f2980.js} +1 -1
  176. package/dist/{svgraph-6fac8cbc.js → svgraph-6ab3011b.js} +1 -1
  177. package/dist/{svmr-d07ff695.js → svmr-3ad3d600.js} +1 -1
  178. package/dist/{table-ad744310.js → table-4d3a771e.js} +1 -1
  179. package/dist/{table-29d5a973.js → table-f50a9344.js} +1 -1
  180. package/dist/{termInfo-bf99a37e.js → termInfo-d0a9e65f.js} +1 -1
  181. package/dist/{termdb.bins-8b656cc3.js → termdb.bins-01e8cce6.js} +1 -1
  182. package/dist/{termsetting-33ea66f1.js → termsetting-ad8c4f3a.js} +1 -1
  183. package/dist/{tk-071a7550.js → tk-e74c9beb.js} +1 -1
  184. package/dist/{toggleButtons-dbdbad01.js → toggleButtons-04c5ad7c.js} +1 -1
  185. package/dist/{tp.ui-9c2e9fc5.js → tp.ui-7b24f0ef.js} +1 -1
  186. package/dist/{tvs.density-f6128793.js → tvs.density-b2790080.js} +1 -1
  187. package/dist/{tvs.geneVariant-ca4bdbb1.js → tvs.geneVariant-418ed4ff.js} +1 -1
  188. package/dist/{tvs.numeric-0260a825.js → tvs.numeric-de14101f.js} +1 -1
  189. package/dist/{tvs.samplelst-cb71b3bf.js → tvs.samplelst-15bb62f1.js} +1 -1
  190. package/dist/{uiUtils-f1bd2bcc.js → uiUtils-ff2d4a6a.js} +1 -1
  191. package/dist/{variantBrowser-7c540224.js → variantBrowser-261373bf.js} +1 -1
  192. package/dist/{vcf-5cc55588.js → vcf-145bf5dd.js} +1 -1
  193. package/dist/violin-e647aac9.js +1 -0
  194. package/dist/{violin.interactivity-4da6d7a9.js → violin.interactivity-30a239fe.js} +1 -1
  195. package/dist/{violin.renderer-ce024265.js → violin.renderer-e29d2700.js} +1 -1
  196. package/dist/{violinRenderer-f7c96a60.js → violinRenderer-08b3b58c.js} +1 -1
  197. package/dist/{viridis-01ab20c5.js → viridis-d86ad99b.js} +1 -1
  198. package/dist/{y-67939f83.js → y-06b0d47c.js} +1 -1
  199. package/dist/{zoom-25dce8b9.js → zoom-d6ef6f3f.js} +1 -1
  200. package/package.json +1 -1
  201. package/dist/app-649f8357.js +0 -1
  202. package/dist/app-b369b169.js +0 -1
  203. package/dist/barchart-8277ed43.js +0 -1
  204. package/dist/block.lazyload-87b12654.js +0 -1
  205. package/dist/controls.config-28d6d6a8.js +0 -1
  206. package/dist/cuminc-9e275854.js +0 -1
  207. package/dist/hierCluster.config-98e82dff.js +0 -1
  208. package/dist/niceNumLabels-238aabce.js +0 -1
  209. package/dist/oncomatrix-351af2a0.js +0 -1
  210. package/dist/plot.app-30c4b8e5.js +0 -1
  211. package/dist/plot.barplot-7c4865a2.js +0 -1
  212. package/dist/profilePolar-6b981e63.js +0 -1
  213. package/dist/profileRadar-bca1cc03.js +0 -1
  214. package/dist/profileRadarFacility-bbb1ecd8.js +0 -1
  215. package/dist/snp-37d06246.js +0 -1
  216. package/dist/snplocus-7a1ea8c9.js +0 -1
  217. package/dist/summary-5ec455d3.js +0 -1
  218. package/dist/violin-2ba509eb.js +0 -1
@@ -1,6 +1,6 @@
1
- import{r as t}from"./app-b369b169.js";
1
+ import{r as t}from"./app-2cd97738.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2010-2023 Three.js Authors
5
5
  * SPDX-License-Identifier: MIT
6
- */const e="152";const n={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2};const i={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};const r=0;const s=1;const a=2;const o=1;const l=2;const c=3;const u=0;const h=1;const f=2;const d=0;const p=1;const m=2;const g=3;const _=4;const x=5;const v=100;const M=101;const y=102;const S=103;const E=104;const T=200;const b=201;const w=202;const A=203;const R=204;const q=205;const C=206;const L=207;const P=208;const U=209;const D=210;const I=0;const N=1;const O=2;const F=3;const z=4;const B=5;const H=6;const G=7;const V=0;const k=1;const W=2;const X=0;const j=1;const Y=2;const J=3;const Z=4;const K=5;const Q=300;const $=301;const tt=302;const et=303;const nt=304;const it=306;const rt=1e3;const st=1001;const at=1002;const ot=1003;const lt=1004;const ct=1005;const ut=1006;const ht=1007;const ft=1008;const dt=1009;const pt=1010;const mt=1011;const gt=1012;const _t=1013;const xt=1014;const vt=1015;const Mt=1016;const yt=1017;const St=1018;const Et=1020;const Tt=1021;const bt=1023;const wt=1024;const At=1025;const Rt=1026;const qt=1027;const Ct=1028;const Lt=1029;const Pt=1030;const Ut=1031;const Dt=1033;const It=33776;const Nt=33777;const Ot=33778;const Ft=33779;const zt=35840;const Bt=35841;const Ht=35842;const Gt=35843;const Vt=36196;const kt=37492;const Wt=37496;const Xt=37808;const jt=37809;const Yt=37810;const Jt=37811;const Zt=37812;const Kt=37813;const Qt=37814;const $t=37815;const te=37816;const ee=37817;const ne=37818;const ie=37819;const re=37820;const se=37821;const ae=36492;const oe=36283;const le=36284;const ce=36285;const ue=36286;const he=3e3;const fe=3001;const de=3200;const pe=3201;const me=0;const ge=1;const _e="";const xe="srgb";const ve="srgb-linear";const Me="display-p3";const ye=7680;const Se=519;const Ee=35044;const Te="300 es";const be=1035;class we{addEventListener(t,e){if(this._listeners===undefined)this._listeners={};const n=this._listeners;if(n[t]===undefined){n[t]=[]}if(n[t].indexOf(e)===-1){n[t].push(e)}}hasEventListener(t,e){if(this._listeners===undefined)return false;const n=this._listeners;return n[t]!==undefined&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===undefined)return;const n=this._listeners;const i=n[t];if(i!==undefined){const t=i.indexOf(e);if(t!==-1){i.splice(t,1)}}}dispatchEvent(t){if(this._listeners===undefined)return;const e=this._listeners;const n=e[t.type];if(n!==undefined){t.target=this;const e=n.slice(0);for(let n=0,i=e.length;n<i;n++){e[n].call(this,t)}t.target=null}}}const Ae=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];const Re=Math.PI/180;const qe=180/Math.PI;function Ce(){const t=Math.random()*4294967295|0;const e=Math.random()*4294967295|0;const n=Math.random()*4294967295|0;const i=Math.random()*4294967295|0;const r=Ae[t&255]+Ae[t>>8&255]+Ae[t>>16&255]+Ae[t>>24&255]+"-"+Ae[e&255]+Ae[e>>8&255]+"-"+Ae[e>>16&15|64]+Ae[e>>24&255]+"-"+Ae[n&63|128]+Ae[n>>8&255]+"-"+Ae[n>>16&255]+Ae[n>>24&255]+Ae[i&255]+Ae[i>>8&255]+Ae[i>>16&255]+Ae[i>>24&255];return r.toLowerCase()}function Le(t,e,n){return Math.max(e,Math.min(n,t))}function Pe(t,e){return(t%e+e)%e}function Ue(t,e,n){return(1-n)*t+n*e}function De(t){return(t&t-1)===0&&t!==0}function Ie(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ne(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Oe(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class Fe{constructor(t=0,e=0){Fe.prototype.isVector2=true;this.x=t;this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){this.x=t;this.y=e;return this}setScalar(t){this.x=t;this.y=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){this.x=t.x;this.y=t.y;return this}add(t){this.x+=t.x;this.y+=t.y;return this}addScalar(t){this.x+=t;this.y+=t;return this}addVectors(t,e){this.x=t.x+e.x;this.y=t.y+e.y;return this}addScaledVector(t,e){this.x+=t.x*e;this.y+=t.y*e;return this}sub(t){this.x-=t.x;this.y-=t.y;return this}subScalar(t){this.x-=t;this.y-=t;return this}subVectors(t,e){this.x=t.x-e.x;this.y=t.y-e.y;return this}multiply(t){this.x*=t.x;this.y*=t.y;return this}multiplyScalar(t){this.x*=t;this.y*=t;return this}divide(t){this.x/=t.x;this.y/=t.y;return this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y;const i=t.elements;this.x=i[0]*e+i[3]*n+i[6];this.y=i[1]*e+i[4]*n+i[7];return this}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);return this}clamp(t,e){this.x=Math.max(t.x,Math.min(e.x,this.x));this.y=Math.max(t.y,Math.min(e.y,this.y));return this}clampScalar(t,e){this.x=Math.max(t,Math.min(e,this.x));this.y=Math.max(t,Math.min(e,this.y));return this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);return this}negate(){this.x=-this.x;this.y=-this.y;return this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){const t=Math.atan2(-this.y,-this.x)+Math.PI;return t}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Le(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){this.x+=(t.x-this.x)*e;this.y+=(t.y-this.y)*e;return this}lerpVectors(t,e,n){this.x=t.x+(e.x-t.x)*n;this.y=t.y+(e.y-t.y)*n;return this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){this.x=t[e];this.y=t[e+1];return this}toArray(t=[],e=0){t[e]=this.x;t[e+1]=this.y;return t}fromBufferAttribute(t,e){this.x=t.getX(e);this.y=t.getY(e);return this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e);const r=this.x-t.x;const s=this.y-t.y;this.x=r*n-s*i+t.x;this.y=r*i+s*n+t.y;return this}random(){this.x=Math.random();this.y=Math.random();return this}*[Symbol.iterator](){yield this.x;yield this.y}}class ze{constructor(){ze.prototype.isMatrix3=true;this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,n,i,r,s,a,o,l){const c=this.elements;c[0]=t;c[1]=i;c[2]=a;c[3]=e;c[4]=r;c[5]=o;c[6]=n;c[7]=s;c[8]=l;return this}identity(){this.set(1,0,0,0,1,0,0,0,1);return this}copy(t){const e=this.elements;const n=t.elements;e[0]=n[0];e[1]=n[1];e[2]=n[2];e[3]=n[3];e[4]=n[4];e[5]=n[5];e[6]=n[6];e[7]=n[7];e[8]=n[8];return this}extractBasis(t,e,n){t.setFromMatrix3Column(this,0);e.setFromMatrix3Column(this,1);n.setFromMatrix3Column(this,2);return this}setFromMatrix4(t){const e=t.elements;this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]);return this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements;const i=e.elements;const r=this.elements;const s=n[0],a=n[3],o=n[6];const l=n[1],c=n[4],u=n[7];const h=n[2],f=n[5],d=n[8];const p=i[0],m=i[3],g=i[6];const _=i[1],x=i[4],v=i[7];const M=i[2],y=i[5],S=i[8];r[0]=s*p+a*_+o*M;r[3]=s*m+a*x+o*y;r[6]=s*g+a*v+o*S;r[1]=l*p+c*_+u*M;r[4]=l*m+c*x+u*y;r[7]=l*g+c*v+u*S;r[2]=h*p+f*_+d*M;r[5]=h*m+f*x+d*y;r[8]=h*g+f*v+d*S;return this}multiplyScalar(t){const e=this.elements;e[0]*=t;e[3]*=t;e[6]*=t;e[1]*=t;e[4]*=t;e[7]*=t;e[2]*=t;e[5]*=t;e[8]*=t;return this}determinant(){const t=this.elements;const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],u=c*s-a*l,h=a*o-c*r,f=l*r-s*o,d=e*u+n*h+i*f;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;t[0]=u*p;t[1]=(i*l-c*n)*p;t[2]=(a*n-i*s)*p;t[3]=h*p;t[4]=(c*e-i*o)*p;t[5]=(i*r-a*e)*p;t[6]=f*p;t[7]=(n*o-l*e)*p;t[8]=(s*e-n*r)*p;return this}transpose(){let t;const e=this.elements;t=e[1];e[1]=e[3];e[3]=t;t=e[2];e[2]=e[6];e[6]=t;t=e[5];e[5]=e[7];e[7]=t;return this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;t[0]=e[0];t[1]=e[3];t[2]=e[6];t[3]=e[1];t[4]=e[4];t[5]=e[7];t[6]=e[2];t[7]=e[5];t[8]=e[8];return this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r);const l=Math.sin(r);this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1);return this}scale(t,e){this.premultiply(Be.makeScale(t,e));return this}rotate(t){this.premultiply(Be.makeRotation(-t));return this}translate(t,e){this.premultiply(Be.makeTranslation(t,e));return this}makeTranslation(t,e){this.set(1,0,t,0,1,e,0,0,1);return this}makeRotation(t){const e=Math.cos(t);const n=Math.sin(t);this.set(e,-n,0,n,e,0,0,0,1);return this}makeScale(t,e){this.set(t,0,0,0,e,0,0,0,1);return this}equals(t){const e=this.elements;const n=t.elements;for(let t=0;t<9;t++){if(e[t]!==n[t])return false}return true}fromArray(t,e=0){for(let n=0;n<9;n++){this.elements[n]=t[n+e]}return this}toArray(t=[],e=0){const n=this.elements;t[e]=n[0];t[e+1]=n[1];t[e+2]=n[2];t[e+3]=n[3];t[e+4]=n[4];t[e+5]=n[5];t[e+6]=n[6];t[e+7]=n[7];t[e+8]=n[8];return t}clone(){return(new this.constructor).fromArray(this.elements)}}const Be=new ze;function He(t){for(let e=t.length-1;e>=0;--e){if(t[e]>=65535)return true}return false}function Ge(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const Ve={};function ke(t){if(t in Ve)return;Ve[t]=true;console.warn(t)}function We(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Xe(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const je=(new ze).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]);const Ye=(new ze).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function Je(t){return t.convertSRGBToLinear().applyMatrix3(Ye)}function Ze(t){return t.applyMatrix3(je).convertLinearToSRGB()}const Ke={[ve]:t=>t,[xe]:t=>t.convertSRGBToLinear(),[Me]:Je};const Qe={[ve]:t=>t,[xe]:t=>t.convertLinearToSRGB(),[Me]:Ze};const $e={enabled:true,get legacyMode(){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.");return!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.");this.enabled=!t},get workingColorSpace(){return ve},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.enabled===false||e===n||!e||!n){return t}const i=Ke[e];const r=Qe[n];if(i===undefined||r===undefined){throw new Error(`Unsupported color space conversion, "${e}" to "${n}".`)}return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}};let tn;class en{static getDataURL(t){if(/^data:/i.test(t.src)){return t.src}if(typeof HTMLCanvasElement==="undefined"){return t.src}let e;if(t instanceof HTMLCanvasElement){e=t}else{if(tn===undefined)tn=Ge("canvas");tn.width=t.width;tn.height=t.height;const n=tn.getContext("2d");if(t instanceof ImageData){n.putImageData(t,0,0)}else{n.drawImage(t,0,0,t.width,t.height)}e=tn}if(e.width>2048||e.height>2048){console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t);return e.toDataURL("image/jpeg",.6)}else{return e.toDataURL("image/png")}}static sRGBToLinear(t){if(typeof HTMLImageElement!=="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&t instanceof ImageBitmap){const e=Ge("canvas");e.width=t.width;e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height);const r=i.data;for(let t=0;t<r.length;t++){r[t]=We(r[t]/255)*255}n.putImageData(i,0,0);return e}else if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++){if(e instanceof Uint8Array||e instanceof Uint8ClampedArray){e[t]=Math.floor(We(e[t]/255)*255)}else{e[t]=We(e[t])}}return{data:e,width:t.width,height:t.height}}else{console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.");return t}}}class nn{constructor(t=null){this.isSource=true;this.uuid=Ce();this.data=t;this.version=0}set needsUpdate(t){if(t===true)this.version++}toJSON(t){const e=t===undefined||typeof t==="string";if(!e&&t.images[this.uuid]!==undefined){return t.images[this.uuid]}const n={uuid:this.uuid,url:""};const i=this.data;if(i!==null){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++){if(i[e].isDataTexture){t.push(rn(i[e].image))}else{t.push(rn(i[e]))}}}else{t=rn(i)}n.url=t}if(!e){t.images[this.uuid]=n}return n}}function rn(t){if(typeof HTMLImageElement!=="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&t instanceof ImageBitmap){return en.getDataURL(t)}else{if(t.data){return{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}}else{console.warn("THREE.Texture: Unable to serialize Texture.");return{}}}}let sn=0;class an extends we{constructor(t=an.DEFAULT_IMAGE,e=an.DEFAULT_MAPPING,n=st,i=st,r=ut,s=ft,a=bt,o=dt,l=an.DEFAULT_ANISOTROPY,c=_e){super();this.isTexture=true;Object.defineProperty(this,"id",{value:sn++});this.uuid=Ce();this.name="";this.source=new nn(t);this.mipmaps=[];this.mapping=e;this.channel=0;this.wrapS=n;this.wrapT=i;this.magFilter=r;this.minFilter=s;this.anisotropy=l;this.format=a;this.internalFormat=null;this.type=o;this.offset=new Fe(0,0);this.repeat=new Fe(1,1);this.center=new Fe(0,0);this.rotation=0;this.matrixAutoUpdate=true;this.matrix=new ze;this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.unpackAlignment=4;if(typeof c==="string"){this.colorSpace=c}else{ke("THREE.Texture: Property .encoding has been replaced by .colorSpace.");this.colorSpace=c===fe?xe:_e}this.userData={};this.version=0;this.onUpdate=null;this.isRenderTargetTexture=false;this.needsPMREMUpdate=false}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name;this.source=t.source;this.mipmaps=t.mipmaps.slice(0);this.mapping=t.mapping;this.channel=t.channel;this.wrapS=t.wrapS;this.wrapT=t.wrapT;this.magFilter=t.magFilter;this.minFilter=t.minFilter;this.anisotropy=t.anisotropy;this.format=t.format;this.internalFormat=t.internalFormat;this.type=t.type;this.offset.copy(t.offset);this.repeat.copy(t.repeat);this.center.copy(t.center);this.rotation=t.rotation;this.matrixAutoUpdate=t.matrixAutoUpdate;this.matrix.copy(t.matrix);this.generateMipmaps=t.generateMipmaps;this.premultiplyAlpha=t.premultiplyAlpha;this.flipY=t.flipY;this.unpackAlignment=t.unpackAlignment;this.colorSpace=t.colorSpace;this.userData=JSON.parse(JSON.stringify(t.userData));this.needsUpdate=true;return this}toJSON(t){const e=t===undefined||typeof t==="string";if(!e&&t.textures[this.uuid]!==undefined){return t.textures[this.uuid]}const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(Object.keys(this.userData).length>0)n.userData=this.userData;if(!e){t.textures[this.uuid]=n}return n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Q)return t;t.applyMatrix3(this.matrix);if(t.x<0||t.x>1){switch(this.wrapS){case rt:t.x=t.x-Math.floor(t.x);break;case st:t.x=t.x<0?0:1;break;case at:if(Math.abs(Math.floor(t.x)%2)===1){t.x=Math.ceil(t.x)-t.x}else{t.x=t.x-Math.floor(t.x)}break}}if(t.y<0||t.y>1){switch(this.wrapT){case rt:t.y=t.y-Math.floor(t.y);break;case st:t.y=t.y<0?0:1;break;case at:if(Math.abs(Math.floor(t.y)%2)===1){t.y=Math.ceil(t.y)-t.y}else{t.y=t.y-Math.floor(t.y)}break}}if(this.flipY){t.y=1-t.y}return t}set needsUpdate(t){if(t===true){this.version++;this.source.needsUpdate=true}}get encoding(){ke("THREE.Texture: Property .encoding has been replaced by .colorSpace.");return this.colorSpace===xe?fe:he}set encoding(t){ke("THREE.Texture: Property .encoding has been replaced by .colorSpace.");this.colorSpace=t===fe?xe:_e}}an.DEFAULT_IMAGE=null;an.DEFAULT_MAPPING=Q;an.DEFAULT_ANISOTROPY=1;class on{constructor(t=0,e=0,n=0,i=1){on.prototype.isVector4=true;this.x=t;this.y=e;this.z=n;this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){this.x=t;this.y=e;this.z=n;this.w=i;return this}setScalar(t){this.x=t;this.y=t;this.z=t;this.w=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setZ(t){this.z=t;return this}setW(t){this.w=t;return this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){this.x=t.x;this.y=t.y;this.z=t.z;this.w=t.w!==undefined?t.w:1;return this}add(t){this.x+=t.x;this.y+=t.y;this.z+=t.z;this.w+=t.w;return this}addScalar(t){this.x+=t;this.y+=t;this.z+=t;this.w+=t;return this}addVectors(t,e){this.x=t.x+e.x;this.y=t.y+e.y;this.z=t.z+e.z;this.w=t.w+e.w;return this}addScaledVector(t,e){this.x+=t.x*e;this.y+=t.y*e;this.z+=t.z*e;this.w+=t.w*e;return this}sub(t){this.x-=t.x;this.y-=t.y;this.z-=t.z;this.w-=t.w;return this}subScalar(t){this.x-=t;this.y-=t;this.z-=t;this.w-=t;return this}subVectors(t,e){this.x=t.x-e.x;this.y=t.y-e.y;this.z=t.z-e.z;this.w=t.w-e.w;return this}multiply(t){this.x*=t.x;this.y*=t.y;this.z*=t.z;this.w*=t.w;return this}multiplyScalar(t){this.x*=t;this.y*=t;this.z*=t;this.w*=t;return this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w;const s=t.elements;this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r;this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r;this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r;this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r;return this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);if(e<1e-4){this.x=1;this.y=0;this.z=0}else{this.x=t.x/e;this.y=t.y/e;this.z=t.z/e}return this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],u=o[8],h=o[1],f=o[5],d=o[9],p=o[2],m=o[6],g=o[10];if(Math.abs(c-h)<s&&Math.abs(u-p)<s&&Math.abs(d-m)<s){if(Math.abs(c+h)<a&&Math.abs(u+p)<a&&Math.abs(d+m)<a&&Math.abs(l+f+g-3)<a){this.set(1,0,0,0);return this}e=Math.PI;const t=(l+1)/2;const o=(f+1)/2;const _=(g+1)/2;const x=(c+h)/4;const v=(u+p)/4;const M=(d+m)/4;if(t>o&&t>_){if(t<s){n=0;i=.707106781;r=.707106781}else{n=Math.sqrt(t);i=x/n;r=v/n}}else if(o>_){if(o<s){n=.707106781;i=0;r=.707106781}else{i=Math.sqrt(o);n=x/i;r=M/i}}else{if(_<s){n=.707106781;i=.707106781;r=0}else{r=Math.sqrt(_);n=v/r;i=M/r}}this.set(n,i,r,e);return this}let _=Math.sqrt((m-d)*(m-d)+(u-p)*(u-p)+(h-c)*(h-c));if(Math.abs(_)<.001)_=1;this.x=(m-d)/_;this.y=(u-p)/_;this.z=(h-c)/_;this.w=Math.acos((l+f+g-1)/2);return this}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);this.z=Math.min(this.z,t.z);this.w=Math.min(this.w,t.w);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);this.z=Math.max(this.z,t.z);this.w=Math.max(this.w,t.w);return this}clamp(t,e){this.x=Math.max(t.x,Math.min(e.x,this.x));this.y=Math.max(t.y,Math.min(e.y,this.y));this.z=Math.max(t.z,Math.min(e.z,this.z));this.w=Math.max(t.w,Math.min(e.w,this.w));return this}clampScalar(t,e){this.x=Math.max(t,Math.min(e,this.x));this.y=Math.max(t,Math.min(e,this.y));this.z=Math.max(t,Math.min(e,this.z));this.w=Math.max(t,Math.min(e,this.w));return this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w);return this}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){this.x+=(t.x-this.x)*e;this.y+=(t.y-this.y)*e;this.z+=(t.z-this.z)*e;this.w+=(t.w-this.w)*e;return this}lerpVectors(t,e,n){this.x=t.x+(e.x-t.x)*n;this.y=t.y+(e.y-t.y)*n;this.z=t.z+(e.z-t.z)*n;this.w=t.w+(e.w-t.w)*n;return this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){this.x=t[e];this.y=t[e+1];this.z=t[e+2];this.w=t[e+3];return this}toArray(t=[],e=0){t[e]=this.x;t[e+1]=this.y;t[e+2]=this.z;t[e+3]=this.w;return t}fromBufferAttribute(t,e){this.x=t.getX(e);this.y=t.getY(e);this.z=t.getZ(e);this.w=t.getW(e);return this}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();this.w=Math.random();return this}*[Symbol.iterator](){yield this.x;yield this.y;yield this.z;yield this.w}}class ln extends we{constructor(t=1,e=1,n={}){super();this.isWebGLRenderTarget=true;this.width=t;this.height=e;this.depth=1;this.scissor=new on(0,0,t,e);this.scissorTest=false;this.viewport=new on(0,0,t,e);const i={width:t,height:e,depth:1};if(n.encoding!==undefined){ke("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.");n.colorSpace=n.encoding===fe?xe:_e}this.texture=new an(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);this.texture.isRenderTargetTexture=true;this.texture.flipY=false;this.texture.generateMipmaps=n.generateMipmaps!==undefined?n.generateMipmaps:false;this.texture.internalFormat=n.internalFormat!==undefined?n.internalFormat:null;this.texture.minFilter=n.minFilter!==undefined?n.minFilter:ut;this.depthBuffer=n.depthBuffer!==undefined?n.depthBuffer:true;this.stencilBuffer=n.stencilBuffer!==undefined?n.stencilBuffer:false;this.depthTexture=n.depthTexture!==undefined?n.depthTexture:null;this.samples=n.samples!==undefined?n.samples:0}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t;this.height=e;this.depth=n;this.texture.image.width=t;this.texture.image.height=e;this.texture.image.depth=n;this.dispose()}this.viewport.set(0,0,t,e);this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width;this.height=t.height;this.depth=t.depth;this.scissor.copy(t.scissor);this.scissorTest=t.scissorTest;this.viewport.copy(t.viewport);this.texture=t.texture.clone();this.texture.isRenderTargetTexture=true;const e=Object.assign({},t.texture.image);this.texture.source=new nn(e);this.depthBuffer=t.depthBuffer;this.stencilBuffer=t.stencilBuffer;if(t.depthTexture!==null)this.depthTexture=t.depthTexture.clone();this.samples=t.samples;return this}dispose(){this.dispatchEvent({type:"dispose"})}}class cn extends an{constructor(t=null,e=1,n=1,i=1){super(null);this.isDataArrayTexture=true;this.image={data:t,width:e,height:n,depth:i};this.magFilter=ot;this.minFilter=ot;this.wrapR=st;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1}}class un extends an{constructor(t=null,e=1,n=1,i=1){super(null);this.isData3DTexture=true;this.image={data:t,width:e,height:n,depth:i};this.magFilter=ot;this.minFilter=ot;this.wrapR=st;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1}}class hn{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=true;this._x=t;this._y=e;this._z=n;this._w=i}static slerpFlat(t,e,n,i,r,s,a){let o=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const h=r[s+0],f=r[s+1],d=r[s+2],p=r[s+3];if(a===0){t[e+0]=o;t[e+1]=l;t[e+2]=c;t[e+3]=u;return}if(a===1){t[e+0]=h;t[e+1]=f;t[e+2]=d;t[e+3]=p;return}if(u!==p||o!==h||l!==f||c!==d){let t=1-a;const e=o*h+l*f+c*d+u*p,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r;a=Math.sin(a*s)/r}const r=a*n;o=o*t+h*r;l=l*t+f*r;c=c*t+d*r;u=u*t+p*r;if(t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=t;l*=t;c*=t;u*=t}}t[e]=o;t[e+1]=l;t[e+2]=c;t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i];const o=n[i+1];const l=n[i+2];const c=n[i+3];const u=r[s];const h=r[s+1];const f=r[s+2];const d=r[s+3];t[e]=a*d+c*u+o*f-l*h;t[e+1]=o*d+c*h+l*u-a*f;t[e+2]=l*d+c*f+a*h-o*u;t[e+3]=c*d-a*u-o*h-l*f;return t}get x(){return this._x}set x(t){this._x=t;this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t;this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t;this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t;this._onChangeCallback()}set(t,e,n,i){this._x=t;this._y=e;this._z=n;this._w=i;this._onChangeCallback();return this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){this._x=t.x;this._y=t.y;this._z=t.z;this._w=t.w;this._onChangeCallback();return this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,s=t._order;const a=Math.cos;const o=Math.sin;const l=a(n/2);const c=a(i/2);const u=a(r/2);const h=o(n/2);const f=o(i/2);const d=o(r/2);switch(s){case"XYZ":this._x=h*c*u+l*f*d;this._y=l*f*u-h*c*d;this._z=l*c*d+h*f*u;this._w=l*c*u-h*f*d;break;case"YXZ":this._x=h*c*u+l*f*d;this._y=l*f*u-h*c*d;this._z=l*c*d-h*f*u;this._w=l*c*u+h*f*d;break;case"ZXY":this._x=h*c*u-l*f*d;this._y=l*f*u+h*c*d;this._z=l*c*d+h*f*u;this._w=l*c*u-h*f*d;break;case"ZYX":this._x=h*c*u-l*f*d;this._y=l*f*u+h*c*d;this._z=l*c*d-h*f*u;this._w=l*c*u+h*f*d;break;case"YZX":this._x=h*c*u+l*f*d;this._y=l*f*u+h*c*d;this._z=l*c*d-h*f*u;this._w=l*c*u-h*f*d;break;case"XZY":this._x=h*c*u-l*f*d;this._y=l*f*u-h*c*d;this._z=l*c*d+h*f*u;this._w=l*c*u+h*f*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}if(e!==false)this._onChangeCallback();return this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);this._x=t.x*i;this._y=t.y*i;this._z=t.z*i;this._w=Math.cos(n);this._onChangeCallback();return this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],u=e[10],h=n+a+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t;this._x=(c-o)*t;this._y=(r-l)*t;this._z=(s-i)*t}else if(n>a&&n>u){const t=2*Math.sqrt(1+n-a-u);this._w=(c-o)/t;this._x=.25*t;this._y=(i+s)/t;this._z=(r+l)/t}else if(a>u){const t=2*Math.sqrt(1+a-n-u);this._w=(r-l)/t;this._x=(i+s)/t;this._y=.25*t;this._z=(o+c)/t}else{const t=2*Math.sqrt(1+u-n-a);this._w=(s-i)/t;this._x=(r+l)/t;this._y=(o+c)/t;this._z=.25*t}this._onChangeCallback();return this}setFromUnitVectors(t,e){let n=t.dot(e)+1;if(n<Number.EPSILON){n=0;if(Math.abs(t.x)>Math.abs(t.z)){this._x=-t.y;this._y=t.x;this._z=0;this._w=n}else{this._x=0;this._y=-t.z;this._z=t.y;this._w=n}}else{this._x=t.y*e.z-t.z*e.y;this._y=t.z*e.x-t.x*e.z;this._z=t.x*e.y-t.y*e.x;this._w=n}return this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Le(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);this.slerp(t,i);return this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();if(t===0){this._x=0;this._y=0;this._z=0;this._w=1}else{t=1/t;this._x=this._x*t;this._y=this._y*t;this._z=this._z*t;this._w=this._w*t}this._onChangeCallback();return this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w;const a=e._x,o=e._y,l=e._z,c=e._w;this._x=n*c+s*a+i*l-r*o;this._y=i*c+s*o+r*a-n*l;this._z=r*c+s*l+n*o-i*a;this._w=s*c-n*a-i*o-r*l;this._onChangeCallback();return this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0){this._w=-t._w;this._x=-t._x;this._y=-t._y;this._z=-t._z;a=-a}else{this.copy(t)}if(a>=1){this._w=s;this._x=n;this._y=i;this._z=r;return this}const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;this._w=t*s+e*this._w;this._x=t*n+e*this._x;this._y=t*i+e*this._y;this._z=t*r+e*this._z;this.normalize();this._onChangeCallback();return this}const l=Math.sqrt(o);const c=Math.atan2(l,a);const u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;this._w=s*u+this._w*h;this._x=n*u+this._x*h;this._y=i*u+this._y*h;this._z=r*u+this._z*h;this._onChangeCallback();return this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random();const e=Math.sqrt(1-t);const n=Math.sqrt(t);const i=2*Math.PI*Math.random();const r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){this._x=t[e];this._y=t[e+1];this._z=t[e+2];this._w=t[e+3];this._onChangeCallback();return this}toArray(t=[],e=0){t[e]=this._x;t[e+1]=this._y;t[e+2]=this._z;t[e+3]=this._w;return t}fromBufferAttribute(t,e){this._x=t.getX(e);this._y=t.getY(e);this._z=t.getZ(e);this._w=t.getW(e);return this}toJSON(){return this.toArray()}_onChange(t){this._onChangeCallback=t;return this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x;yield this._y;yield this._z;yield this._w}}class fn{constructor(t=0,e=0,n=0){fn.prototype.isVector3=true;this.x=t;this.y=e;this.z=n}set(t,e,n){if(n===undefined)n=this.z;this.x=t;this.y=e;this.z=n;return this}setScalar(t){this.x=t;this.y=t;this.z=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setZ(t){this.z=t;return this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){this.x=t.x;this.y=t.y;this.z=t.z;return this}add(t){this.x+=t.x;this.y+=t.y;this.z+=t.z;return this}addScalar(t){this.x+=t;this.y+=t;this.z+=t;return this}addVectors(t,e){this.x=t.x+e.x;this.y=t.y+e.y;this.z=t.z+e.z;return this}addScaledVector(t,e){this.x+=t.x*e;this.y+=t.y*e;this.z+=t.z*e;return this}sub(t){this.x-=t.x;this.y-=t.y;this.z-=t.z;return this}subScalar(t){this.x-=t;this.y-=t;this.z-=t;return this}subVectors(t,e){this.x=t.x-e.x;this.y=t.y-e.y;this.z=t.z-e.z;return this}multiply(t){this.x*=t.x;this.y*=t.y;this.z*=t.z;return this}multiplyScalar(t){this.x*=t;this.y*=t;this.z*=t;return this}multiplyVectors(t,e){this.x=t.x*e.x;this.y=t.y*e.y;this.z=t.z*e.z;return this}applyEuler(t){return this.applyQuaternion(pn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(pn.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z;const r=t.elements;this.x=r[0]*e+r[3]*n+r[6]*i;this.y=r[1]*e+r[4]*n+r[7]*i;this.z=r[2]*e+r[5]*n+r[8]*i;return this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z;const r=t.elements;const s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s;this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s;this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s;return this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z;const r=t.x,s=t.y,a=t.z,o=t.w;const l=o*e+s*i-a*n;const c=o*n+a*e-r*i;const u=o*i+r*n-s*e;const h=-r*e-s*n-a*i;this.x=l*o+h*-r+c*-a-u*-s;this.y=c*o+h*-s+u*-r-l*-a;this.z=u*o+h*-a+l*-s-c*-r;return this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z;const r=t.elements;this.x=r[0]*e+r[4]*n+r[8]*i;this.y=r[1]*e+r[5]*n+r[9]*i;this.z=r[2]*e+r[6]*n+r[10]*i;return this.normalize()}divide(t){this.x/=t.x;this.y/=t.y;this.z/=t.z;return this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);this.z=Math.min(this.z,t.z);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);this.z=Math.max(this.z,t.z);return this}clamp(t,e){this.x=Math.max(t.x,Math.min(e.x,this.x));this.y=Math.max(t.y,Math.min(e.y,this.y));this.z=Math.max(t.z,Math.min(e.z,this.z));return this}clampScalar(t,e){this.x=Math.max(t,Math.min(e,this.x));this.y=Math.max(t,Math.min(e,this.y));this.z=Math.max(t,Math.min(e,this.z));return this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);return this}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){this.x+=(t.x-this.x)*e;this.y+=(t.y-this.y)*e;this.z+=(t.z-this.z)*e;return this}lerpVectors(t,e,n){this.x=t.x+(e.x-t.x)*n;this.y=t.y+(e.y-t.y)*n;this.z=t.z+(e.z-t.z)*n;return this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z;const s=e.x,a=e.y,o=e.z;this.x=i*o-r*a;this.y=r*s-n*o;this.z=n*a-i*s;return this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){dn.copy(this).projectOnVector(t);return this.sub(dn)}reflect(t){return this.sub(dn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Le(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;this.x=i*Math.sin(n);this.y=Math.cos(e)*t;this.z=i*Math.cos(n);return this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){this.x=t*Math.sin(e);this.y=n;this.z=t*Math.cos(e);return this}setFromMatrixPosition(t){const e=t.elements;this.x=e[12];this.y=e[13];this.z=e[14];return this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length();const n=this.setFromMatrixColumn(t,1).length();const i=this.setFromMatrixColumn(t,2).length();this.x=e;this.y=n;this.z=i;return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){this.x=t._x;this.y=t._y;this.z=t._z;return this}setFromColor(t){this.x=t.r;this.y=t.g;this.z=t.b;return this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){this.x=t[e];this.y=t[e+1];this.z=t[e+2];return this}toArray(t=[],e=0){t[e]=this.x;t[e+1]=this.y;t[e+2]=this.z;return t}fromBufferAttribute(t,e){this.x=t.getX(e);this.y=t.getY(e);this.z=t.getZ(e);return this}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this}randomDirection(){const t=(Math.random()-.5)*2;const e=Math.random()*Math.PI*2;const n=Math.sqrt(1-t**2);this.x=n*Math.cos(e);this.y=n*Math.sin(e);this.z=t;return this}*[Symbol.iterator](){yield this.x;yield this.y;yield this.z}}const dn=new fn;const pn=new hn;class mn{constructor(t=new fn(+Infinity,+Infinity,+Infinity),e=new fn(-Infinity,-Infinity,-Infinity)){this.isBox3=true;this.min=t;this.max=e}set(t,e){this.min.copy(t);this.max.copy(e);return this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3){this.expandByPoint(_n.fromArray(t,e))}return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++){this.expandByPoint(_n.fromBufferAttribute(t,e))}return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++){this.expandByPoint(t[e])}return this}setFromCenterAndSize(t,e){const n=_n.copy(e).multiplyScalar(.5);this.min.copy(t).sub(n);this.max.copy(t).add(n);return this}setFromObject(t,e=false){this.makeEmpty();return this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.min.copy(t.min);this.max.copy(t.max);return this}makeEmpty(){this.min.x=this.min.y=this.min.z=+Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){this.min.min(t);this.max.max(t);return this}expandByVector(t){this.min.sub(t);this.max.add(t);return this}expandByScalar(t){this.min.addScalar(-t);this.max.addScalar(t);return this}expandByObject(t,e=false){t.updateWorldMatrix(false,false);if(t.boundingBox!==undefined){if(t.boundingBox===null){t.computeBoundingBox()}xn.copy(t.boundingBox);xn.applyMatrix4(t.matrixWorld);this.union(xn)}else{const n=t.geometry;if(n!==undefined){if(e&&n.attributes!==undefined&&n.attributes.position!==undefined){const e=n.attributes.position;for(let n=0,i=e.count;n<i;n++){_n.fromBufferAttribute(e,n).applyMatrix4(t.matrixWorld);this.expandByPoint(_n)}}else{if(n.boundingBox===null){n.computeBoundingBox()}xn.copy(n.boundingBox);xn.applyMatrix4(t.matrixWorld);this.union(xn)}}}const n=t.children;for(let t=0,i=n.length;t<i;t++){this.expandByObject(n[t],e)}return this}containsPoint(t){return t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z?false:true}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z?false:true}intersectsSphere(t){this.clampPoint(t.center,_n);return _n.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;if(t.normal.x>0){e=t.normal.x*this.min.x;n=t.normal.x*this.max.x}else{e=t.normal.x*this.max.x;n=t.normal.x*this.min.x}if(t.normal.y>0){e+=t.normal.y*this.min.y;n+=t.normal.y*this.max.y}else{e+=t.normal.y*this.max.y;n+=t.normal.y*this.min.y}if(t.normal.z>0){e+=t.normal.z*this.min.z;n+=t.normal.z*this.max.z}else{e+=t.normal.z*this.max.z;n+=t.normal.z*this.min.z}return e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty()){return false}this.getCenter(bn);wn.subVectors(this.max,bn);vn.subVectors(t.a,bn);Mn.subVectors(t.b,bn);yn.subVectors(t.c,bn);Sn.subVectors(Mn,vn);En.subVectors(yn,Mn);Tn.subVectors(vn,yn);let e=[0,-Sn.z,Sn.y,0,-En.z,En.y,0,-Tn.z,Tn.y,Sn.z,0,-Sn.x,En.z,0,-En.x,Tn.z,0,-Tn.x,-Sn.y,Sn.x,0,-En.y,En.x,0,-Tn.y,Tn.x,0];if(!qn(e,vn,Mn,yn,wn)){return false}e=[1,0,0,0,1,0,0,0,1];if(!qn(e,vn,Mn,yn,wn)){return false}An.crossVectors(Sn,En);e=[An.x,An.y,An.z];return qn(e,vn,Mn,yn,wn)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_n).distanceTo(t)}getBoundingSphere(t){if(this.isEmpty()){t.makeEmpty()}else{this.getCenter(t.center);t.radius=this.getSize(_n).length()*.5}return t}intersect(t){this.min.max(t.min);this.max.min(t.max);if(this.isEmpty())this.makeEmpty();return this}union(t){this.min.min(t.min);this.max.max(t.max);return this}applyMatrix4(t){if(this.isEmpty())return this;gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t);gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t);gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t);gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t);gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t);gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t);gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t);gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t);this.setFromPoints(gn);return this}translate(t){this.min.add(t);this.max.add(t);return this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const gn=[new fn,new fn,new fn,new fn,new fn,new fn,new fn,new fn];const _n=new fn;const xn=new mn;const vn=new fn;const Mn=new fn;const yn=new fn;const Sn=new fn;const En=new fn;const Tn=new fn;const bn=new fn;const wn=new fn;const An=new fn;const Rn=new fn;function qn(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Rn.fromArray(t,s);const a=r.x*Math.abs(Rn.x)+r.y*Math.abs(Rn.y)+r.z*Math.abs(Rn.z);const o=e.dot(Rn);const l=n.dot(Rn);const c=i.dot(Rn);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a){return false}}return true}const Cn=new mn;const Ln=new fn;const Pn=new fn;class Un{constructor(t=new fn,e=-1){this.center=t;this.radius=e}set(t,e){this.center.copy(t);this.radius=e;return this}setFromPoints(t,e){const n=this.center;if(e!==undefined){n.copy(e)}else{Cn.setFromPoints(t).getCenter(n)}let i=0;for(let e=0,r=t.length;e<r;e++){i=Math.max(i,n.distanceToSquared(t[e]))}this.radius=Math.sqrt(i);return this}copy(t){this.center.copy(t.center);this.radius=t.radius;return this}isEmpty(){return this.radius<0}makeEmpty(){this.center.set(0,0,0);this.radius=-1;return this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);e.copy(t);if(n>this.radius*this.radius){e.sub(this.center).normalize();e.multiplyScalar(this.radius).add(this.center)}return e}getBoundingBox(t){if(this.isEmpty()){t.makeEmpty();return t}t.set(this.center,this.center);t.expandByScalar(this.radius);return t}applyMatrix4(t){this.center.applyMatrix4(t);this.radius=this.radius*t.getMaxScaleOnAxis();return this}translate(t){this.center.add(t);return this}expandByPoint(t){if(this.isEmpty()){this.center.copy(t);this.radius=0;return this}Ln.subVectors(t,this.center);const e=Ln.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e);const n=(t-this.radius)*.5;this.center.addScaledVector(Ln,n/t);this.radius+=n}return this}union(t){if(t.isEmpty()){return this}if(this.isEmpty()){this.copy(t);return this}if(this.center.equals(t.center)===true){this.radius=Math.max(this.radius,t.radius)}else{Pn.subVectors(t.center,this.center).setLength(t.radius);this.expandByPoint(Ln.copy(t.center).add(Pn));this.expandByPoint(Ln.copy(t.center).sub(Pn))}return this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Dn=new fn;const In=new fn;const Nn=new fn;const On=new fn;const Fn=new fn;const zn=new fn;const Bn=new fn;class Hn{constructor(t=new fn,e=new fn(0,0,-1)){this.origin=t;this.direction=e}set(t,e){this.origin.copy(t);this.direction.copy(e);return this}copy(t){this.origin.copy(t.origin);this.direction.copy(t.direction);return this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){this.direction.copy(t).sub(this.origin).normalize();return this}recast(t){this.origin.copy(this.at(t,Dn));return this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);if(n<0){return e.copy(this.origin)}return e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Dn.subVectors(t,this.origin).dot(this.direction);if(e<0){return this.origin.distanceToSquared(t)}Dn.copy(this.origin).addScaledVector(this.direction,e);return Dn.distanceToSquared(t)}distanceSqToSegment(t,e,n,i){In.copy(t).add(e).multiplyScalar(.5);Nn.copy(e).sub(t).normalize();On.copy(this.origin).sub(In);const r=t.distanceTo(e)*.5;const s=-this.direction.dot(Nn);const a=On.dot(this.direction);const o=-On.dot(Nn);const l=On.lengthSq();const c=Math.abs(1-s*s);let u,h,f,d;if(c>0){u=s*o-a;h=s*a-o;d=r*c;if(u>=0){if(h>=-d){if(h<=d){const t=1/c;u*=t;h*=t;f=u*(u+s*h+2*a)+h*(s*u+h+2*o)+l}else{h=r;u=Math.max(0,-(s*h+a));f=-u*u+h*(h+2*o)+l}}else{h=-r;u=Math.max(0,-(s*h+a));f=-u*u+h*(h+2*o)+l}}else{if(h<=-d){u=Math.max(0,-(-s*r+a));h=u>0?-r:Math.min(Math.max(-r,-o),r);f=-u*u+h*(h+2*o)+l}else if(h<=d){u=0;h=Math.min(Math.max(-r,-o),r);f=h*(h+2*o)+l}else{u=Math.max(0,-(s*r+a));h=u>0?r:Math.min(Math.max(-r,-o),r);f=-u*u+h*(h+2*o)+l}}}else{h=s>0?-r:r;u=Math.max(0,-(s*h+a));f=-u*u+h*(h+2*o)+l}if(n){n.copy(this.origin).addScaledVector(this.direction,u)}if(i){i.copy(In).addScaledVector(Nn,h)}return f}intersectSphere(t,e){Dn.subVectors(t.center,this.origin);const n=Dn.dot(this.direction);const i=Dn.dot(Dn)-n*n;const r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i);const a=n-s;const o=n+s;if(o<0)return null;if(a<0)return this.at(o,e);return this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0){if(t.distanceToPoint(this.origin)===0){return 0}return null}const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);if(n===null){return null}return this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(e===0){return true}const n=t.normal.dot(this.direction);if(n*e<0){return true}return false}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z;const h=this.origin;if(l>=0){n=(t.min.x-h.x)*l;i=(t.max.x-h.x)*l}else{n=(t.max.x-h.x)*l;i=(t.min.x-h.x)*l}if(c>=0){r=(t.min.y-h.y)*c;s=(t.max.y-h.y)*c}else{r=(t.max.y-h.y)*c;s=(t.min.y-h.y)*c}if(n>s||r>i)return null;if(r>n||isNaN(n))n=r;if(s<i||isNaN(i))i=s;if(u>=0){a=(t.min.z-h.z)*u;o=(t.max.z-h.z)*u}else{a=(t.max.z-h.z)*u;o=(t.min.z-h.z)*u}if(n>o||a>i)return null;if(a>n||n!==n)n=a;if(o<i||i!==i)i=o;if(i<0)return null;return this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Dn)!==null}intersectTriangle(t,e,n,i,r){Fn.subVectors(e,t);zn.subVectors(n,t);Bn.crossVectors(Fn,zn);let s=this.direction.dot(Bn);let a;if(s>0){if(i)return null;a=1}else if(s<0){a=-1;s=-s}else{return null}On.subVectors(this.origin,t);const o=a*this.direction.dot(zn.crossVectors(On,zn));if(o<0){return null}const l=a*this.direction.dot(Fn.cross(On));if(l<0){return null}if(o+l>s){return null}const c=-a*On.dot(Bn);if(c<0){return null}return this.at(c/s,r)}applyMatrix4(t){this.origin.applyMatrix4(t);this.direction.transformDirection(t);return this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Gn{constructor(){Gn.prototype.isMatrix4=true;this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,n,i,r,s,a,o,l,c,u,h,f,d,p,m){const g=this.elements;g[0]=t;g[4]=e;g[8]=n;g[12]=i;g[1]=r;g[5]=s;g[9]=a;g[13]=o;g[2]=l;g[6]=c;g[10]=u;g[14]=h;g[3]=f;g[7]=d;g[11]=p;g[15]=m;return this}identity(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this}clone(){return(new Gn).fromArray(this.elements)}copy(t){const e=this.elements;const n=t.elements;e[0]=n[0];e[1]=n[1];e[2]=n[2];e[3]=n[3];e[4]=n[4];e[5]=n[5];e[6]=n[6];e[7]=n[7];e[8]=n[8];e[9]=n[9];e[10]=n[10];e[11]=n[11];e[12]=n[12];e[13]=n[13];e[14]=n[14];e[15]=n[15];return this}copyPosition(t){const e=this.elements,n=t.elements;e[12]=n[12];e[13]=n[13];e[14]=n[14];return this}setFromMatrix3(t){const e=t.elements;this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1);return this}extractBasis(t,e,n){t.setFromMatrixColumn(this,0);e.setFromMatrixColumn(this,1);n.setFromMatrixColumn(this,2);return this}makeBasis(t,e,n){this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1);return this}extractRotation(t){const e=this.elements;const n=t.elements;const i=1/Vn.setFromMatrixColumn(t,0).length();const r=1/Vn.setFromMatrixColumn(t,1).length();const s=1/Vn.setFromMatrixColumn(t,2).length();e[0]=n[0]*i;e[1]=n[1]*i;e[2]=n[2]*i;e[3]=0;e[4]=n[4]*r;e[5]=n[5]*r;e[6]=n[6]*r;e[7]=0;e[8]=n[8]*s;e[9]=n[9]*s;e[10]=n[10]*s;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return this}makeRotationFromEuler(t){const e=this.elements;const n=t.x,i=t.y,r=t.z;const s=Math.cos(n),a=Math.sin(n);const o=Math.cos(i),l=Math.sin(i);const c=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const t=s*c,n=s*u,i=a*c,r=a*u;e[0]=o*c;e[4]=-o*u;e[8]=l;e[1]=n+i*l;e[5]=t-r*l;e[9]=-a*o;e[2]=r-t*l;e[6]=i+n*l;e[10]=s*o}else if(t.order==="YXZ"){const t=o*c,n=o*u,i=l*c,r=l*u;e[0]=t+r*a;e[4]=i*a-n;e[8]=s*l;e[1]=s*u;e[5]=s*c;e[9]=-a;e[2]=n*a-i;e[6]=r+t*a;e[10]=s*o}else if(t.order==="ZXY"){const t=o*c,n=o*u,i=l*c,r=l*u;e[0]=t-r*a;e[4]=-s*u;e[8]=i+n*a;e[1]=n+i*a;e[5]=s*c;e[9]=r-t*a;e[2]=-s*l;e[6]=a;e[10]=s*o}else if(t.order==="ZYX"){const t=s*c,n=s*u,i=a*c,r=a*u;e[0]=o*c;e[4]=i*l-n;e[8]=t*l+r;e[1]=o*u;e[5]=r*l+t;e[9]=n*l-i;e[2]=-l;e[6]=a*o;e[10]=s*o}else if(t.order==="YZX"){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c;e[4]=r-t*u;e[8]=i*u+n;e[1]=u;e[5]=s*c;e[9]=-a*c;e[2]=-l*c;e[6]=n*u+i;e[10]=t-r*u}else if(t.order==="XZY"){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c;e[4]=-u;e[8]=l*c;e[1]=t*u+r;e[5]=s*c;e[9]=n*u-i;e[2]=i*u-n;e[6]=a*c;e[10]=r*u+t}e[3]=0;e[7]=0;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return this}makeRotationFromQuaternion(t){return this.compose(Wn,t,Xn)}lookAt(t,e,n){const i=this.elements;Jn.subVectors(t,e);if(Jn.lengthSq()===0){Jn.z=1}Jn.normalize();jn.crossVectors(n,Jn);if(jn.lengthSq()===0){if(Math.abs(n.z)===1){Jn.x+=1e-4}else{Jn.z+=1e-4}Jn.normalize();jn.crossVectors(n,Jn)}jn.normalize();Yn.crossVectors(Jn,jn);i[0]=jn.x;i[4]=Yn.x;i[8]=Jn.x;i[1]=jn.y;i[5]=Yn.y;i[9]=Jn.y;i[2]=jn.z;i[6]=Yn.z;i[10]=Jn.z;return this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements;const i=e.elements;const r=this.elements;const s=n[0],a=n[4],o=n[8],l=n[12];const c=n[1],u=n[5],h=n[9],f=n[13];const d=n[2],p=n[6],m=n[10],g=n[14];const _=n[3],x=n[7],v=n[11],M=n[15];const y=i[0],S=i[4],E=i[8],T=i[12];const b=i[1],w=i[5],A=i[9],R=i[13];const q=i[2],C=i[6],L=i[10],P=i[14];const U=i[3],D=i[7],I=i[11],N=i[15];r[0]=s*y+a*b+o*q+l*U;r[4]=s*S+a*w+o*C+l*D;r[8]=s*E+a*A+o*L+l*I;r[12]=s*T+a*R+o*P+l*N;r[1]=c*y+u*b+h*q+f*U;r[5]=c*S+u*w+h*C+f*D;r[9]=c*E+u*A+h*L+f*I;r[13]=c*T+u*R+h*P+f*N;r[2]=d*y+p*b+m*q+g*U;r[6]=d*S+p*w+m*C+g*D;r[10]=d*E+p*A+m*L+g*I;r[14]=d*T+p*R+m*P+g*N;r[3]=_*y+x*b+v*q+M*U;r[7]=_*S+x*w+v*C+M*D;r[11]=_*E+x*A+v*L+M*I;r[15]=_*T+x*R+v*P+M*N;return this}multiplyScalar(t){const e=this.elements;e[0]*=t;e[4]*=t;e[8]*=t;e[12]*=t;e[1]*=t;e[5]*=t;e[9]*=t;e[13]*=t;e[2]*=t;e[6]*=t;e[10]*=t;e[14]*=t;e[3]*=t;e[7]*=t;e[11]*=t;e[15]*=t;return this}determinant(){const t=this.elements;const e=t[0],n=t[4],i=t[8],r=t[12];const s=t[1],a=t[5],o=t[9],l=t[13];const c=t[2],u=t[6],h=t[10],f=t[14];const d=t[3],p=t[7],m=t[11],g=t[15];return d*(+r*o*u-i*l*u-r*a*h+n*l*h+i*a*f-n*o*f)+p*(+e*o*f-e*l*h+r*s*h-i*s*f+i*l*c-r*o*c)+m*(+e*l*u-e*a*f-r*s*u+n*s*f+r*a*c-n*l*c)+g*(-i*a*c-e*o*u+e*a*h+i*s*u-n*s*h+n*o*c)}transpose(){const t=this.elements;let e;e=t[1];t[1]=t[4];t[4]=e;e=t[2];t[2]=t[8];t[8]=e;e=t[6];t[6]=t[9];t[9]=e;e=t[3];t[3]=t[12];t[12]=e;e=t[7];t[7]=t[13];t[13]=e;e=t[11];t[11]=t[14];t[14]=e;return this}setPosition(t,e,n){const i=this.elements;if(t.isVector3){i[12]=t.x;i[13]=t.y;i[14]=t.z}else{i[12]=t;i[13]=e;i[14]=n}return this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15],_=u*m*l-p*h*l+p*o*f-a*m*f-u*o*g+a*h*g,x=d*h*l-c*m*l-d*o*f+s*m*f+c*o*g-s*h*g,v=c*p*l-d*u*l+d*a*f-s*p*f-c*a*g+s*u*g,M=d*u*o-c*p*o-d*a*h+s*p*h+c*a*m-s*u*m;const y=e*_+n*x+i*v+r*M;if(y===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/y;t[0]=_*S;t[1]=(p*h*r-u*m*r-p*i*f+n*m*f+u*i*g-n*h*g)*S;t[2]=(a*m*r-p*o*r+p*i*l-n*m*l-a*i*g+n*o*g)*S;t[3]=(u*o*r-a*h*r-u*i*l+n*h*l+a*i*f-n*o*f)*S;t[4]=x*S;t[5]=(c*m*r-d*h*r+d*i*f-e*m*f-c*i*g+e*h*g)*S;t[6]=(d*o*r-s*m*r-d*i*l+e*m*l+s*i*g-e*o*g)*S;t[7]=(s*h*r-c*o*r+c*i*l-e*h*l-s*i*f+e*o*f)*S;t[8]=v*S;t[9]=(d*u*r-c*p*r-d*n*f+e*p*f+c*n*g-e*u*g)*S;t[10]=(s*p*r-d*a*r+d*n*l-e*p*l-s*n*g+e*a*g)*S;t[11]=(c*a*r-s*u*r-c*n*l+e*u*l+s*n*f-e*a*f)*S;t[12]=M*S;t[13]=(c*p*i-d*u*i+d*n*h-e*p*h-c*n*m+e*u*m)*S;t[14]=(d*a*i-s*p*i-d*n*o+e*p*o+s*n*m-e*a*m)*S;t[15]=(s*u*i-c*a*i+c*n*o-e*u*o-s*n*h+e*a*h)*S;return this}scale(t){const e=this.elements;const n=t.x,i=t.y,r=t.z;e[0]*=n;e[4]*=i;e[8]*=r;e[1]*=n;e[5]*=i;e[9]*=r;e[2]*=n;e[6]*=i;e[10]*=r;e[3]*=n;e[7]*=i;e[11]*=r;return this}getMaxScaleOnAxis(){const t=this.elements;const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];const n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6];const i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1);return this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1);return this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1);return this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1);return this}makeRotationAxis(t,e){const n=Math.cos(e);const i=Math.sin(e);const r=1-n;const s=t.x,a=t.y,o=t.z;const l=r*s,c=r*a;this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1);return this}makeScale(t,e,n){this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1);return this}makeShear(t,e,n,i,r,s){this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1);return this}compose(t,e,n){const i=this.elements;const r=e._x,s=e._y,a=e._z,o=e._w;const l=r+r,c=s+s,u=a+a;const h=r*l,f=r*c,d=r*u;const p=s*c,m=s*u,g=a*u;const _=o*l,x=o*c,v=o*u;const M=n.x,y=n.y,S=n.z;i[0]=(1-(p+g))*M;i[1]=(f+v)*M;i[2]=(d-x)*M;i[3]=0;i[4]=(f-v)*y;i[5]=(1-(h+g))*y;i[6]=(m+_)*y;i[7]=0;i[8]=(d+x)*S;i[9]=(m-_)*S;i[10]=(1-(h+p))*S;i[11]=0;i[12]=t.x;i[13]=t.y;i[14]=t.z;i[15]=1;return this}decompose(t,e,n){const i=this.elements;let r=Vn.set(i[0],i[1],i[2]).length();const s=Vn.set(i[4],i[5],i[6]).length();const a=Vn.set(i[8],i[9],i[10]).length();const o=this.determinant();if(o<0)r=-r;t.x=i[12];t.y=i[13];t.z=i[14];kn.copy(this);const l=1/r;const c=1/s;const u=1/a;kn.elements[0]*=l;kn.elements[1]*=l;kn.elements[2]*=l;kn.elements[4]*=c;kn.elements[5]*=c;kn.elements[6]*=c;kn.elements[8]*=u;kn.elements[9]*=u;kn.elements[10]*=u;e.setFromRotationMatrix(kn);n.x=r;n.y=s;n.z=a;return this}makePerspective(t,e,n,i,r,s){const a=this.elements;const o=2*r/(e-t);const l=2*r/(n-i);const c=(e+t)/(e-t);const u=(n+i)/(n-i);const h=-(s+r)/(s-r);const f=-2*s*r/(s-r);a[0]=o;a[4]=0;a[8]=c;a[12]=0;a[1]=0;a[5]=l;a[9]=u;a[13]=0;a[2]=0;a[6]=0;a[10]=h;a[14]=f;a[3]=0;a[7]=0;a[11]=-1;a[15]=0;return this}makeOrthographic(t,e,n,i,r,s){const a=this.elements;const o=1/(e-t);const l=1/(n-i);const c=1/(s-r);const u=(e+t)*o;const h=(n+i)*l;const f=(s+r)*c;a[0]=2*o;a[4]=0;a[8]=0;a[12]=-u;a[1]=0;a[5]=2*l;a[9]=0;a[13]=-h;a[2]=0;a[6]=0;a[10]=-2*c;a[14]=-f;a[3]=0;a[7]=0;a[11]=0;a[15]=1;return this}equals(t){const e=this.elements;const n=t.elements;for(let t=0;t<16;t++){if(e[t]!==n[t])return false}return true}fromArray(t,e=0){for(let n=0;n<16;n++){this.elements[n]=t[n+e]}return this}toArray(t=[],e=0){const n=this.elements;t[e]=n[0];t[e+1]=n[1];t[e+2]=n[2];t[e+3]=n[3];t[e+4]=n[4];t[e+5]=n[5];t[e+6]=n[6];t[e+7]=n[7];t[e+8]=n[8];t[e+9]=n[9];t[e+10]=n[10];t[e+11]=n[11];t[e+12]=n[12];t[e+13]=n[13];t[e+14]=n[14];t[e+15]=n[15];return t}}const Vn=new fn;const kn=new Gn;const Wn=new fn(0,0,0);const Xn=new fn(1,1,1);const jn=new fn;const Yn=new fn;const Jn=new fn;const Zn=new Gn;const Kn=new hn;class Qn{constructor(t=0,e=0,n=0,i=Qn.DEFAULT_ORDER){this.isEuler=true;this._x=t;this._y=e;this._z=n;this._order=i}get x(){return this._x}set x(t){this._x=t;this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t;this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t;this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t;this._onChangeCallback()}set(t,e,n,i=this._order){this._x=t;this._y=e;this._z=n;this._order=i;this._onChangeCallback();return this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){this._x=t._x;this._y=t._y;this._z=t._z;this._order=t._order;this._onChangeCallback();return this}setFromRotationMatrix(t,e=this._order,n=true){const i=t.elements;const r=i[0],s=i[4],a=i[8];const o=i[1],l=i[5],c=i[9];const u=i[2],h=i[6],f=i[10];switch(e){case"XYZ":this._y=Math.asin(Le(a,-1,1));if(Math.abs(a)<.9999999){this._x=Math.atan2(-c,f);this._z=Math.atan2(-s,r)}else{this._x=Math.atan2(h,l);this._z=0}break;case"YXZ":this._x=Math.asin(-Le(c,-1,1));if(Math.abs(c)<.9999999){this._y=Math.atan2(a,f);this._z=Math.atan2(o,l)}else{this._y=Math.atan2(-u,r);this._z=0}break;case"ZXY":this._x=Math.asin(Le(h,-1,1));if(Math.abs(h)<.9999999){this._y=Math.atan2(-u,f);this._z=Math.atan2(-s,l)}else{this._y=0;this._z=Math.atan2(o,r)}break;case"ZYX":this._y=Math.asin(-Le(u,-1,1));if(Math.abs(u)<.9999999){this._x=Math.atan2(h,f);this._z=Math.atan2(o,r)}else{this._x=0;this._z=Math.atan2(-s,l)}break;case"YZX":this._z=Math.asin(Le(o,-1,1));if(Math.abs(o)<.9999999){this._x=Math.atan2(-c,l);this._y=Math.atan2(-u,r)}else{this._x=0;this._y=Math.atan2(a,f)}break;case"XZY":this._z=Math.asin(-Le(s,-1,1));if(Math.abs(s)<.9999999){this._x=Math.atan2(h,l);this._y=Math.atan2(a,r)}else{this._x=Math.atan2(-c,f);this._y=0}break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}this._order=e;if(n===true)this._onChangeCallback();return this}setFromQuaternion(t,e,n){Zn.makeRotationFromQuaternion(t);return this.setFromRotationMatrix(Zn,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){Kn.setFromEuler(this);return this.setFromQuaternion(Kn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){this._x=t[0];this._y=t[1];this._z=t[2];if(t[3]!==undefined)this._order=t[3];this._onChangeCallback();return this}toArray(t=[],e=0){t[e]=this._x;t[e+1]=this._y;t[e+2]=this._z;t[e+3]=this._order;return t}_onChange(t){this._onChangeCallback=t;return this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x;yield this._y;yield this._z;yield this._order}}Qn.DEFAULT_ORDER="XYZ";class $n{constructor(){this.mask=1|0}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=4294967295|0}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let ti=0;const ei=new fn;const ni=new hn;const ii=new Gn;const ri=new fn;const si=new fn;const ai=new fn;const oi=new hn;const li=new fn(1,0,0);const ci=new fn(0,1,0);const ui=new fn(0,0,1);const hi={type:"added"};const fi={type:"removed"};class di extends we{constructor(){super();this.isObject3D=true;Object.defineProperty(this,"id",{value:ti++});this.uuid=Ce();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=di.DEFAULT_UP.clone();const t=new fn;const e=new Qn;const n=new hn;const i=new fn(1,1,1);function r(){n.setFromEuler(e,false)}function s(){e.setFromQuaternion(n,undefined,false)}e._onChange(r);n._onChange(s);Object.defineProperties(this,{position:{configurable:true,enumerable:true,value:t},rotation:{configurable:true,enumerable:true,value:e},quaternion:{configurable:true,enumerable:true,value:n},scale:{configurable:true,enumerable:true,value:i},modelViewMatrix:{value:new Gn},normalMatrix:{value:new ze}});this.matrix=new Gn;this.matrixWorld=new Gn;this.matrixAutoUpdate=di.DEFAULT_MATRIX_AUTO_UPDATE;this.matrixWorldNeedsUpdate=false;this.matrixWorldAutoUpdate=di.DEFAULT_MATRIX_WORLD_AUTO_UPDATE;this.layers=new $n;this.visible=true;this.castShadow=false;this.receiveShadow=false;this.frustumCulled=true;this.renderOrder=0;this.animations=[];this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){if(this.matrixAutoUpdate)this.updateMatrix();this.matrix.premultiply(t);this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){this.quaternion.premultiply(t);return this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,true)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){ni.setFromAxisAngle(t,e);this.quaternion.multiply(ni);return this}rotateOnWorldAxis(t,e){ni.setFromAxisAngle(t,e);this.quaternion.premultiply(ni);return this}rotateX(t){return this.rotateOnAxis(li,t)}rotateY(t){return this.rotateOnAxis(ci,t)}rotateZ(t){return this.rotateOnAxis(ui,t)}translateOnAxis(t,e){ei.copy(t).applyQuaternion(this.quaternion);this.position.add(ei.multiplyScalar(e));return this}translateX(t){return this.translateOnAxis(li,t)}translateY(t){return this.translateOnAxis(ci,t)}translateZ(t){return this.translateOnAxis(ui,t)}localToWorld(t){this.updateWorldMatrix(true,false);return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){this.updateWorldMatrix(true,false);return t.applyMatrix4(ii.copy(this.matrixWorld).invert())}lookAt(t,e,n){if(t.isVector3){ri.copy(t)}else{ri.set(t,e,n)}const i=this.parent;this.updateWorldMatrix(true,false);si.setFromMatrixPosition(this.matrixWorld);if(this.isCamera||this.isLight){ii.lookAt(si,ri,this.up)}else{ii.lookAt(ri,si,this.up)}this.quaternion.setFromRotationMatrix(ii);if(i){ii.extractRotation(i.matrixWorld);ni.setFromRotationMatrix(ii);this.quaternion.premultiply(ni.invert())}}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++){this.add(arguments[t])}return this}if(t===this){console.error("THREE.Object3D.add: object can't be added as a child of itself.",t);return this}if(t&&t.isObject3D){if(t.parent!==null){t.parent.remove(t)}t.parent=this;this.children.push(t);t.dispatchEvent(hi)}else{console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t)}return this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++){this.remove(arguments[t])}return this}const e=this.children.indexOf(t);if(e!==-1){t.parent=null;this.children.splice(e,1);t.dispatchEvent(fi)}return this}removeFromParent(){const t=this.parent;if(t!==null){t.remove(this)}return this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null;e.dispatchEvent(fi)}this.children.length=0;return this}attach(t){this.updateWorldMatrix(true,false);ii.copy(this.matrixWorld).invert();if(t.parent!==null){t.parent.updateWorldMatrix(true,false);ii.multiply(t.parent.matrixWorld)}t.applyMatrix4(ii);this.add(t);t.updateWorldMatrix(false,true);return this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n];const r=i.getObjectByProperty(t,e);if(r!==undefined){return r}}return undefined}getObjectsByProperty(t,e){let n=[];if(this[t]===e)n.push(this);for(let i=0,r=this.children.length;i<r;i++){const r=this.children[i].getObjectsByProperty(t,e);if(r.length>0){n=n.concat(r)}}return n}getWorldPosition(t){this.updateWorldMatrix(true,false);return t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){this.updateWorldMatrix(true,false);this.matrixWorld.decompose(si,t,ai);return t}getWorldScale(t){this.updateWorldMatrix(true,false);this.matrixWorld.decompose(si,oi,t);return t}getWorldDirection(t){this.updateWorldMatrix(true,false);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].traverse(t)}}traverseVisible(t){if(this.visible===false)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].traverseVisible(t)}}traverseAncestors(t){const e=this.parent;if(e!==null){t(e);e.traverseAncestors(t)}}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=true}updateMatrixWorld(t){if(this.matrixAutoUpdate)this.updateMatrix();if(this.matrixWorldNeedsUpdate||t){if(this.parent===null){this.matrixWorld.copy(this.matrix)}else{this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)}this.matrixWorldNeedsUpdate=false;t=true}const e=this.children;for(let n=0,i=e.length;n<i;n++){const i=e[n];if(i.matrixWorldAutoUpdate===true||t===true){i.updateMatrixWorld(t)}}}updateWorldMatrix(t,e){const n=this.parent;if(t===true&&n!==null&&n.matrixWorldAutoUpdate===true){n.updateWorldMatrix(true,false)}if(this.matrixAutoUpdate)this.updateMatrix();if(this.parent===null){this.matrixWorld.copy(this.matrix)}else{this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)}if(e===true){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n.matrixWorldAutoUpdate===true){n.updateWorldMatrix(false,true)}}}}toJSON(t){const e=t===undefined||typeof t==="string";const n={};if(e){t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}};n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}}const i={};i.uuid=this.uuid;i.type=this.type;if(this.name!=="")i.name=this.name;if(this.castShadow===true)i.castShadow=true;if(this.receiveShadow===true)i.receiveShadow=true;if(this.visible===false)i.visible=false;if(this.frustumCulled===false)i.frustumCulled=false;if(this.renderOrder!==0)i.renderOrder=this.renderOrder;if(Object.keys(this.userData).length>0)i.userData=this.userData;i.layers=this.layers.mask;i.matrix=this.matrix.toArray();i.up=this.up.toArray();if(this.matrixAutoUpdate===false)i.matrixAutoUpdate=false;if(this.isInstancedMesh){i.type="InstancedMesh";i.count=this.count;i.instanceMatrix=this.instanceMatrix.toJSON();if(this.instanceColor!==null)i.instanceColor=this.instanceColor.toJSON()}function r(e,n){if(e[n.uuid]===undefined){e[n.uuid]=n.toJSON(t)}return n.uuid}if(this.isScene){if(this.background){if(this.background.isColor){i.background=this.background.toJSON()}else if(this.background.isTexture){i.background=this.background.toJSON(t).uuid}}if(this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==true){i.environment=this.environment.toJSON(t).uuid}}else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(e!==undefined&&e.shapes!==undefined){const n=e.shapes;if(Array.isArray(n)){for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}}else{r(t.shapes,n)}}}if(this.isSkinnedMesh){i.bindMode=this.bindMode;i.bindMatrix=this.bindMatrix.toArray();if(this.skeleton!==undefined){r(t.skeletons,this.skeleton);i.skeleton=this.skeleton.uuid}}if(this.material!==undefined){if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++){e.push(r(t.materials,this.material[n]))}i.material=e}else{i.material=r(t.materials,this.material)}}if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++){i.children.push(this.children[e].toJSON(t).object)}}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=s(t.geometries);const i=s(t.materials);const r=s(t.textures);const a=s(t.images);const o=s(t.shapes);const l=s(t.skeletons);const c=s(t.animations);const u=s(t.nodes);if(e.length>0)n.geometries=e;if(i.length>0)n.materials=i;if(r.length>0)n.textures=r;if(a.length>0)n.images=a;if(o.length>0)n.shapes=o;if(l.length>0)n.skeletons=l;if(c.length>0)n.animations=c;if(u.length>0)n.nodes=u}n.object=i;return n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata;e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=true){this.name=t.name;this.up.copy(t.up);this.position.copy(t.position);this.rotation.order=t.rotation.order;this.quaternion.copy(t.quaternion);this.scale.copy(t.scale);this.matrix.copy(t.matrix);this.matrixWorld.copy(t.matrixWorld);this.matrixAutoUpdate=t.matrixAutoUpdate;this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate;this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate;this.layers.mask=t.layers.mask;this.visible=t.visible;this.castShadow=t.castShadow;this.receiveShadow=t.receiveShadow;this.frustumCulled=t.frustumCulled;this.renderOrder=t.renderOrder;this.animations=t.animations;this.userData=JSON.parse(JSON.stringify(t.userData));if(e===true){for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}}return this}}di.DEFAULT_UP=new fn(0,1,0);di.DEFAULT_MATRIX_AUTO_UPDATE=true;di.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=true;const pi=new fn;const mi=new fn;const gi=new fn;const _i=new fn;const xi=new fn;const vi=new fn;const Mi=new fn;const yi=new fn;const Si=new fn;const Ei=new fn;let Ti=false;class bi{constructor(t=new fn,e=new fn,n=new fn){this.a=t;this.b=e;this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e);pi.subVectors(t,e);i.cross(pi);const r=i.lengthSq();if(r>0){return i.multiplyScalar(1/Math.sqrt(r))}return i.set(0,0,0)}static getBarycoord(t,e,n,i,r){pi.subVectors(i,e);mi.subVectors(n,e);gi.subVectors(t,e);const s=pi.dot(pi);const a=pi.dot(mi);const o=pi.dot(gi);const l=mi.dot(mi);const c=mi.dot(gi);const u=s*l-a*a;if(u===0){return r.set(-2,-1,-1)}const h=1/u;const f=(l*o-a*c)*h;const d=(s*c-a*o)*h;return r.set(1-f-d,d,f)}static containsPoint(t,e,n,i){this.getBarycoord(t,e,n,i,_i);return _i.x>=0&&_i.y>=0&&_i.x+_i.y<=1}static getUV(t,e,n,i,r,s,a,o){if(Ti===false){console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().");Ti=true}return this.getInterpolation(t,e,n,i,r,s,a,o)}static getInterpolation(t,e,n,i,r,s,a,o){this.getBarycoord(t,e,n,i,_i);o.setScalar(0);o.addScaledVector(r,_i.x);o.addScaledVector(s,_i.y);o.addScaledVector(a,_i.z);return o}static isFrontFacing(t,e,n,i){pi.subVectors(n,e);mi.subVectors(t,e);return pi.cross(mi).dot(i)<0?true:false}set(t,e,n){this.a.copy(t);this.b.copy(e);this.c.copy(n);return this}setFromPointsAndIndices(t,e,n,i){this.a.copy(t[e]);this.b.copy(t[n]);this.c.copy(t[i]);return this}setFromAttributeAndIndices(t,e,n,i){this.a.fromBufferAttribute(t,e);this.b.fromBufferAttribute(t,n);this.c.fromBufferAttribute(t,i);return this}clone(){return(new this.constructor).copy(this)}copy(t){this.a.copy(t.a);this.b.copy(t.b);this.c.copy(t.c);return this}getArea(){pi.subVectors(this.c,this.b);mi.subVectors(this.a,this.b);return pi.cross(mi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return bi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return bi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){if(Ti===false){console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().");Ti=true}return bi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}getInterpolation(t,e,n,i,r){return bi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return bi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return bi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;xi.subVectors(i,n);vi.subVectors(r,n);yi.subVectors(t,n);const o=xi.dot(yi);const l=vi.dot(yi);if(o<=0&&l<=0){return e.copy(n)}Si.subVectors(t,i);const c=xi.dot(Si);const u=vi.dot(Si);if(c>=0&&u<=c){return e.copy(i)}const h=o*u-c*l;if(h<=0&&o>=0&&c<=0){s=o/(o-c);return e.copy(n).addScaledVector(xi,s)}Ei.subVectors(t,r);const f=xi.dot(Ei);const d=vi.dot(Ei);if(d>=0&&f<=d){return e.copy(r)}const p=f*l-o*d;if(p<=0&&l>=0&&d<=0){a=l/(l-d);return e.copy(n).addScaledVector(vi,a)}const m=c*d-f*u;if(m<=0&&u-c>=0&&f-d>=0){Mi.subVectors(r,i);a=(u-c)/(u-c+(f-d));return e.copy(i).addScaledVector(Mi,a)}const g=1/(m+p+h);s=p*g;a=h*g;return e.copy(n).addScaledVector(xi,s).addScaledVector(vi,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let wi=0;class Ai extends we{constructor(){super();this.isMaterial=true;Object.defineProperty(this,"id",{value:wi++});this.uuid=Ce();this.name="";this.type="Material";this.blending=p;this.side=u;this.vertexColors=false;this.opacity=1;this.transparent=false;this.blendSrc=R;this.blendDst=q;this.blendEquation=v;this.blendSrcAlpha=null;this.blendDstAlpha=null;this.blendEquationAlpha=null;this.depthFunc=F;this.depthTest=true;this.depthWrite=true;this.stencilWriteMask=255;this.stencilFunc=Se;this.stencilRef=0;this.stencilFuncMask=255;this.stencilFail=ye;this.stencilZFail=ye;this.stencilZPass=ye;this.stencilWrite=false;this.clippingPlanes=null;this.clipIntersection=false;this.clipShadows=false;this.shadowSide=null;this.colorWrite=true;this.precision=null;this.polygonOffset=false;this.polygonOffsetFactor=0;this.polygonOffsetUnits=0;this.dithering=false;this.alphaToCoverage=false;this.premultipliedAlpha=false;this.forceSinglePass=false;this.visible=true;this.toneMapped=true;this.userData={};this.version=0;this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){if(this._alphaTest>0!==t>0){this.version++}this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t===undefined)return;for(const e in t){const n=t[e];if(n===undefined){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];if(i===undefined){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}if(i&&i.isColor){i.set(n)}else if(i&&i.isVector3&&(n&&n.isVector3)){i.copy(n)}else{this[e]=n}}}toJSON(t){const e=t===undefined||typeof t==="string";if(e){t={textures:{},images:{}}}const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid;n.type=this.type;if(this.name!=="")n.name=this.name;if(this.color&&this.color.isColor)n.color=this.color.getHex();if(this.roughness!==undefined)n.roughness=this.roughness;if(this.metalness!==undefined)n.metalness=this.metalness;if(this.sheen!==undefined)n.sheen=this.sheen;if(this.sheenColor&&this.sheenColor.isColor)n.sheenColor=this.sheenColor.getHex();if(this.sheenRoughness!==undefined)n.sheenRoughness=this.sheenRoughness;if(this.emissive&&this.emissive.isColor)n.emissive=this.emissive.getHex();if(this.emissiveIntensity&&this.emissiveIntensity!==1)n.emissiveIntensity=this.emissiveIntensity;if(this.specular&&this.specular.isColor)n.specular=this.specular.getHex();if(this.specularIntensity!==undefined)n.specularIntensity=this.specularIntensity;if(this.specularColor&&this.specularColor.isColor)n.specularColor=this.specularColor.getHex();if(this.shininess!==undefined)n.shininess=this.shininess;if(this.clearcoat!==undefined)n.clearcoat=this.clearcoat;if(this.clearcoatRoughness!==undefined)n.clearcoatRoughness=this.clearcoatRoughness;if(this.clearcoatMap&&this.clearcoatMap.isTexture){n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid}if(this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture){n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid}if(this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture){n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid;n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()}if(this.iridescence!==undefined)n.iridescence=this.iridescence;if(this.iridescenceIOR!==undefined)n.iridescenceIOR=this.iridescenceIOR;if(this.iridescenceThicknessRange!==undefined)n.iridescenceThicknessRange=this.iridescenceThicknessRange;if(this.iridescenceMap&&this.iridescenceMap.isTexture){n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid}if(this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture){n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid}if(this.map&&this.map.isTexture)n.map=this.map.toJSON(t).uuid;if(this.matcap&&this.matcap.isTexture)n.matcap=this.matcap.toJSON(t).uuid;if(this.alphaMap&&this.alphaMap.isTexture)n.alphaMap=this.alphaMap.toJSON(t).uuid;if(this.lightMap&&this.lightMap.isTexture){n.lightMap=this.lightMap.toJSON(t).uuid;n.lightMapIntensity=this.lightMapIntensity}if(this.aoMap&&this.aoMap.isTexture){n.aoMap=this.aoMap.toJSON(t).uuid;n.aoMapIntensity=this.aoMapIntensity}if(this.bumpMap&&this.bumpMap.isTexture){n.bumpMap=this.bumpMap.toJSON(t).uuid;n.bumpScale=this.bumpScale}if(this.normalMap&&this.normalMap.isTexture){n.normalMap=this.normalMap.toJSON(t).uuid;n.normalMapType=this.normalMapType;n.normalScale=this.normalScale.toArray()}if(this.displacementMap&&this.displacementMap.isTexture){n.displacementMap=this.displacementMap.toJSON(t).uuid;n.displacementScale=this.displacementScale;n.displacementBias=this.displacementBias}if(this.roughnessMap&&this.roughnessMap.isTexture)n.roughnessMap=this.roughnessMap.toJSON(t).uuid;if(this.metalnessMap&&this.metalnessMap.isTexture)n.metalnessMap=this.metalnessMap.toJSON(t).uuid;if(this.emissiveMap&&this.emissiveMap.isTexture)n.emissiveMap=this.emissiveMap.toJSON(t).uuid;if(this.specularMap&&this.specularMap.isTexture)n.specularMap=this.specularMap.toJSON(t).uuid;if(this.specularIntensityMap&&this.specularIntensityMap.isTexture)n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid;if(this.specularColorMap&&this.specularColorMap.isTexture)n.specularColorMap=this.specularColorMap.toJSON(t).uuid;if(this.envMap&&this.envMap.isTexture){n.envMap=this.envMap.toJSON(t).uuid;if(this.combine!==undefined)n.combine=this.combine}if(this.envMapIntensity!==undefined)n.envMapIntensity=this.envMapIntensity;if(this.reflectivity!==undefined)n.reflectivity=this.reflectivity;if(this.refractionRatio!==undefined)n.refractionRatio=this.refractionRatio;if(this.gradientMap&&this.gradientMap.isTexture){n.gradientMap=this.gradientMap.toJSON(t).uuid}if(this.transmission!==undefined)n.transmission=this.transmission;if(this.transmissionMap&&this.transmissionMap.isTexture)n.transmissionMap=this.transmissionMap.toJSON(t).uuid;if(this.thickness!==undefined)n.thickness=this.thickness;if(this.thicknessMap&&this.thicknessMap.isTexture)n.thicknessMap=this.thicknessMap.toJSON(t).uuid;if(this.attenuationDistance!==undefined&&this.attenuationDistance!==Infinity)n.attenuationDistance=this.attenuationDistance;if(this.attenuationColor!==undefined)n.attenuationColor=this.attenuationColor.getHex();if(this.size!==undefined)n.size=this.size;if(this.shadowSide!==null)n.shadowSide=this.shadowSide;if(this.sizeAttenuation!==undefined)n.sizeAttenuation=this.sizeAttenuation;if(this.blending!==p)n.blending=this.blending;if(this.side!==u)n.side=this.side;if(this.vertexColors)n.vertexColors=true;if(this.opacity<1)n.opacity=this.opacity;if(this.transparent===true)n.transparent=this.transparent;n.depthFunc=this.depthFunc;n.depthTest=this.depthTest;n.depthWrite=this.depthWrite;n.colorWrite=this.colorWrite;n.stencilWrite=this.stencilWrite;n.stencilWriteMask=this.stencilWriteMask;n.stencilFunc=this.stencilFunc;n.stencilRef=this.stencilRef;n.stencilFuncMask=this.stencilFuncMask;n.stencilFail=this.stencilFail;n.stencilZFail=this.stencilZFail;n.stencilZPass=this.stencilZPass;if(this.rotation!==undefined&&this.rotation!==0)n.rotation=this.rotation;if(this.polygonOffset===true)n.polygonOffset=true;if(this.polygonOffsetFactor!==0)n.polygonOffsetFactor=this.polygonOffsetFactor;if(this.polygonOffsetUnits!==0)n.polygonOffsetUnits=this.polygonOffsetUnits;if(this.linewidth!==undefined&&this.linewidth!==1)n.linewidth=this.linewidth;if(this.dashSize!==undefined)n.dashSize=this.dashSize;if(this.gapSize!==undefined)n.gapSize=this.gapSize;if(this.scale!==undefined)n.scale=this.scale;if(this.dithering===true)n.dithering=true;if(this.alphaTest>0)n.alphaTest=this.alphaTest;if(this.alphaToCoverage===true)n.alphaToCoverage=this.alphaToCoverage;if(this.premultipliedAlpha===true)n.premultipliedAlpha=this.premultipliedAlpha;if(this.forceSinglePass===true)n.forceSinglePass=this.forceSinglePass;if(this.wireframe===true)n.wireframe=this.wireframe;if(this.wireframeLinewidth>1)n.wireframeLinewidth=this.wireframeLinewidth;if(this.wireframeLinecap!=="round")n.wireframeLinecap=this.wireframeLinecap;if(this.wireframeLinejoin!=="round")n.wireframeLinejoin=this.wireframeLinejoin;if(this.flatShading===true)n.flatShading=this.flatShading;if(this.visible===false)n.visible=false;if(this.toneMapped===false)n.toneMapped=false;if(this.fog===false)n.fog=false;if(Object.keys(this.userData).length>0)n.userData=this.userData;function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata;e.push(i)}return e}if(e){const e=i(t.textures);const r=i(t.images);if(e.length>0)n.textures=e;if(r.length>0)n.images=r}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name;this.blending=t.blending;this.side=t.side;this.vertexColors=t.vertexColors;this.opacity=t.opacity;this.transparent=t.transparent;this.blendSrc=t.blendSrc;this.blendDst=t.blendDst;this.blendEquation=t.blendEquation;this.blendSrcAlpha=t.blendSrcAlpha;this.blendDstAlpha=t.blendDstAlpha;this.blendEquationAlpha=t.blendEquationAlpha;this.depthFunc=t.depthFunc;this.depthTest=t.depthTest;this.depthWrite=t.depthWrite;this.stencilWriteMask=t.stencilWriteMask;this.stencilFunc=t.stencilFunc;this.stencilRef=t.stencilRef;this.stencilFuncMask=t.stencilFuncMask;this.stencilFail=t.stencilFail;this.stencilZFail=t.stencilZFail;this.stencilZPass=t.stencilZPass;this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i){n[i]=e[i].clone()}}this.clippingPlanes=n;this.clipIntersection=t.clipIntersection;this.clipShadows=t.clipShadows;this.shadowSide=t.shadowSide;this.colorWrite=t.colorWrite;this.precision=t.precision;this.polygonOffset=t.polygonOffset;this.polygonOffsetFactor=t.polygonOffsetFactor;this.polygonOffsetUnits=t.polygonOffsetUnits;this.dithering=t.dithering;this.alphaTest=t.alphaTest;this.alphaToCoverage=t.alphaToCoverage;this.premultipliedAlpha=t.premultipliedAlpha;this.forceSinglePass=t.forceSinglePass;this.visible=t.visible;this.toneMapped=t.toneMapped;this.userData=JSON.parse(JSON.stringify(t.userData));return this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){if(t===true)this.version++}}const Ri={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};const qi={h:0,s:0,l:0};const Ci={h:0,s:0,l:0};function Li(t,e,n){if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return t+(e-t)*6*n;if(n<1/2)return e;if(n<2/3)return t+(e-t)*6*(2/3-n);return t}class Pi{constructor(t,e,n){this.isColor=true;this.r=1;this.g=1;this.b=1;if(e===undefined&&n===undefined){return this.set(t)}return this.setRGB(t,e,n)}set(t){if(t&&t.isColor){this.copy(t)}else if(typeof t==="number"){this.setHex(t)}else if(typeof t==="string"){this.setStyle(t)}return this}setScalar(t){this.r=t;this.g=t;this.b=t;return this}setHex(t,e=xe){t=Math.floor(t);this.r=(t>>16&255)/255;this.g=(t>>8&255)/255;this.b=(t&255)/255;$e.toWorkingColorSpace(this,e);return this}setRGB(t,e,n,i=$e.workingColorSpace){this.r=t;this.g=e;this.b=n;$e.toWorkingColorSpace(this,i);return this}setHSL(t,e,n,i=$e.workingColorSpace){t=Pe(t,1);e=Le(e,0,1);n=Le(n,0,1);if(e===0){this.r=this.g=this.b=n}else{const i=n<=.5?n*(1+e):n+e-n*e;const r=2*n-i;this.r=Li(r,i,t+1/3);this.g=Li(r,i,t);this.b=Li(r,i,t-1/3)}$e.toWorkingColorSpace(this,i);return this}setStyle(t,e=xe){function n(e){if(e===undefined)return;if(parseFloat(e)<1){console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1];const a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){n(r[4]);return this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e)}if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){n(r[4]);return this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e)}break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){n(r[4]);return this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e)}break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1];const r=n.length;if(r===3){return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e)}else if(r===6){return this.setHex(parseInt(n,16),e)}else{console.warn("THREE.Color: Invalid hex color "+t)}}else if(t&&t.length>0){return this.setColorName(t,e)}return this}setColorName(t,e=xe){const n=Ri[t.toLowerCase()];if(n!==undefined){this.setHex(n,e)}else{console.warn("THREE.Color: Unknown color "+t)}return this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){this.r=t.r;this.g=t.g;this.b=t.b;return this}copySRGBToLinear(t){this.r=We(t.r);this.g=We(t.g);this.b=We(t.b);return this}copyLinearToSRGB(t){this.r=Xe(t.r);this.g=Xe(t.g);this.b=Xe(t.b);return this}convertSRGBToLinear(){this.copySRGBToLinear(this);return this}convertLinearToSRGB(){this.copyLinearToSRGB(this);return this}getHex(t=xe){$e.fromWorkingColorSpace(Ui.copy(this),t);return Math.round(Le(Ui.r*255,0,255))*65536+Math.round(Le(Ui.g*255,0,255))*256+Math.round(Le(Ui.b*255,0,255))}getHexString(t=xe){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=$e.workingColorSpace){$e.fromWorkingColorSpace(Ui.copy(this),e);const n=Ui.r,i=Ui.g,r=Ui.b;const s=Math.max(n,i,r);const a=Math.min(n,i,r);let o,l;const c=(a+s)/2;if(a===s){o=0;l=0}else{const t=s-a;l=c<=.5?t/(s+a):t/(2-s-a);switch(s){case n:o=(i-r)/t+(i<r?6:0);break;case i:o=(r-n)/t+2;break;case r:o=(n-i)/t+4;break}o/=6}t.h=o;t.s=l;t.l=c;return t}getRGB(t,e=$e.workingColorSpace){$e.fromWorkingColorSpace(Ui.copy(this),e);t.r=Ui.r;t.g=Ui.g;t.b=Ui.b;return t}getStyle(t=xe){$e.fromWorkingColorSpace(Ui.copy(this),t);const e=Ui.r,n=Ui.g,i=Ui.b;if(t!==xe){return`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`}return`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){this.getHSL(qi);qi.h+=t;qi.s+=e;qi.l+=n;this.setHSL(qi.h,qi.s,qi.l);return this}add(t){this.r+=t.r;this.g+=t.g;this.b+=t.b;return this}addColors(t,e){this.r=t.r+e.r;this.g=t.g+e.g;this.b=t.b+e.b;return this}addScalar(t){this.r+=t;this.g+=t;this.b+=t;return this}sub(t){this.r=Math.max(0,this.r-t.r);this.g=Math.max(0,this.g-t.g);this.b=Math.max(0,this.b-t.b);return this}multiply(t){this.r*=t.r;this.g*=t.g;this.b*=t.b;return this}multiplyScalar(t){this.r*=t;this.g*=t;this.b*=t;return this}lerp(t,e){this.r+=(t.r-this.r)*e;this.g+=(t.g-this.g)*e;this.b+=(t.b-this.b)*e;return this}lerpColors(t,e,n){this.r=t.r+(e.r-t.r)*n;this.g=t.g+(e.g-t.g)*n;this.b=t.b+(e.b-t.b)*n;return this}lerpHSL(t,e){this.getHSL(qi);t.getHSL(Ci);const n=Ue(qi.h,Ci.h,e);const i=Ue(qi.s,Ci.s,e);const r=Ue(qi.l,Ci.l,e);this.setHSL(n,i,r);return this}setFromVector3(t){this.r=t.x;this.g=t.y;this.b=t.z;return this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b;const r=t.elements;this.r=r[0]*e+r[3]*n+r[6]*i;this.g=r[1]*e+r[4]*n+r[7]*i;this.b=r[2]*e+r[5]*n+r[8]*i;return this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){this.r=t[e];this.g=t[e+1];this.b=t[e+2];return this}toArray(t=[],e=0){t[e]=this.r;t[e+1]=this.g;t[e+2]=this.b;return t}fromBufferAttribute(t,e){this.r=t.getX(e);this.g=t.getY(e);this.b=t.getZ(e);return this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r;yield this.g;yield this.b}}const Ui=new Pi;Pi.NAMES=Ri;class Di extends Ai{constructor(t){super();this.isMeshBasicMaterial=true;this.type="MeshBasicMaterial";this.color=new Pi(16777215);this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=V;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.lightMap=t.lightMap;this.lightMapIntensity=t.lightMapIntensity;this.aoMap=t.aoMap;this.aoMapIntensity=t.aoMapIntensity;this.specularMap=t.specularMap;this.alphaMap=t.alphaMap;this.envMap=t.envMap;this.combine=t.combine;this.reflectivity=t.reflectivity;this.refractionRatio=t.refractionRatio;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;this.wireframeLinecap=t.wireframeLinecap;this.wireframeLinejoin=t.wireframeLinejoin;this.fog=t.fog;return this}}const Ii=new fn;const Ni=new Fe;class Oi{constructor(t,e,n=false){if(Array.isArray(t)){throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.")}this.isBufferAttribute=true;this.name="";this.array=t;this.itemSize=e;this.count=t!==undefined?t.length/e:0;this.normalized=n;this.usage=Ee;this.updateRange={offset:0,count:-1};this.version=0}onUploadCallback(){}set needsUpdate(t){if(t===true)this.version++}setUsage(t){this.usage=t;return this}copy(t){this.name=t.name;this.array=new t.array.constructor(t.array);this.itemSize=t.itemSize;this.count=t.count;this.normalized=t.normalized;this.usage=t.usage;return this}copyAt(t,e,n){t*=this.itemSize;n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++){this.array[t+i]=e.array[n+i]}return this}copyArray(t){this.array.set(t);return this}applyMatrix3(t){if(this.itemSize===2){for(let e=0,n=this.count;e<n;e++){Ni.fromBufferAttribute(this,e);Ni.applyMatrix3(t);this.setXY(e,Ni.x,Ni.y)}}else if(this.itemSize===3){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.applyMatrix3(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}}return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.applyMatrix4(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.applyNormalMatrix(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.transformDirection(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}return this}set(t,e=0){this.array.set(t,e);return this}getX(t){let e=this.array[t*this.itemSize];if(this.normalized)e=Ne(e,this.array);return e}setX(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize]=e;return this}getY(t){let e=this.array[t*this.itemSize+1];if(this.normalized)e=Ne(e,this.array);return e}setY(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize+1]=e;return this}getZ(t){let e=this.array[t*this.itemSize+2];if(this.normalized)e=Ne(e,this.array);return e}setZ(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize+2]=e;return this}getW(t){let e=this.array[t*this.itemSize+3];if(this.normalized)e=Ne(e,this.array);return e}setW(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize+3]=e;return this}setXY(t,e,n){t*=this.itemSize;if(this.normalized){e=Oe(e,this.array);n=Oe(n,this.array)}this.array[t+0]=e;this.array[t+1]=n;return this}setXYZ(t,e,n,i){t*=this.itemSize;if(this.normalized){e=Oe(e,this.array);n=Oe(n,this.array);i=Oe(i,this.array)}this.array[t+0]=e;this.array[t+1]=n;this.array[t+2]=i;return this}setXYZW(t,e,n,i,r){t*=this.itemSize;if(this.normalized){e=Oe(e,this.array);n=Oe(n,this.array);i=Oe(i,this.array);r=Oe(r,this.array)}this.array[t+0]=e;this.array[t+1]=n;this.array[t+2]=i;this.array[t+3]=r;return this}onUpload(t){this.onUploadCallback=t;return this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};if(this.name!=="")t.name=this.name;if(this.usage!==Ee)t.usage=this.usage;if(this.updateRange.offset!==0||this.updateRange.count!==-1)t.updateRange=this.updateRange;return t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class Fi extends Oi{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class zi extends Oi{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class Bi extends Oi{constructor(t,e,n){super(new Float32Array(t),e,n)}}let Hi=0;const Gi=new Gn;const Vi=new di;const ki=new fn;const Wi=new mn;const Xi=new mn;const ji=new fn;class Yi extends we{constructor(){super();this.isBufferGeometry=true;Object.defineProperty(this,"id",{value:Hi++});this.uuid=Ce();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=false;this.groups=[];this.boundingBox=null;this.boundingSphere=null;this.drawRange={start:0,count:Infinity};this.userData={}}getIndex(){return this.index}setIndex(t){if(Array.isArray(t)){this.index=new(He(t)?zi:Fi)(t,1)}else{this.index=t}return this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){this.attributes[t]=e;return this}deleteAttribute(t){delete this.attributes[t];return this}hasAttribute(t){return this.attributes[t]!==undefined}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t;this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;if(e!==undefined){e.applyMatrix4(t);e.needsUpdate=true}const n=this.attributes.normal;if(n!==undefined){const e=(new ze).getNormalMatrix(t);n.applyNormalMatrix(e);n.needsUpdate=true}const i=this.attributes.tangent;if(i!==undefined){i.transformDirection(t);i.needsUpdate=true}if(this.boundingBox!==null){this.computeBoundingBox()}if(this.boundingSphere!==null){this.computeBoundingSphere()}return this}applyQuaternion(t){Gi.makeRotationFromQuaternion(t);this.applyMatrix4(Gi);return this}rotateX(t){Gi.makeRotationX(t);this.applyMatrix4(Gi);return this}rotateY(t){Gi.makeRotationY(t);this.applyMatrix4(Gi);return this}rotateZ(t){Gi.makeRotationZ(t);this.applyMatrix4(Gi);return this}translate(t,e,n){Gi.makeTranslation(t,e,n);this.applyMatrix4(Gi);return this}scale(t,e,n){Gi.makeScale(t,e,n);this.applyMatrix4(Gi);return this}lookAt(t){Vi.lookAt(t);Vi.updateMatrix();this.applyMatrix4(Vi.matrix);return this}center(){this.computeBoundingBox();this.boundingBox.getCenter(ki).negate();this.translate(ki.x,ki.y,ki.z);return this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}this.setAttribute("position",new Bi(e,3));return this}computeBoundingBox(){if(this.boundingBox===null){this.boundingBox=new mn}const t=this.attributes.position;const e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this);this.boundingBox.set(new fn(-Infinity,-Infinity,-Infinity),new fn(+Infinity,+Infinity,+Infinity));return}if(t!==undefined){this.boundingBox.setFromBufferAttribute(t);if(e){for(let t=0,n=e.length;t<n;t++){const n=e[t];Wi.setFromBufferAttribute(n);if(this.morphTargetsRelative){ji.addVectors(this.boundingBox.min,Wi.min);this.boundingBox.expandByPoint(ji);ji.addVectors(this.boundingBox.max,Wi.max);this.boundingBox.expandByPoint(ji)}else{this.boundingBox.expandByPoint(Wi.min);this.boundingBox.expandByPoint(Wi.max)}}}}else{this.boundingBox.makeEmpty()}if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)){console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}computeBoundingSphere(){if(this.boundingSphere===null){this.boundingSphere=new Un}const t=this.attributes.position;const e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this);this.boundingSphere.set(new fn,Infinity);return}if(t){const n=this.boundingSphere.center;Wi.setFromBufferAttribute(t);if(e){for(let t=0,n=e.length;t<n;t++){const n=e[t];Xi.setFromBufferAttribute(n);if(this.morphTargetsRelative){ji.addVectors(Wi.min,Xi.min);Wi.expandByPoint(ji);ji.addVectors(Wi.max,Xi.max);Wi.expandByPoint(ji)}else{Wi.expandByPoint(Xi.min);Wi.expandByPoint(Xi.max)}}}Wi.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++){ji.fromBufferAttribute(t,e);i=Math.max(i,n.distanceToSquared(ji))}if(e){for(let r=0,s=e.length;r<s;r++){const s=e[r];const a=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++){ji.fromBufferAttribute(s,e);if(a){ki.fromBufferAttribute(t,e);ji.add(ki)}i=Math.max(i,n.distanceToSquared(ji))}}}this.boundingSphere.radius=Math.sqrt(i);if(isNaN(this.boundingSphere.radius)){console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}computeTangents(){const t=this.index;const e=this.attributes;if(t===null||e.position===undefined||e.normal===undefined||e.uv===undefined){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.array;const i=e.position.array;const r=e.normal.array;const s=e.uv.array;const a=i.length/3;if(this.hasAttribute("tangent")===false){this.setAttribute("tangent",new Oi(new Float32Array(4*a),4))}const o=this.getAttribute("tangent").array;const l=[],c=[];for(let t=0;t<a;t++){l[t]=new fn;c[t]=new fn}const u=new fn,h=new fn,f=new fn,d=new Fe,p=new Fe,m=new Fe,g=new fn,_=new fn;function x(t,e,n){u.fromArray(i,t*3);h.fromArray(i,e*3);f.fromArray(i,n*3);d.fromArray(s,t*2);p.fromArray(s,e*2);m.fromArray(s,n*2);h.sub(u);f.sub(u);p.sub(d);m.sub(d);const r=1/(p.x*m.y-m.x*p.y);if(!isFinite(r))return;g.copy(h).multiplyScalar(m.y).addScaledVector(f,-p.y).multiplyScalar(r);_.copy(f).multiplyScalar(p.x).addScaledVector(h,-m.x).multiplyScalar(r);l[t].add(g);l[e].add(g);l[n].add(g);c[t].add(_);c[e].add(_);c[n].add(_)}let v=this.groups;if(v.length===0){v=[{start:0,count:n.length}]}for(let t=0,e=v.length;t<e;++t){const e=v[t];const i=e.start;const r=e.count;for(let t=i,e=i+r;t<e;t+=3){x(n[t+0],n[t+1],n[t+2])}}const M=new fn,y=new fn;const S=new fn,E=new fn;function T(t){S.fromArray(r,t*3);E.copy(S);const e=l[t];M.copy(e);M.sub(S.multiplyScalar(S.dot(e))).normalize();y.crossVectors(E,e);const n=y.dot(c[t]);const i=n<0?-1:1;o[t*4]=M.x;o[t*4+1]=M.y;o[t*4+2]=M.z;o[t*4+3]=i}for(let t=0,e=v.length;t<e;++t){const e=v[t];const i=e.start;const r=e.count;for(let t=i,e=i+r;t<e;t+=3){T(n[t+0]);T(n[t+1]);T(n[t+2])}}}computeVertexNormals(){const t=this.index;const e=this.getAttribute("position");if(e!==undefined){let n=this.getAttribute("normal");if(n===undefined){n=new Oi(new Float32Array(e.count*3),3);this.setAttribute("normal",n)}else{for(let t=0,e=n.count;t<e;t++){n.setXYZ(t,0,0,0)}}const i=new fn,r=new fn,s=new fn;const a=new fn,o=new fn,l=new fn;const c=new fn,u=new fn;if(t){for(let h=0,f=t.count;h<f;h+=3){const f=t.getX(h+0);const d=t.getX(h+1);const p=t.getX(h+2);i.fromBufferAttribute(e,f);r.fromBufferAttribute(e,d);s.fromBufferAttribute(e,p);c.subVectors(s,r);u.subVectors(i,r);c.cross(u);a.fromBufferAttribute(n,f);o.fromBufferAttribute(n,d);l.fromBufferAttribute(n,p);a.add(c);o.add(c);l.add(c);n.setXYZ(f,a.x,a.y,a.z);n.setXYZ(d,o.x,o.y,o.z);n.setXYZ(p,l.x,l.y,l.z)}}else{for(let t=0,a=e.count;t<a;t+=3){i.fromBufferAttribute(e,t+0);r.fromBufferAttribute(e,t+1);s.fromBufferAttribute(e,t+2);c.subVectors(s,r);u.subVectors(i,r);c.cross(u);n.setXYZ(t+0,c.x,c.y,c.z);n.setXYZ(t+1,c.x,c.y,c.z);n.setXYZ(t+2,c.x,c.y,c.z)}}this.normalizeNormals();n.needsUpdate=true}}merge(){console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.");return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++){ji.fromBufferAttribute(t,e);ji.normalize();t.setXYZ(e,ji.x,ji.y,ji.z)}}toNonIndexed(){function t(t,e){const n=t.array;const i=t.itemSize;const r=t.normalized;const s=new n.constructor(e.length*i);let a=0,o=0;for(let r=0,l=e.length;r<l;r++){if(t.isInterleavedBufferAttribute){a=e[r]*t.data.stride+t.offset}else{a=e[r]*i}for(let t=0;t<i;t++){s[o++]=n[a++]}}return new Oi(s,i,r)}if(this.index===null){console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.");return this}const e=new Yi;const n=this.index.array;const i=this.attributes;for(const r in i){const s=i[r];const a=t(s,n);e.setAttribute(r,a)}const r=this.morphAttributes;for(const i in r){const s=[];const a=r[i];for(let e=0,i=a.length;e<i;e++){const i=a[e];const r=t(i,n);s.push(r)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,n=s.length;t<n;t++){const n=s[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};t.uuid=this.uuid;t.type=this.type;if(this.name!=="")t.name=this.name;if(Object.keys(this.userData).length>0)t.userData=this.userData;if(this.parameters!==undefined){const e=this.parameters;for(const n in e){if(e[n]!==undefined)t[n]=e[n]}return t}t.data={attributes:{}};const e=this.index;if(e!==null){t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)}}const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=false;for(const e in this.morphAttributes){const n=this.morphAttributes[e];const s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];s.push(i.toJSON(t.data))}if(s.length>0){i[e]=s;r=true}}if(r){t.data.morphAttributes=i;t.data.morphTargetsRelative=this.morphTargetsRelative}const s=this.groups;if(s.length>0){t.data.groups=JSON.parse(JSON.stringify(s))}const a=this.boundingSphere;if(a!==null){t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}}return t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingBox=null;this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;if(n!==null){this.setIndex(n.clone(e))}const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[];const i=r[t];for(let t=0,r=i.length;t<r;t++){n.push(i[t].clone(e))}this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;if(a!==null){this.boundingBox=a.clone()}const o=t.boundingSphere;if(o!==null){this.boundingSphere=o.clone()}this.drawRange.start=t.drawRange.start;this.drawRange.count=t.drawRange.count;this.userData=t.userData;return this}dispose(){this.dispatchEvent({type:"dispose"})}}const Ji=new Gn;const Zi=new Hn;const Ki=new Un;const Qi=new fn;const $i=new fn;const tr=new fn;const er=new fn;const nr=new fn;const ir=new fn;const rr=new Fe;const sr=new Fe;const ar=new Fe;const or=new fn;const lr=new fn;const cr=new fn;const ur=new fn;const hr=new fn;class fr extends di{constructor(t=new Yi,e=new Di){super();this.isMesh=true;this.type="Mesh";this.geometry=t;this.material=e;this.updateMorphTargets()}copy(t,e){super.copy(t,e);if(t.morphTargetInfluences!==undefined){this.morphTargetInfluences=t.morphTargetInfluences.slice()}if(t.morphTargetDictionary!==undefined){this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)}this.material=t.material;this.geometry=t.geometry;return this}updateMorphTargets(){const t=this.geometry;const e=t.morphAttributes;const n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(t!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0);this.morphTargetDictionary[n]=e}}}}getVertexPosition(t,e){const n=this.geometry;const i=n.attributes.position;const r=n.morphAttributes.position;const s=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const a=this.morphTargetInfluences;if(r&&a){ir.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=a[n];const o=r[n];if(i===0)continue;nr.fromBufferAttribute(o,t);if(s){ir.addScaledVector(nr,i)}else{ir.addScaledVector(nr.sub(e),i)}}e.add(ir)}return e}raycast(t,e){const n=this.geometry;const i=this.material;const r=this.matrixWorld;if(i===undefined)return;if(n.boundingSphere===null)n.computeBoundingSphere();Ki.copy(n.boundingSphere);Ki.applyMatrix4(r);Zi.copy(t.ray).recast(t.near);if(Ki.containsPoint(Zi.origin)===false){if(Zi.intersectSphere(Ki,Qi)===null)return;if(Zi.origin.distanceToSquared(Qi)>(t.far-t.near)**2)return}Ji.copy(r).invert();Zi.copy(t.ray).applyMatrix4(Ji);if(n.boundingBox!==null){if(Zi.intersectsBox(n.boundingBox)===false)return}this._computeIntersections(t,e)}_computeIntersections(t,e){let n;const i=this.geometry;const r=this.material;const s=i.index;const a=i.attributes.position;const o=i.attributes.uv;const l=i.attributes.uv1;const c=i.attributes.normal;const u=i.groups;const h=i.drawRange;if(s!==null){if(Array.isArray(r)){for(let i=0,a=u.length;i<a;i++){const a=u[i];const f=r[a.materialIndex];const d=Math.max(a.start,h.start);const p=Math.min(s.count,Math.min(a.start+a.count,h.start+h.count));for(let i=d,r=p;i<r;i+=3){const r=s.getX(i);const u=s.getX(i+1);const h=s.getX(i+2);n=pr(this,f,t,Zi,o,l,c,r,u,h);if(n){n.faceIndex=Math.floor(i/3);n.face.materialIndex=a.materialIndex;e.push(n)}}}}else{const i=Math.max(0,h.start);const a=Math.min(s.count,h.start+h.count);for(let u=i,h=a;u<h;u+=3){const i=s.getX(u);const a=s.getX(u+1);const h=s.getX(u+2);n=pr(this,r,t,Zi,o,l,c,i,a,h);if(n){n.faceIndex=Math.floor(u/3);e.push(n)}}}}else if(a!==undefined){if(Array.isArray(r)){for(let i=0,s=u.length;i<s;i++){const s=u[i];const f=r[s.materialIndex];const d=Math.max(s.start,h.start);const p=Math.min(a.count,Math.min(s.start+s.count,h.start+h.count));for(let i=d,r=p;i<r;i+=3){const r=i;const a=i+1;const u=i+2;n=pr(this,f,t,Zi,o,l,c,r,a,u);if(n){n.faceIndex=Math.floor(i/3);n.face.materialIndex=s.materialIndex;e.push(n)}}}}else{const i=Math.max(0,h.start);const s=Math.min(a.count,h.start+h.count);for(let a=i,u=s;a<u;a+=3){const i=a;const s=a+1;const u=a+2;n=pr(this,r,t,Zi,o,l,c,i,s,u);if(n){n.faceIndex=Math.floor(a/3);e.push(n)}}}}}}function dr(t,e,n,i,r,s,a,o){let l;if(e.side===h){l=i.intersectTriangle(a,s,r,true,o)}else{l=i.intersectTriangle(r,s,a,e.side===u,o)}if(l===null)return null;hr.copy(o);hr.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(hr);if(c<n.near||c>n.far)return null;return{distance:c,point:hr.clone(),object:t}}function pr(t,e,n,i,r,s,a,o,l,c){t.getVertexPosition(o,$i);t.getVertexPosition(l,tr);t.getVertexPosition(c,er);const u=dr(t,e,n,i,$i,tr,er,ur);if(u){if(r){rr.fromBufferAttribute(r,o);sr.fromBufferAttribute(r,l);ar.fromBufferAttribute(r,c);u.uv=bi.getInterpolation(ur,$i,tr,er,rr,sr,ar,new Fe)}if(s){rr.fromBufferAttribute(s,o);sr.fromBufferAttribute(s,l);ar.fromBufferAttribute(s,c);u.uv1=bi.getInterpolation(ur,$i,tr,er,rr,sr,ar,new Fe);u.uv2=u.uv1}if(a){or.fromBufferAttribute(a,o);lr.fromBufferAttribute(a,l);cr.fromBufferAttribute(a,c);u.normal=bi.getInterpolation(ur,$i,tr,er,or,lr,cr,new fn);if(u.normal.dot(i.direction)>0){u.normal.multiplyScalar(-1)}}const t={a:o,b:l,c:c,normal:new fn,materialIndex:0};bi.getNormal($i,tr,er,t.normal);u.face=t}return u}class mr extends Yi{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super();this.type="BoxGeometry";this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i);r=Math.floor(r);s=Math.floor(s);const o=[];const l=[];const c=[];const u=[];let h=0;let f=0;d("z","y","x",-1,-1,n,e,t,s,r,0);d("z","y","x",1,-1,n,e,-t,s,r,1);d("x","z","y",1,1,t,n,e,i,s,2);d("x","z","y",1,-1,t,n,-e,i,s,3);d("x","y","z",1,-1,t,e,n,i,r,4);d("x","y","z",-1,-1,t,e,-n,i,r,5);this.setIndex(o);this.setAttribute("position",new Bi(l,3));this.setAttribute("normal",new Bi(c,3));this.setAttribute("uv",new Bi(u,2));function d(t,e,n,i,r,s,d,p,m,g,_){const x=s/m;const v=d/g;const M=s/2;const y=d/2;const S=p/2;const E=m+1;const T=g+1;let b=0;let w=0;const A=new fn;for(let s=0;s<T;s++){const a=s*v-y;for(let o=0;o<E;o++){const h=o*x-M;A[t]=h*i;A[e]=a*r;A[n]=S;l.push(A.x,A.y,A.z);A[t]=0;A[e]=0;A[n]=p>0?1:-1;c.push(A.x,A.y,A.z);u.push(o/m);u.push(1-s/g);b+=1}}for(let t=0;t<g;t++){for(let e=0;e<m;e++){const n=h+e+E*t;const i=h+e+E*(t+1);const r=h+(e+1)+E*(t+1);const s=h+(e+1)+E*t;o.push(n,i,s);o.push(i,r,s);w+=6}}a.addGroup(f,w,_);f+=w;h+=b}}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}static fromJSON(t){return new mr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function gr(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];if(r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)){if(r.isRenderTargetTexture){console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().");e[n][i]=null}else{e[n][i]=r.clone()}}else if(Array.isArray(r)){e[n][i]=r.slice()}else{e[n][i]=r}}}return e}function _r(t){const e={};for(let n=0;n<t.length;n++){const i=gr(t[n]);for(const t in i){e[t]=i[t]}}return e}function xr(t){const e=[];for(let n=0;n<t.length;n++){e.push(t[n].clone())}return e}function vr(t){if(t.getRenderTarget()===null){return t.outputColorSpace}return ve}const Mr={clone:gr,merge:_r};var yr="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";var Sr="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";class Er extends Ai{constructor(t){super();this.isShaderMaterial=true;this.type="ShaderMaterial";this.defines={};this.uniforms={};this.uniformsGroups=[];this.vertexShader=yr;this.fragmentShader=Sr;this.linewidth=1;this.wireframe=false;this.wireframeLinewidth=1;this.fog=false;this.lights=false;this.clipping=false;this.forceSinglePass=true;this.extensions={derivatives:false,fragDepth:false,drawBuffers:false,shaderTextureLOD:false};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]};this.index0AttributeName=undefined;this.uniformsNeedUpdate=false;this.glslVersion=null;if(t!==undefined){this.setValues(t)}}copy(t){super.copy(t);this.fragmentShader=t.fragmentShader;this.vertexShader=t.vertexShader;this.uniforms=gr(t.uniforms);this.uniformsGroups=xr(t.uniformsGroups);this.defines=Object.assign({},t.defines);this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;this.fog=t.fog;this.lights=t.lights;this.clipping=t.clipping;this.extensions=Object.assign({},t.extensions);this.glslVersion=t.glslVersion;return this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion;e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n];const r=i.value;if(r&&r.isTexture){e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}}else if(r&&r.isColor){e.uniforms[n]={type:"c",value:r.getHex()}}else if(r&&r.isVector2){e.uniforms[n]={type:"v2",value:r.toArray()}}else if(r&&r.isVector3){e.uniforms[n]={type:"v3",value:r.toArray()}}else if(r&&r.isVector4){e.uniforms[n]={type:"v4",value:r.toArray()}}else if(r&&r.isMatrix3){e.uniforms[n]={type:"m3",value:r.toArray()}}else if(r&&r.isMatrix4){e.uniforms[n]={type:"m4",value:r.toArray()}}else{e.uniforms[n]={value:r}}}if(Object.keys(this.defines).length>0)e.defines=this.defines;e.vertexShader=this.vertexShader;e.fragmentShader=this.fragmentShader;e.lights=this.lights;e.clipping=this.clipping;const n={};for(const t in this.extensions){if(this.extensions[t]===true)n[t]=true}if(Object.keys(n).length>0)e.extensions=n;return e}}class Tr extends di{constructor(){super();this.isCamera=true;this.type="Camera";this.matrixWorldInverse=new Gn;this.projectionMatrix=new Gn;this.projectionMatrixInverse=new Gn}copy(t,e){super.copy(t,e);this.matrixWorldInverse.copy(t.matrixWorldInverse);this.projectionMatrix.copy(t.projectionMatrix);this.projectionMatrixInverse.copy(t.projectionMatrixInverse);return this}getWorldDirection(t){this.updateWorldMatrix(true,false);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t);this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e);this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class br extends Tr{constructor(t=50,e=1,n=.1,i=2e3){super();this.isPerspectiveCamera=true;this.type="PerspectiveCamera";this.fov=t;this.zoom=1;this.near=n;this.far=i;this.focus=10;this.aspect=e;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}copy(t,e){super.copy(t,e);this.fov=t.fov;this.zoom=t.zoom;this.near=t.near;this.far=t.far;this.focus=t.focus;this.aspect=t.aspect;this.view=t.view===null?null:Object.assign({},t.view);this.filmGauge=t.filmGauge;this.filmOffset=t.filmOffset;return this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=qe*2*Math.atan(e);this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Re*.5*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return qe*2*Math.atan(Math.tan(Re*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e;if(this.view===null){this.view={enabled:true,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}}this.view.enabled=true;this.view.fullWidth=t;this.view.fullHeight=e;this.view.offsetX=n;this.view.offsetY=i;this.view.width=r;this.view.height=s;this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null){this.view.enabled=false}this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Re*.5*this.fov)/this.zoom;let n=2*e;let i=this.aspect*n;let r=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t;e-=s.offsetY*n/a;i*=s.width/t;n*=s.height/a}const a=this.filmOffset;if(a!==0)r+=t*a/this.getFilmWidth();this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far);this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);e.object.fov=this.fov;e.object.zoom=this.zoom;e.object.near=this.near;e.object.far=this.far;e.object.focus=this.focus;e.object.aspect=this.aspect;if(this.view!==null)e.object.view=Object.assign({},this.view);e.object.filmGauge=this.filmGauge;e.object.filmOffset=this.filmOffset;return e}}const wr=-90;const Ar=1;class Rr extends di{constructor(t,e,n){super();this.type="CubeCamera";this.renderTarget=n;const i=new br(wr,Ar,t,e);i.layers=this.layers;i.up.set(0,1,0);i.lookAt(1,0,0);this.add(i);const r=new br(wr,Ar,t,e);r.layers=this.layers;r.up.set(0,1,0);r.lookAt(-1,0,0);this.add(r);const s=new br(wr,Ar,t,e);s.layers=this.layers;s.up.set(0,0,-1);s.lookAt(0,1,0);this.add(s);const a=new br(wr,Ar,t,e);a.layers=this.layers;a.up.set(0,0,1);a.lookAt(0,-1,0);this.add(a);const o=new br(wr,Ar,t,e);o.layers=this.layers;o.up.set(0,1,0);o.lookAt(0,0,1);this.add(o);const l=new br(wr,Ar,t,e);l.layers=this.layers;l.up.set(0,1,0);l.lookAt(0,0,-1);this.add(l)}update(t,e){if(this.parent===null)this.updateMatrixWorld();const n=this.renderTarget;const[i,r,s,a,o,l]=this.children;const c=t.getRenderTarget();const u=t.toneMapping;const h=t.xr.enabled;t.toneMapping=X;t.xr.enabled=false;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=false;t.setRenderTarget(n,0);t.render(e,i);t.setRenderTarget(n,1);t.render(e,r);t.setRenderTarget(n,2);t.render(e,s);t.setRenderTarget(n,3);t.render(e,a);t.setRenderTarget(n,4);t.render(e,o);n.texture.generateMipmaps=f;t.setRenderTarget(n,5);t.render(e,l);t.setRenderTarget(c);t.toneMapping=u;t.xr.enabled=h;n.texture.needsPMREMUpdate=true}}class qr extends an{constructor(t,e,n,i,r,s,a,o,l,c){t=t!==undefined?t:[];e=e!==undefined?e:$;super(t,e,n,i,r,s,a,o,l,c);this.isCubeTexture=true;this.flipY=false}get images(){return this.image}set images(t){this.image=t}}class Cr extends ln{constructor(t=1,e={}){super(t,t,e);this.isWebGLCubeRenderTarget=true;const n={width:t,height:t,depth:1};const i=[n,n,n,n,n,n];if(e.encoding!==undefined){ke("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.");e.colorSpace=e.encoding===fe?xe:_e}this.texture=new qr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace);this.texture.isRenderTargetTexture=true;this.texture.generateMipmaps=e.generateMipmaps!==undefined?e.generateMipmaps:false;this.texture.minFilter=e.minFilter!==undefined?e.minFilter:ut}fromEquirectangularTexture(t,e){this.texture.type=e.type;this.texture.colorSpace=e.colorSpace;this.texture.generateMipmaps=e.generateMipmaps;this.texture.minFilter=e.minFilter;this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,fragmentShader:`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`};const i=new mr(5,5,5);const r=new Er({name:"CubemapFromEquirect",uniforms:gr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:h,blending:d});r.uniforms.tEquirect.value=e;const s=new fr(i,r);const a=e.minFilter;if(e.minFilter===ft)e.minFilter=ut;const o=new Rr(1,10,this);o.update(t,s);e.minFilter=a;s.geometry.dispose();s.material.dispose();return this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++){t.setRenderTarget(this,r);t.clear(e,n,i)}t.setRenderTarget(r)}}const Lr=new fn;const Pr=new fn;const Ur=new ze;class Dr{constructor(t=new fn(1,0,0),e=0){this.isPlane=true;this.normal=t;this.constant=e}set(t,e){this.normal.copy(t);this.constant=e;return this}setComponents(t,e,n,i){this.normal.set(t,e,n);this.constant=i;return this}setFromNormalAndCoplanarPoint(t,e){this.normal.copy(t);this.constant=-e.dot(this.normal);return this}setFromCoplanarPoints(t,e,n){const i=Lr.subVectors(n,e).cross(Pr.subVectors(t,e)).normalize();this.setFromNormalAndCoplanarPoint(i,t);return this}copy(t){this.normal.copy(t.normal);this.constant=t.constant;return this}normalize(){const t=1/this.normal.length();this.normal.multiplyScalar(t);this.constant*=t;return this}negate(){this.constant*=-1;this.normal.negate();return this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Lr);const i=this.normal.dot(n);if(i===0){if(this.distanceToPoint(t.start)===0){return e.copy(t.start)}return null}const r=-(t.start.dot(this.normal)+this.constant)/i;if(r<0||r>1){return null}return e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start);const n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Ur.getNormalMatrix(t);const i=this.coplanarPoint(Lr).applyMatrix4(t);const r=this.normal.applyMatrix3(n).normalize();this.constant=-i.dot(r);return this}translate(t){this.constant-=t.dot(this.normal);return this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Ir=new Un;const Nr=new fn;class Or{constructor(t=new Dr,e=new Dr,n=new Dr,i=new Dr,r=new Dr,s=new Dr){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;a[0].copy(t);a[1].copy(e);a[2].copy(n);a[3].copy(i);a[4].copy(r);a[5].copy(s);return this}copy(t){const e=this.planes;for(let n=0;n<6;n++){e[n].copy(t.planes[n])}return this}setFromProjectionMatrix(t){const e=this.planes;const n=t.elements;const i=n[0],r=n[1],s=n[2],a=n[3];const o=n[4],l=n[5],c=n[6],u=n[7];const h=n[8],f=n[9],d=n[10],p=n[11];const m=n[12],g=n[13],_=n[14],x=n[15];e[0].setComponents(a-i,u-o,p-h,x-m).normalize();e[1].setComponents(a+i,u+o,p+h,x+m).normalize();e[2].setComponents(a+r,u+l,p+f,x+g).normalize();e[3].setComponents(a-r,u-l,p-f,x-g).normalize();e[4].setComponents(a-s,u-c,p-d,x-_).normalize();e[5].setComponents(a+s,u+c,p+d,x+_).normalize();return this}intersectsObject(t){if(t.boundingSphere!==undefined){if(t.boundingSphere===null)t.computeBoundingSphere();Ir.copy(t.boundingSphere).applyMatrix4(t.matrixWorld)}else{const e=t.geometry;if(e.boundingSphere===null)e.computeBoundingSphere();Ir.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Ir)}intersectsSprite(t){Ir.center.set(0,0,0);Ir.radius=.7071067811865476;Ir.applyMatrix4(t.matrixWorld);return this.intersectsSphere(Ir)}intersectsSphere(t){const e=this.planes;const n=t.center;const i=-t.radius;for(let t=0;t<6;t++){const r=e[t].distanceToPoint(n);if(r<i){return false}}return true}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];Nr.x=i.normal.x>0?t.max.x:t.min.x;Nr.y=i.normal.y>0?t.max.y:t.min.y;Nr.z=i.normal.z>0?t.max.z:t.min.z;if(i.distanceToPoint(Nr)<0){return false}}return true}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++){if(e[n].distanceToPoint(t)<0){return false}}return true}clone(){return(new this.constructor).copy(this)}}function Fr(){let t=null;let e=false;let n=null;let i=null;function r(e,s){n(e,s);i=t.requestAnimationFrame(r)}return{start:function(){if(e===true)return;if(n===null)return;i=t.requestAnimationFrame(r);e=true},stop:function(){t.cancelAnimationFrame(i);e=false},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function zr(t,e){const n=e.isWebGL2;const i=new WeakMap;function r(e,i){const r=e.array;const s=e.usage;const a=t.createBuffer();t.bindBuffer(i,a);t.bufferData(i,r,s);e.onUploadCallback();let o;if(r instanceof Float32Array){o=t.FLOAT}else if(r instanceof Uint16Array){if(e.isFloat16BufferAttribute){if(n){o=t.HALF_FLOAT}else{throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.")}}else{o=t.UNSIGNED_SHORT}}else if(r instanceof Int16Array){o=t.SHORT}else if(r instanceof Uint32Array){o=t.UNSIGNED_INT}else if(r instanceof Int32Array){o=t.INT}else if(r instanceof Int8Array){o=t.BYTE}else if(r instanceof Uint8Array){o=t.UNSIGNED_BYTE}else if(r instanceof Uint8ClampedArray){o=t.UNSIGNED_BYTE}else{throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r)}return{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}function s(e,i,r){const s=i.array;const a=i.updateRange;t.bindBuffer(r,e);if(a.count===-1){t.bufferSubData(r,0,s)}else{if(n){t.bufferSubData(r,a.offset*s.BYTES_PER_ELEMENT,s,a.offset,a.count)}else{t.bufferSubData(r,a.offset*s.BYTES_PER_ELEMENT,s.subarray(a.offset,a.offset+a.count))}a.count=-1}i.onUploadCallback()}function a(t){if(t.isInterleavedBufferAttribute)t=t.data;return i.get(t)}function o(e){if(e.isInterleavedBufferAttribute)e=e.data;const n=i.get(e);if(n){t.deleteBuffer(n.buffer);i.delete(e)}}function l(t,e){if(t.isGLBufferAttribute){const e=i.get(t);if(!e||e.version<t.version){i.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version})}return}if(t.isInterleavedBufferAttribute)t=t.data;const n=i.get(t);if(n===undefined){i.set(t,r(t,e))}else if(n.version<t.version){s(n.buffer,t,e);n.version=t.version}}return{get:a,remove:o,update:l}}class Br extends Yi{constructor(t=1,e=1,n=1,i=1){super();this.type="PlaneGeometry";this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2;const s=e/2;const a=Math.floor(n);const o=Math.floor(i);const l=a+1;const c=o+1;const u=t/a;const h=e/o;const f=[];const d=[];const p=[];const m=[];for(let t=0;t<c;t++){const e=t*h-s;for(let n=0;n<l;n++){const i=n*u-r;d.push(i,-e,0);p.push(0,0,1);m.push(n/a);m.push(1-t/o)}}for(let t=0;t<o;t++){for(let e=0;e<a;e++){const n=e+l*t;const i=e+l*(t+1);const r=e+1+l*(t+1);const s=e+1+l*t;f.push(n,i,s);f.push(i,r,s)}}this.setIndex(f);this.setAttribute("position",new Bi(d,3));this.setAttribute("normal",new Bi(p,3));this.setAttribute("uv",new Bi(m,2))}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}static fromJSON(t){return new Br(t.width,t.height,t.widthSegments,t.heightSegments)}}var Hr="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif";var Gr="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";var Vr="#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif";var kr="#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif";var Wr="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif";var Xr="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif";var jr="vec3 transformed = vec3( position );";var Yr="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";var Jr="float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated";var Zr="#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif";var Kr="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif";var Qr="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif";var $r="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif";var ts="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif";var es="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif";var ns="#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif";var is="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif";var rs="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif";var ss="#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif";var as="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated";var os="#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif";var ls="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif";var cs="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif";var us="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif";var hs="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif";var fs="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif";var ds="gl_FragColor = linearToOutputTexel( gl_FragColor );";var ps="vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";var ms="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";var gs="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";var _s="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif";var xs="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif";var vs="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif";var Ms="#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif";var ys="#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif";var Ss="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif";var Es="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif";var Ts="#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}";var bs="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif";var ws="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif";var As="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";var Rs="varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert";var qs="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";var Cs="#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif";var Ls="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";var Ps="varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon";var Us="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";var Ds="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong";var Is="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif";var Ns="struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";var Os="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif";var Fs="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";var zs="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif";var Bs="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";var Hs="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif";var Gs="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif";var Vs="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";var ks="#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif";var Ws="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";var Xs="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif";var js="#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";var Ys="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif";var Js="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif";var Zs="#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif";var Ks="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif";var Qs="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";var $s="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif";var ta="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_NORMALMAP_TANGENTSPACE\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;";var ea="#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";var na="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif";var ia="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif";var ra="#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif";var sa="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif";var aa="#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif";var oa="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif";var la="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif";var ca="#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif";var ua="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";var ha="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}";var fa="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif";var da="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;";var pa="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif";var ma="#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif";var ga="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif";var _a="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif";var xa="#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif";var va="#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif";var Ma="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif";var ya="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}";var Sa="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";var Ea="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif";var Ta="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif";var ba="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif";var wa="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif";var Aa="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif";var Ra="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";var qa="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";var Ca="#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif";var La="#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif";var Pa="#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";var Ua="#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";var Da="#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif";var Ia="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";const Na="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";const Oa="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Fa="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";const za="#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Ba="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";const Ha="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Ga="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";const Va="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";const ka="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";const Wa="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";const Xa="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}";const ja="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Ya="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";const Ja="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";const Za="#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";const Ka="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const Qa="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const $a="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const to="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";const eo="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const no="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";const io="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}";const ro="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const so="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const ao="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";const oo="#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const lo="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const co="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const uo="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";const ho="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";const fo="#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const po="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";const mo="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";const go="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";const _o={alphamap_fragment:Hr,alphamap_pars_fragment:Gr,alphatest_fragment:Vr,alphatest_pars_fragment:kr,aomap_fragment:Wr,aomap_pars_fragment:Xr,begin_vertex:jr,beginnormal_vertex:Yr,bsdfs:Jr,iridescence_fragment:Zr,bumpmap_pars_fragment:Kr,clipping_planes_fragment:Qr,clipping_planes_pars_fragment:$r,clipping_planes_pars_vertex:ts,clipping_planes_vertex:es,color_fragment:ns,color_pars_fragment:is,color_pars_vertex:rs,color_vertex:ss,common:as,cube_uv_reflection_fragment:os,defaultnormal_vertex:ls,displacementmap_pars_vertex:cs,displacementmap_vertex:us,emissivemap_fragment:hs,emissivemap_pars_fragment:fs,encodings_fragment:ds,encodings_pars_fragment:ps,envmap_fragment:ms,envmap_common_pars_fragment:gs,envmap_pars_fragment:_s,envmap_pars_vertex:xs,envmap_physical_pars_fragment:Cs,envmap_vertex:vs,fog_vertex:Ms,fog_pars_vertex:ys,fog_fragment:Ss,fog_pars_fragment:Es,gradientmap_pars_fragment:Ts,lightmap_fragment:bs,lightmap_pars_fragment:ws,lights_lambert_fragment:As,lights_lambert_pars_fragment:Rs,lights_pars_begin:qs,lights_toon_fragment:Ls,lights_toon_pars_fragment:Ps,lights_phong_fragment:Us,lights_phong_pars_fragment:Ds,lights_physical_fragment:Is,lights_physical_pars_fragment:Ns,lights_fragment_begin:Os,lights_fragment_maps:Fs,lights_fragment_end:zs,logdepthbuf_fragment:Bs,logdepthbuf_pars_fragment:Hs,logdepthbuf_pars_vertex:Gs,logdepthbuf_vertex:Vs,map_fragment:ks,map_pars_fragment:Ws,map_particle_fragment:Xs,map_particle_pars_fragment:js,metalnessmap_fragment:Ys,metalnessmap_pars_fragment:Js,morphcolor_vertex:Zs,morphnormal_vertex:Ks,morphtarget_pars_vertex:Qs,morphtarget_vertex:$s,normal_fragment_begin:ta,normal_fragment_maps:ea,normal_pars_fragment:na,normal_pars_vertex:ia,normal_vertex:ra,normalmap_pars_fragment:sa,clearcoat_normal_fragment_begin:aa,clearcoat_normal_fragment_maps:oa,clearcoat_pars_fragment:la,iridescence_pars_fragment:ca,output_fragment:ua,packing:ha,premultiplied_alpha_fragment:fa,project_vertex:da,dithering_fragment:pa,dithering_pars_fragment:ma,roughnessmap_fragment:ga,roughnessmap_pars_fragment:_a,shadowmap_pars_fragment:xa,shadowmap_pars_vertex:va,shadowmap_vertex:Ma,shadowmask_pars_fragment:ya,skinbase_vertex:Sa,skinning_pars_vertex:Ea,skinning_vertex:Ta,skinnormal_vertex:ba,specularmap_fragment:wa,specularmap_pars_fragment:Aa,tonemapping_fragment:Ra,tonemapping_pars_fragment:qa,transmission_fragment:Ca,transmission_pars_fragment:La,uv_pars_fragment:Pa,uv_pars_vertex:Ua,uv_vertex:Da,worldpos_vertex:Ia,background_vert:Na,background_frag:Oa,backgroundCube_vert:Fa,backgroundCube_frag:za,cube_vert:Ba,cube_frag:Ha,depth_vert:Ga,depth_frag:Va,distanceRGBA_vert:ka,distanceRGBA_frag:Wa,equirect_vert:Xa,equirect_frag:ja,linedashed_vert:Ya,linedashed_frag:Ja,meshbasic_vert:Za,meshbasic_frag:Ka,meshlambert_vert:Qa,meshlambert_frag:$a,meshmatcap_vert:to,meshmatcap_frag:eo,meshnormal_vert:no,meshnormal_frag:io,meshphong_vert:ro,meshphong_frag:so,meshphysical_vert:ao,meshphysical_frag:oo,meshtoon_vert:lo,meshtoon_frag:co,points_vert:uo,points_frag:ho,shadow_vert:fo,shadow_frag:po,sprite_vert:mo,sprite_frag:go};const xo={common:{diffuse:{value:new Pi(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ze},alphaMap:{value:null},alphaMapTransform:{value:new ze},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ze}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ze}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ze}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ze},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ze},normalScale:{value:new Fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ze},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ze}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ze}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ze}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ze}},sprite:{diffuse:{value:new Pi(16777215)},opacity:{value:1},center:{value:new Fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ze},alphaMap:{value:null},alphaTest:{value:0}}};const vo={basic:{uniforms:_r([xo.common,xo.specularmap,xo.envmap,xo.aomap,xo.lightmap,xo.fog]),vertexShader:_o.meshbasic_vert,fragmentShader:_o.meshbasic_frag},lambert:{uniforms:_r([xo.common,xo.specularmap,xo.envmap,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)}}]),vertexShader:_o.meshlambert_vert,fragmentShader:_o.meshlambert_frag},phong:{uniforms:_r([xo.common,xo.specularmap,xo.envmap,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)},specular:{value:new Pi(1118481)},shininess:{value:30}}]),vertexShader:_o.meshphong_vert,fragmentShader:_o.meshphong_frag},standard:{uniforms:_r([xo.common,xo.envmap,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.roughnessmap,xo.metalnessmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag},toon:{uniforms:_r([xo.common,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.gradientmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)}}]),vertexShader:_o.meshtoon_vert,fragmentShader:_o.meshtoon_frag},matcap:{uniforms:_r([xo.common,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.fog,{matcap:{value:null}}]),vertexShader:_o.meshmatcap_vert,fragmentShader:_o.meshmatcap_frag},points:{uniforms:_r([xo.points,xo.fog]),vertexShader:_o.points_vert,fragmentShader:_o.points_frag},dashed:{uniforms:_r([xo.common,xo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_o.linedashed_vert,fragmentShader:_o.linedashed_frag},depth:{uniforms:_r([xo.common,xo.displacementmap]),vertexShader:_o.depth_vert,fragmentShader:_o.depth_frag},normal:{uniforms:_r([xo.common,xo.bumpmap,xo.normalmap,xo.displacementmap,{opacity:{value:1}}]),vertexShader:_o.meshnormal_vert,fragmentShader:_o.meshnormal_frag},sprite:{uniforms:_r([xo.sprite,xo.fog]),vertexShader:_o.sprite_vert,fragmentShader:_o.sprite_frag},background:{uniforms:{uvTransform:{value:new ze},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_o.background_vert,fragmentShader:_o.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_o.backgroundCube_vert,fragmentShader:_o.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_o.cube_vert,fragmentShader:_o.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_o.equirect_vert,fragmentShader:_o.equirect_frag},distanceRGBA:{uniforms:_r([xo.common,xo.displacementmap,{referencePosition:{value:new fn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_o.distanceRGBA_vert,fragmentShader:_o.distanceRGBA_frag},shadow:{uniforms:_r([xo.lights,xo.fog,{color:{value:new Pi(0)},opacity:{value:1}}]),vertexShader:_o.shadow_vert,fragmentShader:_o.shadow_frag}};vo.physical={uniforms:_r([vo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ze},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ze},clearcoatNormalScale:{value:new Fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ze},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ze},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ze},sheen:{value:0},sheenColor:{value:new Pi(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ze},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ze},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ze},transmissionSamplerSize:{value:new Fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ze},attenuationDistance:{value:0},attenuationColor:{value:new Pi(0)},specularColor:{value:new Pi(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ze},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ze}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag};const Mo={r:0,b:0,g:0};function yo(t,e,n,i,r,s,a){const o=new Pi(0);let l=s===true?0:1;let c;let f;let d=null;let p=0;let m=null;function g(s,g){let x=false;let v=g.isScene===true?g.background:null;if(v&&v.isTexture){const t=g.backgroundBlurriness>0;v=(t?n:e).get(v)}if(v===null){_(o,l)}else if(v&&v.isColor){_(v,1);x=true}const M=t.xr;const y=M.getEnvironmentBlendMode();switch(y){case"opaque":x=true;break;case"additive":i.buffers.color.setClear(0,0,0,1,a);x=true;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,a);x=true;break}if(t.autoClear||x){t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil)}if(v&&(v.isCubeTexture||v.mapping===it)){if(f===undefined){f=new fr(new mr(1,1,1),new Er({name:"BackgroundCubeMaterial",uniforms:gr(vo.backgroundCube.uniforms),vertexShader:vo.backgroundCube.vertexShader,fragmentShader:vo.backgroundCube.fragmentShader,side:h,depthTest:false,depthWrite:false,fog:false}));f.geometry.deleteAttribute("normal");f.geometry.deleteAttribute("uv");f.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)};Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}});r.update(f)}f.material.uniforms.envMap.value=v;f.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===false?-1:1;f.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness;f.material.uniforms.backgroundIntensity.value=g.backgroundIntensity;f.material.toneMapped=v.colorSpace===xe?false:true;if(d!==v||p!==v.version||m!==t.toneMapping){f.material.needsUpdate=true;d=v;p=v.version;m=t.toneMapping}f.layers.enableAll();s.unshift(f,f.geometry,f.material,0,0,null)}else if(v&&v.isTexture){if(c===undefined){c=new fr(new Br(2,2),new Er({name:"BackgroundMaterial",uniforms:gr(vo.background.uniforms),vertexShader:vo.background.vertexShader,fragmentShader:vo.background.fragmentShader,side:u,depthTest:false,depthWrite:false,fog:false}));c.geometry.deleteAttribute("normal");Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}});r.update(c)}c.material.uniforms.t2D.value=v;c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity;c.material.toneMapped=v.colorSpace===xe?false:true;if(v.matrixAutoUpdate===true){v.updateMatrix()}c.material.uniforms.uvTransform.value.copy(v.matrix);if(d!==v||p!==v.version||m!==t.toneMapping){c.material.needsUpdate=true;d=v;p=v.version;m=t.toneMapping}c.layers.enableAll();s.unshift(c,c.geometry,c.material,0,0,null)}}function _(e,n){e.getRGB(Mo,vr(t));i.buffers.color.setClear(Mo.r,Mo.g,Mo.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t);l=e;_(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t;_(o,l)},render:g}}function So(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS);const s=i.isWebGL2?null:e.get("OES_vertex_array_object");const a=i.isWebGL2||s!==null;const o={};const l=g(null);let c=l;let u=false;function h(e,i,r,s,o){let l=false;if(a){const t=m(s,r,i);if(c!==t){c=t;d(c.object)}l=_(e,s,r,o);if(l)x(e,s,r,o)}else{const t=i.wireframe===true;if(c.geometry!==s.id||c.program!==r.id||c.wireframe!==t){c.geometry=s.id;c.program=r.id;c.wireframe=t;l=true}}if(o!==null){n.update(o,t.ELEMENT_ARRAY_BUFFER)}if(l||u){u=false;T(e,i,r,s);if(o!==null){t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(o).buffer)}}}function f(){if(i.isWebGL2)return t.createVertexArray();return s.createVertexArrayOES()}function d(e){if(i.isWebGL2)return t.bindVertexArray(e);return s.bindVertexArrayOES(e)}function p(e){if(i.isWebGL2)return t.deleteVertexArray(e);return s.deleteVertexArrayOES(e)}function m(t,e,n){const i=n.wireframe===true;let r=o[t.id];if(r===undefined){r={};o[t.id]=r}let s=r[e.id];if(s===undefined){s={};r[e.id]=s}let a=s[i];if(a===undefined){a=g(f());s[i]=a}return a}function g(t){const e=[];const n=[];const i=[];for(let t=0;t<r;t++){e[t]=0;n[t]=0;i[t]=0}return{geometry:null,program:null,wireframe:false,newAttributes:e,enabledAttributes:n,attributeDivisors:i,object:t,attributes:{},index:null}}function _(t,e,n,i){const r=c.attributes;const s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){const n=o[e];if(n.location>=0){const n=r[e];let i=s[e];if(i===undefined){if(e==="instanceMatrix"&&t.instanceMatrix)i=t.instanceMatrix;if(e==="instanceColor"&&t.instanceColor)i=t.instanceColor}if(n===undefined)return true;if(n.attribute!==i)return true;if(i&&n.data!==i.data)return true;a++}}if(c.attributesNum!==a)return true;if(c.index!==i)return true;return false}function x(t,e,n,i){const r={};const s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){const n=o[e];if(n.location>=0){let n=s[e];if(n===undefined){if(e==="instanceMatrix"&&t.instanceMatrix)n=t.instanceMatrix;if(e==="instanceColor"&&t.instanceColor)n=t.instanceColor}const i={};i.attribute=n;if(n&&n.data){i.data=n.data}r[e]=i;a++}}c.attributes=r;c.attributesNum=a;c.index=i}function v(){const t=c.newAttributes;for(let e=0,n=t.length;e<n;e++){t[e]=0}}function M(t){y(t,0)}function y(n,r){const s=c.newAttributes;const a=c.enabledAttributes;const o=c.attributeDivisors;s[n]=1;if(a[n]===0){t.enableVertexAttribArray(n);a[n]=1}if(o[n]!==r){const s=i.isWebGL2?t:e.get("ANGLE_instanced_arrays");s[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r);o[n]=r}}function S(){const e=c.newAttributes;const n=c.enabledAttributes;for(let i=0,r=n.length;i<r;i++){if(n[i]!==e[i]){t.disableVertexAttribArray(i);n[i]=0}}}function E(e,n,r,s,a,o){if(i.isWebGL2===true&&(r===t.INT||r===t.UNSIGNED_INT)){t.vertexAttribIPointer(e,n,r,a,o)}else{t.vertexAttribPointer(e,n,r,s,a,o)}}function T(r,s,a,o){if(i.isWebGL2===false&&(r.isInstancedMesh||o.isInstancedBufferGeometry)){if(e.get("ANGLE_instanced_arrays")===null)return}v();const l=o.attributes;const c=a.getAttributes();const u=s.defaultAttributeValues;for(const e in c){const i=c[e];if(i.location>=0){let s=l[e];if(s===undefined){if(e==="instanceMatrix"&&r.instanceMatrix)s=r.instanceMatrix;if(e==="instanceColor"&&r.instanceColor)s=r.instanceColor}if(s!==undefined){const e=s.normalized;const a=s.itemSize;const l=n.get(s);if(l===undefined)continue;const c=l.buffer;const u=l.type;const h=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data;const l=n.stride;const f=s.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<i.locationSize;t++){y(i.location+t,n.meshPerAttribute)}if(r.isInstancedMesh!==true&&o._maxInstanceCount===undefined){o._maxInstanceCount=n.meshPerAttribute*n.count}}else{for(let t=0;t<i.locationSize;t++){M(i.location+t)}}t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<i.locationSize;t++){E(i.location+t,a/i.locationSize,u,e,l*h,(f+a/i.locationSize*t)*h)}}else{if(s.isInstancedBufferAttribute){for(let t=0;t<i.locationSize;t++){y(i.location+t,s.meshPerAttribute)}if(r.isInstancedMesh!==true&&o._maxInstanceCount===undefined){o._maxInstanceCount=s.meshPerAttribute*s.count}}else{for(let t=0;t<i.locationSize;t++){M(i.location+t)}}t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<i.locationSize;t++){E(i.location+t,a/i.locationSize,u,e,a*h,a/i.locationSize*t*h)}}}else if(u!==undefined){const n=u[e];if(n!==undefined){switch(n.length){case 2:t.vertexAttrib2fv(i.location,n);break;case 3:t.vertexAttrib3fv(i.location,n);break;case 4:t.vertexAttrib4fv(i.location,n);break;default:t.vertexAttrib1fv(i.location,n)}}}}}S()}function b(){R();for(const t in o){const e=o[t];for(const t in e){const n=e[t];for(const t in n){p(n[t].object);delete n[t]}delete e[t]}delete o[t]}}function w(t){if(o[t.id]===undefined)return;const e=o[t.id];for(const t in e){const n=e[t];for(const t in n){p(n[t].object);delete n[t]}delete e[t]}delete o[t.id]}function A(t){for(const e in o){const n=o[e];if(n[t.id]===undefined)continue;const i=n[t.id];for(const t in i){p(i[t].object);delete i[t]}delete n[t.id]}}function R(){q();u=true;if(c===l)return;c=l;d(c.object)}function q(){l.geometry=null;l.program=null;l.wireframe=false}return{setup:h,reset:R,resetDefaultState:q,dispose:b,releaseStatesOfGeometry:w,releaseStatesOfProgram:A,initAttributes:v,enableAttribute:M,disableUnusedAttributes:S}}function Eo(t,e,n,i){const r=i.isWebGL2;let s;function a(t){s=t}function o(e,i){t.drawArrays(s,e,i);n.update(i,s,1)}function l(i,a,o){if(o===0)return;let l,c;if(r){l=t;c="drawArraysInstanced"}else{l=e.get("ANGLE_instanced_arrays");c="drawArraysInstancedANGLE";if(l===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}}l[c](s,i,a,o);n.update(a,s,o)}this.setMode=a;this.render=o;this.renderInstances=l}function To(t,e,n){let i;function r(){if(i!==undefined)return i;if(e.has("EXT_texture_filter_anisotropic")===true){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else{i=0}return i}function s(e){if(e==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0){return"highp"}e="mediump"}if(e==="mediump"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0){return"mediump"}}return"lowp"}const a=typeof WebGL2RenderingContext!=="undefined"&&t.constructor.name==="WebGL2RenderingContext";let o=n.precision!==undefined?n.precision:"highp";const l=s(o);if(l!==o){console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead.");o=l}const c=a||e.has("WEBGL_draw_buffers");const u=n.logarithmicDepthBuffer===true;const h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);const f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);const d=t.getParameter(t.MAX_TEXTURE_SIZE);const p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);const m=t.getParameter(t.MAX_VERTEX_ATTRIBS);const g=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS);const _=t.getParameter(t.MAX_VARYING_VECTORS);const x=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS);const v=f>0;const M=a||e.has("OES_texture_float");const y=v&&M;const S=a?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:f,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:_,maxFragmentUniforms:x,vertexTextures:v,floatFragmentTextures:M,floatVertexTextures:y,maxSamples:S}}function bo(t){const e=this;let n=null,i=0,r=false,s=false;const a=new Dr,o=new ze,l={value:null,needsUpdate:false};this.uniform=l;this.numPlanes=0;this.numIntersection=0;this.init=function(t,e){const n=t.length!==0||e||i!==0||r;r=e;i=t.length;return n};this.beginShadows=function(){s=true;u(null)};this.endShadows=function(){s=false};this.setGlobalState=function(t,e){n=u(t,e,0)};this.setState=function(e,a,o){const h=e.clippingPlanes,f=e.clipIntersection,d=e.clipShadows;const p=t.get(e);if(!r||h===null||h.length===0||s&&!d){if(s){u(null)}else{c()}}else{const t=s?0:i,e=t*4;let r=p.clippingState||null;l.value=r;r=u(h,a,e,o);for(let t=0;t!==e;++t){r[t]=n[t]}p.clippingState=r;this.numIntersection=f?this.numPlanes:0;this.numPlanes+=t}};function c(){if(l.value!==n){l.value=n;l.needsUpdate=i>0}e.numPlanes=i;e.numIntersection=0}function u(t,n,i,r){const s=t!==null?t.length:0;let c=null;if(s!==0){c=l.value;if(r!==true||c===null){const e=i+s*4,r=n.matrixWorldInverse;o.getNormalMatrix(r);if(c===null||c.length<e){c=new Float32Array(e)}for(let e=0,n=i;e!==s;++e,n+=4){a.copy(t[e]).applyMatrix4(r,o);a.normal.toArray(c,n);c[n+3]=a.constant}}l.value=c;l.needsUpdate=true}e.numPlanes=s;e.numIntersection=0;return c}}function wo(t){let e=new WeakMap;function n(t,e){if(e===et){t.mapping=$}else if(e===nt){t.mapping=tt}return t}function i(i){if(i&&i.isTexture&&i.isRenderTargetTexture===false){const s=i.mapping;if(s===et||s===nt){if(e.has(i)){const t=e.get(i).texture;return n(t,i.mapping)}else{const s=i.image;if(s&&s.height>0){const a=new Cr(s.height/2);a.fromEquirectangularTexture(t,i);e.set(i,a);i.addEventListener("dispose",r);return n(a.texture,i.mapping)}else{return null}}}}return i}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);if(i!==undefined){e.delete(n);i.dispose()}}function s(){e=new WeakMap}return{get:i,dispose:s}}class Ao extends Tr{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super();this.isOrthographicCamera=true;this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=t;this.right=e;this.top=n;this.bottom=i;this.near=r;this.far=s;this.updateProjectionMatrix()}copy(t,e){super.copy(t,e);this.left=t.left;this.right=t.right;this.top=t.top;this.bottom=t.bottom;this.near=t.near;this.far=t.far;this.zoom=t.zoom;this.view=t.view===null?null:Object.assign({},t.view);return this}setViewOffset(t,e,n,i,r,s){if(this.view===null){this.view={enabled:true,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}}this.view.enabled=true;this.view.fullWidth=t;this.view.fullHeight=e;this.view.offsetX=n;this.view.offsetY=i;this.view.width=r;this.view.height=s;this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null){this.view.enabled=false}this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom);const e=(this.top-this.bottom)/(2*this.zoom);const n=(this.right+this.left)/2;const i=(this.top+this.bottom)/2;let r=n-t;let s=n+t;let a=i+e;let o=i-e;if(this.view!==null&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom;const e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX;s=r+t*this.view.width;a-=e*this.view.offsetY;o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far);this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);e.object.zoom=this.zoom;e.object.left=this.left;e.object.right=this.right;e.object.top=this.top;e.object.bottom=this.bottom;e.object.near=this.near;e.object.far=this.far;if(this.view!==null)e.object.view=Object.assign({},this.view);return e}}const Ro=4;const qo=[.125,.215,.35,.446,.526,.582];const Co=20;const Lo=new Ao;const Po=new Pi;let Uo=null;const Do=(1+Math.sqrt(5))/2;const Io=1/Do;const No=[new fn(1,1,1),new fn(-1,1,1),new fn(1,1,-1),new fn(-1,1,-1),new fn(0,Do,Io),new fn(0,Do,-Io),new fn(Io,0,Do),new fn(-Io,0,Do),new fn(Do,Io,0),new fn(-Do,Io,0)];class Oo{constructor(t){this._renderer=t;this._pingPongRenderTarget=null;this._lodMax=0;this._cubeSize=0;this._lodPlanes=[];this._sizeLods=[];this._sigmas=[];this._blurMaterial=null;this._cubemapMaterial=null;this._equirectMaterial=null;this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Uo=this._renderer.getRenderTarget();this._setSize(256);const r=this._allocateTargets();r.depthBuffer=true;this._sceneToCubeUV(t,n,i,r);if(e>0){this._blur(r,0,0,e)}this._applyPMREM(r);this._cleanup(r);return r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){if(this._cubemapMaterial===null){this._cubemapMaterial=Vo();this._compileMaterial(this._cubemapMaterial)}}compileEquirectangularShader(){if(this._equirectMaterial===null){this._equirectMaterial=Go();this._compileMaterial(this._equirectMaterial)}}dispose(){this._dispose();if(this._cubemapMaterial!==null)this._cubemapMaterial.dispose();if(this._equirectMaterial!==null)this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t));this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){if(this._blurMaterial!==null)this._blurMaterial.dispose();if(this._pingPongRenderTarget!==null)this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++){this._lodPlanes[t].dispose()}}_cleanup(t){this._renderer.setRenderTarget(Uo);t.scissorTest=false;Bo(t,0,0,t.width,t.height)}_fromTexture(t,e){if(t.mapping===$||t.mapping===tt){this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width)}else{this._setSize(t.image.width/4)}Uo=this._renderer.getRenderTarget();const n=e||this._allocateTargets();this._textureToCubeUV(t,n);this._applyPMREM(n);this._cleanup(n);return n}_allocateTargets(){const t=3*Math.max(this._cubeSize,16*7);const e=4*this._cubeSize;const n={magFilter:ut,minFilter:ut,generateMipmaps:false,type:Mt,format:bt,colorSpace:ve,depthBuffer:false};const i=zo(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){if(this._pingPongRenderTarget!==null){this._dispose()}this._pingPongRenderTarget=zo(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Fo(i));this._blurMaterial=Ho(i,t,e)}return i}_compileMaterial(t){const e=new fr(this._lodPlanes[0],t);this._renderer.compile(e,Lo)}_sceneToCubeUV(t,e,n,i){const r=90;const s=1;const a=new br(r,s,e,n);const o=[1,-1,1,1,1,1];const l=[1,1,1,-1,-1,-1];const c=this._renderer;const u=c.autoClear;const f=c.toneMapping;c.getClearColor(Po);c.toneMapping=X;c.autoClear=false;const d=new Di({name:"PMREM.Background",side:h,depthWrite:false,depthTest:false});const p=new fr(new mr,d);let m=false;const g=t.background;if(g){if(g.isColor){d.color.copy(g);t.background=null;m=true}}else{d.color.copy(Po);m=true}for(let e=0;e<6;e++){const n=e%3;if(n===0){a.up.set(0,o[e],0);a.lookAt(l[e],0,0)}else if(n===1){a.up.set(0,0,o[e]);a.lookAt(0,l[e],0)}else{a.up.set(0,o[e],0);a.lookAt(0,0,l[e])}const r=this._cubeSize;Bo(i,n*r,e>2?r:0,r,r);c.setRenderTarget(i);if(m){c.render(p,a)}c.render(t,a)}p.geometry.dispose();p.material.dispose();c.toneMapping=f;c.autoClear=u;t.background=g}_textureToCubeUV(t,e){const n=this._renderer;const i=t.mapping===$||t.mapping===tt;if(i){if(this._cubemapMaterial===null){this._cubemapMaterial=Vo()}this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===false?-1:1}else{if(this._equirectMaterial===null){this._equirectMaterial=Go()}}const r=i?this._cubemapMaterial:this._equirectMaterial;const s=new fr(this._lodPlanes[0],r);const a=r.uniforms;a["envMap"].value=t;const o=this._cubeSize;Bo(e,0,0,3*o,2*o);n.setRenderTarget(e);n.render(s,Lo)}_applyPMREM(t){const e=this._renderer;const n=e.autoClear;e.autoClear=false;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]);const i=No[(e-1)%No.length];this._blur(t,e-1,e,n,i)}e.autoClear=n}_blur(t,e,n,i,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,n,i,"latitudinal",r);this._halfBlur(s,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,s,a){const o=this._renderer;const l=this._blurMaterial;if(s!=="latitudinal"&&s!=="longitudinal"){console.error("blur direction must be either latitudinal or longitudinal!")}const c=3;const u=new fr(this._lodPlanes[i],l);const h=l.uniforms;const f=this._sizeLods[n]-1;const d=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*Co-1);const p=r/d;const m=isFinite(r)?1+Math.floor(c*p):Co;if(m>Co){console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Co}`)}const g=[];let _=0;for(let t=0;t<Co;++t){const e=t/p;const n=Math.exp(-e*e/2);g.push(n);if(t===0){_+=n}else if(t<m){_+=2*n}}for(let t=0;t<g.length;t++){g[t]=g[t]/_}h["envMap"].value=t.texture;h["samples"].value=m;h["weights"].value=g;h["latitudinal"].value=s==="latitudinal";if(a){h["poleAxis"].value=a}const{_lodMax:x}=this;h["dTheta"].value=d;h["mipInt"].value=x-n;const v=this._sizeLods[i];const M=3*v*(i>x-Ro?i-x+Ro:0);const y=4*(this._cubeSize-v);Bo(e,M,y,3*v,2*v);o.setRenderTarget(e);o.render(u,Lo)}}function Fo(t){const e=[];const n=[];const i=[];let r=t;const s=t-Ro+1+qo.length;for(let a=0;a<s;a++){const s=Math.pow(2,r);n.push(s);let o=1/s;if(a>t-Ro){o=qo[a-t+Ro-1]}else if(a===0){o=0}i.push(o);const l=1/(s-2);const c=-l;const u=1+l;const h=[c,c,u,c,u,u,c,c,u,u,c,u];const f=6;const d=6;const p=3;const m=2;const g=1;const _=new Float32Array(p*d*f);const x=new Float32Array(m*d*f);const v=new Float32Array(g*d*f);for(let t=0;t<f;t++){const e=t%3*2/3-1;const n=t>2?0:-1;const i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];_.set(i,p*d*t);x.set(h,m*d*t);const r=[t,t,t,t,t,t];v.set(r,g*d*t)}const M=new Yi;M.setAttribute("position",new Oi(_,p));M.setAttribute("uv",new Oi(x,m));M.setAttribute("faceIndex",new Oi(v,g));e.push(M);if(r>Ro){r--}}return{lodPlanes:e,sizeLods:n,sigmas:i}}function zo(t,e,n){const i=new ln(t,e,n);i.texture.mapping=it;i.texture.name="PMREM.cubeUv";i.scissorTest=true;return i}function Bo(t,e,n,i,r){t.viewport.set(e,n,i,r);t.scissor.set(e,n,i,r)}function Ho(t,e,n){const i=new Float32Array(Co);const r=new fn(0,1,0);const s=new Er({name:"SphericalGaussianBlur",defines:{n:Co,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:false},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ko(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,blending:d,depthTest:false,depthWrite:false});return s}function Go(){return new Er({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ko(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,blending:d,depthTest:false,depthWrite:false})}function Vo(){return new Er({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ko(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,blending:d,depthTest:false,depthWrite:false})}function ko(){return`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`}function Wo(t){let e=new WeakMap;let n=null;function i(i){if(i&&i.isTexture){const a=i.mapping;const o=a===et||a===nt;const l=a===$||a===tt;if(o||l){if(i.isRenderTargetTexture&&i.needsPMREMUpdate===true){i.needsPMREMUpdate=false;let r=e.get(i);if(n===null)n=new Oo(t);r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r);e.set(i,r);return r.texture}else{if(e.has(i)){return e.get(i).texture}else{const a=i.image;if(o&&a&&a.height>0||l&&a&&r(a)){if(n===null)n=new Oo(t);const r=o?n.fromEquirectangular(i):n.fromCubemap(i);e.set(i,r);i.addEventListener("dispose",s);return r.texture}else{return null}}}}}return i}function r(t){let e=0;const n=6;for(let i=0;i<n;i++){if(t[i]!==undefined)e++}return e===n}function s(t){const n=t.target;n.removeEventListener("dispose",s);const i=e.get(n);if(i!==undefined){e.delete(n);i.dispose()}}function a(){e=new WeakMap;if(n!==null){n.dispose();n=null}}return{get:i,dispose:a}}function Xo(t){const e={};function n(n){if(e[n]!==undefined){return e[n]}let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}e[n]=i;return i}return{has:function(t){return n(t)!==null},init:function(t){if(t.isWebGL2){n("EXT_color_buffer_float")}else{n("WEBGL_depth_texture");n("OES_texture_float");n("OES_texture_half_float");n("OES_texture_half_float_linear");n("OES_standard_derivatives");n("OES_element_index_uint");n("OES_vertex_array_object");n("ANGLE_instanced_arrays")}n("OES_texture_float_linear");n("EXT_color_buffer_half_float");n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);if(e===null){console.warn("THREE.WebGLRenderer: "+t+" extension not supported.")}return e}}}function jo(t,e,n,i){const r={};const s=new WeakMap;function a(t){const o=t.target;if(o.index!==null){e.remove(o.index)}for(const t in o.attributes){e.remove(o.attributes[t])}o.removeEventListener("dispose",a);delete r[o.id];const l=s.get(o);if(l){e.remove(l);s.delete(o)}i.releaseStatesOfGeometry(o);if(o.isInstancedBufferGeometry===true){delete o._maxInstanceCount}n.memory.geometries--}function o(t,e){if(r[e.id]===true)return e;e.addEventListener("dispose",a);r[e.id]=true;n.memory.geometries++;return e}function l(n){const i=n.attributes;for(const n in i){e.update(i[n],t.ARRAY_BUFFER)}const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++){e.update(i[n],t.ARRAY_BUFFER)}}}function c(t){const n=[];const i=t.index;const r=t.attributes.position;let a=0;if(i!==null){const t=i.array;a=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0];const r=t[e+1];const s=t[e+2];n.push(i,r,r,s,s,i)}}else{const t=r.array;a=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0;const i=e+1;const r=e+2;n.push(t,i,i,r,r,t)}}const o=new(He(n)?zi:Fi)(n,1);o.version=a;const l=s.get(t);if(l)e.remove(l);s.set(t,o)}function u(t){const e=s.get(t);if(e){const n=t.index;if(n!==null){if(e.version<n.version){c(t)}}}else{c(t)}return s.get(t)}return{get:o,update:l,getWireframeAttribute:u}}function Yo(t,e,n,i){const r=i.isWebGL2;let s;function a(t){s=t}let o,l;function c(t){o=t.type;l=t.bytesPerElement}function u(e,i){t.drawElements(s,i,o,e*l);n.update(i,s,1)}function h(i,a,c){if(c===0)return;let u,h;if(r){u=t;h="drawElementsInstanced"}else{u=e.get("ANGLE_instanced_arrays");h="drawElementsInstancedANGLE";if(u===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}}u[h](s,a,o,i*l,c);n.update(a,s,c)}this.setMode=a;this.setIndex=c;this.render=u;this.renderInstances=h}function Jo(t){const e={geometries:0,textures:0};const n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(e,i,r){n.calls++;switch(i){case t.TRIANGLES:n.triangles+=r*(e/3);break;case t.LINES:n.lines+=r*(e/2);break;case t.LINE_STRIP:n.lines+=r*(e-1);break;case t.LINE_LOOP:n.lines+=r*e;break;case t.POINTS:n.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i);break}}function r(){n.frame++;n.calls=0;n.triangles=0;n.points=0;n.lines=0}return{memory:e,render:n,programs:null,autoReset:true,reset:r,update:i}}function Zo(t,e){return t[0]-e[0]}function Ko(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Qo(t,e,n){const i={};const r=new Float32Array(8);const s=new WeakMap;const a=new on;const o=[];for(let t=0;t<8;t++){o[t]=[t,0]}function l(l,c,u){const h=l.morphTargetInfluences;if(e.isWebGL2===true){const f=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color;const d=f!==undefined?f.length:0;let p=s.get(c);if(p===undefined||p.count!==d){if(p!==undefined)p.texture.dispose();const _=c.morphAttributes.position!==undefined;const x=c.morphAttributes.normal!==undefined;const v=c.morphAttributes.color!==undefined;const M=c.morphAttributes.position||[];const y=c.morphAttributes.normal||[];const S=c.morphAttributes.color||[];let E=0;if(_===true)E=1;if(x===true)E=2;if(v===true)E=3;let T=c.attributes.position.count*E;let b=1;if(T>e.maxTextureSize){b=Math.ceil(T/e.maxTextureSize);T=e.maxTextureSize}const w=new Float32Array(T*b*4*d);const A=new cn(w,T,b,d);A.type=vt;A.needsUpdate=true;const R=E*4;for(let C=0;C<d;C++){const L=M[C];const P=y[C];const U=S[C];const D=T*b*4*C;for(let I=0;I<L.count;I++){const N=I*R;if(_===true){a.fromBufferAttribute(L,I);w[D+N+0]=a.x;w[D+N+1]=a.y;w[D+N+2]=a.z;w[D+N+3]=0}if(x===true){a.fromBufferAttribute(P,I);w[D+N+4]=a.x;w[D+N+5]=a.y;w[D+N+6]=a.z;w[D+N+7]=0}if(v===true){a.fromBufferAttribute(U,I);w[D+N+8]=a.x;w[D+N+9]=a.y;w[D+N+10]=a.z;w[D+N+11]=U.itemSize===4?a.w:1}}}p={count:d,texture:A,size:new Fe(T,b)};s.set(c,p);function q(){A.dispose();s.delete(c);c.removeEventListener("dispose",q)}c.addEventListener("dispose",q)}let m=0;for(let O=0;O<h.length;O++){m+=h[O]}const g=c.morphTargetsRelative?1:1-m;u.getUniforms().setValue(t,"morphTargetBaseInfluence",g);u.getUniforms().setValue(t,"morphTargetInfluences",h);u.getUniforms().setValue(t,"morphTargetsTexture",p.texture,n);u.getUniforms().setValue(t,"morphTargetsTextureSize",p.size)}else{const F=h===undefined?0:h.length;let z=i[c.id];if(z===undefined||z.length!==F){z=[];for(let k=0;k<F;k++){z[k]=[k,0]}i[c.id]=z}for(let W=0;W<F;W++){const X=z[W];X[0]=W;X[1]=h[W]}z.sort(Ko);for(let j=0;j<8;j++){if(j<F&&z[j][1]){o[j][0]=z[j][0];o[j][1]=z[j][1]}else{o[j][0]=Number.MAX_SAFE_INTEGER;o[j][1]=0}}o.sort(Zo);const B=c.morphAttributes.position;const H=c.morphAttributes.normal;let G=0;for(let Y=0;Y<8;Y++){const J=o[Y];const Z=J[0];const K=J[1];if(Z!==Number.MAX_SAFE_INTEGER&&K){if(B&&c.getAttribute("morphTarget"+Y)!==B[Z]){c.setAttribute("morphTarget"+Y,B[Z])}if(H&&c.getAttribute("morphNormal"+Y)!==H[Z]){c.setAttribute("morphNormal"+Y,H[Z])}r[Y]=K;G+=K}else{if(B&&c.hasAttribute("morphTarget"+Y)===true){c.deleteAttribute("morphTarget"+Y)}if(H&&c.hasAttribute("morphNormal"+Y)===true){c.deleteAttribute("morphNormal"+Y)}r[Y]=0}}const V=c.morphTargetsRelative?1:1-G;u.getUniforms().setValue(t,"morphTargetBaseInfluence",V);u.getUniforms().setValue(t,"morphTargetInfluences",r)}}return{update:l}}function $o(t,e,n,i){let r=new WeakMap;function s(s){const a=i.render.frame;const l=s.geometry;const c=e.get(s,l);if(r.get(c)!==a){e.update(c);r.set(c,a)}if(s.isInstancedMesh){if(s.hasEventListener("dispose",o)===false){s.addEventListener("dispose",o)}n.update(s.instanceMatrix,t.ARRAY_BUFFER);if(s.instanceColor!==null){n.update(s.instanceColor,t.ARRAY_BUFFER)}}return c}function a(){r=new WeakMap}function o(t){const e=t.target;e.removeEventListener("dispose",o);n.remove(e.instanceMatrix);if(e.instanceColor!==null)n.remove(e.instanceColor)}return{update:s,dispose:a}}const tl=new an;const el=new cn;const nl=new un;const il=new qr;const rl=[];const sl=[];const al=new Float32Array(16);const ol=new Float32Array(9);const ll=new Float32Array(4);function cl(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let s=rl[r];if(s===undefined){s=new Float32Array(r);rl[r]=s}if(e!==0){i.toArray(s,0);for(let i=1,r=0;i!==e;++i){r+=n;t[i].toArray(s,r)}}return s}function ul(t,e){if(t.length!==e.length)return false;for(let n=0,i=t.length;n<i;n++){if(t[n]!==e[n])return false}return true}function hl(t,e){for(let n=0,i=e.length;n<i;n++){t[n]=e[n]}}function fl(t,e){let n=sl[e];if(n===undefined){n=new Int32Array(e);sl[e]=n}for(let i=0;i!==e;++i){n[i]=t.allocateTextureUnit()}return n}function dl(t,e){const n=this.cache;if(n[0]===e)return;t.uniform1f(this.addr,e);n[0]=e}function pl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y){t.uniform2f(this.addr,e.x,e.y);n[0]=e.x;n[1]=e.y}}else{if(ul(n,e))return;t.uniform2fv(this.addr,e);hl(n,e)}}function ml(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z){t.uniform3f(this.addr,e.x,e.y,e.z);n[0]=e.x;n[1]=e.y;n[2]=e.z}}else if(e.r!==undefined){if(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b){t.uniform3f(this.addr,e.r,e.g,e.b);n[0]=e.r;n[1]=e.g;n[2]=e.b}}else{if(ul(n,e))return;t.uniform3fv(this.addr,e);hl(n,e)}}function gl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w){t.uniform4f(this.addr,e.x,e.y,e.z,e.w);n[0]=e.x;n[1]=e.y;n[2]=e.z;n[3]=e.w}}else{if(ul(n,e))return;t.uniform4fv(this.addr,e);hl(n,e)}}function _l(t,e){const n=this.cache;const i=e.elements;if(i===undefined){if(ul(n,e))return;t.uniformMatrix2fv(this.addr,false,e);hl(n,e)}else{if(ul(n,i))return;ll.set(i);t.uniformMatrix2fv(this.addr,false,ll);hl(n,i)}}function xl(t,e){const n=this.cache;const i=e.elements;if(i===undefined){if(ul(n,e))return;t.uniformMatrix3fv(this.addr,false,e);hl(n,e)}else{if(ul(n,i))return;ol.set(i);t.uniformMatrix3fv(this.addr,false,ol);hl(n,i)}}function vl(t,e){const n=this.cache;const i=e.elements;if(i===undefined){if(ul(n,e))return;t.uniformMatrix4fv(this.addr,false,e);hl(n,e)}else{if(ul(n,i))return;al.set(i);t.uniformMatrix4fv(this.addr,false,al);hl(n,i)}}function Ml(t,e){const n=this.cache;if(n[0]===e)return;t.uniform1i(this.addr,e);n[0]=e}function yl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y){t.uniform2i(this.addr,e.x,e.y);n[0]=e.x;n[1]=e.y}}else{if(ul(n,e))return;t.uniform2iv(this.addr,e);hl(n,e)}}function Sl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z){t.uniform3i(this.addr,e.x,e.y,e.z);n[0]=e.x;n[1]=e.y;n[2]=e.z}}else{if(ul(n,e))return;t.uniform3iv(this.addr,e);hl(n,e)}}function El(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w){t.uniform4i(this.addr,e.x,e.y,e.z,e.w);n[0]=e.x;n[1]=e.y;n[2]=e.z;n[3]=e.w}}else{if(ul(n,e))return;t.uniform4iv(this.addr,e);hl(n,e)}}function Tl(t,e){const n=this.cache;if(n[0]===e)return;t.uniform1ui(this.addr,e);n[0]=e}function bl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y){t.uniform2ui(this.addr,e.x,e.y);n[0]=e.x;n[1]=e.y}}else{if(ul(n,e))return;t.uniform2uiv(this.addr,e);hl(n,e)}}function wl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z){t.uniform3ui(this.addr,e.x,e.y,e.z);n[0]=e.x;n[1]=e.y;n[2]=e.z}}else{if(ul(n,e))return;t.uniform3uiv(this.addr,e);hl(n,e)}}function Al(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w){t.uniform4ui(this.addr,e.x,e.y,e.z,e.w);n[0]=e.x;n[1]=e.y;n[2]=e.z;n[3]=e.w}}else{if(ul(n,e))return;t.uniform4uiv(this.addr,e);hl(n,e)}}function Rl(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTexture2D(e||tl,r)}function ql(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTexture3D(e||nl,r)}function Cl(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTextureCube(e||il,r)}function Ll(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTexture2DArray(e||el,r)}function Pl(t){switch(t){case 5126:return dl;case 35664:return pl;case 35665:return ml;case 35666:return gl;case 35674:return _l;case 35675:return xl;case 35676:return vl;case 5124:case 35670:return Ml;case 35667:case 35671:return yl;case 35668:case 35672:return Sl;case 35669:case 35673:return El;case 5125:return Tl;case 36294:return bl;case 36295:return wl;case 36296:return Al;case 35678:case 36198:case 36298:case 36306:case 35682:return Rl;case 35679:case 36299:case 36307:return ql;case 35680:case 36300:case 36308:case 36293:return Cl;case 36289:case 36303:case 36311:case 36292:return Ll}}function Ul(t,e){t.uniform1fv(this.addr,e)}function Dl(t,e){const n=cl(e,this.size,2);t.uniform2fv(this.addr,n)}function Il(t,e){const n=cl(e,this.size,3);t.uniform3fv(this.addr,n)}function Nl(t,e){const n=cl(e,this.size,4);t.uniform4fv(this.addr,n)}function Ol(t,e){const n=cl(e,this.size,4);t.uniformMatrix2fv(this.addr,false,n)}function Fl(t,e){const n=cl(e,this.size,9);t.uniformMatrix3fv(this.addr,false,n)}function zl(t,e){const n=cl(e,this.size,16);t.uniformMatrix4fv(this.addr,false,n)}function Bl(t,e){t.uniform1iv(this.addr,e)}function Hl(t,e){t.uniform2iv(this.addr,e)}function Gl(t,e){t.uniform3iv(this.addr,e)}function Vl(t,e){t.uniform4iv(this.addr,e)}function kl(t,e){t.uniform1uiv(this.addr,e)}function Wl(t,e){t.uniform2uiv(this.addr,e)}function Xl(t,e){t.uniform3uiv(this.addr,e)}function jl(t,e){t.uniform4uiv(this.addr,e)}function Yl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTexture2D(e[t]||tl,s[t])}}function Jl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTexture3D(e[t]||nl,s[t])}}function Zl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTextureCube(e[t]||il,s[t])}}function Kl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTexture2DArray(e[t]||el,s[t])}}function Ql(t){switch(t){case 5126:return Ul;case 35664:return Dl;case 35665:return Il;case 35666:return Nl;case 35674:return Ol;case 35675:return Fl;case 35676:return zl;case 5124:case 35670:return Bl;case 35667:case 35671:return Hl;case 35668:case 35672:return Gl;case 35669:case 35673:return Vl;case 5125:return kl;case 36294:return Wl;case 36295:return Xl;case 36296:return jl;case 35678:case 36198:case 36298:case 36306:case 35682:return Yl;case 35679:case 36299:case 36307:return Jl;case 35680:case 36300:case 36308:case 36293:return Zl;case 36289:case 36303:case 36311:case 36292:return Kl}}class $l{constructor(t,e,n){this.id=t;this.addr=n;this.cache=[];this.setValue=Pl(e.type)}}class tc{constructor(t,e,n){this.id=t;this.addr=n;this.cache=[];this.size=e.size;this.setValue=Ql(e.type)}}class ec{constructor(t){this.id=t;this.seq=[];this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const s=i[r];s.setValue(t,e[s.id],n)}}}const nc=/(\w+)(\])?(\[|\.)?/g;function ic(t,e){t.seq.push(e);t.map[e.id]=e}function rc(t,e,n){const i=t.name,r=i.length;nc.lastIndex=0;while(true){const s=nc.exec(i),a=nc.lastIndex;let o=s[1];const l=s[2]==="]",c=s[3];if(l)o=o|0;if(c===undefined||c==="["&&a+2===r){ic(n,c===undefined?new $l(o,t,e):new tc(o,t,e));break}else{const t=n.map;let e=t[o];if(e===undefined){e=new ec(o);ic(n,e)}n=e}}}class sc{constructor(t,e){this.seq=[];this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i),r=t.getUniformLocation(e,n.name);rc(n,r,this)}}setValue(t,e,n,i){const r=this.map[e];if(r!==undefined)r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];if(i!==undefined)this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,s=e.length;r!==s;++r){const s=e[r],a=n[s.id];if(a.needsUpdate!==false){s.setValue(t,a.value,i)}}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];if(r.id in e)n.push(r)}return n}}function ac(t,e,n){const i=t.createShader(e);t.shaderSource(i,n);t.compileShader(i);return i}let oc=0;function lc(t,e){const n=t.split("\n");const i=[];const r=Math.max(e-6,0);const s=Math.min(e+6,n.length);for(let t=r;t<s;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}function cc(t){switch(t){case ve:return["Linear","( value )"];case xe:return["sRGB","( value )"];default:console.warn("THREE.WebGLProgram: Unsupported color space:",t);return["Linear","( value )"]}}function uc(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS);const r=t.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const i=parseInt(s[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+lc(t.getShaderSource(e),i)}else{return r}}function hc(t,e){const n=cc(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function fc(t,e){let n;switch(e){case j:n="Linear";break;case Y:n="Reinhard";break;case J:n="OptimizedCineon";break;case Z:n="ACESFilmic";break;case K:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e);n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function dc(t){const e=[t.extensionDerivatives||!!t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return e.filter(gc).join("\n")}function pc(t){const e=[];for(const n in t){const i=t[n];if(i===false)continue;e.push("#define "+n+" "+i)}return e.join("\n")}function mc(t,e){const n={};const i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r);const s=i.name;let a=1;if(i.type===t.FLOAT_MAT2)a=2;if(i.type===t.FLOAT_MAT3)a=3;if(i.type===t.FLOAT_MAT4)a=4;n[s]={type:i.type,location:t.getAttribLocation(e,s),locationSize:a}}return n}function gc(t){return t!==""}function _c(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function xc(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const vc=/^[ \t]*#include +<([\w\d./]+)>/gm;function Mc(t){return t.replace(vc,yc)}function yc(t,e){const n=_o[e];if(n===undefined){throw new Error("Can not resolve #include <"+e+">")}return Mc(n)}const Sc=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ec(t){return t.replace(Sc,Tc)}function Tc(t,e,n,i){let r="";for(let t=parseInt(e);t<parseInt(n);t++){r+=i.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t)}return r}function bc(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";if(t.precision==="highp"){e+="\n#define HIGH_PRECISION"}else if(t.precision==="mediump"){e+="\n#define MEDIUM_PRECISION"}else if(t.precision==="lowp"){e+="\n#define LOW_PRECISION"}return e}function wc(t){let e="SHADOWMAP_TYPE_BASIC";if(t.shadowMapType===o){e="SHADOWMAP_TYPE_PCF"}else if(t.shadowMapType===l){e="SHADOWMAP_TYPE_PCF_SOFT"}else if(t.shadowMapType===c){e="SHADOWMAP_TYPE_VSM"}return e}function Ac(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap){switch(t.envMapMode){case $:case tt:e="ENVMAP_TYPE_CUBE";break;case it:e="ENVMAP_TYPE_CUBE_UV";break}}return e}function Rc(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap){switch(t.envMapMode){case tt:e="ENVMAP_MODE_REFRACTION";break}}return e}function qc(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap){switch(t.combine){case V:e="ENVMAP_BLENDING_MULTIPLY";break;case k:e="ENVMAP_BLENDING_MIX";break;case W:e="ENVMAP_BLENDING_ADD";break}}return e}function Cc(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2;const i=1/e;const r=1/(3*Math.max(Math.pow(2,n),7*16));return{texelWidth:r,texelHeight:i,maxMip:n}}function Lc(t,e,n,i){const r=t.getContext();const s=n.defines;let a=n.vertexShader;let o=n.fragmentShader;const l=wc(n);const c=Ac(n);const u=Rc(n);const h=qc(n);const f=Cc(n);const d=n.isWebGL2?"":dc(n);const p=pc(s);const m=r.createProgram();let g,_;let x=n.glslVersion?"#version "+n.glslVersion+"\n":"";if(n.isRawShaderMaterial){g=[p].filter(gc).join("\n");if(g.length>0){g+="\n"}_=[d,p].filter(gc).join("\n");if(_.length>0){_+="\n"}}else{g=[bc(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===false?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(gc).join("\n");_=[d,bc(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==X?"#define TONE_MAPPING":"",n.toneMapping!==X?_o["tonemapping_pars_fragment"]:"",n.toneMapping!==X?fc("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",_o["encodings_pars_fragment"],hc("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(gc).join("\n")}a=Mc(a);a=_c(a,n);a=xc(a,n);o=Mc(o);o=_c(o,n);o=xc(o,n);a=Ec(a);o=Ec(o);if(n.isWebGL2&&n.isRawShaderMaterial!==true){x="#version 300 es\n";g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g;_=["#define varying in",n.glslVersion===Te?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Te?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+_}const v=x+g+a;const M=x+_+o;const y=ac(r,r.VERTEX_SHADER,v);const S=ac(r,r.FRAGMENT_SHADER,M);r.attachShader(m,y);r.attachShader(m,S);if(n.index0AttributeName!==undefined){r.bindAttribLocation(m,0,n.index0AttributeName)}else if(n.morphTargets===true){r.bindAttribLocation(m,0,"position")}r.linkProgram(m);if(t.debug.checkShaderErrors){const e=r.getProgramInfoLog(m).trim();const n=r.getShaderInfoLog(y).trim();const i=r.getShaderInfoLog(S).trim();let s=true;let a=true;if(r.getProgramParameter(m,r.LINK_STATUS)===false){s=false;if(typeof t.debug.onShaderError==="function"){t.debug.onShaderError(r,m,y,S)}else{const t=uc(r,y,"vertex");const n=uc(r,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - "+"VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+"\n\n"+"Program Info Log: "+e+"\n"+t+"\n"+n)}}else if(e!==""){console.warn("THREE.WebGLProgram: Program Info Log:",e)}else if(n===""||i===""){a=false}if(a){this.diagnostics={runnable:s,programLog:e,vertexShader:{log:n,prefix:g},fragmentShader:{log:i,prefix:_}}}}r.deleteShader(y);r.deleteShader(S);let E;this.getUniforms=function(){if(E===undefined){E=new sc(r,m)}return E};let T;this.getAttributes=function(){if(T===undefined){T=mc(r,m)}return T};this.destroy=function(){i.releaseStatesOfProgram(this);r.deleteProgram(m);this.program=undefined};this.name=n.shaderName;this.id=oc++;this.cacheKey=e;this.usedTimes=1;this.program=m;this.vertexShader=y;this.fragmentShader=S;return this}let Pc=0;class Uc{constructor(){this.shaderCache=new Map;this.materialCache=new Map}update(t){const e=t.vertexShader;const n=t.fragmentShader;const i=this._getShaderStage(e);const r=this._getShaderStage(n);const s=this._getShaderCacheForMaterial(t);if(s.has(i)===false){s.add(i);i.usedTimes++}if(s.has(r)===false){s.add(r);r.usedTimes++}return this}remove(t){const e=this.materialCache.get(t);for(const t of e){t.usedTimes--;if(t.usedTimes===0)this.shaderCache.delete(t.code)}this.materialCache.delete(t);return this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear();this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);if(n===undefined){n=new Set;e.set(t,n)}return n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);if(n===undefined){n=new Dc(t);e.set(t,n)}return n}}class Dc{constructor(t){this.id=Pc++;this.code=t;this.usedTimes=0}}function Ic(t,e,n,i,r,s,a){const o=new $n;const l=new Uc;const c=[];const u=r.isWebGL2;const d=r.logarithmicDepthBuffer;const m=r.vertexTextures;let g=r.precision;const _={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(t){if(t===1)return"uv1";if(t===2)return"uv2";if(t===3)return"uv3";return"uv"}function v(s,o,c,v,M){const y=v.fog;const S=M.geometry;const E=s.isMeshStandardMaterial?v.environment:null;const T=(s.isMeshStandardMaterial?n:e).get(s.envMap||E);const b=!!T&&T.mapping===it?T.image.height:null;const w=_[s.type];if(s.precision!==null){g=r.getMaxPrecision(s.precision);if(g!==s.precision){console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",g,"instead.")}}const A=S.morphAttributes.position||S.morphAttributes.normal||S.morphAttributes.color;const R=A!==undefined?A.length:0;let q=0;if(S.morphAttributes.position!==undefined)q=1;if(S.morphAttributes.normal!==undefined)q=2;if(S.morphAttributes.color!==undefined)q=3;let C,L;let P,U;if(w){const t=vo[w];C=t.vertexShader;L=t.fragmentShader}else{C=s.vertexShader;L=s.fragmentShader;l.update(s);P=l.getVertexShaderID(s);U=l.getFragmentShaderID(s)}const D=t.getRenderTarget();const I=M.isInstancedMesh===true;const N=!!s.map;const O=!!s.matcap;const F=!!T;const z=!!s.aoMap;const B=!!s.lightMap;const H=!!s.bumpMap;const G=!!s.normalMap;const V=!!s.displacementMap;const k=!!s.emissiveMap;const W=!!s.metalnessMap;const j=!!s.roughnessMap;const Y=s.clearcoat>0;const J=s.iridescence>0;const Z=s.sheen>0;const K=s.transmission>0;const Q=Y&&!!s.clearcoatMap;const $=Y&&!!s.clearcoatNormalMap;const tt=Y&&!!s.clearcoatRoughnessMap;const et=J&&!!s.iridescenceMap;const nt=J&&!!s.iridescenceThicknessMap;const rt=Z&&!!s.sheenColorMap;const st=Z&&!!s.sheenRoughnessMap;const at=!!s.specularMap;const ot=!!s.specularColorMap;const lt=!!s.specularIntensityMap;const ct=K&&!!s.transmissionMap;const ut=K&&!!s.thicknessMap;const ht=!!s.gradientMap;const ft=!!s.alphaMap;const dt=s.alphaTest>0;const pt=!!s.extensions;const mt=!!S.attributes.uv1;const gt=!!S.attributes.uv2;const _t=!!S.attributes.uv3;const xt={isWebGL2:u,shaderID:w,shaderName:s.type,vertexShader:C,fragmentShader:L,defines:s.defines,customVertexShaderID:P,customFragmentShaderID:U,isRawShaderMaterial:s.isRawShaderMaterial===true,glslVersion:s.glslVersion,precision:g,instancing:I,instancingColor:I&&M.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:D===null?t.outputColorSpace:D.isXRRenderTarget===true?D.texture.colorSpace:ve,map:N,matcap:O,envMap:F,envMapMode:F&&T.mapping,envMapCubeUVHeight:b,aoMap:z,lightMap:B,bumpMap:H,normalMap:G,displacementMap:m&&V,emissiveMap:k,normalMapObjectSpace:G&&s.normalMapType===ge,normalMapTangentSpace:G&&s.normalMapType===me,metalnessMap:W,roughnessMap:j,clearcoat:Y,clearcoatMap:Q,clearcoatNormalMap:$,clearcoatRoughnessMap:tt,iridescence:J,iridescenceMap:et,iridescenceThicknessMap:nt,sheen:Z,sheenColorMap:rt,sheenRoughnessMap:st,specularMap:at,specularColorMap:ot,specularIntensityMap:lt,transmission:K,transmissionMap:ct,thicknessMap:ut,gradientMap:ht,opaque:s.transparent===false&&s.blending===p,alphaMap:ft,alphaTest:dt,combine:s.combine,mapUv:N&&x(s.map.channel),aoMapUv:z&&x(s.aoMap.channel),lightMapUv:B&&x(s.lightMap.channel),bumpMapUv:H&&x(s.bumpMap.channel),normalMapUv:G&&x(s.normalMap.channel),displacementMapUv:V&&x(s.displacementMap.channel),emissiveMapUv:k&&x(s.emissiveMap.channel),metalnessMapUv:W&&x(s.metalnessMap.channel),roughnessMapUv:j&&x(s.roughnessMap.channel),clearcoatMapUv:Q&&x(s.clearcoatMap.channel),clearcoatNormalMapUv:$&&x(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&x(s.clearcoatRoughnessMap.channel),iridescenceMapUv:et&&x(s.iridescenceMap.channel),iridescenceThicknessMapUv:nt&&x(s.iridescenceThicknessMap.channel),sheenColorMapUv:rt&&x(s.sheenColorMap.channel),sheenRoughnessMapUv:st&&x(s.sheenRoughnessMap.channel),specularMapUv:at&&x(s.specularMap.channel),specularColorMapUv:ot&&x(s.specularColorMap.channel),specularIntensityMapUv:lt&&x(s.specularIntensityMap.channel),transmissionMapUv:ct&&x(s.transmissionMap.channel),thicknessMapUv:ut&&x(s.thicknessMap.channel),alphaMapUv:ft&&x(s.alphaMap.channel),vertexTangents:G&&!!S.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:s.vertexColors===true&&!!S.attributes.color&&S.attributes.color.itemSize===4,vertexUv1s:mt,vertexUv2s:gt,vertexUv3s:_t,pointsUvs:M.isPoints===true&&!!S.attributes.uv&&(N||ft),fog:!!y,useFog:s.fog===true,fogExp2:y&&y.isFogExp2,flatShading:s.flatShading===true,sizeAttenuation:s.sizeAttenuation===true,logarithmicDepthBuffer:d,skinning:M.isSkinnedMesh===true,morphTargets:S.morphAttributes.position!==undefined,morphNormals:S.morphAttributes.normal!==undefined,morphColors:S.morphAttributes.color!==undefined,morphTargetsCount:R,morphTextureStride:q,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:X,useLegacyLights:t.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===f,flipSided:s.side===h,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:pt&&s.extensions.derivatives===true,extensionFragDepth:pt&&s.extensions.fragDepth===true,extensionDrawBuffers:pt&&s.extensions.drawBuffers===true,extensionShaderTextureLOD:pt&&s.extensions.shaderTextureLOD===true,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()};return xt}function M(e){const n=[];if(e.shaderID){n.push(e.shaderID)}else{n.push(e.customVertexShaderID);n.push(e.customFragmentShaderID)}if(e.defines!==undefined){for(const t in e.defines){n.push(t);n.push(e.defines[t])}}if(e.isRawShaderMaterial===false){y(n,e);S(n,e);n.push(t.outputColorSpace)}n.push(e.customProgramCacheKey);return n.join()}function y(t,e){t.push(e.precision);t.push(e.outputColorSpace);t.push(e.envMapMode);t.push(e.envMapCubeUVHeight);t.push(e.mapUv);t.push(e.alphaMapUv);t.push(e.lightMapUv);t.push(e.aoMapUv);t.push(e.bumpMapUv);t.push(e.normalMapUv);t.push(e.displacementMapUv);t.push(e.emissiveMapUv);t.push(e.metalnessMapUv);t.push(e.roughnessMapUv);t.push(e.clearcoatMapUv);t.push(e.clearcoatNormalMapUv);t.push(e.clearcoatRoughnessMapUv);t.push(e.iridescenceMapUv);t.push(e.iridescenceThicknessMapUv);t.push(e.sheenColorMapUv);t.push(e.sheenRoughnessMapUv);t.push(e.specularMapUv);t.push(e.specularColorMapUv);t.push(e.specularIntensityMapUv);t.push(e.transmissionMapUv);t.push(e.thicknessMapUv);t.push(e.combine);t.push(e.fogExp2);t.push(e.sizeAttenuation);t.push(e.morphTargetsCount);t.push(e.morphAttributeCount);t.push(e.numDirLights);t.push(e.numPointLights);t.push(e.numSpotLights);t.push(e.numSpotLightMaps);t.push(e.numHemiLights);t.push(e.numRectAreaLights);t.push(e.numDirLightShadows);t.push(e.numPointLightShadows);t.push(e.numSpotLightShadows);t.push(e.numSpotLightShadowsWithMaps);t.push(e.shadowMapType);t.push(e.toneMapping);t.push(e.numClippingPlanes);t.push(e.numClipIntersection);t.push(e.depthPacking)}function S(t,e){o.disableAll();if(e.isWebGL2)o.enable(0);if(e.supportsVertexTextures)o.enable(1);if(e.instancing)o.enable(2);if(e.instancingColor)o.enable(3);if(e.matcap)o.enable(4);if(e.envMap)o.enable(5);if(e.normalMapObjectSpace)o.enable(6);if(e.normalMapTangentSpace)o.enable(7);if(e.clearcoat)o.enable(8);if(e.iridescence)o.enable(9);if(e.alphaTest)o.enable(10);if(e.vertexColors)o.enable(11);if(e.vertexAlphas)o.enable(12);if(e.vertexUv1s)o.enable(13);if(e.vertexUv2s)o.enable(14);if(e.vertexUv3s)o.enable(15);if(e.vertexTangents)o.enable(16);t.push(o.mask);o.disableAll();if(e.fog)o.enable(0);if(e.useFog)o.enable(1);if(e.flatShading)o.enable(2);if(e.logarithmicDepthBuffer)o.enable(3);if(e.skinning)o.enable(4);if(e.morphTargets)o.enable(5);if(e.morphNormals)o.enable(6);if(e.morphColors)o.enable(7);if(e.premultipliedAlpha)o.enable(8);if(e.shadowMapEnabled)o.enable(9);if(e.useLegacyLights)o.enable(10);if(e.doubleSided)o.enable(11);if(e.flipSided)o.enable(12);if(e.useDepthPacking)o.enable(13);if(e.dithering)o.enable(14);if(e.transmission)o.enable(15);if(e.sheen)o.enable(16);if(e.opaque)o.enable(17);if(e.pointsUvs)o.enable(18);t.push(o.mask)}function E(t){const e=_[t.type];let n;if(e){const t=vo[e];n=Mr.clone(t.uniforms)}else{n=t.uniforms}return n}function T(e,n){let i;for(let t=0,e=c.length;t<e;t++){const e=c[t];if(e.cacheKey===n){i=e;++i.usedTimes;break}}if(i===undefined){i=new Lc(t,n,e,s);c.push(i)}return i}function b(t){if(--t.usedTimes===0){const e=c.indexOf(t);c[e]=c[c.length-1];c.pop();t.destroy()}}function w(t){l.remove(t)}function A(){l.dispose()}return{getParameters:v,getProgramCacheKey:M,getUniforms:E,acquireProgram:T,releaseProgram:b,releaseShaderCache:w,programs:c,dispose:A}}function Nc(){let t=new WeakMap;function e(e){let n=t.get(e);if(n===undefined){n={};t.set(e,n)}return n}function n(e){t.delete(e)}function i(e,n,i){t.get(e)[n]=i}function r(){t=new WeakMap}return{get:e,remove:n,update:i,dispose:r}}function Oc(t,e){if(t.groupOrder!==e.groupOrder){return t.groupOrder-e.groupOrder}else if(t.renderOrder!==e.renderOrder){return t.renderOrder-e.renderOrder}else if(t.material.id!==e.material.id){return t.material.id-e.material.id}else if(t.z!==e.z){return t.z-e.z}else{return t.id-e.id}}function Fc(t,e){if(t.groupOrder!==e.groupOrder){return t.groupOrder-e.groupOrder}else if(t.renderOrder!==e.renderOrder){return t.renderOrder-e.renderOrder}else if(t.z!==e.z){return e.z-t.z}else{return t.id-e.id}}function zc(){const t=[];let e=0;const n=[];const i=[];const r=[];function s(){e=0;n.length=0;i.length=0;r.length=0}function a(n,i,r,s,a,o){let l=t[e];if(l===undefined){l={id:n.id,object:n,geometry:i,material:r,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o};t[e]=l}else{l.id=n.id;l.object=n;l.geometry=i;l.material=r;l.groupOrder=s;l.renderOrder=n.renderOrder;l.z=a;l.group=o}e++;return l}function o(t,e,s,o,l,c){const u=a(t,e,s,o,l,c);if(s.transmission>0){i.push(u)}else if(s.transparent===true){r.push(u)}else{n.push(u)}}function l(t,e,s,o,l,c){const u=a(t,e,s,o,l,c);if(s.transmission>0){i.unshift(u)}else if(s.transparent===true){r.unshift(u)}else{n.unshift(u)}}function c(t,e){if(n.length>1)n.sort(t||Oc);if(i.length>1)i.sort(e||Fc);if(r.length>1)r.sort(e||Fc)}function u(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(e.id===null)break;e.id=null;e.object=null;e.geometry=null;e.material=null;e.group=null}}return{opaque:n,transmissive:i,transparent:r,init:s,push:o,unshift:l,finish:u,sort:c}}function Bc(){let t=new WeakMap;function e(e,n){const i=t.get(e);let r;if(i===undefined){r=new zc;t.set(e,[r])}else{if(n>=i.length){r=new zc;i.push(r)}else{r=i[n]}}return r}function n(){t=new WeakMap}return{get:e,dispose:n}}function Hc(){const t={};return{get:function(e){if(t[e.id]!==undefined){return t[e.id]}let n;switch(e.type){case"DirectionalLight":n={direction:new fn,color:new Pi};break;case"SpotLight":n={position:new fn,direction:new fn,color:new Pi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new fn,color:new Pi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new fn,skyColor:new Pi,groundColor:new Pi};break;case"RectAreaLight":n={color:new Pi,position:new fn,halfWidth:new fn,halfHeight:new fn};break}t[e.id]=n;return n}}}function Gc(){const t={};return{get:function(e){if(t[e.id]!==undefined){return t[e.id]}let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe,shadowCameraNear:1,shadowCameraFar:1e3};break}t[e.id]=n;return n}}}let Vc=0;function kc(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Wc(t,e){const n=new Hc;const i=Gc();const r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new fn);const s=new fn;const a=new Gn;const o=new Gn;function l(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let u=0;let h=0;let f=0;let d=0;let p=0;let m=0;let g=0;let _=0;let x=0;let v=0;s.sort(kc);const M=a===true?Math.PI:1;for(let t=0,e=s.length;t<e;t++){const e=s[t];const a=e.color;const y=e.intensity;const S=e.distance;const E=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight){o+=a.r*y*M;l+=a.g*y*M;c+=a.b*y*M}else if(e.isLightProbe){for(let t=0;t<9;t++){r.probe[t].addScaledVector(e.sh.coefficients[t],y)}}else if(e.isDirectionalLight){const t=n.get(e);t.color.copy(e.color).multiplyScalar(e.intensity*M);if(e.castShadow){const t=e.shadow;const n=i.get(e);n.shadowBias=t.bias;n.shadowNormalBias=t.normalBias;n.shadowRadius=t.radius;n.shadowMapSize=t.mapSize;r.directionalShadow[u]=n;r.directionalShadowMap[u]=E;r.directionalShadowMatrix[u]=e.shadow.matrix;m++}r.directional[u]=t;u++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld);t.color.copy(a).multiplyScalar(y*M);t.distance=S;t.coneCos=Math.cos(e.angle);t.penumbraCos=Math.cos(e.angle*(1-e.penumbra));t.decay=e.decay;r.spot[f]=t;const s=e.shadow;if(e.map){r.spotLightMap[x]=e.map;x++;s.updateMatrices(e);if(e.castShadow)v++}r.spotLightMatrix[f]=s.matrix;if(e.castShadow){const t=i.get(e);t.shadowBias=s.bias;t.shadowNormalBias=s.normalBias;t.shadowRadius=s.radius;t.shadowMapSize=s.mapSize;r.spotShadow[f]=t;r.spotShadowMap[f]=E;_++}f++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(a).multiplyScalar(y);t.halfWidth.set(e.width*.5,0,0);t.halfHeight.set(0,e.height*.5,0);r.rectArea[d]=t;d++}else if(e.isPointLight){const t=n.get(e);t.color.copy(e.color).multiplyScalar(e.intensity*M);t.distance=e.distance;t.decay=e.decay;if(e.castShadow){const t=e.shadow;const n=i.get(e);n.shadowBias=t.bias;n.shadowNormalBias=t.normalBias;n.shadowRadius=t.radius;n.shadowMapSize=t.mapSize;n.shadowCameraNear=t.camera.near;n.shadowCameraFar=t.camera.far;r.pointShadow[h]=n;r.pointShadowMap[h]=E;r.pointShadowMatrix[h]=e.shadow.matrix;g++}r.point[h]=t;h++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(y*M);t.groundColor.copy(e.groundColor).multiplyScalar(y*M);r.hemi[p]=t;p++}}if(d>0){if(e.isWebGL2){r.rectAreaLTC1=xo.LTC_FLOAT_1;r.rectAreaLTC2=xo.LTC_FLOAT_2}else{if(t.has("OES_texture_float_linear")===true){r.rectAreaLTC1=xo.LTC_FLOAT_1;r.rectAreaLTC2=xo.LTC_FLOAT_2}else if(t.has("OES_texture_half_float_linear")===true){r.rectAreaLTC1=xo.LTC_HALF_1;r.rectAreaLTC2=xo.LTC_HALF_2}else{console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")}}}r.ambient[0]=o;r.ambient[1]=l;r.ambient[2]=c;const y=r.hash;if(y.directionalLength!==u||y.pointLength!==h||y.spotLength!==f||y.rectAreaLength!==d||y.hemiLength!==p||y.numDirectionalShadows!==m||y.numPointShadows!==g||y.numSpotShadows!==_||y.numSpotMaps!==x){r.directional.length=u;r.spot.length=f;r.rectArea.length=d;r.point.length=h;r.hemi.length=p;r.directionalShadow.length=m;r.directionalShadowMap.length=m;r.pointShadow.length=g;r.pointShadowMap.length=g;r.spotShadow.length=_;r.spotShadowMap.length=_;r.directionalShadowMatrix.length=m;r.pointShadowMatrix.length=g;r.spotLightMatrix.length=_+x-v;r.spotLightMap.length=x;r.numSpotLightShadowsWithMaps=v;y.directionalLength=u;y.pointLength=h;y.spotLength=f;y.rectAreaLength=d;y.hemiLength=p;y.numDirectionalShadows=m;y.numPointShadows=g;y.numSpotShadows=_;y.numSpotMaps=x;r.version=Vc++}}function c(t,e){let n=0;let i=0;let l=0;let c=0;let u=0;const h=e.matrixWorldInverse;for(let e=0,f=t.length;e<f;e++){const f=t[e];if(f.isDirectionalLight){const t=r.directional[n];t.direction.setFromMatrixPosition(f.matrixWorld);s.setFromMatrixPosition(f.target.matrixWorld);t.direction.sub(s);t.direction.transformDirection(h);n++}else if(f.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(f.matrixWorld);t.position.applyMatrix4(h);t.direction.setFromMatrixPosition(f.matrixWorld);s.setFromMatrixPosition(f.target.matrixWorld);t.direction.sub(s);t.direction.transformDirection(h);l++}else if(f.isRectAreaLight){const t=r.rectArea[c];t.position.setFromMatrixPosition(f.matrixWorld);t.position.applyMatrix4(h);o.identity();a.copy(f.matrixWorld);a.premultiply(h);o.extractRotation(a);t.halfWidth.set(f.width*.5,0,0);t.halfHeight.set(0,f.height*.5,0);t.halfWidth.applyMatrix4(o);t.halfHeight.applyMatrix4(o);c++}else if(f.isPointLight){const t=r.point[i];t.position.setFromMatrixPosition(f.matrixWorld);t.position.applyMatrix4(h);i++}else if(f.isHemisphereLight){const t=r.hemi[u];t.direction.setFromMatrixPosition(f.matrixWorld);t.direction.transformDirection(h);u++}}}return{setup:l,setupView:c,state:r}}function Xc(t,e){const n=new Wc(t,e);const i=[];const r=[];function s(){i.length=0;r.length=0}function a(t){i.push(t)}function o(t){r.push(t)}function l(t){n.setup(i,t)}function c(t){n.setupView(i,t)}const u={lightsArray:i,shadowsArray:r,lights:n};return{init:s,state:u,setupLights:l,setupLightsView:c,pushLight:a,pushShadow:o}}function jc(t,e){let n=new WeakMap;function i(i,r=0){const s=n.get(i);let a;if(s===undefined){a=new Xc(t,e);n.set(i,[a])}else{if(r>=s.length){a=new Xc(t,e);s.push(a)}else{a=s[r]}}return a}function r(){n=new WeakMap}return{get:i,dispose:r}}class Yc extends Ai{constructor(t){super();this.isMeshDepthMaterial=true;this.type="MeshDepthMaterial";this.depthPacking=de;this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(t)}copy(t){super.copy(t);this.depthPacking=t.depthPacking;this.map=t.map;this.alphaMap=t.alphaMap;this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;return this}}class Jc extends Ai{constructor(t){super();this.isMeshDistanceMaterial=true;this.type="MeshDistanceMaterial";this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.setValues(t)}copy(t){super.copy(t);this.map=t.map;this.alphaMap=t.alphaMap;this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;return this}}const Zc="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";const Kc="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function Qc(t,e,n){let i=new Or;const r=new Fe,s=new Fe,a=new on,l=new Yc({depthPacking:pe}),p=new Jc,m={},g=n.maxTextureSize;const _={[u]:h,[h]:u,[f]:f};const x=new Er({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fe},radius:{value:4}},vertexShader:Zc,fragmentShader:Kc});const v=x.clone();v.defines.HORIZONTAL_PASS=1;const M=new Yi;M.setAttribute("position",new Oi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new fr(M,x);const S=this;this.enabled=false;this.autoUpdate=true;this.needsUpdate=false;this.type=o;let E=this.type;this.render=function(e,n,o){if(S.enabled===false)return;if(S.autoUpdate===false&&S.needsUpdate===false)return;if(e.length===0)return;const l=t.getRenderTarget();const u=t.getActiveCubeFace();const h=t.getActiveMipmapLevel();const f=t.state;f.setBlending(d);f.buffers.color.setClear(1,1,1,1);f.buffers.depth.setTest(true);f.setScissorTest(false);const p=E!==c&&this.type===c;const m=E===c&&this.type!==c;for(let l=0,u=e.length;l<u;l++){const u=e[l];const h=u.shadow;if(h===undefined){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(h.autoUpdate===false&&h.needsUpdate===false)continue;r.copy(h.mapSize);const d=h.getFrameExtents();r.multiply(d);s.copy(h.mapSize);if(r.x>g||r.y>g){if(r.x>g){s.x=Math.floor(g/d.x);r.x=s.x*d.x;h.mapSize.x=s.x}if(r.y>g){s.y=Math.floor(g/d.y);r.y=s.y*d.y;h.mapSize.y=s.y}}if(h.map===null||p===true||m===true){const t=this.type!==c?{minFilter:ot,magFilter:ot}:{};if(h.map!==null){h.map.dispose()}h.map=new ln(r.x,r.y,t);h.map.texture.name=u.name+".shadowMap";h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map);t.clear();const _=h.getViewportCount();for(let t=0;t<_;t++){const e=h.getViewport(t);a.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w);f.viewport(a);h.updateMatrices(u,t);i=h.getFrustum();w(n,o,h.camera,u,this.type)}if(h.isPointLightShadow!==true&&this.type===c){T(h,o)}h.needsUpdate=false}E=this.type;S.needsUpdate=false;t.setRenderTarget(l,u,h)};function T(n,i){const s=e.update(y);if(x.defines.VSM_SAMPLES!==n.blurSamples){x.defines.VSM_SAMPLES=n.blurSamples;v.defines.VSM_SAMPLES=n.blurSamples;x.needsUpdate=true;v.needsUpdate=true}if(n.mapPass===null){n.mapPass=new ln(r.x,r.y)}x.uniforms.shadow_pass.value=n.map.texture;x.uniforms.resolution.value=n.mapSize;x.uniforms.radius.value=n.radius;t.setRenderTarget(n.mapPass);t.clear();t.renderBufferDirect(i,null,s,x,y,null);v.uniforms.shadow_pass.value=n.mapPass.texture;v.uniforms.resolution.value=n.mapSize;v.uniforms.radius.value=n.radius;t.setRenderTarget(n.map);t.clear();t.renderBufferDirect(i,null,s,v,y,null)}function b(e,n,i,r){let s=null;const a=i.isPointLight===true?e.customDistanceMaterial:e.customDepthMaterial;if(a!==undefined){s=a}else{s=i.isPointLight===true?p:l;if(t.localClippingEnabled&&n.clipShadows===true&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=m[t];if(i===undefined){i={};m[t]=i}let r=i[e];if(r===undefined){r=s.clone();i[e]=r}s=r}}s.visible=n.visible;s.wireframe=n.wireframe;if(r===c){s.side=n.shadowSide!==null?n.shadowSide:n.side}else{s.side=n.shadowSide!==null?n.shadowSide:_[n.side]}s.alphaMap=n.alphaMap;s.alphaTest=n.alphaTest;s.map=n.map;s.clipShadows=n.clipShadows;s.clippingPlanes=n.clippingPlanes;s.clipIntersection=n.clipIntersection;s.displacementMap=n.displacementMap;s.displacementScale=n.displacementScale;s.displacementBias=n.displacementBias;s.wireframeLinewidth=n.wireframeLinewidth;s.linewidth=n.linewidth;if(i.isPointLight===true&&s.isMeshDistanceMaterial===true){const e=t.properties.get(s);e.light=i}return s}function w(n,r,s,a,o){if(n.visible===false)return;const l=n.layers.test(r.layers);if(l&&(n.isMesh||n.isLine||n.isPoints)){if((n.castShadow||n.receiveShadow&&o===c)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n);const r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l];const u=r[c.materialIndex];if(u&&u.visible){const e=b(n,u,a,o);t.renderBufferDirect(s,null,i,e,n,c)}}}else if(r.visible){const e=b(n,r,a,o);t.renderBufferDirect(s,null,i,e,n,null)}}}const u=n.children;for(let t=0,e=u.length;t<e;t++){w(u[t],r,s,a,o)}}}function $c(t,e,n){const i=n.isWebGL2;function o(){let e=false;const n=new on;let i=null;const r=new on(0,0,0,0);return{setMask:function(n){if(i!==n&&!e){t.colorMask(n,n,n,n);i=n}},setLocked:function(t){e=t},setClear:function(e,i,s,a,o){if(o===true){e*=a;i*=a;s*=a}n.set(e,i,s,a);if(r.equals(n)===false){t.clearColor(e,i,s,a);r.copy(n)}},reset:function(){e=false;i=null;r.set(-1,0,0,0)}}}function l(){let e=false;let n=null;let i=null;let r=null;return{setTest:function(e){if(e){Tt(t.DEPTH_TEST)}else{bt(t.DEPTH_TEST)}},setMask:function(i){if(n!==i&&!e){t.depthMask(i);n=i}},setFunc:function(e){if(i!==e){switch(e){case I:t.depthFunc(t.NEVER);break;case N:t.depthFunc(t.ALWAYS);break;case O:t.depthFunc(t.LESS);break;case F:t.depthFunc(t.LEQUAL);break;case z:t.depthFunc(t.EQUAL);break;case B:t.depthFunc(t.GEQUAL);break;case H:t.depthFunc(t.GREATER);break;case G:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}i=e}},setLocked:function(t){e=t},setClear:function(e){if(r!==e){t.clearDepth(e);r=e}},reset:function(){e=false;n=null;i=null;r=null}}}function c(){let e=false;let n=null;let i=null;let r=null;let s=null;let a=null;let o=null;let l=null;let c=null;return{setTest:function(n){if(!e){if(n){Tt(t.STENCIL_TEST)}else{bt(t.STENCIL_TEST)}}},setMask:function(i){if(n!==i&&!e){t.stencilMask(i);n=i}},setFunc:function(e,n,a){if(i!==e||r!==n||s!==a){t.stencilFunc(e,n,a);i=e;r=n;s=a}},setOp:function(e,n,i){if(a!==e||o!==n||l!==i){t.stencilOp(e,n,i);a=e;o=n;l=i}},setLocked:function(t){e=t},setClear:function(e){if(c!==e){t.clearStencil(e);c=e}},reset:function(){e=false;n=null;i=null;r=null;s=null;a=null;o=null;l=null;c=null}}}const u=new o;const V=new l;const k=new c;const W=new WeakMap;const X=new WeakMap;let j={};let Y={};let J=new WeakMap;let Z=[];let K=null;let Q=false;let $=null;let tt=null;let et=null;let nt=null;let it=null;let rt=null;let st=null;let at=false;let ot=null;let lt=null;let ct=null;let ut=null;let ht=null;const ft=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let dt=false;let pt=0;const mt=t.getParameter(t.VERSION);if(mt.indexOf("WebGL")!==-1){pt=parseFloat(/^WebGL (\d)/.exec(mt)[1]);dt=pt>=1}else if(mt.indexOf("OpenGL ES")!==-1){pt=parseFloat(/^OpenGL ES (\d)/.exec(mt)[1]);dt=pt>=2}let gt=null;let _t={};const xt=t.getParameter(t.SCISSOR_BOX);const vt=t.getParameter(t.VIEWPORT);const Mt=(new on).fromArray(xt);const yt=(new on).fromArray(vt);function St(e,n,r,s){const a=new Uint8Array(4);const o=t.createTexture();t.bindTexture(e,o);t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST);t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o=0;o<r;o++){if(i&&(e===t.TEXTURE_3D||e===t.TEXTURE_2D_ARRAY)){t.texImage3D(n,0,t.RGBA,1,1,s,0,t.RGBA,t.UNSIGNED_BYTE,a)}else{t.texImage2D(n+o,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,a)}}return o}const Et={};Et[t.TEXTURE_2D]=St(t.TEXTURE_2D,t.TEXTURE_2D,1);Et[t.TEXTURE_CUBE_MAP]=St(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6);if(i){Et[t.TEXTURE_2D_ARRAY]=St(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1);Et[t.TEXTURE_3D]=St(t.TEXTURE_3D,t.TEXTURE_3D,1,1)}u.setClear(0,0,0,1);V.setClear(1);k.setClear(0);Tt(t.DEPTH_TEST);V.setFunc(F);Ut(false);Dt(s);Tt(t.CULL_FACE);Lt(d);function Tt(e){if(j[e]!==true){t.enable(e);j[e]=true}}function bt(e){if(j[e]!==false){t.disable(e);j[e]=false}}function wt(e,n){if(Y[e]!==n){t.bindFramebuffer(e,n);Y[e]=n;if(i){if(e===t.DRAW_FRAMEBUFFER){Y[t.FRAMEBUFFER]=n}if(e===t.FRAMEBUFFER){Y[t.DRAW_FRAMEBUFFER]=n}}return true}return false}function At(i,r){let s=Z;let a=false;if(i){s=J.get(r);if(s===undefined){s=[];J.set(r,s)}if(i.isWebGLMultipleRenderTargets){const e=i.texture;if(s.length!==e.length||s[0]!==t.COLOR_ATTACHMENT0){for(let n=0,i=e.length;n<i;n++){s[n]=t.COLOR_ATTACHMENT0+n}s.length=e.length;a=true}}else{if(s[0]!==t.COLOR_ATTACHMENT0){s[0]=t.COLOR_ATTACHMENT0;a=true}}}else{if(s[0]!==t.BACK){s[0]=t.BACK;a=true}}if(a){if(n.isWebGL2){t.drawBuffers(s)}else{e.get("WEBGL_draw_buffers").drawBuffersWEBGL(s)}}}function Rt(e){if(K!==e){t.useProgram(e);K=e;return true}return false}const qt={[v]:t.FUNC_ADD,[M]:t.FUNC_SUBTRACT,[y]:t.FUNC_REVERSE_SUBTRACT};if(i){qt[S]=t.MIN;qt[E]=t.MAX}else{const t=e.get("EXT_blend_minmax");if(t!==null){qt[S]=t.MIN_EXT;qt[E]=t.MAX_EXT}}const Ct={[T]:t.ZERO,[b]:t.ONE,[w]:t.SRC_COLOR,[R]:t.SRC_ALPHA,[D]:t.SRC_ALPHA_SATURATE,[P]:t.DST_COLOR,[C]:t.DST_ALPHA,[A]:t.ONE_MINUS_SRC_COLOR,[q]:t.ONE_MINUS_SRC_ALPHA,[U]:t.ONE_MINUS_DST_COLOR,[L]:t.ONE_MINUS_DST_ALPHA};function Lt(e,n,i,r,s,a,o,l){if(e===d){if(Q===true){bt(t.BLEND);Q=false}return}if(Q===false){Tt(t.BLEND);Q=true}if(e!==x){if(e!==$||l!==at){if(tt!==v||it!==v){t.blendEquation(t.FUNC_ADD);tt=v;it=v}if(l){switch(e){case p:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case m:t.blendFunc(t.ONE,t.ONE);break;case g:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case _:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}}else{switch(e){case p:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case m:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case g:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case _:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}}et=null;nt=null;rt=null;st=null;$=e;at=l}return}s=s||n;a=a||i;o=o||r;if(n!==tt||s!==it){t.blendEquationSeparate(qt[n],qt[s]);tt=n;it=s}if(i!==et||r!==nt||a!==rt||o!==st){t.blendFuncSeparate(Ct[i],Ct[r],Ct[a],Ct[o]);et=i;nt=r;rt=a;st=o}$=e;at=false}function Pt(e,n){e.side===f?bt(t.CULL_FACE):Tt(t.CULL_FACE);let i=e.side===h;if(n)i=!i;Ut(i);e.blending===p&&e.transparent===false?Lt(d):Lt(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha);V.setFunc(e.depthFunc);V.setTest(e.depthTest);V.setMask(e.depthWrite);u.setMask(e.colorWrite);const r=e.stencilWrite;k.setTest(r);if(r){k.setMask(e.stencilWriteMask);k.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask);k.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)}Nt(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits);e.alphaToCoverage===true?Tt(t.SAMPLE_ALPHA_TO_COVERAGE):bt(t.SAMPLE_ALPHA_TO_COVERAGE)}function Ut(e){if(ot!==e){if(e){t.frontFace(t.CW)}else{t.frontFace(t.CCW)}ot=e}}function Dt(e){if(e!==r){Tt(t.CULL_FACE);if(e!==lt){if(e===s){t.cullFace(t.BACK)}else if(e===a){t.cullFace(t.FRONT)}else{t.cullFace(t.FRONT_AND_BACK)}}}else{bt(t.CULL_FACE)}lt=e}function It(e){if(e!==ct){if(dt)t.lineWidth(e);ct=e}}function Nt(e,n,i){if(e){Tt(t.POLYGON_OFFSET_FILL);if(ut!==n||ht!==i){t.polygonOffset(n,i);ut=n;ht=i}}else{bt(t.POLYGON_OFFSET_FILL)}}function Ot(e){if(e){Tt(t.SCISSOR_TEST)}else{bt(t.SCISSOR_TEST)}}function Ft(e){if(e===undefined)e=t.TEXTURE0+ft-1;if(gt!==e){t.activeTexture(e);gt=e}}function zt(e,n,i){if(i===undefined){if(gt===null){i=t.TEXTURE0+ft-1}else{i=gt}}let r=_t[i];if(r===undefined){r={type:undefined,texture:undefined};_t[i]=r}if(r.type!==e||r.texture!==n){if(gt!==i){t.activeTexture(i);gt=i}t.bindTexture(e,n||Et[e]);r.type=e;r.texture=n}}function Bt(){const e=_t[gt];if(e!==undefined&&e.type!==undefined){t.bindTexture(e.type,null);e.type=undefined;e.texture=undefined}}function Ht(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Gt(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Vt(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function kt(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Wt(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Xt(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function jt(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Yt(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Jt(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Zt(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Kt(e){if(Mt.equals(e)===false){t.scissor(e.x,e.y,e.z,e.w);Mt.copy(e)}}function Qt(e){if(yt.equals(e)===false){t.viewport(e.x,e.y,e.z,e.w);yt.copy(e)}}function $t(e,n){let i=X.get(n);if(i===undefined){i=new WeakMap;X.set(n,i)}let r=i.get(e);if(r===undefined){r=t.getUniformBlockIndex(n,e.name);i.set(e,r)}}function te(e,n){const i=X.get(n);const r=i.get(e);if(W.get(n)!==r){t.uniformBlockBinding(n,r,e.__bindingPointIndex);W.set(n,r)}}function ee(){t.disable(t.BLEND);t.disable(t.CULL_FACE);t.disable(t.DEPTH_TEST);t.disable(t.POLYGON_OFFSET_FILL);t.disable(t.SCISSOR_TEST);t.disable(t.STENCIL_TEST);t.disable(t.SAMPLE_ALPHA_TO_COVERAGE);t.blendEquation(t.FUNC_ADD);t.blendFunc(t.ONE,t.ZERO);t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO);t.colorMask(true,true,true,true);t.clearColor(0,0,0,0);t.depthMask(true);t.depthFunc(t.LESS);t.clearDepth(1);t.stencilMask(4294967295);t.stencilFunc(t.ALWAYS,0,4294967295);t.stencilOp(t.KEEP,t.KEEP,t.KEEP);t.clearStencil(0);t.cullFace(t.BACK);t.frontFace(t.CCW);t.polygonOffset(0,0);t.activeTexture(t.TEXTURE0);t.bindFramebuffer(t.FRAMEBUFFER,null);if(i===true){t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null);t.bindFramebuffer(t.READ_FRAMEBUFFER,null)}t.useProgram(null);t.lineWidth(1);t.scissor(0,0,t.canvas.width,t.canvas.height);t.viewport(0,0,t.canvas.width,t.canvas.height);j={};gt=null;_t={};Y={};J=new WeakMap;Z=[];K=null;Q=false;$=null;tt=null;et=null;nt=null;it=null;rt=null;st=null;at=false;ot=null;lt=null;ct=null;ut=null;ht=null;Mt.set(0,0,t.canvas.width,t.canvas.height);yt.set(0,0,t.canvas.width,t.canvas.height);u.reset();V.reset();k.reset()}return{buffers:{color:u,depth:V,stencil:k},enable:Tt,disable:bt,bindFramebuffer:wt,drawBuffers:At,useProgram:Rt,setBlending:Lt,setMaterial:Pt,setFlipSided:Ut,setCullFace:Dt,setLineWidth:It,setPolygonOffset:Nt,setScissorTest:Ot,activeTexture:Ft,bindTexture:zt,unbindTexture:Bt,compressedTexImage2D:Ht,compressedTexImage3D:Gt,texImage2D:Jt,texImage3D:Zt,updateUBOMapping:$t,uniformBlockBinding:te,texStorage2D:jt,texStorage3D:Yt,texSubImage2D:Vt,texSubImage3D:kt,compressedTexSubImage2D:Wt,compressedTexSubImage3D:Xt,scissor:Kt,viewport:Qt,reset:ee}}function tu(t,e,n,i,r,s,a){const o=r.isWebGL2;const l=r.maxTextures;const c=r.maxCubemapSize;const u=r.maxTextureSize;const h=r.maxSamples;const f=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null;const d=typeof navigator==="undefined"?false:/OculusBrowser/g.test(navigator.userAgent);const p=new WeakMap;let m;const g=new WeakMap;let _=false;try{_=typeof OffscreenCanvas!=="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(t){}function x(t,e){return _?new OffscreenCanvas(t,e):Ge("canvas")}function v(t,e,n,i){let r=1;if(t.width>i||t.height>i){r=i/Math.max(t.width,t.height)}if(r<1||e===true){if(typeof HTMLImageElement!=="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&t instanceof ImageBitmap){const i=e?Ie:Math.floor;const s=i(r*t.width);const a=i(r*t.height);if(m===undefined)m=x(s,a);const o=n?x(s,a):m;o.width=s;o.height=a;const l=o.getContext("2d");l.drawImage(t,0,0,s,a);console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+").");return o}else{if("data"in t){console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+").")}return t}}return t}function M(t){return De(t.width)&&De(t.height)}function y(t){if(o)return false;return t.wrapS!==st||t.wrapT!==st||t.minFilter!==ot&&t.minFilter!==ut}function S(t,e){return t.generateMipmaps&&e&&t.minFilter!==ot&&t.minFilter!==ut}function E(e){t.generateMipmap(e)}function T(n,i,r,s,a=false){if(o===false)return i;if(n!==null){if(t[n]!==undefined)return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;if(i===t.RED){if(r===t.FLOAT)l=t.R32F;if(r===t.HALF_FLOAT)l=t.R16F;if(r===t.UNSIGNED_BYTE)l=t.R8}if(i===t.RG){if(r===t.FLOAT)l=t.RG32F;if(r===t.HALF_FLOAT)l=t.RG16F;if(r===t.UNSIGNED_BYTE)l=t.RG8}if(i===t.RGBA){if(r===t.FLOAT)l=t.RGBA32F;if(r===t.HALF_FLOAT)l=t.RGBA16F;if(r===t.UNSIGNED_BYTE)l=s===xe&&a===false?t.SRGB8_ALPHA8:t.RGBA8;if(r===t.UNSIGNED_SHORT_4_4_4_4)l=t.RGBA4;if(r===t.UNSIGNED_SHORT_5_5_5_1)l=t.RGB5_A1}if(l===t.R16F||l===t.R32F||l===t.RG16F||l===t.RG32F||l===t.RGBA16F||l===t.RGBA32F){e.get("EXT_color_buffer_float")}return l}function b(t,e,n){if(S(t,n)===true||t.isFramebufferTexture&&t.minFilter!==ot&&t.minFilter!==ut){return Math.log2(Math.max(e.width,e.height))+1}else if(t.mipmaps!==undefined&&t.mipmaps.length>0){return t.mipmaps.length}else if(t.isCompressedTexture&&Array.isArray(t.image)){return e.mipmaps.length}else{return 1}}function w(e){if(e===ot||e===lt||e===ct){return t.NEAREST}return t.LINEAR}function A(t){const e=t.target;e.removeEventListener("dispose",A);q(e);if(e.isVideoTexture){p.delete(e)}}function R(t){const e=t.target;e.removeEventListener("dispose",R);L(e)}function q(t){const e=i.get(t);if(e.__webglInit===undefined)return;const n=t.source;const r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--;if(i.usedTimes===0){C(t)}if(Object.keys(r).length===0){g.delete(n)}}i.remove(t)}function C(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source;const s=g.get(r);delete s[n.__cacheKey];a.memory.textures--}function L(e){const n=e.texture;const r=i.get(e);const s=i.get(n);if(s.__webglTexture!==undefined){t.deleteTexture(s.__webglTexture);a.memory.textures--}if(e.depthTexture){e.depthTexture.dispose()}if(e.isWebGLCubeRenderTarget){for(let e=0;e<6;e++){t.deleteFramebuffer(r.__webglFramebuffer[e]);if(r.__webglDepthbuffer)t.deleteRenderbuffer(r.__webglDepthbuffer[e])}}else{t.deleteFramebuffer(r.__webglFramebuffer);if(r.__webglDepthbuffer)t.deleteRenderbuffer(r.__webglDepthbuffer);if(r.__webglMultisampledFramebuffer)t.deleteFramebuffer(r.__webglMultisampledFramebuffer);if(r.__webglColorRenderbuffer){for(let e=0;e<r.__webglColorRenderbuffer.length;e++){if(r.__webglColorRenderbuffer[e])t.deleteRenderbuffer(r.__webglColorRenderbuffer[e])}}if(r.__webglDepthRenderbuffer)t.deleteRenderbuffer(r.__webglDepthRenderbuffer)}if(e.isWebGLMultipleRenderTargets){for(let e=0,r=n.length;e<r;e++){const r=i.get(n[e]);if(r.__webglTexture){t.deleteTexture(r.__webglTexture);a.memory.textures--}i.remove(n[e])}}i.remove(n);i.remove(e)}let P=0;function U(){P=0}function D(){const t=P;if(t>=l){console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l)}P+=1;return t}function I(t){const e=[];e.push(t.wrapS);e.push(t.wrapT);e.push(t.wrapR||0);e.push(t.magFilter);e.push(t.minFilter);e.push(t.anisotropy);e.push(t.internalFormat);e.push(t.format);e.push(t.type);e.push(t.generateMipmaps);e.push(t.premultiplyAlpha);e.push(t.flipY);e.push(t.unpackAlignment);e.push(t.colorSpace);return e.join()}function N(e,r){const s=i.get(e);if(e.isVideoTexture)nt(e);if(e.isRenderTargetTexture===false&&e.version>0&&s.__version!==e.version){const t=e.image;if(t===null){console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.")}else if(t.complete===false){console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}else{k(s,e,r);return}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}function O(e,r){const s=i.get(e);if(e.version>0&&s.__version!==e.version){k(s,e,r);return}n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)}function F(e,r){const s=i.get(e);if(e.version>0&&s.__version!==e.version){k(s,e,r);return}n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)}function z(e,r){const s=i.get(e);if(e.version>0&&s.__version!==e.version){W(s,e,r);return}n.bindTexture(t.TEXTURE_CUBE_MAP,s.__webglTexture,t.TEXTURE0+r)}const B={[rt]:t.REPEAT,[st]:t.CLAMP_TO_EDGE,[at]:t.MIRRORED_REPEAT};const H={[ot]:t.NEAREST,[lt]:t.NEAREST_MIPMAP_NEAREST,[ct]:t.NEAREST_MIPMAP_LINEAR,[ut]:t.LINEAR,[ht]:t.LINEAR_MIPMAP_NEAREST,[ft]:t.LINEAR_MIPMAP_LINEAR};function G(n,s,a){if(a){t.texParameteri(n,t.TEXTURE_WRAP_S,B[s.wrapS]);t.texParameteri(n,t.TEXTURE_WRAP_T,B[s.wrapT]);if(n===t.TEXTURE_3D||n===t.TEXTURE_2D_ARRAY){t.texParameteri(n,t.TEXTURE_WRAP_R,B[s.wrapR])}t.texParameteri(n,t.TEXTURE_MAG_FILTER,H[s.magFilter]);t.texParameteri(n,t.TEXTURE_MIN_FILTER,H[s.minFilter])}else{t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE);t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);if(n===t.TEXTURE_3D||n===t.TEXTURE_2D_ARRAY){t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE)}if(s.wrapS!==st||s.wrapT!==st){console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.")}t.texParameteri(n,t.TEXTURE_MAG_FILTER,w(s.magFilter));t.texParameteri(n,t.TEXTURE_MIN_FILTER,w(s.minFilter));if(s.minFilter!==ot&&s.minFilter!==ut){console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")}}if(e.has("EXT_texture_filter_anisotropic")===true){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===ot)return;if(s.minFilter!==ct&&s.minFilter!==ft)return;if(s.type===vt&&e.has("OES_texture_float_linear")===false)return;if(o===false&&(s.type===Mt&&e.has("OES_texture_half_float_linear")===false))return;if(s.anisotropy>1||i.get(s).__currentAnisotropy){t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy()));i.get(s).__currentAnisotropy=s.anisotropy}}}function V(e,n){let i=false;if(e.__webglInit===undefined){e.__webglInit=true;n.addEventListener("dispose",A)}const r=n.source;let s=g.get(r);if(s===undefined){s={};g.set(r,s)}const o=I(n);if(o!==e.__cacheKey){if(s[o]===undefined){s[o]={texture:t.createTexture(),usedTimes:0};a.memory.textures++;i=true}s[o].usedTimes++;const r=s[e.__cacheKey];if(r!==undefined){s[e.__cacheKey].usedTimes--;if(r.usedTimes===0){C(n)}}e.__cacheKey=o;e.__webglTexture=s[o].texture}return i}function k(e,r,a){let l=t.TEXTURE_2D;if(r.isDataArrayTexture||r.isCompressedArrayTexture)l=t.TEXTURE_2D_ARRAY;if(r.isData3DTexture)l=t.TEXTURE_3D;const c=V(e,r);const h=r.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const f=i.get(h);if(h.version!==f.__version||c===true){n.activeTexture(t.TEXTURE0+a);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY);t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha);t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment);t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=y(r)&&M(r.image)===false;let i=v(r.image,e,false,u);i=it(r,i);const d=M(i)||o,p=s.convert(r.format,r.colorSpace);let m=s.convert(r.type),g=T(r.internalFormat,p,m,r.colorSpace);G(l,r,d);let _;const x=r.mipmaps;const w=o&&r.isVideoTexture!==true;const A=f.__version===undefined||c===true;const R=b(r,i,d);if(r.isDepthTexture){g=t.DEPTH_COMPONENT;if(o){if(r.type===vt){g=t.DEPTH_COMPONENT32F}else if(r.type===xt){g=t.DEPTH_COMPONENT24}else if(r.type===Et){g=t.DEPTH24_STENCIL8}else{g=t.DEPTH_COMPONENT16}}else{if(r.type===vt){console.error("WebGLRenderer: Floating point depth texture requires WebGL2.")}}if(r.format===Rt&&g===t.DEPTH_COMPONENT){if(r.type!==gt&&r.type!==xt){console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.");r.type=xt;m=s.convert(r.type)}}if(r.format===qt&&g===t.DEPTH_COMPONENT){g=t.DEPTH_STENCIL;if(r.type!==Et){console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.");r.type=Et;m=s.convert(r.type)}}if(A){if(w){n.texStorage2D(t.TEXTURE_2D,1,g,i.width,i.height)}else{n.texImage2D(t.TEXTURE_2D,0,g,i.width,i.height,0,p,m,null)}}}else if(r.isDataTexture){if(x.length>0&&d){if(w&&A){n.texStorage2D(t.TEXTURE_2D,R,g,x[0].width,x[0].height)}for(let e=0,i=x.length;e<i;e++){_=x[e];if(w){n.texSubImage2D(t.TEXTURE_2D,e,0,0,_.width,_.height,p,m,_.data)}else{n.texImage2D(t.TEXTURE_2D,e,g,_.width,_.height,0,p,m,_.data)}}r.generateMipmaps=false}else{if(w){if(A){n.texStorage2D(t.TEXTURE_2D,R,g,i.width,i.height)}n.texSubImage2D(t.TEXTURE_2D,0,0,0,i.width,i.height,p,m,i.data)}else{n.texImage2D(t.TEXTURE_2D,0,g,i.width,i.height,0,p,m,i.data)}}}else if(r.isCompressedTexture){if(r.isCompressedArrayTexture){if(w&&A){n.texStorage3D(t.TEXTURE_2D_ARRAY,R,g,x[0].width,x[0].height,i.depth)}for(let e=0,s=x.length;e<s;e++){_=x[e];if(r.format!==bt){if(p!==null){if(w){n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,_.width,_.height,i.depth,p,_.data,0,0)}else{n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,g,_.width,_.height,i.depth,0,_.data,0,0)}}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()")}}else{if(w){n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,_.width,_.height,i.depth,p,m,_.data)}else{n.texImage3D(t.TEXTURE_2D_ARRAY,e,g,_.width,_.height,i.depth,0,p,m,_.data)}}}}else{if(w&&A){n.texStorage2D(t.TEXTURE_2D,R,g,x[0].width,x[0].height)}for(let e=0,i=x.length;e<i;e++){_=x[e];if(r.format!==bt){if(p!==null){if(w){n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,_.width,_.height,p,_.data)}else{n.compressedTexImage2D(t.TEXTURE_2D,e,g,_.width,_.height,0,_.data)}}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()")}}else{if(w){n.texSubImage2D(t.TEXTURE_2D,e,0,0,_.width,_.height,p,m,_.data)}else{n.texImage2D(t.TEXTURE_2D,e,g,_.width,_.height,0,p,m,_.data)}}}}}else if(r.isDataArrayTexture){if(w){if(A){n.texStorage3D(t.TEXTURE_2D_ARRAY,R,g,i.width,i.height,i.depth)}n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,i.width,i.height,i.depth,p,m,i.data)}else{n.texImage3D(t.TEXTURE_2D_ARRAY,0,g,i.width,i.height,i.depth,0,p,m,i.data)}}else if(r.isData3DTexture){if(w){if(A){n.texStorage3D(t.TEXTURE_3D,R,g,i.width,i.height,i.depth)}n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,i.width,i.height,i.depth,p,m,i.data)}else{n.texImage3D(t.TEXTURE_3D,0,g,i.width,i.height,i.depth,0,p,m,i.data)}}else if(r.isFramebufferTexture){if(A){if(w){n.texStorage2D(t.TEXTURE_2D,R,g,i.width,i.height)}else{let e=i.width,r=i.height;for(let i=0;i<R;i++){n.texImage2D(t.TEXTURE_2D,i,g,e,r,0,p,m,null);e>>=1;r>>=1}}}}else{if(x.length>0&&d){if(w&&A){n.texStorage2D(t.TEXTURE_2D,R,g,x[0].width,x[0].height)}for(let e=0,i=x.length;e<i;e++){_=x[e];if(w){n.texSubImage2D(t.TEXTURE_2D,e,0,0,p,m,_)}else{n.texImage2D(t.TEXTURE_2D,e,g,p,m,_)}}r.generateMipmaps=false}else{if(w){if(A){n.texStorage2D(t.TEXTURE_2D,R,g,i.width,i.height)}n.texSubImage2D(t.TEXTURE_2D,0,0,0,p,m,i)}else{n.texImage2D(t.TEXTURE_2D,0,g,p,m,i)}}}if(S(r,d)){E(l)}f.__version=h.version;if(r.onUpdate)r.onUpdate(r)}e.__version=r.version}function W(e,r,a){if(r.image.length!==6)return;const l=V(e,r);const u=r.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const h=i.get(u);if(u.version!==h.__version||l===true){n.activeTexture(t.TEXTURE0+a);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY);t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha);t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment);t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture;const i=r.image[0]&&r.image[0].isDataTexture;const f=[];for(let t=0;t<6;t++){if(!e&&!i){f[t]=v(r.image[t],false,true,c)}else{f[t]=i?r.image[t].image:r.image[t]}f[t]=it(r,f[t])}const d=f[0],p=M(d)||o,m=s.convert(r.format,r.colorSpace),g=s.convert(r.type),_=T(r.internalFormat,m,g,r.colorSpace);const x=o&&r.isVideoTexture!==true;const y=h.__version===undefined||l===true;let w=b(r,d,p);G(t.TEXTURE_CUBE_MAP,r,p);let A;if(e){if(x&&y){n.texStorage2D(t.TEXTURE_CUBE_MAP,w,_,d.width,d.height)}for(let e=0;e<6;e++){A=f[e].mipmaps;for(let i=0;i<A.length;i++){const s=A[i];if(r.format!==bt){if(m!==null){if(x){n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,s.width,s.height,m,s.data)}else{n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,_,s.width,s.height,0,s.data)}}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()")}}else{if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,s.width,s.height,m,g,s.data)}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,_,s.width,s.height,0,m,g,s.data)}}}}}else{A=r.mipmaps;if(x&&y){if(A.length>0)w++;n.texStorage2D(t.TEXTURE_CUBE_MAP,w,_,f[0].width,f[0].height)}for(let e=0;e<6;e++){if(i){if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,f[e].width,f[e].height,m,g,f[e].data)}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,_,f[e].width,f[e].height,0,m,g,f[e].data)}for(let i=0;i<A.length;i++){const r=A[i];const s=r.image[e].image;if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,s.width,s.height,m,g,s.data)}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,_,s.width,s.height,0,m,g,s.data)}}}else{if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m,g,f[e])}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,_,m,g,f[e])}for(let i=0;i<A.length;i++){const r=A[i];if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,m,g,r.image[e])}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,_,m,g,r.image[e])}}}}}if(S(r,p)){E(t.TEXTURE_CUBE_MAP)}h.__version=u.version;if(r.onUpdate)r.onUpdate(r)}e.__version=r.version}function X(e,r,a,o,l){const c=s.convert(a.format,a.colorSpace);const u=s.convert(a.type);const h=T(a.internalFormat,c,u,a.colorSpace);const d=i.get(r);if(!d.__hasExternalTextures){if(l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY){n.texImage3D(l,0,h,r.width,r.height,r.depth,0,c,u,null)}else{n.texImage2D(l,0,h,r.width,r.height,0,c,u,null)}}n.bindFramebuffer(t.FRAMEBUFFER,e);if(et(r)){f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0,tt(r))}else if(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z){t.framebufferTexture2D(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0)}n.bindFramebuffer(t.FRAMEBUFFER,null)}function j(e,n,i){t.bindRenderbuffer(t.RENDERBUFFER,e);if(n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i||et(n)){const e=n.depthTexture;if(e&&e.isDepthTexture){if(e.type===vt){r=t.DEPTH_COMPONENT32F}else if(e.type===xt){r=t.DEPTH_COMPONENT24}}const i=tt(n);if(et(n)){f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height)}else{t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}}else{t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height)}t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=tt(n);if(i&&et(n)===false){t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height)}else if(et(n)){f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height)}else{t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height)}t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=n.isWebGLMultipleRenderTargets===true?n.texture:[n.texture];for(let r=0;r<e.length;r++){const a=e[r];const o=s.convert(a.format,a.colorSpace);const l=s.convert(a.type);const c=T(a.internalFormat,o,l,a.colorSpace);const u=tt(n);if(i&&et(n)===false){t.renderbufferStorageMultisample(t.RENDERBUFFER,u,c,n.width,n.height)}else if(et(n)){f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,c,n.width,n.height)}else{t.renderbufferStorage(t.RENDERBUFFER,c,n.width,n.height)}}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function Y(e,r){const s=r&&r.isWebGLCubeRenderTarget;if(s)throw new Error("Depth Texture with cube render targets is not supported");n.bindFramebuffer(t.FRAMEBUFFER,e);if(!(r.depthTexture&&r.depthTexture.isDepthTexture)){throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture")}if(!i.get(r.depthTexture).__webglTexture||r.depthTexture.image.width!==r.width||r.depthTexture.image.height!==r.height){r.depthTexture.image.width=r.width;r.depthTexture.image.height=r.height;r.depthTexture.needsUpdate=true}N(r.depthTexture,0);const a=i.get(r.depthTexture).__webglTexture;const o=tt(r);if(r.depthTexture.format===Rt){if(et(r)){f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0,o)}else{t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0)}}else if(r.depthTexture.format===qt){if(et(r)){f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0,o)}else{t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0)}}else{throw new Error("Unknown depthTexture format")}}function J(e){const r=i.get(e);const s=e.isWebGLCubeRenderTarget===true;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");Y(r.__webglFramebuffer,e)}else{if(s){r.__webglDepthbuffer=[];for(let i=0;i<6;i++){n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[i]);r.__webglDepthbuffer[i]=t.createRenderbuffer();j(r.__webglDepthbuffer[i],e,false)}}else{n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer);r.__webglDepthbuffer=t.createRenderbuffer();j(r.__webglDepthbuffer,e,false)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function Z(e,n,r){const s=i.get(e);if(n!==undefined){X(s.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D)}if(r!==undefined){J(e)}}function K(e){const l=e.texture;const c=i.get(e);const u=i.get(l);e.addEventListener("dispose",R);if(e.isWebGLMultipleRenderTargets!==true){if(u.__webglTexture===undefined){u.__webglTexture=t.createTexture()}u.__version=l.version;a.memory.textures++}const h=e.isWebGLCubeRenderTarget===true;const f=e.isWebGLMultipleRenderTargets===true;const d=M(e)||o;if(h){c.__webglFramebuffer=[];for(let e=0;e<6;e++){c.__webglFramebuffer[e]=t.createFramebuffer()}}else{c.__webglFramebuffer=t.createFramebuffer();if(f){if(r.drawBuffers){const n=e.texture;for(let e=0,r=n.length;e<r;e++){const r=i.get(n[e]);if(r.__webglTexture===undefined){r.__webglTexture=t.createTexture();a.memory.textures++}}}else{console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.")}}if(o&&e.samples>0&&et(e)===false){const i=f?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer();c.__webglColorRenderbuffer=[];n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n<i.length;n++){const r=i[n];c.__webglColorRenderbuffer[n]=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,c.__webglColorRenderbuffer[n]);const a=s.convert(r.format,r.colorSpace);const o=s.convert(r.type);const l=T(r.internalFormat,a,o,r.colorSpace,e.isXRRenderTarget===true);const u=tt(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,u,l,e.width,e.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,c.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null);if(e.depthBuffer){c.__webglDepthRenderbuffer=t.createRenderbuffer();j(c.__webglDepthRenderbuffer,e,true)}n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(h){n.bindTexture(t.TEXTURE_CUBE_MAP,u.__webglTexture);G(t.TEXTURE_CUBE_MAP,l,d);for(let n=0;n<6;n++){X(c.__webglFramebuffer[n],e,l,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n)}if(S(l,d)){E(t.TEXTURE_CUBE_MAP)}n.unbindTexture()}else if(f){const r=e.texture;for(let s=0,a=r.length;s<a;s++){const a=r[s];const o=i.get(a);n.bindTexture(t.TEXTURE_2D,o.__webglTexture);G(t.TEXTURE_2D,a,d);X(c.__webglFramebuffer,e,a,t.COLOR_ATTACHMENT0+s,t.TEXTURE_2D);if(S(a,d)){E(t.TEXTURE_2D)}}n.unbindTexture()}else{let i=t.TEXTURE_2D;if(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget){if(o){i=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY}else{console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")}}n.bindTexture(i,u.__webglTexture);G(i,l,d);X(c.__webglFramebuffer,e,l,t.COLOR_ATTACHMENT0,i);if(S(l,d)){E(i)}n.unbindTexture()}if(e.depthBuffer){J(e)}}function Q(e){const r=M(e)||o;const s=e.isWebGLMultipleRenderTargets===true?e.texture:[e.texture];for(let a=0,o=s.length;a<o;a++){const o=s[a];if(S(o,r)){const r=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D;const s=i.get(o).__webglTexture;n.bindTexture(r,s);E(r);n.unbindTexture()}}}function $(e){if(o&&e.samples>0&&et(e)===false){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture];const s=e.width;const a=e.height;let o=t.COLOR_BUFFER_BIT;const l=[];const c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;const u=i.get(e);const h=e.isWebGLMultipleRenderTargets===true;if(h){for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null);n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer);t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0)}}n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<r.length;n++){l.push(t.COLOR_ATTACHMENT0+n);if(e.depthBuffer){l.push(c)}const f=u.__ignoreDepthValues!==undefined?u.__ignoreDepthValues:false;if(f===false){if(e.depthBuffer)o|=t.DEPTH_BUFFER_BIT;if(e.stencilBuffer)o|=t.STENCIL_BUFFER_BIT}if(h){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n])}if(f===true){t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]);t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])}if(h){const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,s,a,0,0,s,a,o,t.NEAREST);if(d){t.invalidateFramebuffer(t.READ_FRAMEBUFFER,l)}}n.bindFramebuffer(t.READ_FRAMEBUFFER,null);n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null);if(h){for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const s=i.get(r[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer);t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,s,0)}}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}}function tt(t){return Math.min(h,t.samples)}function et(t){const n=i.get(t);return o&&t.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===true&&n.__useRenderToTexture!==false}function nt(t){const e=a.render.frame;if(p.get(t)!==e){p.set(t,e);t.update()}}function it(t,n){const i=t.colorSpace;const r=t.format;const s=t.type;if(t.isCompressedTexture===true||t.format===be)return n;if(i!==ve&&i!==_e){if(i===xe){if(o===false){if(e.has("EXT_sRGB")===true&&r===bt){t.format=be;t.minFilter=ut;t.generateMipmaps=false}else{n=en.sRGBToLinear(n)}}else{if(r!==bt||s!==dt){console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.")}}}else{console.error("THREE.WebGLTextures: Unsupported texture color space:",i)}}return n}this.allocateTextureUnit=D;this.resetTextureUnits=U;this.setTexture2D=N;this.setTexture2DArray=O;this.setTexture3D=F;this.setTextureCube=z;this.rebindTextures=Z;this.setupRenderTarget=K;this.updateRenderTargetMipmap=Q;this.updateMultisampleRenderTarget=$;this.setupDepthRenderbuffer=J;this.setupFrameBufferTexture=X;this.useMultisampledRTT=et}function eu(t,e,n){const i=n.isWebGL2;function r(n,r=_e){let s;if(n===dt)return t.UNSIGNED_BYTE;if(n===yt)return t.UNSIGNED_SHORT_4_4_4_4;if(n===St)return t.UNSIGNED_SHORT_5_5_5_1;if(n===pt)return t.BYTE;if(n===mt)return t.SHORT;if(n===gt)return t.UNSIGNED_SHORT;if(n===_t)return t.INT;if(n===xt)return t.UNSIGNED_INT;if(n===vt)return t.FLOAT;if(n===Mt){if(i)return t.HALF_FLOAT;s=e.get("OES_texture_half_float");if(s!==null){return s.HALF_FLOAT_OES}else{return null}}if(n===Tt)return t.ALPHA;if(n===bt)return t.RGBA;if(n===wt)return t.LUMINANCE;if(n===At)return t.LUMINANCE_ALPHA;if(n===Rt)return t.DEPTH_COMPONENT;if(n===qt)return t.DEPTH_STENCIL;if(n===be){s=e.get("EXT_sRGB");if(s!==null){return s.SRGB_ALPHA_EXT}else{return null}}if(n===Ct)return t.RED;if(n===Lt)return t.RED_INTEGER;if(n===Pt)return t.RG;if(n===Ut)return t.RG_INTEGER;if(n===Dt)return t.RGBA_INTEGER;if(n===It||n===Nt||n===Ot||n===Ft){if(r===xe){s=e.get("WEBGL_compressed_texture_s3tc_srgb");if(s!==null){if(n===It)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Nt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Ot)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ft)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{return null}}else{s=e.get("WEBGL_compressed_texture_s3tc");if(s!==null){if(n===It)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Nt)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Ot)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ft)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else{return null}}}if(n===zt||n===Bt||n===Ht||n===Gt){s=e.get("WEBGL_compressed_texture_pvrtc");if(s!==null){if(n===zt)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Bt)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ht)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Gt)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else{return null}}if(n===Vt){s=e.get("WEBGL_compressed_texture_etc1");if(s!==null){return s.COMPRESSED_RGB_ETC1_WEBGL}else{return null}}if(n===kt||n===Wt){s=e.get("WEBGL_compressed_texture_etc");if(s!==null){if(n===kt)return r===xe?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Wt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else{return null}}if(n===Xt||n===jt||n===Yt||n===Jt||n===Zt||n===Kt||n===Qt||n===$t||n===te||n===ee||n===ne||n===ie||n===re||n===se){s=e.get("WEBGL_compressed_texture_astc");if(s!==null){if(n===Xt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===jt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Yt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Jt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Zt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Kt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Qt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===$t)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===te)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ee)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ne)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ie)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===re)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===se)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else{return null}}if(n===ae){s=e.get("EXT_texture_compression_bptc");if(s!==null){if(n===ae)return r===xe?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else{return null}}if(n===oe||n===le||n===ce||n===ue){s=e.get("EXT_texture_compression_rgtc");if(s!==null){if(n===ae)return s.COMPRESSED_RED_RGTC1_EXT;if(n===le)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ce)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===ue)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else{return null}}if(n===Et){if(i)return t.UNSIGNED_INT_24_8;s=e.get("WEBGL_depth_texture");if(s!==null){return s.UNSIGNED_INT_24_8_WEBGL}else{return null}}return t[n]!==undefined?t[n]:null}return{convert:r}}class nu extends br{constructor(t=[]){super();this.isArrayCamera=true;this.cameras=t}}class iu extends di{constructor(){super();this.isGroup=true;this.type="Group"}}const ru={type:"move"};class su{constructor(){this._targetRay=null;this._grip=null;this._hand=null}getHandSpace(){if(this._hand===null){this._hand=new iu;this._hand.matrixAutoUpdate=false;this._hand.visible=false;this._hand.joints={};this._hand.inputState={pinching:false}}return this._hand}getTargetRaySpace(){if(this._targetRay===null){this._targetRay=new iu;this._targetRay.matrixAutoUpdate=false;this._targetRay.visible=false;this._targetRay.hasLinearVelocity=false;this._targetRay.linearVelocity=new fn;this._targetRay.hasAngularVelocity=false;this._targetRay.angularVelocity=new fn}return this._targetRay}getGripSpace(){if(this._grip===null){this._grip=new iu;this._grip.matrixAutoUpdate=false;this._grip.visible=false;this._grip.hasLinearVelocity=false;this._grip.linearVelocity=new fn;this._grip.hasAngularVelocity=false;this._grip.angularVelocity=new fn}return this._grip}dispatchEvent(t){if(this._targetRay!==null){this._targetRay.dispatchEvent(t)}if(this._grip!==null){this._grip.dispatchEvent(t)}if(this._hand!==null){this._hand.dispatchEvent(t)}return this}connect(t){if(t&&t.hand){const e=this._hand;if(e){for(const n of t.hand.values()){this._getHandJoint(e,n)}}}this.dispatchEvent({type:"connected",data:t});return this}disconnect(t){this.dispatchEvent({type:"disconnected",data:t});if(this._targetRay!==null){this._targetRay.visible=false}if(this._grip!==null){this._grip.visible=false}if(this._hand!==null){this._hand.visible=false}return this}update(t,e,n){let i=null;let r=null;let s=null;const a=this._targetRay;const o=this._grip;const l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){s=true;for(const i of t.hand.values()){const t=e.getJointPose(i,n);const r=this._getHandJoint(l,i);if(t!==null){r.matrix.fromArray(t.transform.matrix);r.matrix.decompose(r.position,r.rotation,r.scale);r.matrixWorldNeedsUpdate=true;r.jointRadius=t.radius}r.visible=t!==null}const i=l.joints["index-finger-tip"];const r=l.joints["thumb-tip"];const a=i.position.distanceTo(r.position);const o=.02;const c=.005;if(l.inputState.pinching&&a>o+c){l.inputState.pinching=false;this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})}else if(!l.inputState.pinching&&a<=o-c){l.inputState.pinching=true;this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this})}}else{if(o!==null&&t.gripSpace){r=e.getPose(t.gripSpace,n);if(r!==null){o.matrix.fromArray(r.transform.matrix);o.matrix.decompose(o.position,o.rotation,o.scale);o.matrixWorldNeedsUpdate=true;if(r.linearVelocity){o.hasLinearVelocity=true;o.linearVelocity.copy(r.linearVelocity)}else{o.hasLinearVelocity=false}if(r.angularVelocity){o.hasAngularVelocity=true;o.angularVelocity.copy(r.angularVelocity)}else{o.hasAngularVelocity=false}}}}if(a!==null){i=e.getPose(t.targetRaySpace,n);if(i===null&&r!==null){i=r}if(i!==null){a.matrix.fromArray(i.transform.matrix);a.matrix.decompose(a.position,a.rotation,a.scale);a.matrixWorldNeedsUpdate=true;if(i.linearVelocity){a.hasLinearVelocity=true;a.linearVelocity.copy(i.linearVelocity)}else{a.hasLinearVelocity=false}if(i.angularVelocity){a.hasAngularVelocity=true;a.angularVelocity.copy(i.angularVelocity)}else{a.hasAngularVelocity=false}this.dispatchEvent(ru)}}}if(a!==null){a.visible=i!==null}if(o!==null){o.visible=r!==null}if(l!==null){l.visible=s!==null}return this}_getHandJoint(t,e){if(t.joints[e.jointName]===undefined){const n=new iu;n.matrixAutoUpdate=false;n.visible=false;t.joints[e.jointName]=n;t.add(n)}return t.joints[e.jointName]}}class au extends an{constructor(t,e,n,i,r,s,a,o,l,c){c=c!==undefined?c:Rt;if(c!==Rt&&c!==qt){throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat")}if(n===undefined&&c===Rt)n=xt;if(n===undefined&&c===qt)n=Et;super(null,i,r,s,a,o,c,n,l);this.isDepthTexture=true;this.image={width:t,height:e};this.magFilter=a!==undefined?a:ot;this.minFilter=o!==undefined?o:ot;this.flipY=false;this.generateMipmaps=false}}class ou extends we{constructor(t,e){super();const n=this;let i=null;let r=1;let s=null;let a="local-floor";let o=1;let l=null;let c=null;let u=null;let h=null;let f=null;let d=null;const p=e.getContextAttributes();let m=null;let g=null;const _=[];const x=[];const v=new Set;const M=new Map;const y=new br;y.layers.enable(1);y.viewport=new on;const S=new br;S.layers.enable(2);S.viewport=new on;const E=[y,S];const T=new nu;T.layers.enable(1);T.layers.enable(2);let b=null;let w=null;this.cameraAutoUpdate=true;this.enabled=false;this.isPresenting=false;this.getController=function(t){let e=_[t];if(e===undefined){e=new su;_[t]=e}return e.getTargetRaySpace()};this.getControllerGrip=function(t){let e=_[t];if(e===undefined){e=new su;_[t]=e}return e.getGripSpace()};this.getHand=function(t){let e=_[t];if(e===undefined){e=new su;_[t]=e}return e.getHandSpace()};function A(t){const e=x.indexOf(t.inputSource);if(e===-1){return}const n=_[e];if(n!==undefined){n.update(t.inputSource,t.frame,l||s);n.dispatchEvent({type:t.type,data:t.inputSource})}}function R(){i.removeEventListener("select",A);i.removeEventListener("selectstart",A);i.removeEventListener("selectend",A);i.removeEventListener("squeeze",A);i.removeEventListener("squeezestart",A);i.removeEventListener("squeezeend",A);i.removeEventListener("end",R);i.removeEventListener("inputsourceschange",q);for(let t=0;t<_.length;t++){const e=x[t];if(e===null)continue;x[t]=null;_[t].disconnect(e)}b=null;w=null;t.setRenderTarget(m);f=null;h=null;u=null;i=null;g=null;O.stop();n.isPresenting=false;n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(t){r=t;if(n.isPresenting===true){console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")}};this.setReferenceSpaceType=function(t){a=t;if(n.isPresenting===true){console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")}};this.getReferenceSpace=function(){return l||s};this.setReferenceSpace=function(t){l=t};this.getBaseLayer=function(){return h!==null?h:f};this.getBinding=function(){return u};this.getFrame=function(){return d};this.getSession=function(){return i};this.setSession=async function(c){i=c;if(i!==null){m=t.getRenderTarget();i.addEventListener("select",A);i.addEventListener("selectstart",A);i.addEventListener("selectend",A);i.addEventListener("squeeze",A);i.addEventListener("squeezestart",A);i.addEventListener("squeezeend",A);i.addEventListener("end",R);i.addEventListener("inputsourceschange",q);if(p.xrCompatible!==true){await e.makeXRCompatible()}if(i.renderState.layers===undefined||t.capabilities.isWebGL2===false){const n={antialias:i.renderState.layers===undefined?p.antialias:true,alpha:true,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(i,e,n);i.updateRenderState({baseLayer:f});g=new ln(f.framebufferWidth,f.framebufferHeight,{format:bt,type:dt,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let n=null;let s=null;let a=null;if(p.depth){a=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24;n=p.stencil?qt:Rt;s=p.stencil?Et:xt}const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};u=new XRWebGLBinding(i,e);h=u.createProjectionLayer(o);i.updateRenderState({layers:[h]});g=new ln(h.textureWidth,h.textureHeight,{format:bt,type:dt,depthTexture:new au(h.textureWidth,h.textureHeight,s,undefined,undefined,undefined,undefined,undefined,undefined,n),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0});const l=t.properties.get(g);l.__ignoreDepthValues=h.ignoreDepthValues}g.isXRRenderTarget=true;this.setFoveation(o);l=null;s=await i.requestReferenceSpace(a);O.setContext(i);O.start();n.isPresenting=true;n.dispatchEvent({type:"sessionstart"})}};this.getEnvironmentBlendMode=function(){if(i!==null){return i.environmentBlendMode}};function q(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e];const i=x.indexOf(n);if(i>=0){x[i]=null;_[i].disconnect(n)}}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=x.indexOf(n);if(i===-1){for(let t=0;t<_.length;t++){if(t>=x.length){x.push(n);i=t;break}else if(x[t]===null){x[t]=n;i=t;break}}if(i===-1)break}const r=_[i];if(r){r.connect(n)}}}const C=new fn;const L=new fn;function P(t,e,n){C.setFromMatrixPosition(e.matrixWorld);L.setFromMatrixPosition(n.matrixWorld);const i=C.distanceTo(L);const r=e.projectionMatrix.elements;const s=n.projectionMatrix.elements;const a=r[14]/(r[10]-1);const o=r[14]/(r[10]+1);const l=(r[9]+1)/r[5];const c=(r[9]-1)/r[5];const u=(r[8]-1)/r[0];const h=(s[8]+1)/s[0];const f=a*u;const d=a*h;const p=i/(-u+h);const m=p*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale);t.translateX(m);t.translateZ(p);t.matrixWorld.compose(t.position,t.quaternion,t.scale);t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=a+p;const _=o+p;const x=f-m;const v=d+(i-m);const M=l*o/_*g;const y=c*o/_*g;t.projectionMatrix.makePerspective(x,v,M,y,g,_);t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}function U(t,e){if(e===null){t.matrixWorld.copy(t.matrix)}else{t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix)}t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(i===null)return;T.near=S.near=y.near=t.near;T.far=S.far=y.far=t.far;if(b!==T.near||w!==T.far){i.updateRenderState({depthNear:T.near,depthFar:T.far});b=T.near;w=T.far}const e=t.parent;const n=T.cameras;U(T,e);for(let t=0;t<n.length;t++){U(n[t],e)}if(n.length===2){P(T,y,S)}else{T.projectionMatrix.copy(y.projectionMatrix)}D(t,T,e)};function D(t,e,n){if(n===null){t.matrix.copy(e.matrixWorld)}else{t.matrix.copy(n.matrixWorld);t.matrix.invert();t.matrix.multiply(e.matrixWorld)}t.matrix.decompose(t.position,t.quaternion,t.scale);t.updateMatrixWorld(true);const i=t.children;for(let t=0,e=i.length;t<e;t++){i[t].updateMatrixWorld(true)}t.projectionMatrix.copy(e.projectionMatrix);t.projectionMatrixInverse.copy(e.projectionMatrixInverse);if(t.isPerspectiveCamera){t.fov=qe*2*Math.atan(1/t.projectionMatrix.elements[5]);t.zoom=1}}this.getCamera=function(){return T};this.getFoveation=function(){if(h===null&&f===null){return undefined}return o};this.setFoveation=function(t){o=t;if(h!==null){h.fixedFoveation=t}if(f!==null&&f.fixedFoveation!==undefined){f.fixedFoveation=t}};this.getPlanes=function(){return v};let I=null;function N(e,i){c=i.getViewerPose(l||s);d=i;if(c!==null){const e=c.views;if(f!==null){t.setRenderTargetFramebuffer(g,f.framebuffer);t.setRenderTarget(g)}let n=false;if(e.length!==T.cameras.length){T.cameras.length=0;n=true}for(let i=0;i<e.length;i++){const r=e[i];let s=null;if(f!==null){s=f.getViewport(r)}else{const e=u.getViewSubImage(h,r);s=e.viewport;if(i===0){t.setRenderTargetTextures(g,e.colorTexture,h.ignoreDepthValues?undefined:e.depthStencilTexture);t.setRenderTarget(g)}}let a=E[i];if(a===undefined){a=new br;a.layers.enable(i);a.viewport=new on;E[i]=a}a.matrix.fromArray(r.transform.matrix);a.matrix.decompose(a.position,a.quaternion,a.scale);a.projectionMatrix.fromArray(r.projectionMatrix);a.projectionMatrixInverse.copy(a.projectionMatrix).invert();a.viewport.set(s.x,s.y,s.width,s.height);if(i===0){T.matrix.copy(a.matrix);T.matrix.decompose(T.position,T.quaternion,T.scale)}if(n===true){T.cameras.push(a)}}}for(let t=0;t<_.length;t++){const e=x[t];const n=_[t];if(e!==null&&n!==undefined){n.update(e,i,l||s)}}if(I)I(e,i);if(i.detectedPlanes){n.dispatchEvent({type:"planesdetected",data:i.detectedPlanes});let t=null;for(const e of v){if(!i.detectedPlanes.has(e)){if(t===null){t=[]}t.push(e)}}if(t!==null){for(const e of t){v.delete(e);M.delete(e);n.dispatchEvent({type:"planeremoved",data:e})}}for(const t of i.detectedPlanes){if(!v.has(t)){v.add(t);M.set(t,i.lastChangedTime);n.dispatchEvent({type:"planeadded",data:t})}else{const e=M.get(t);if(t.lastChangedTime>e){M.set(t,t.lastChangedTime);n.dispatchEvent({type:"planechanged",data:t})}}}}d=null}const O=new Fr;O.setAnimationLoop(N);this.setAnimationLoop=function(t){I=t};this.dispose=function(){}}}function lu(t,e){function n(t,e){if(t.matrixAutoUpdate===true){t.updateMatrix()}e.value.copy(t.matrix)}function i(e,n){n.color.getRGB(e.fogColor.value,vr(t));if(n.isFog){e.fogNear.value=n.near;e.fogFar.value=n.far}else if(n.isFogExp2){e.fogDensity.value=n.density}}function r(t,e,n,i,r){if(e.isMeshBasicMaterial){s(t,e)}else if(e.isMeshLambertMaterial){s(t,e)}else if(e.isMeshToonMaterial){s(t,e);f(t,e)}else if(e.isMeshPhongMaterial){s(t,e);u(t,e)}else if(e.isMeshStandardMaterial){s(t,e);d(t,e);if(e.isMeshPhysicalMaterial){p(t,e,r)}}else if(e.isMeshMatcapMaterial){s(t,e);m(t,e)}else if(e.isMeshDepthMaterial){s(t,e)}else if(e.isMeshDistanceMaterial){s(t,e);g(t,e)}else if(e.isMeshNormalMaterial){s(t,e)}else if(e.isLineBasicMaterial){a(t,e);if(e.isLineDashedMaterial){o(t,e)}}else if(e.isPointsMaterial){l(t,e,n,i)}else if(e.isSpriteMaterial){c(t,e)}else if(e.isShadowMaterial){t.color.value.copy(e.color);t.opacity.value=e.opacity}else if(e.isShaderMaterial){e.uniformsNeedUpdate=false}}function s(i,r){i.opacity.value=r.opacity;if(r.color){i.diffuse.value.copy(r.color)}if(r.emissive){i.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity)}if(r.map){i.map.value=r.map;n(r.map,i.mapTransform)}if(r.alphaMap){i.alphaMap.value=r.alphaMap;n(r.alphaMap,i.alphaMapTransform)}if(r.bumpMap){i.bumpMap.value=r.bumpMap;n(r.bumpMap,i.bumpMapTransform);i.bumpScale.value=r.bumpScale;if(r.side===h){i.bumpScale.value*=-1}}if(r.normalMap){i.normalMap.value=r.normalMap;n(r.normalMap,i.normalMapTransform);i.normalScale.value.copy(r.normalScale);if(r.side===h){i.normalScale.value.negate()}}if(r.displacementMap){i.displacementMap.value=r.displacementMap;n(r.displacementMap,i.displacementMapTransform);i.displacementScale.value=r.displacementScale;i.displacementBias.value=r.displacementBias}if(r.emissiveMap){i.emissiveMap.value=r.emissiveMap;n(r.emissiveMap,i.emissiveMapTransform)}if(r.specularMap){i.specularMap.value=r.specularMap;n(r.specularMap,i.specularMapTransform)}if(r.alphaTest>0){i.alphaTest.value=r.alphaTest}const s=e.get(r).envMap;if(s){i.envMap.value=s;i.flipEnvMap.value=s.isCubeTexture&&s.isRenderTargetTexture===false?-1:1;i.reflectivity.value=r.reflectivity;i.ior.value=r.ior;i.refractionRatio.value=r.refractionRatio}if(r.lightMap){i.lightMap.value=r.lightMap;const e=t.useLegacyLights===true?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e;n(r.lightMap,i.lightMapTransform)}if(r.aoMap){i.aoMap.value=r.aoMap;i.aoMapIntensity.value=r.aoMapIntensity;n(r.aoMap,i.aoMapTransform)}}function a(t,e){t.diffuse.value.copy(e.color);t.opacity.value=e.opacity;if(e.map){t.map.value=e.map;n(e.map,t.mapTransform)}}function o(t,e){t.dashSize.value=e.dashSize;t.totalSize.value=e.dashSize+e.gapSize;t.scale.value=e.scale}function l(t,e,i,r){t.diffuse.value.copy(e.color);t.opacity.value=e.opacity;t.size.value=e.size*i;t.scale.value=r*.5;if(e.map){t.map.value=e.map;n(e.map,t.uvTransform)}if(e.alphaMap){t.alphaMap.value=e.alphaMap}if(e.alphaTest>0){t.alphaTest.value=e.alphaTest}}function c(t,e){t.diffuse.value.copy(e.color);t.opacity.value=e.opacity;t.rotation.value=e.rotation;if(e.map){t.map.value=e.map;n(e.map,t.mapTransform)}if(e.alphaMap){t.alphaMap.value=e.alphaMap}if(e.alphaTest>0){t.alphaTest.value=e.alphaTest}}function u(t,e){t.specular.value.copy(e.specular);t.shininess.value=Math.max(e.shininess,1e-4)}function f(t,e){if(e.gradientMap){t.gradientMap.value=e.gradientMap}}function d(t,i){t.metalness.value=i.metalness;if(i.metalnessMap){t.metalnessMap.value=i.metalnessMap;n(i.metalnessMap,t.metalnessMapTransform)}t.roughness.value=i.roughness;if(i.roughnessMap){t.roughnessMap.value=i.roughnessMap;n(i.roughnessMap,t.roughnessMapTransform)}const r=e.get(i).envMap;if(r){t.envMapIntensity.value=i.envMapIntensity}}function p(t,e,i){t.ior.value=e.ior;if(e.sheen>0){t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen);t.sheenRoughness.value=e.sheenRoughness;if(e.sheenColorMap){t.sheenColorMap.value=e.sheenColorMap;n(e.sheenColorMap,t.sheenColorMapTransform)}if(e.sheenRoughnessMap){t.sheenRoughnessMap.value=e.sheenRoughnessMap;n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)}}if(e.clearcoat>0){t.clearcoat.value=e.clearcoat;t.clearcoatRoughness.value=e.clearcoatRoughness;if(e.clearcoatMap){t.clearcoatMap.value=e.clearcoatMap;n(e.clearcoatMap,t.clearcoatMapTransform)}if(e.clearcoatRoughnessMap){t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap;n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)}if(e.clearcoatNormalMap){t.clearcoatNormalMap.value=e.clearcoatNormalMap;n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform);t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale);if(e.side===h){t.clearcoatNormalScale.value.negate()}}}if(e.iridescence>0){t.iridescence.value=e.iridescence;t.iridescenceIOR.value=e.iridescenceIOR;t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0];t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1];if(e.iridescenceMap){t.iridescenceMap.value=e.iridescenceMap;n(e.iridescenceMap,t.iridescenceMapTransform)}if(e.iridescenceThicknessMap){t.iridescenceThicknessMap.value=e.iridescenceThicknessMap;n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)}}if(e.transmission>0){t.transmission.value=e.transmission;t.transmissionSamplerMap.value=i.texture;t.transmissionSamplerSize.value.set(i.width,i.height);if(e.transmissionMap){t.transmissionMap.value=e.transmissionMap;n(e.transmissionMap,t.transmissionMapTransform)}t.thickness.value=e.thickness;if(e.thicknessMap){t.thicknessMap.value=e.thicknessMap;n(e.thicknessMap,t.thicknessMapTransform)}t.attenuationDistance.value=e.attenuationDistance;t.attenuationColor.value.copy(e.attenuationColor)}t.specularIntensity.value=e.specularIntensity;t.specularColor.value.copy(e.specularColor);if(e.specularColorMap){t.specularColorMap.value=e.specularColorMap;n(e.specularColorMap,t.specularColorMapTransform)}if(e.specularIntensityMap){t.specularIntensityMap.value=e.specularIntensityMap;n(e.specularIntensityMap,t.specularIntensityMapTransform)}}function m(t,e){if(e.matcap){t.matcap.value=e.matcap}}function g(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld);t.nearDistance.value=i.shadow.camera.near;t.farDistance.value=i.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function cu(t,e,n,i){let r={};let s={};let a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e){const n=e.program;i.uniformBlockBinding(t,n)}function c(t,n){let a=r[t.id];if(a===undefined){p(t);a=u(t);r[t.id]=a;t.addEventListener("dispose",g)}const o=n.program;i.updateUBOMapping(t,o);const l=e.render.frame;if(s[t.id]!==l){f(t);s[t.id]=l}}function u(e){const n=h();e.__bindingPointIndex=n;const i=t.createBuffer();const r=e.__size;const s=e.usage;t.bindBuffer(t.UNIFORM_BUFFER,i);t.bufferData(t.UNIFORM_BUFFER,r,s);t.bindBuffer(t.UNIFORM_BUFFER,null);t.bindBufferBase(t.UNIFORM_BUFFER,n,i);return i}function h(){for(let t=0;t<o;t++){if(a.indexOf(t)===-1){a.push(t);return t}}console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.");return 0}function f(e){const n=r[e.id];const i=e.uniforms;const s=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=i.length;e<n;e++){const n=i[e];if(d(n,e,s)===true){const e=n.__offset;const i=Array.isArray(n.value)?n.value:[n.value];let r=0;for(let s=0;s<i.length;s++){const a=i[s];const o=m(a);if(typeof a==="number"){n.__data[0]=a;t.bufferSubData(t.UNIFORM_BUFFER,e+r,n.__data)}else if(a.isMatrix3){n.__data[0]=a.elements[0];n.__data[1]=a.elements[1];n.__data[2]=a.elements[2];n.__data[3]=a.elements[0];n.__data[4]=a.elements[3];n.__data[5]=a.elements[4];n.__data[6]=a.elements[5];n.__data[7]=a.elements[0];n.__data[8]=a.elements[6];n.__data[9]=a.elements[7];n.__data[10]=a.elements[8];n.__data[11]=a.elements[0]}else{a.toArray(n.__data,r);r+=o.storage/Float32Array.BYTES_PER_ELEMENT}}t.bufferSubData(t.UNIFORM_BUFFER,e,n.__data)}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function d(t,e,n){const i=t.value;if(n[e]===undefined){if(typeof i==="number"){n[e]=i}else{const t=Array.isArray(i)?i:[i];const r=[];for(let e=0;e<t.length;e++){r.push(t[e].clone())}n[e]=r}return true}else{if(typeof i==="number"){if(n[e]!==i){n[e]=i;return true}}else{const t=Array.isArray(n[e])?n[e]:[n[e]];const r=Array.isArray(i)?i:[i];for(let e=0;e<t.length;e++){const n=t[e];if(n.equals(r[e])===false){n.copy(r[e]);return true}}}}return false}function p(t){const e=t.uniforms;let n=0;const i=16;let r=0;for(let t=0,s=e.length;t<s;t++){const s=e[t];const a={boundary:0,storage:0};const o=Array.isArray(s.value)?s.value:[s.value];for(let t=0,e=o.length;t<e;t++){const e=o[t];const n=m(e);a.boundary+=n.boundary;a.storage+=n.storage}s.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT);s.__offset=n;if(t>0){r=n%i;const t=i-r;if(r!==0&&t-a.boundary<0){n+=i-r;s.__offset=n}}n+=a.storage}r=n%i;if(r>0)n+=i-r;t.__size=n;t.__cache={};return this}function m(t){const e={boundary:0,storage:0};if(typeof t==="number"){e.boundary=4;e.storage=4}else if(t.isVector2){e.boundary=8;e.storage=8}else if(t.isVector3||t.isColor){e.boundary=16;e.storage=12}else if(t.isVector4){e.boundary=16;e.storage=16}else if(t.isMatrix3){e.boundary=48;e.storage=48}else if(t.isMatrix4){e.boundary=64;e.storage=64}else if(t.isTexture){console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.")}else{console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t)}return e}function g(e){const n=e.target;n.removeEventListener("dispose",g);const i=a.indexOf(n.__bindingPointIndex);a.splice(i,1);t.deleteBuffer(r[n.id]);delete r[n.id];delete s[n.id]}function _(){for(const e in r){t.deleteBuffer(r[e])}a=[];r={};s={}}return{bind:l,update:c,dispose:_}}function uu(){const t=Ge("canvas");t.style.display="block";return t}class hu{constructor(t={}){const{canvas:n=uu(),context:i=null,depth:r=true,stencil:s=true,alpha:a=false,antialias:o=false,premultipliedAlpha:l=true,preserveDrawingBuffer:c=false,powerPreference:d="default",failIfMajorPerformanceCaveat:p=false}=t;this.isWebGLRenderer=true;let m;if(i!==null){m=i.getContextAttributes().alpha}else{m=a}let g=null;let _=null;const x=[];const v=[];this.domElement=n;this.debug={checkShaderErrors:true,onShaderError:null};this.autoClear=true;this.autoClearColor=true;this.autoClearDepth=true;this.autoClearStencil=true;this.sortObjects=true;this.clippingPlanes=[];this.localClippingEnabled=false;this.outputColorSpace=xe;this.useLegacyLights=true;this.toneMapping=X;this.toneMappingExposure=1;const M=this;let y=false;let S=0;let E=0;let T=null;let b=-1;let w=null;const A=new on;const R=new on;let q=null;let C=n.width;let L=n.height;let P=1;let U=null;let D=null;const I=new on(0,0,C,L);const N=new on(0,0,C,L);let O=false;const F=new Or;let z=false;let B=false;let H=null;const G=new Gn;const V=new fn;const k={background:null,fog:null,environment:null,overrideMaterial:null,isScene:true};function W(){return T===null?P:1}let j=i;function Y(t,e){for(let i=0;i<t.length;i++){const r=t[i];const s=n.getContext(r,e);if(s!==null)return s}return null}try{const t={alpha:true,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:d,failIfMajorPerformanceCaveat:p};if("setAttribute"in n)n.setAttribute("data-engine",`three.js r${e}`);n.addEventListener("webglcontextlost",wt,false);n.addEventListener("webglcontextrestored",At,false);n.addEventListener("webglcontextcreationerror",Rt,false);if(j===null){const e=["webgl2","webgl","experimental-webgl"];if(M.isWebGL1Renderer===true){e.shift()}j=Y(e,t);if(j===null){if(Y(e)){throw new Error("Error creating WebGL context with your selected attributes.")}else{throw new Error("Error creating WebGL context.")}}}if(j.getShaderPrecisionFormat===undefined){j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}}}catch(t){console.error("THREE.WebGLRenderer: "+t.message);throw t}let J,Z,K,Q;let $,tt,et,nt,it,rt,st;let at,ot,lt,ct,ut,ht;let pt,mt,gt,_t;let xt,yt,St;function Et(){J=new Xo(j);Z=new To(j,J,t);J.init(Z);xt=new eu(j,J,Z);K=new $c(j,J,Z);Q=new Jo(j);$=new Nc;tt=new tu(j,J,K,$,Z,xt,Q);et=new wo(M);nt=new Wo(M);it=new zr(j,Z);yt=new So(j,J,it,Z);rt=new jo(j,it,Q,yt);st=new $o(j,rt,it,Q);mt=new Qo(j,Z,tt);ut=new bo($);at=new Ic(M,et,nt,J,Z,yt,ut);ot=new lu(M,$);lt=new Bc;ct=new jc(J,Z);pt=new yo(M,et,nt,K,st,m,l);ht=new Qc(M,st,Z);St=new cu(j,Q,Z,K);gt=new Eo(j,J,Q,Z);_t=new Yo(j,J,Q,Z);Q.programs=at.programs;M.capabilities=Z;M.extensions=J;M.properties=$;M.renderLists=lt;M.shadowMap=ht;M.state=K;M.info=Q}Et();const Tt=new ou(M,j);this.xr=Tt;this.getContext=function(){return j};this.getContextAttributes=function(){return j.getContextAttributes()};this.forceContextLoss=function(){const t=J.get("WEBGL_lose_context");if(t)t.loseContext()};this.forceContextRestore=function(){const t=J.get("WEBGL_lose_context");if(t)t.restoreContext()};this.getPixelRatio=function(){return P};this.setPixelRatio=function(t){if(t===undefined)return;P=t;this.setSize(C,L,false)};this.getSize=function(t){return t.set(C,L)};this.setSize=function(t,e,i=true){if(Tt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}C=t;L=e;n.width=Math.floor(t*P);n.height=Math.floor(e*P);if(i===true){n.style.width=t+"px";n.style.height=e+"px"}this.setViewport(0,0,t,e)};this.getDrawingBufferSize=function(t){return t.set(C*P,L*P).floor()};this.setDrawingBufferSize=function(t,e,i){C=t;L=e;P=i;n.width=Math.floor(t*i);n.height=Math.floor(e*i);this.setViewport(0,0,t,e)};this.getCurrentViewport=function(t){return t.copy(A)};this.getViewport=function(t){return t.copy(I)};this.setViewport=function(t,e,n,i){if(t.isVector4){I.set(t.x,t.y,t.z,t.w)}else{I.set(t,e,n,i)}K.viewport(A.copy(I).multiplyScalar(P).floor())};this.getScissor=function(t){return t.copy(N)};this.setScissor=function(t,e,n,i){if(t.isVector4){N.set(t.x,t.y,t.z,t.w)}else{N.set(t,e,n,i)}K.scissor(R.copy(N).multiplyScalar(P).floor())};this.getScissorTest=function(){return O};this.setScissorTest=function(t){K.setScissorTest(O=t)};this.setOpaqueSort=function(t){U=t};this.setTransparentSort=function(t){D=t};this.getClearColor=function(t){return t.copy(pt.getClearColor())};this.setClearColor=function(){pt.setClearColor.apply(pt,arguments)};this.getClearAlpha=function(){return pt.getClearAlpha()};this.setClearAlpha=function(){pt.setClearAlpha.apply(pt,arguments)};this.clear=function(t=true,e=true,n=true){let i=0;if(t)i|=j.COLOR_BUFFER_BIT;if(e)i|=j.DEPTH_BUFFER_BIT;if(n)i|=j.STENCIL_BUFFER_BIT;j.clear(i)};this.clearColor=function(){this.clear(true,false,false)};this.clearDepth=function(){this.clear(false,true,false)};this.clearStencil=function(){this.clear(false,false,true)};this.dispose=function(){n.removeEventListener("webglcontextlost",wt,false);n.removeEventListener("webglcontextrestored",At,false);n.removeEventListener("webglcontextcreationerror",Rt,false);lt.dispose();ct.dispose();$.dispose();et.dispose();nt.dispose();st.dispose();yt.dispose();St.dispose();at.dispose();Tt.dispose();Tt.removeEventListener("sessionstart",Dt);Tt.removeEventListener("sessionend",It);if(H){H.dispose();H=null}Nt.stop()};function wt(t){t.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");y=true}function At(){console.log("THREE.WebGLRenderer: Context Restored.");y=false;const t=Q.autoReset;const e=ht.enabled;const n=ht.autoUpdate;const i=ht.needsUpdate;const r=ht.type;Et();Q.autoReset=t;ht.enabled=e;ht.autoUpdate=n;ht.needsUpdate=i;ht.type=r}function Rt(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function qt(t){const e=t.target;e.removeEventListener("dispose",qt);Ct(e)}function Ct(t){Lt(t);$.remove(t)}function Lt(t){const e=$.get(t).programs;if(e!==undefined){e.forEach((function(t){at.releaseProgram(t)}));if(t.isShaderMaterial){at.releaseShaderCache(t)}}}this.renderBufferDirect=function(t,e,n,i,r,s){if(e===null)e=k;const a=r.isMesh&&r.matrixWorld.determinant()<0;const o=kt(t,e,n,i,r);K.setMaterial(i,a);let l=n.index;let c=1;if(i.wireframe===true){l=rt.getWireframeAttribute(n);c=2}const u=n.drawRange;const h=n.attributes.position;let f=u.start*c;let d=(u.start+u.count)*c;if(s!==null){f=Math.max(f,s.start*c);d=Math.min(d,(s.start+s.count)*c)}if(l!==null){f=Math.max(f,0);d=Math.min(d,l.count)}else if(h!==undefined&&h!==null){f=Math.max(f,0);d=Math.min(d,h.count)}const p=d-f;if(p<0||p===Infinity)return;yt.setup(r,i,o,n,l);let m;let g=gt;if(l!==null){m=it.get(l);g=_t;g.setIndex(m)}if(r.isMesh){if(i.wireframe===true){K.setLineWidth(i.wireframeLinewidth*W());g.setMode(j.LINES)}else{g.setMode(j.TRIANGLES)}}else if(r.isLine){let t=i.linewidth;if(t===undefined)t=1;K.setLineWidth(t*W());if(r.isLineSegments){g.setMode(j.LINES)}else if(r.isLineLoop){g.setMode(j.LINE_LOOP)}else{g.setMode(j.LINE_STRIP)}}else if(r.isPoints){g.setMode(j.POINTS)}else if(r.isSprite){g.setMode(j.TRIANGLES)}if(r.isInstancedMesh){g.renderInstances(f,p,r.count)}else if(n.isInstancedBufferGeometry){const t=n._maxInstanceCount!==undefined?n._maxInstanceCount:Infinity;const e=Math.min(n.instanceCount,t);g.renderInstances(f,p,e)}else{g.render(f,p)}};this.compile=function(t,e){function n(t,e,n){if(t.transparent===true&&t.side===f&&t.forceSinglePass===false){t.side=h;t.needsUpdate=true;Gt(t,e,n);t.side=u;t.needsUpdate=true;Gt(t,e,n);t.side=f}else{Gt(t,e,n)}}_=ct.get(t);_.init();v.push(_);t.traverseVisible((function(t){if(t.isLight&&t.layers.test(e.layers)){_.pushLight(t);if(t.castShadow){_.pushShadow(t)}}}));_.setupLights(M.useLegacyLights);t.traverse((function(e){const i=e.material;if(i){if(Array.isArray(i)){for(let r=0;r<i.length;r++){const s=i[r];n(s,t,e)}}else{n(i,t,e)}}}));v.pop();_=null};let Pt=null;function Ut(t){if(Pt)Pt(t)}function Dt(){Nt.stop()}function It(){Nt.start()}const Nt=new Fr;Nt.setAnimationLoop(Ut);if(typeof self!=="undefined")Nt.setContext(self);this.setAnimationLoop=function(t){Pt=t;Tt.setAnimationLoop(t);t===null?Nt.stop():Nt.start()};Tt.addEventListener("sessionstart",Dt);Tt.addEventListener("sessionend",It);this.render=function(t,e){if(e!==undefined&&e.isCamera!==true){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(y===true)return;if(t.matrixWorldAutoUpdate===true)t.updateMatrixWorld();if(e.parent===null&&e.matrixWorldAutoUpdate===true)e.updateMatrixWorld();if(Tt.enabled===true&&Tt.isPresenting===true){if(Tt.cameraAutoUpdate===true)Tt.updateCamera(e);e=Tt.getCamera()}if(t.isScene===true)t.onBeforeRender(M,t,e,T);_=ct.get(t,v.length);_.init();v.push(_);G.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse);F.setFromProjectionMatrix(G);B=this.localClippingEnabled;z=ut.init(this.clippingPlanes,B);g=lt.get(t,x.length);g.init();x.push(g);Ot(t,e,0,M.sortObjects);g.finish();if(M.sortObjects===true){g.sort(U,D)}if(z===true)ut.beginShadows();const n=_.state.shadowsArray;ht.render(n,t,e);if(z===true)ut.endShadows();if(this.info.autoReset===true)this.info.reset();pt.render(g,t);_.setupLights(M.useLegacyLights);if(e.isArrayCamera){const n=e.cameras;for(let e=0,i=n.length;e<i;e++){const i=n[e];Ft(g,t,i,i.viewport)}}else{Ft(g,t,e)}if(T!==null){tt.updateMultisampleRenderTarget(T);tt.updateRenderTargetMipmap(T)}if(t.isScene===true)t.onAfterRender(M,t,e);yt.resetDefaultState();b=-1;w=null;v.pop();if(v.length>0){_=v[v.length-1]}else{_=null}x.pop();if(x.length>0){g=x[x.length-1]}else{g=null}};function Ot(t,e,n,i){if(t.visible===false)return;const r=t.layers.test(e.layers);if(r){if(t.isGroup){n=t.renderOrder}else if(t.isLOD){if(t.autoUpdate===true)t.update(e)}else if(t.isLight){_.pushLight(t);if(t.castShadow){_.pushShadow(t)}}else if(t.isSprite){if(!t.frustumCulled||F.intersectsSprite(t)){if(i){V.setFromMatrixPosition(t.matrixWorld).applyMatrix4(G)}const e=st.update(t);const r=t.material;if(r.visible){g.push(t,e,r,n,V.z,null)}}}else if(t.isMesh||t.isLine||t.isPoints){if(!t.frustumCulled||F.intersectsObject(t)){if(t.isSkinnedMesh){if(t.skeleton.frame!==Q.render.frame){t.skeleton.update();t.skeleton.frame=Q.render.frame}}const e=st.update(t);const r=t.material;if(i){if(e.boundingSphere===null)e.computeBoundingSphere();V.copy(e.boundingSphere.center).applyMatrix4(t.matrixWorld).applyMatrix4(G)}if(Array.isArray(r)){const i=e.groups;for(let s=0,a=i.length;s<a;s++){const a=i[s];const o=r[a.materialIndex];if(o&&o.visible){g.push(t,e,o,n,V.z,a)}}}else if(r.visible){g.push(t,e,r,n,V.z,null)}}}}const s=t.children;for(let t=0,r=s.length;t<r;t++){Ot(s[t],e,n,i)}}function Ft(t,e,n,i){const r=t.opaque;const s=t.transmissive;const a=t.transparent;_.setupLightsView(n);if(z===true)ut.setGlobalState(M.clippingPlanes,n);if(s.length>0)zt(r,s,e,n);if(i)K.viewport(A.copy(i));if(r.length>0)Bt(r,e,n);if(s.length>0)Bt(s,e,n);if(a.length>0)Bt(a,e,n);K.buffers.depth.setTest(true);K.buffers.depth.setMask(true);K.buffers.color.setMask(true);K.setPolygonOffset(false)}function zt(t,e,n,i){if(H===null){const t=Z.isWebGL2;H=new ln(1024,1024,{generateMipmaps:true,type:J.has("EXT_color_buffer_half_float")?Mt:dt,minFilter:ft,samples:t&&o===true?4:0})}const r=M.getRenderTarget();M.setRenderTarget(H);M.clear();const s=M.toneMapping;M.toneMapping=X;Bt(t,n,i);tt.updateMultisampleRenderTarget(H);tt.updateRenderTargetMipmap(H);let a=false;for(let t=0,r=e.length;t<r;t++){const r=e[t];const s=r.object;const o=r.geometry;const l=r.material;const c=r.group;if(l.side===f&&s.layers.test(i.layers)){const t=l.side;l.side=h;l.needsUpdate=true;Ht(s,n,i,o,l,c);l.side=t;l.needsUpdate=true;a=true}}if(a===true){tt.updateMultisampleRenderTarget(H);tt.updateRenderTargetMipmap(H)}M.setRenderTarget(r);M.toneMapping=s}function Bt(t,e,n){const i=e.isScene===true?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){const s=t[r];const a=s.object;const o=s.geometry;const l=i===null?s.material:i;const c=s.group;if(a.layers.test(n.layers)){Ht(a,e,n,o,l,c)}}}function Ht(t,e,n,i,r,s){t.onBeforeRender(M,e,n,i,r,s);t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld);t.normalMatrix.getNormalMatrix(t.modelViewMatrix);r.onBeforeRender(M,e,n,i,t,s);if(r.transparent===true&&r.side===f&&r.forceSinglePass===false){r.side=h;r.needsUpdate=true;M.renderBufferDirect(n,e,i,r,t,s);r.side=u;r.needsUpdate=true;M.renderBufferDirect(n,e,i,r,t,s);r.side=f}else{M.renderBufferDirect(n,e,i,r,t,s)}t.onAfterRender(M,e,n,i,r,s)}function Gt(t,e,n){if(e.isScene!==true)e=k;const i=$.get(t);const r=_.state.lights;const s=_.state.shadowsArray;const a=r.state.version;const o=at.getParameters(t,r.state,s,e,n);const l=at.getProgramCacheKey(o);let c=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null;i.fog=e.fog;i.envMap=(t.isMeshStandardMaterial?nt:et).get(t.envMap||i.environment);if(c===undefined){t.addEventListener("dispose",qt);c=new Map;i.programs=c}let u=c.get(l);if(u!==undefined){if(i.currentProgram===u&&i.lightsStateVersion===a){Vt(t,o);return u}}else{o.uniforms=at.getUniforms(t);t.onBuild(n,o,M);t.onBeforeCompile(o,M);u=at.acquireProgram(o,l);c.set(l,u);i.uniforms=o.uniforms}const h=i.uniforms;if(!t.isShaderMaterial&&!t.isRawShaderMaterial||t.clipping===true){h.clippingPlanes=ut.uniform}Vt(t,o);i.needsLights=Xt(t);i.lightsStateVersion=a;if(i.needsLights){h.ambientLightColor.value=r.state.ambient;h.lightProbe.value=r.state.probe;h.directionalLights.value=r.state.directional;h.directionalLightShadows.value=r.state.directionalShadow;h.spotLights.value=r.state.spot;h.spotLightShadows.value=r.state.spotShadow;h.rectAreaLights.value=r.state.rectArea;h.ltc_1.value=r.state.rectAreaLTC1;h.ltc_2.value=r.state.rectAreaLTC2;h.pointLights.value=r.state.point;h.pointLightShadows.value=r.state.pointShadow;h.hemisphereLights.value=r.state.hemi;h.directionalShadowMap.value=r.state.directionalShadowMap;h.directionalShadowMatrix.value=r.state.directionalShadowMatrix;h.spotShadowMap.value=r.state.spotShadowMap;h.spotLightMatrix.value=r.state.spotLightMatrix;h.spotLightMap.value=r.state.spotLightMap;h.pointShadowMap.value=r.state.pointShadowMap;h.pointShadowMatrix.value=r.state.pointShadowMatrix}const f=u.getUniforms();const d=sc.seqWithValue(f.seq,h);i.currentProgram=u;i.uniformsList=d;return u}function Vt(t,e){const n=$.get(t);n.outputColorSpace=e.outputColorSpace;n.instancing=e.instancing;n.skinning=e.skinning;n.morphTargets=e.morphTargets;n.morphNormals=e.morphNormals;n.morphColors=e.morphColors;n.morphTargetsCount=e.morphTargetsCount;n.numClippingPlanes=e.numClippingPlanes;n.numIntersection=e.numClipIntersection;n.vertexAlphas=e.vertexAlphas;n.vertexTangents=e.vertexTangents;n.toneMapping=e.toneMapping}function kt(t,e,n,i,r){if(e.isScene!==true)e=k;tt.resetTextureUnits();const s=e.fog;const a=i.isMeshStandardMaterial?e.environment:null;const o=T===null?M.outputColorSpace:T.isXRRenderTarget===true?T.texture.colorSpace:ve;const l=(i.isMeshStandardMaterial?nt:et).get(i.envMap||a);const c=i.vertexColors===true&&!!n.attributes.color&&n.attributes.color.itemSize===4;const u=!!i.normalMap&&!!n.attributes.tangent;const h=!!n.morphAttributes.position;const f=!!n.morphAttributes.normal;const d=!!n.morphAttributes.color;const p=i.toneMapped?M.toneMapping:X;const m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color;const g=m!==undefined?m.length:0;const x=$.get(i);const v=_.state.lights;if(z===true){if(B===true||t!==w){const e=t===w&&i.id===b;ut.setState(i,t,e)}}let y=false;if(i.version===x.__version){if(x.needsLights&&x.lightsStateVersion!==v.state.version){y=true}else if(x.outputColorSpace!==o){y=true}else if(r.isInstancedMesh&&x.instancing===false){y=true}else if(!r.isInstancedMesh&&x.instancing===true){y=true}else if(r.isSkinnedMesh&&x.skinning===false){y=true}else if(!r.isSkinnedMesh&&x.skinning===true){y=true}else if(x.envMap!==l){y=true}else if(i.fog===true&&x.fog!==s){y=true}else if(x.numClippingPlanes!==undefined&&(x.numClippingPlanes!==ut.numPlanes||x.numIntersection!==ut.numIntersection)){y=true}else if(x.vertexAlphas!==c){y=true}else if(x.vertexTangents!==u){y=true}else if(x.morphTargets!==h){y=true}else if(x.morphNormals!==f){y=true}else if(x.morphColors!==d){y=true}else if(x.toneMapping!==p){y=true}else if(Z.isWebGL2===true&&x.morphTargetsCount!==g){y=true}}else{y=true;x.__version=i.version}let S=x.currentProgram;if(y===true){S=Gt(i,e,r)}let E=false;let A=false;let R=false;const q=S.getUniforms(),C=x.uniforms;if(K.useProgram(S.program)){E=true;A=true;R=true}if(i.id!==b){b=i.id;A=true}if(E||w!==t){q.setValue(j,"projectionMatrix",t.projectionMatrix);if(Z.logarithmicDepthBuffer){q.setValue(j,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2))}if(w!==t){w=t;A=true;R=true}if(i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=q.map.cameraPosition;if(e!==undefined){e.setValue(j,V.setFromMatrixPosition(t.matrixWorld))}}if(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial){q.setValue(j,"isOrthographic",t.isOrthographicCamera===true)}if(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh){q.setValue(j,"viewMatrix",t.matrixWorldInverse)}}if(r.isSkinnedMesh){q.setOptional(j,r,"bindMatrix");q.setOptional(j,r,"bindMatrixInverse");const t=r.skeleton;if(t){if(Z.floatVertexTextures){if(t.boneTexture===null)t.computeBoneTexture();q.setValue(j,"boneTexture",t.boneTexture,tt);q.setValue(j,"boneTextureSize",t.boneTextureSize)}else{console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required.")}}}const U=n.morphAttributes;if(U.position!==undefined||U.normal!==undefined||U.color!==undefined&&Z.isWebGL2===true){mt.update(r,n,S)}if(A||x.receiveShadow!==r.receiveShadow){x.receiveShadow=r.receiveShadow;q.setValue(j,"receiveShadow",r.receiveShadow)}if(i.isMeshGouraudMaterial&&i.envMap!==null){C.envMap.value=l;C.flipEnvMap.value=l.isCubeTexture&&l.isRenderTargetTexture===false?-1:1}if(A){q.setValue(j,"toneMappingExposure",M.toneMappingExposure);if(x.needsLights){Wt(C,R)}if(s&&i.fog===true){ot.refreshFogUniforms(C,s)}ot.refreshMaterialUniforms(C,i,P,L,H);sc.upload(j,x.uniformsList,C,tt)}if(i.isShaderMaterial&&i.uniformsNeedUpdate===true){sc.upload(j,x.uniformsList,C,tt);i.uniformsNeedUpdate=false}if(i.isSpriteMaterial){q.setValue(j,"center",r.center)}q.setValue(j,"modelViewMatrix",r.modelViewMatrix);q.setValue(j,"normalMatrix",r.normalMatrix);q.setValue(j,"modelMatrix",r.matrixWorld);if(i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++){if(Z.isWebGL2){const n=t[e];St.update(n,S);St.bind(n,S)}else{console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}}}return S}function Wt(t,e){t.ambientLightColor.needsUpdate=e;t.lightProbe.needsUpdate=e;t.directionalLights.needsUpdate=e;t.directionalLightShadows.needsUpdate=e;t.pointLights.needsUpdate=e;t.pointLightShadows.needsUpdate=e;t.spotLights.needsUpdate=e;t.spotLightShadows.needsUpdate=e;t.rectAreaLights.needsUpdate=e;t.hemisphereLights.needsUpdate=e}function Xt(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&t.lights===true}this.getActiveCubeFace=function(){return S};this.getActiveMipmapLevel=function(){return E};this.getRenderTarget=function(){return T};this.setRenderTargetTextures=function(t,e,n){$.get(t.texture).__webglTexture=e;$.get(t.depthTexture).__webglTexture=n;const i=$.get(t);i.__hasExternalTextures=true;if(i.__hasExternalTextures){i.__autoAllocateDepthBuffer=n===undefined;if(!i.__autoAllocateDepthBuffer){if(J.has("WEBGL_multisampled_render_to_texture")===true){console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided");i.__useRenderToTexture=false}}}};this.setRenderTargetFramebuffer=function(t,e){const n=$.get(t);n.__webglFramebuffer=e;n.__useDefaultFramebuffer=e===undefined};this.setRenderTarget=function(t,e=0,n=0){T=t;S=e;E=n;let i=true;let r=null;let s=false;let a=false;if(t){const n=$.get(t);if(n.__useDefaultFramebuffer!==undefined){K.bindFramebuffer(j.FRAMEBUFFER,null);i=false}else if(n.__webglFramebuffer===undefined){tt.setupRenderTarget(t)}else if(n.__hasExternalTextures){tt.rebindTextures(t,$.get(t.texture).__webglTexture,$.get(t.depthTexture).__webglTexture)}const o=t.texture;if(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture){a=true}const l=$.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget){r=l[e];s=true}else if(Z.isWebGL2&&t.samples>0&&tt.useMultisampledRTT(t)===false){r=$.get(t).__webglMultisampledFramebuffer}else{r=l}A.copy(t.viewport);R.copy(t.scissor);q=t.scissorTest}else{A.copy(I).multiplyScalar(P).floor();R.copy(N).multiplyScalar(P).floor();q=O}const o=K.bindFramebuffer(j.FRAMEBUFFER,r);if(o&&Z.drawBuffers&&i){K.drawBuffers(t,r)}K.viewport(A);K.scissor(R);K.setScissorTest(q);if(s){const i=$.get(t.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=$.get(t.texture);const r=e||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}b=-1};this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!(t&&t.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let o=$.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&a!==undefined){o=o[a]}if(o){K.bindFramebuffer(j.FRAMEBUFFER,o);try{const a=t.texture;const o=a.format;const l=a.type;if(o!==bt&&xt.convert(o)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const c=l===Mt&&(J.has("EXT_color_buffer_half_float")||Z.isWebGL2&&J.has("EXT_color_buffer_float"));if(l!==dt&&xt.convert(l)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_TYPE)&&!(l===vt&&(Z.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float")))&&!c){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}if(e>=0&&e<=t.width-i&&(n>=0&&n<=t.height-r)){j.readPixels(e,n,i,r,xt.convert(o),xt.convert(l),s)}}finally{const t=T!==null?$.get(T).__webglFramebuffer:null;K.bindFramebuffer(j.FRAMEBUFFER,t)}}};this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n);const r=Math.floor(e.image.width*i);const s=Math.floor(e.image.height*i);tt.setTexture2D(e,0);j.copyTexSubImage2D(j.TEXTURE_2D,n,0,0,t.x,t.y,r,s);K.unbindTexture()};this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width;const s=e.image.height;const a=xt.convert(n.format);const o=xt.convert(n.type);tt.setTexture2D(n,0);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,n.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,n.unpackAlignment);if(e.isDataTexture){j.texSubImage2D(j.TEXTURE_2D,i,t.x,t.y,r,s,a,o,e.image.data)}else{if(e.isCompressedTexture){j.compressedTexSubImage2D(j.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data)}else{j.texSubImage2D(j.TEXTURE_2D,i,t.x,t.y,a,o,e.image)}}if(i===0&&n.generateMipmaps)j.generateMipmap(j.TEXTURE_2D);K.unbindTexture()};this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const s=t.max.x-t.min.x+1;const a=t.max.y-t.min.y+1;const o=t.max.z-t.min.z+1;const l=xt.convert(i.format);const c=xt.convert(i.type);let u;if(i.isData3DTexture){tt.setTexture3D(i,0);u=j.TEXTURE_3D}else if(i.isDataArrayTexture){tt.setTexture2DArray(i,0);u=j.TEXTURE_2D_ARRAY}else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,i.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,i.unpackAlignment);const h=j.getParameter(j.UNPACK_ROW_LENGTH);const f=j.getParameter(j.UNPACK_IMAGE_HEIGHT);const d=j.getParameter(j.UNPACK_SKIP_PIXELS);const p=j.getParameter(j.UNPACK_SKIP_ROWS);const m=j.getParameter(j.UNPACK_SKIP_IMAGES);const g=n.isCompressedTexture?n.mipmaps[0]:n.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,g.width);j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,g.height);j.pixelStorei(j.UNPACK_SKIP_PIXELS,t.min.x);j.pixelStorei(j.UNPACK_SKIP_ROWS,t.min.y);j.pixelStorei(j.UNPACK_SKIP_IMAGES,t.min.z);if(n.isDataTexture||n.isData3DTexture){j.texSubImage3D(u,r,e.x,e.y,e.z,s,a,o,l,c,g.data)}else{if(n.isCompressedArrayTexture){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.");j.compressedTexSubImage3D(u,r,e.x,e.y,e.z,s,a,o,l,g.data)}else{j.texSubImage3D(u,r,e.x,e.y,e.z,s,a,o,l,c,g)}}j.pixelStorei(j.UNPACK_ROW_LENGTH,h);j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,f);j.pixelStorei(j.UNPACK_SKIP_PIXELS,d);j.pixelStorei(j.UNPACK_SKIP_ROWS,p);j.pixelStorei(j.UNPACK_SKIP_IMAGES,m);if(r===0&&i.generateMipmaps)j.generateMipmap(u);K.unbindTexture()};this.initTexture=function(t){if(t.isCubeTexture){tt.setTextureCube(t,0)}else if(t.isData3DTexture){tt.setTexture3D(t,0)}else if(t.isDataArrayTexture||t.isCompressedArrayTexture){tt.setTexture2DArray(t,0)}else{tt.setTexture2D(t,0)}K.unbindTexture()};this.resetState=function(){S=0;E=0;T=null;K.reset();yt.reset()};if(typeof __THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}get physicallyCorrectLights(){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.");return!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.");this.useLegacyLights=!t}get outputEncoding(){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.");return this.outputColorSpace===xe?fe:he}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.");this.outputColorSpace=t===fe?xe:ve}}class fu extends hu{}fu.prototype.isWebGL1Renderer=true;class du extends di{constructor(){super();this.isScene=true;this.type="Scene";this.background=null;this.environment=null;this.fog=null;this.backgroundBlurriness=0;this.backgroundIntensity=1;this.overrideMaterial=null;if(typeof __THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}copy(t,e){super.copy(t,e);if(t.background!==null)this.background=t.background.clone();if(t.environment!==null)this.environment=t.environment.clone();if(t.fog!==null)this.fog=t.fog.clone();this.backgroundBlurriness=t.backgroundBlurriness;this.backgroundIntensity=t.backgroundIntensity;if(t.overrideMaterial!==null)this.overrideMaterial=t.overrideMaterial.clone();this.matrixAutoUpdate=t.matrixAutoUpdate;return this}toJSON(t){const e=super.toJSON(t);if(this.fog!==null)e.object.fog=this.fog.toJSON();if(this.backgroundBlurriness>0)e.object.backgroundBlurriness=this.backgroundBlurriness;if(this.backgroundIntensity!==1)e.object.backgroundIntensity=this.backgroundIntensity;return e}get autoUpdate(){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.");return this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.");this.matrixWorldAutoUpdate=t}}class pu extends Ai{constructor(t){super();this.isLineBasicMaterial=true;this.type="LineBasicMaterial";this.color=new Pi(16777215);this.map=null;this.linewidth=1;this.linecap="round";this.linejoin="round";this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.linewidth=t.linewidth;this.linecap=t.linecap;this.linejoin=t.linejoin;this.fog=t.fog;return this}}const mu=new fn;const gu=new fn;const _u=new Gn;const xu=new Hn;const vu=new Un;class Mu extends di{constructor(t=new Yi,e=new pu){super();this.isLine=true;this.type="Line";this.geometry=t;this.material=e;this.updateMorphTargets()}copy(t,e){super.copy(t,e);this.material=t.material;this.geometry=t.geometry;return this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position;const n=[0];for(let t=1,i=e.count;t<i;t++){mu.fromBufferAttribute(e,t-1);gu.fromBufferAttribute(e,t);n[t]=n[t-1];n[t]+=mu.distanceTo(gu)}t.setAttribute("lineDistance",new Bi(n,1))}else{console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.")}return this}raycast(t,e){const n=this.geometry;const i=this.matrixWorld;const r=t.params.Line.threshold;const s=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();vu.copy(n.boundingSphere);vu.applyMatrix4(i);vu.radius+=r;if(t.ray.intersectsSphere(vu)===false)return;_u.copy(i).invert();xu.copy(t.ray).applyMatrix4(_u);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3);const o=a*a;const l=new fn;const c=new fn;const u=new fn;const h=new fn;const f=this.isLineSegments?2:1;const d=n.index;const p=n.attributes;const m=p.position;if(d!==null){const n=Math.max(0,s.start);const i=Math.min(d.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=f){const n=d.getX(r);const i=d.getX(r+1);l.fromBufferAttribute(m,n);c.fromBufferAttribute(m,i);const s=xu.distanceSqToSegment(l,c,h,u);if(s>o)continue;h.applyMatrix4(this.matrixWorld);const a=t.ray.origin.distanceTo(h);if(a<t.near||a>t.far)continue;e.push({distance:a,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else{const n=Math.max(0,s.start);const i=Math.min(m.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=f){l.fromBufferAttribute(m,r);c.fromBufferAttribute(m,r+1);const n=xu.distanceSqToSegment(l,c,h,u);if(n>o)continue;h.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(h);if(i<t.near||i>t.far)continue;e.push({distance:i,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry;const e=t.morphAttributes;const n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(t!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0);this.morphTargetDictionary[n]=e}}}}}const yu=new fn;const Su=new fn;class Eu extends Mu{constructor(t,e){super(t,e);this.isLineSegments=true;this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position;const n=[];for(let t=0,i=e.count;t<i;t+=2){yu.fromBufferAttribute(e,t);Su.fromBufferAttribute(e,t+1);n[t]=t===0?0:n[t-1];n[t+1]=n[t]+yu.distanceTo(Su)}t.setAttribute("lineDistance",new Bi(n,1))}else{console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.")}return this}}class Tu extends Ai{constructor(t){super();this.isPointsMaterial=true;this.type="PointsMaterial";this.color=new Pi(16777215);this.map=null;this.alphaMap=null;this.size=1;this.sizeAttenuation=true;this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.alphaMap=t.alphaMap;this.size=t.size;this.sizeAttenuation=t.sizeAttenuation;this.fog=t.fog;return this}}const bu=new Gn;const wu=new Hn;const Au=new Un;const Ru=new fn;class qu extends di{constructor(t=new Yi,e=new Tu){super();this.isPoints=true;this.type="Points";this.geometry=t;this.material=e;this.updateMorphTargets()}copy(t,e){super.copy(t,e);this.material=t.material;this.geometry=t.geometry;return this}raycast(t,e){const n=this.geometry;const i=this.matrixWorld;const r=t.params.Points.threshold;const s=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();Au.copy(n.boundingSphere);Au.applyMatrix4(i);Au.radius+=r;if(t.ray.intersectsSphere(Au)===false)return;bu.copy(i).invert();wu.copy(t.ray).applyMatrix4(bu);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3);const o=a*a;const l=n.index;const c=n.attributes;const u=c.position;if(l!==null){const n=Math.max(0,s.start);const r=Math.min(l.count,s.start+s.count);for(let s=n,a=r;s<a;s++){const n=l.getX(s);Ru.fromBufferAttribute(u,n);Cu(Ru,n,o,i,t,e,this)}}else{const n=Math.max(0,s.start);const r=Math.min(u.count,s.start+s.count);for(let s=n,a=r;s<a;s++){Ru.fromBufferAttribute(u,s);Cu(Ru,s,o,i,t,e,this)}}}updateMorphTargets(){const t=this.geometry;const e=t.morphAttributes;const n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(t!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0);this.morphTargetDictionary[n]=e}}}}}function Cu(t,e,n,i,r,s,a){const o=wu.distanceSqToPoint(t);if(o<n){const n=new fn;wu.closestPointToPoint(t,n);n.applyMatrix4(i);const l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}class Lu extends an{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l);this.isCanvasTexture=true;this.needsUpdate=true}}class Pu{constructor(){this.type="Curve";this.arcLengthDivisions=200}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.");return null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++){e.push(this.getPoint(n/t))}return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++){e.push(this.getPointAt(n/t))}return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate){return this.cacheArcLengths}this.needsUpdate=false;const e=[];let n,i=this.getPoint(0);let r=0;e.push(0);for(let s=1;s<=t;s++){n=this.getPoint(s/t);r+=n.distanceTo(i);e.push(r);i=n}this.cacheArcLengths=e;return e}updateArcLengths(){this.needsUpdate=true;this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;if(e){s=e}else{s=t*n[r-1]}let a=0,o=r-1,l;while(a<=o){i=Math.floor(a+(o-a)/2);l=n[i]-s;if(l<0){a=i+1}else if(l>0){o=i-1}else{o=i;break}}i=o;if(n[i]===s){return i/(r-1)}const c=n[i];const u=n[i+1];const h=u-c;const f=(s-c)/h;const d=(i+f)/(r-1);return d}getTangent(t,e){const n=1e-4;let i=t-n;let r=t+n;if(i<0)i=0;if(r>1)r=1;const s=this.getPoint(i);const a=this.getPoint(r);const o=e||(s.isVector2?new Fe:new fn);o.copy(a).sub(s).normalize();return o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new fn;const i=[];const r=[];const s=[];const a=new fn;const o=new Gn;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new fn)}r[0]=new fn;s[0]=new fn;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x);const u=Math.abs(i[0].y);const h=Math.abs(i[0].z);if(c<=l){l=c;n.set(1,0,0)}if(u<=l){l=u;n.set(0,1,0)}if(h<=l){n.set(0,0,1)}a.crossVectors(i[0],n).normalize();r[0].crossVectors(i[0],a);s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){r[e]=r[e-1].clone();s[e]=s[e-1].clone();a.crossVectors(i[e-1],i[e]);if(a.length()>Number.EPSILON){a.normalize();const t=Math.acos(Le(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(e===true){let e=Math.acos(Le(r[0].dot(r[t]),-1,1));e/=t;if(i[0].dot(a.crossVectors(r[0],r[t]))>0){e=-e}for(let n=1;n<=t;n++){r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n));s[n].crossVectors(i[n],r[n])}}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){this.arcLengthDivisions=t.arcLengthDivisions;return this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};t.arcLengthDivisions=this.arcLengthDivisions;t.type=this.type;return t}fromJSON(t){this.arcLengthDivisions=t.arcLengthDivisions;return this}}class Uu extends Pu{constructor(t=0,e=0,n=1,i=1,r=0,s=Math.PI*2,a=false,o=0){super();this.isEllipseCurve=true;this.type="EllipseCurve";this.aX=t;this.aY=e;this.xRadius=n;this.yRadius=i;this.aStartAngle=r;this.aEndAngle=s;this.aClockwise=a;this.aRotation=o}getPoint(t,e){const n=e||new Fe;const i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;while(r<0)r+=i;while(r>i)r-=i;if(r<Number.EPSILON){if(s){r=0}else{r=i}}if(this.aClockwise===true&&!s){if(r===i){r=-i}else{r=r-i}}const a=this.aStartAngle+t*r;let o=this.aX+this.xRadius*Math.cos(a);let l=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const t=Math.cos(this.aRotation);const e=Math.sin(this.aRotation);const n=o-this.aX;const i=l-this.aY;o=n*t-i*e+this.aX;l=n*e+i*t+this.aY}return n.set(o,l)}copy(t){super.copy(t);this.aX=t.aX;this.aY=t.aY;this.xRadius=t.xRadius;this.yRadius=t.yRadius;this.aStartAngle=t.aStartAngle;this.aEndAngle=t.aEndAngle;this.aClockwise=t.aClockwise;this.aRotation=t.aRotation;return this}toJSON(){const t=super.toJSON();t.aX=this.aX;t.aY=this.aY;t.xRadius=this.xRadius;t.yRadius=this.yRadius;t.aStartAngle=this.aStartAngle;t.aEndAngle=this.aEndAngle;t.aClockwise=this.aClockwise;t.aRotation=this.aRotation;return t}fromJSON(t){super.fromJSON(t);this.aX=t.aX;this.aY=t.aY;this.xRadius=t.xRadius;this.yRadius=t.yRadius;this.aStartAngle=t.aStartAngle;this.aEndAngle=t.aEndAngle;this.aClockwise=t.aClockwise;this.aRotation=t.aRotation;return this}}class Du extends Uu{constructor(t,e,n,i,r,s){super(t,e,n,n,i,r,s);this.isArcCurve=true;this.type="ArcCurve"}}function Iu(){let t=0,e=0,n=0,i=0;function r(r,s,a,o){t=r;e=a;n=-3*r+3*s-2*a-o;i=2*r-2*s+a+o}return{initCatmullRom:function(t,e,n,i,s){r(e,n,s*(n-t),s*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,s,a,o){let l=(e-t)/s-(n-t)/(s+a)+(n-e)/a;let c=(n-e)/a-(i-e)/(a+o)+(i-n)/o;l*=a;c*=a;r(e,n,l,c)},calc:function(r){const s=r*r;const a=s*r;return t+e*r+n*s+i*a}}}const Nu=new fn;const Ou=new Iu;const Fu=new Iu;const zu=new Iu;class Bu extends Pu{constructor(t=[],e=false,n="centripetal",i=.5){super();this.isCatmullRomCurve3=true;this.type="CatmullRomCurve3";this.points=t;this.closed=e;this.curveType=n;this.tension=i}getPoint(t,e=new fn){const n=e;const i=this.points;const r=i.length;const s=(r-(this.closed?0:1))*t;let a=Math.floor(s);let o=s-a;if(this.closed){a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r}else if(o===0&&a===r-1){a=r-2;o=1}let l,c;if(this.closed||a>0){l=i[(a-1)%r]}else{Nu.subVectors(i[0],i[1]).add(i[0]);l=Nu}const u=i[a%r];const h=i[(a+1)%r];if(this.closed||a+2<r){c=i[(a+2)%r]}else{Nu.subVectors(i[r-1],i[r-2]).add(i[r-1]);c=Nu}if(this.curveType==="centripetal"||this.curveType==="chordal"){const t=this.curveType==="chordal"?.5:.25;let e=Math.pow(l.distanceToSquared(u),t);let n=Math.pow(u.distanceToSquared(h),t);let i=Math.pow(h.distanceToSquared(c),t);if(n<1e-4)n=1;if(e<1e-4)e=n;if(i<1e-4)i=n;Ou.initNonuniformCatmullRom(l.x,u.x,h.x,c.x,e,n,i);Fu.initNonuniformCatmullRom(l.y,u.y,h.y,c.y,e,n,i);zu.initNonuniformCatmullRom(l.z,u.z,h.z,c.z,e,n,i)}else if(this.curveType==="catmullrom"){Ou.initCatmullRom(l.x,u.x,h.x,c.x,this.tension);Fu.initCatmullRom(l.y,u.y,h.y,c.y,this.tension);zu.initCatmullRom(l.z,u.z,h.z,c.z,this.tension)}n.set(Ou.calc(o),Fu.calc(o),zu.calc(o));return n}copy(t){super.copy(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}this.closed=t.closed;this.curveType=t.curveType;this.tension=t.tension;return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}t.closed=this.closed;t.curveType=this.curveType;t.tension=this.tension;return t}fromJSON(t){super.fromJSON(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new fn).fromArray(n))}this.closed=t.closed;this.curveType=t.curveType;this.tension=t.tension;return this}}function Hu(t,e,n,i,r){const s=(i-e)*.5;const a=(r-n)*.5;const o=t*t;const l=t*o;return(2*n-2*i+s+a)*l+(-3*n+3*i-2*s-a)*o+s*t+n}function Gu(t,e){const n=1-t;return n*n*e}function Vu(t,e){return 2*(1-t)*t*e}function ku(t,e){return t*t*e}function Wu(t,e,n,i){return Gu(t,e)+Vu(t,n)+ku(t,i)}function Xu(t,e){const n=1-t;return n*n*n*e}function ju(t,e){const n=1-t;return 3*n*n*t*e}function Yu(t,e){return 3*(1-t)*t*t*e}function Ju(t,e){return t*t*t*e}function Zu(t,e,n,i,r){return Xu(t,e)+ju(t,n)+Yu(t,i)+Ju(t,r)}class Ku extends Pu{constructor(t=new Fe,e=new Fe,n=new Fe,i=new Fe){super();this.isCubicBezierCurve=true;this.type="CubicBezierCurve";this.v0=t;this.v1=e;this.v2=n;this.v3=i}getPoint(t,e=new Fe){const n=e;const i=this.v0,r=this.v1,s=this.v2,a=this.v3;n.set(Zu(t,i.x,r.x,s.x,a.x),Zu(t,i.y,r.y,s.y,a.y));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);this.v3.copy(t.v3);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();t.v3=this.v3.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);this.v3.fromArray(t.v3);return this}}class Qu extends Pu{constructor(t=new fn,e=new fn,n=new fn,i=new fn){super();this.isCubicBezierCurve3=true;this.type="CubicBezierCurve3";this.v0=t;this.v1=e;this.v2=n;this.v3=i}getPoint(t,e=new fn){const n=e;const i=this.v0,r=this.v1,s=this.v2,a=this.v3;n.set(Zu(t,i.x,r.x,s.x,a.x),Zu(t,i.y,r.y,s.y,a.y),Zu(t,i.z,r.z,s.z,a.z));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);this.v3.copy(t.v3);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();t.v3=this.v3.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);this.v3.fromArray(t.v3);return this}}class $u extends Pu{constructor(t=new Fe,e=new Fe){super();this.isLineCurve=true;this.type="LineCurve";this.v1=t;this.v2=e}getPoint(t,e=new Fe){const n=e;if(t===1){n.copy(this.v2)}else{n.copy(this.v2).sub(this.v1);n.multiplyScalar(t).add(this.v1)}return n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Fe){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){super.copy(t);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class th extends Pu{constructor(t=new fn,e=new fn){super();this.isLineCurve3=true;this.type="LineCurve3";this.v1=t;this.v2=e}getPoint(t,e=new fn){const n=e;if(t===1){n.copy(this.v2)}else{n.copy(this.v2).sub(this.v1);n.multiplyScalar(t).add(this.v1)}return n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new fn){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){super.copy(t);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class eh extends Pu{constructor(t=new Fe,e=new Fe,n=new Fe){super();this.isQuadraticBezierCurve=true;this.type="QuadraticBezierCurve";this.v0=t;this.v1=e;this.v2=n}getPoint(t,e=new Fe){const n=e;const i=this.v0,r=this.v1,s=this.v2;n.set(Wu(t,i.x,r.x,s.x),Wu(t,i.y,r.y,s.y));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class nh extends Pu{constructor(t=new fn,e=new fn,n=new fn){super();this.isQuadraticBezierCurve3=true;this.type="QuadraticBezierCurve3";this.v0=t;this.v1=e;this.v2=n}getPoint(t,e=new fn){const n=e;const i=this.v0,r=this.v1,s=this.v2;n.set(Wu(t,i.x,r.x,s.x),Wu(t,i.y,r.y,s.y),Wu(t,i.z,r.z,s.z));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class ih extends Pu{constructor(t=[]){super();this.isSplineCurve=true;this.type="SplineCurve";this.points=t}getPoint(t,e=new Fe){const n=e;const i=this.points;const r=(i.length-1)*t;const s=Math.floor(r);const a=r-s;const o=i[s===0?s:s-1];const l=i[s];const c=i[s>i.length-2?i.length-1:s+1];const u=i[s>i.length-3?i.length-1:s+2];n.set(Hu(a,o.x,l.x,c.x,u.x),Hu(a,o.y,l.y,c.y,u.y));return n}copy(t){super.copy(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Fe).fromArray(n))}return this}}var rh=Object.freeze({__proto__:null,ArcCurve:Du,CatmullRomCurve3:Bu,CubicBezierCurve:Ku,CubicBezierCurve3:Qu,EllipseCurve:Uu,LineCurve:$u,LineCurve3:th,QuadraticBezierCurve:eh,QuadraticBezierCurve3:nh,SplineCurve:ih});class sh extends Pu{constructor(){super();this.type="CurvePath";this.curves=[];this.autoClose=false}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0);const e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){this.curves.push(new $u(e,t))}}getPoint(t,e){const n=t*this.getLength();const i=this.getCurveLengths();let r=0;while(r<i.length){if(i[r]>=n){const t=i[r]-n;const s=this.curves[r];const a=s.getLength();const o=a===0?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=true;this.cacheLengths=null;this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length){return this.cacheLengths}const t=[];let e=0;for(let n=0,i=this.curves.length;n<i;n++){e+=this.curves[n].getLength();t.push(e)}this.cacheLengths=t;return t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++){e.push(this.getPoint(n/t))}if(this.autoClose){e.push(e[0])}return e}getPoints(t=12){const e=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const s=r[i];const a=s.isEllipseCurve?t*2:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t;const o=s.getPoints(a);for(let t=0;t<o.length;t++){const i=o[t];if(n&&n.equals(i))continue;e.push(i);n=i}}if(this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])){e.push(e[0])}return e}copy(t){super.copy(t);this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}this.autoClose=t.autoClose;return this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose;t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t);this.autoClose=t.autoClose;this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new rh[n.type]).fromJSON(n))}return this}}class ah extends sh{constructor(t){super();this.type="Path";this.currentPoint=new Fe;if(t){this.setFromPoints(t)}}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++){this.lineTo(t[e].x,t[e].y)}return this}moveTo(t,e){this.currentPoint.set(t,e);return this}lineTo(t,e){const n=new $u(this.currentPoint.clone(),new Fe(t,e));this.curves.push(n);this.currentPoint.set(t,e);return this}quadraticCurveTo(t,e,n,i){const r=new eh(this.currentPoint.clone(),new Fe(t,e),new Fe(n,i));this.curves.push(r);this.currentPoint.set(n,i);return this}bezierCurveTo(t,e,n,i,r,s){const a=new Ku(this.currentPoint.clone(),new Fe(t,e),new Fe(n,i),new Fe(r,s));this.curves.push(a);this.currentPoint.set(r,s);return this}splineThru(t){const e=[this.currentPoint.clone()].concat(t);const n=new ih(e);this.curves.push(n);this.currentPoint.copy(t[t.length-1]);return this}arc(t,e,n,i,r,s){const a=this.currentPoint.x;const o=this.currentPoint.y;this.absarc(t+a,e+o,n,i,r,s);return this}absarc(t,e,n,i,r,s){this.absellipse(t,e,n,n,i,r,s);return this}ellipse(t,e,n,i,r,s,a,o){const l=this.currentPoint.x;const c=this.currentPoint.y;this.absellipse(t+l,e+c,n,i,r,s,a,o);return this}absellipse(t,e,n,i,r,s,a,o){const l=new Uu(t,e,n,i,r,s,a,o);if(this.curves.length>0){const t=l.getPoint(0);if(!t.equals(this.currentPoint)){this.lineTo(t.x,t.y)}}this.curves.push(l);const c=l.getPoint(1);this.currentPoint.copy(c);return this}copy(t){super.copy(t);this.currentPoint.copy(t.currentPoint);return this}toJSON(){const t=super.toJSON();t.currentPoint=this.currentPoint.toArray();return t}fromJSON(t){super.fromJSON(t);this.currentPoint.fromArray(t.currentPoint);return this}}class oh extends ah{constructor(t){super(t);this.uuid=Ce();this.type="Shape";this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,i=this.holes.length;n<i;n++){e[n]=this.holes[n].getPoints(t)}return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t);this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid;t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t);this.uuid=t.uuid;this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new ah).fromJSON(n))}return this}}const lh={triangulate:function(t,e,n=2){const i=e&&e.length;const r=i?e[0]*n:t.length;let s=ch(t,0,r,n,true);const a=[];if(!s||s.next===s.prev)return a;let o,l,c,u,h,f,d;if(i)s=gh(t,e,s,n);if(t.length>80*n){o=c=t[0];l=u=t[1];for(let e=n;e<r;e+=n){h=t[e];f=t[e+1];if(h<o)o=h;if(f<l)l=f;if(h>c)c=h;if(f>u)u=f}d=Math.max(c-o,u-l);d=d!==0?32767/d:0}hh(s,a,n,o,l,d,0);return a}};function ch(t,e,n,i,r){let s,a;if(r===zh(t,e,n,i)>0){for(s=e;s<n;s+=i)a=Nh(s,t[s],t[s+1],a)}else{for(s=n-i;s>=e;s-=i)a=Nh(s,t[s],t[s+1],a)}if(a&&Rh(a,a.next)){Oh(a);a=a.next}return a}function uh(t,e){if(!t)return t;if(!e)e=t;let n=t,i;do{i=false;if(!n.steiner&&(Rh(n,n.next)||Ah(n.prev,n,n.next)===0)){Oh(n);n=e=n.prev;if(n===n.next)break;i=true}else{n=n.next}}while(i||n!==e);return e}function hh(t,e,n,i,r,s,a){if(!t)return;if(!a&&s)yh(t,i,r,s);let o=t,l,c;while(t.prev!==t.next){l=t.prev;c=t.next;if(s?dh(t,i,r,s):fh(t)){e.push(l.i/n|0);e.push(t.i/n|0);e.push(c.i/n|0);Oh(t);t=c.next;o=c.next;continue}t=c;if(t===o){if(!a){hh(uh(t),e,n,i,r,s,1)}else if(a===1){t=ph(uh(t),e,n);hh(t,e,n,i,r,s,2)}else if(a===2){mh(t,e,n,i,r,s)}break}}}function fh(t){const e=t.prev,n=t,i=t.next;if(Ah(e,n,i)>=0)return false;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,c=i.y;const u=r<s?r<a?r:a:s<a?s:a,h=o<l?o<c?o:c:l<c?l:c,f=r>s?r>a?r:a:s>a?s:a,d=o>l?o>c?o:c:l>c?l:c;let p=i.next;while(p!==e){if(p.x>=u&&p.x<=f&&p.y>=h&&p.y<=d&&bh(r,o,s,l,a,c,p.x,p.y)&&Ah(p.prev,p,p.next)>=0)return false;p=p.next}return true}function dh(t,e,n,i){const r=t.prev,s=t,a=t.next;if(Ah(r,s,a)>=0)return false;const o=r.x,l=s.x,c=a.x,u=r.y,h=s.y,f=a.y;const d=o<l?o<c?o:c:l<c?l:c,p=u<h?u<f?u:f:h<f?h:f,m=o>l?o>c?o:c:l>c?l:c,g=u>h?u>f?u:f:h>f?h:f;const _=Eh(d,p,e,n,i),x=Eh(m,g,e,n,i);let v=t.prevZ,M=t.nextZ;while(v&&v.z>=_&&M&&M.z<=x){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==a&&bh(o,u,l,h,c,f,v.x,v.y)&&Ah(v.prev,v,v.next)>=0)return false;v=v.prevZ;if(M.x>=d&&M.x<=m&&M.y>=p&&M.y<=g&&M!==r&&M!==a&&bh(o,u,l,h,c,f,M.x,M.y)&&Ah(M.prev,M,M.next)>=0)return false;M=M.nextZ}while(v&&v.z>=_){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==a&&bh(o,u,l,h,c,f,v.x,v.y)&&Ah(v.prev,v,v.next)>=0)return false;v=v.prevZ}while(M&&M.z<=x){if(M.x>=d&&M.x<=m&&M.y>=p&&M.y<=g&&M!==r&&M!==a&&bh(o,u,l,h,c,f,M.x,M.y)&&Ah(M.prev,M,M.next)>=0)return false;M=M.nextZ}return true}function ph(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;if(!Rh(r,s)&&qh(r,i,i.next,s)&&Uh(r,s)&&Uh(s,r)){e.push(r.i/n|0);e.push(i.i/n|0);e.push(s.i/n|0);Oh(i);Oh(i.next);i=t=s}i=i.next}while(i!==t);return uh(i)}function mh(t,e,n,i,r,s){let a=t;do{let t=a.next.next;while(t!==a.prev){if(a.i!==t.i&&wh(a,t)){let o=Ih(a,t);a=uh(a,a.next);o=uh(o,o.next);hh(a,e,n,i,r,s,0);hh(o,e,n,i,r,s,0);return}t=t.next}a=a.next}while(a!==t)}function gh(t,e,n,i){const r=[];let s,a,o,l,c;for(s=0,a=e.length;s<a;s++){o=e[s]*i;l=s<a-1?e[s+1]*i:t.length;c=ch(t,o,l,i,false);if(c===c.next)c.steiner=true;r.push(Th(c))}r.sort(_h);for(s=0;s<r.length;s++){n=xh(r[s],n)}return n}function _h(t,e){return t.x-e.x}function xh(t,e){const n=vh(t,e);if(!n){return e}const i=Ih(n,t);uh(i,i.next);return uh(n,n.next)}function vh(t,e){let n=e,i=-Infinity,r;const s=t.x,a=t.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){const t=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=s&&t>i){i=t;r=n.x<n.next.x?n:n.next;if(t===s)return r}}n=n.next}while(n!==e);if(!r)return null;const o=r,l=r.x,c=r.y;let u=Infinity,h;n=r;do{if(s>=n.x&&n.x>=l&&s!==n.x&&bh(a<c?s:i,a,l,c,a<c?i:s,a,n.x,n.y)){h=Math.abs(a-n.y)/(s-n.x);if(Uh(n,t)&&(h<u||h===u&&(n.x>r.x||n.x===r.x&&Mh(r,n)))){r=n;u=h}}n=n.next}while(n!==o);return r}function Mh(t,e){return Ah(t.prev,t,e.prev)<0&&Ah(e.next,t,t.next)<0}function yh(t,e,n,i){let r=t;do{if(r.z===0)r.z=Eh(r.x,r.y,e,n,i);r.prevZ=r.prev;r.nextZ=r.next;r=r.next}while(r!==t);r.prevZ.nextZ=null;r.prevZ=null;Sh(r)}function Sh(t){let e,n,i,r,s,a,o,l,c=1;do{n=t;t=null;s=null;a=0;while(n){a++;i=n;o=0;for(e=0;e<c;e++){o++;i=i.nextZ;if(!i)break}l=c;while(o>0||l>0&&i){if(o!==0&&(l===0||!i||n.z<=i.z)){r=n;n=n.nextZ;o--}else{r=i;i=i.nextZ;l--}if(s)s.nextZ=r;else t=r;r.prevZ=s;s=r}n=i}s.nextZ=null;c*=2}while(a>1);return t}function Eh(t,e,n,i,r){t=(t-n)*r|0;e=(e-i)*r|0;t=(t|t<<8)&16711935;t=(t|t<<4)&252645135;t=(t|t<<2)&858993459;t=(t|t<<1)&1431655765;e=(e|e<<8)&16711935;e=(e|e<<4)&252645135;e=(e|e<<2)&858993459;e=(e|e<<1)&1431655765;return t|e<<1}function Th(t){let e=t,n=t;do{if(e.x<n.x||e.x===n.x&&e.y<n.y)n=e;e=e.next}while(e!==t);return n}function bh(t,e,n,i,r,s,a,o){return(r-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function wh(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Ph(t,e)&&(Uh(t,e)&&Uh(e,t)&&Dh(t,e)&&(Ah(t.prev,t,e.prev)||Ah(t,e.prev,e))||Rh(t,e)&&Ah(t.prev,t,t.next)>0&&Ah(e.prev,e,e.next)>0)}function Ah(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Rh(t,e){return t.x===e.x&&t.y===e.y}function qh(t,e,n,i){const r=Lh(Ah(t,e,n));const s=Lh(Ah(t,e,i));const a=Lh(Ah(n,i,t));const o=Lh(Ah(n,i,e));if(r!==s&&a!==o)return true;if(r===0&&Ch(t,n,e))return true;if(s===0&&Ch(t,i,e))return true;if(a===0&&Ch(n,t,i))return true;if(o===0&&Ch(n,e,i))return true;return false}function Ch(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Lh(t){return t>0?1:t<0?-1:0}function Ph(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&qh(n,n.next,t,e))return true;n=n.next}while(n!==t);return false}function Uh(t,e){return Ah(t.prev,t,t.next)<0?Ah(t,e,t.next)>=0&&Ah(t,t.prev,e)>=0:Ah(t,e,t.prev)<0||Ah(t,t.next,e)<0}function Dh(t,e){let n=t,i=false;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{if(n.y>s!==n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x)i=!i;n=n.next}while(n!==t);return i}function Ih(t,e){const n=new Fh(t.i,t.x,t.y),i=new Fh(e.i,e.x,e.y),r=t.next,s=e.prev;t.next=e;e.prev=t;n.next=r;r.prev=n;i.next=n;n.prev=i;s.next=i;i.prev=s;return i}function Nh(t,e,n,i){const r=new Fh(t,e,n);if(!i){r.prev=r;r.next=r}else{r.next=i.next;r.prev=i;i.next.prev=r;i.next=r}return r}function Oh(t){t.next.prev=t.prev;t.prev.next=t.next;if(t.prevZ)t.prevZ.nextZ=t.nextZ;if(t.nextZ)t.nextZ.prevZ=t.prevZ}function Fh(t,e,n){this.i=t;this.x=e;this.y=n;this.prev=null;this.next=null;this.z=0;this.prevZ=null;this.nextZ=null;this.steiner=false}function zh(t,e,n,i){let r=0;for(let s=e,a=n-i;s<n;s+=i){r+=(t[a]-t[s])*(t[s+1]+t[a+1]);a=s}return r}class Bh{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r<e;i=r++){n+=t[i].x*t[r].y-t[r].x*t[i].y}return n*.5}static isClockWise(t){return Bh.area(t)<0}static triangulateShape(t,e){const n=[];const i=[];const r=[];Hh(t);Gh(n,t);let s=t.length;e.forEach(Hh);for(let t=0;t<e.length;t++){i.push(s);s+=e[t].length;Gh(n,e[t])}const a=lh.triangulate(n,i);for(let t=0;t<a.length;t+=3){r.push(a.slice(t,t+3))}return r}}function Hh(t){const e=t.length;if(e>2&&t[e-1].equals(t[0])){t.pop()}}function Gh(t,e){for(let n=0;n<e.length;n++){t.push(e[n].x);t.push(e[n].y)}}class Vh extends Yi{constructor(t=new oh([new Fe(.5,.5),new Fe(-.5,.5),new Fe(-.5,-.5),new Fe(.5,-.5)]),e={}){super();this.type="ExtrudeGeometry";this.parameters={shapes:t,options:e};t=Array.isArray(t)?t:[t];const n=this;const i=[];const r=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];s(n)}this.setAttribute("position",new Bi(i,3));this.setAttribute("uv",new Bi(r,2));this.computeVertexNormals();function s(t){const s=[];const a=e.curveSegments!==undefined?e.curveSegments:12;const o=e.steps!==undefined?e.steps:1;const l=e.depth!==undefined?e.depth:1;let c=e.bevelEnabled!==undefined?e.bevelEnabled:true;let u=e.bevelThickness!==undefined?e.bevelThickness:.2;let h=e.bevelSize!==undefined?e.bevelSize:u-.1;let f=e.bevelOffset!==undefined?e.bevelOffset:0;let d=e.bevelSegments!==undefined?e.bevelSegments:3;const p=e.extrudePath;const m=e.UVGenerator!==undefined?e.UVGenerator:kh;let g,_=false;let x,v,M,y;if(p){g=p.getSpacedPoints(o);_=true;c=false;x=p.computeFrenetFrames(o,false);v=new fn;M=new fn;y=new fn}if(!c){d=0;u=0;h=0;f=0}const S=t.extractPoints(a);let E=S.shape;const T=S.holes;const b=!Bh.isClockWise(E);if(b){E=E.reverse();for(let t=0,e=T.length;t<e;t++){const e=T[t];if(Bh.isClockWise(e)){T[t]=e.reverse()}}}const w=Bh.triangulateShape(E,T);const A=E;for(let t=0,e=T.length;t<e;t++){const e=T[t];E=E.concat(e)}function R(t,e,n){if(!e)console.error("THREE.ExtrudeGeometry: vec does not exist");return t.clone().addScaledVector(e,n)}const q=E.length,C=w.length;function L(t,e,n){let i,r,s;const a=t.x-e.x,o=t.y-e.y;const l=n.x-t.x,c=n.y-t.y;const u=a*a+o*o;const h=a*c-o*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u);const f=Math.sqrt(l*l+c*c);const d=e.x-o/h;const p=e.y+a/h;const m=n.x-c/f;const g=n.y+l/f;const _=((m-d)*c-(g-p)*l)/(a*c-o*l);i=d+a*_-t.x;r=p+o*_-t.y;const x=i*i+r*r;if(x<=2){return new Fe(i,r)}else{s=Math.sqrt(x/2)}}else{let t=false;if(a>Number.EPSILON){if(l>Number.EPSILON){t=true}}else{if(a<-Number.EPSILON){if(l<-Number.EPSILON){t=true}}else{if(Math.sign(o)===Math.sign(c)){t=true}}}if(t){i=-o;r=a;s=Math.sqrt(u)}else{i=a;r=o;s=Math.sqrt(u/2)}}return new Fe(i/s,r/s)}const P=[];for(let t=0,e=A.length,n=e-1,i=t+1;t<e;t++,n++,i++){if(n===e)n=0;if(i===e)i=0;P[t]=L(A[t],A[n],A[i])}const U=[];let D,I=P.concat();for(let t=0,e=T.length;t<e;t++){const e=T[t];D=[];for(let t=0,n=e.length,i=n-1,r=t+1;t<n;t++,i++,r++){if(i===n)i=0;if(r===n)r=0;D[t]=L(e[t],e[i],e[r])}U.push(D);I=I.concat(D)}for(let t=0;t<d;t++){const e=t/d;const n=u*Math.cos(e*Math.PI/2);const i=h*Math.sin(e*Math.PI/2)+f;for(let t=0,e=A.length;t<e;t++){const e=R(A[t],P[t],i);B(e.x,e.y,-n)}for(let t=0,e=T.length;t<e;t++){const e=T[t];D=U[t];for(let t=0,r=e.length;t<r;t++){const r=R(e[t],D[t],i);B(r.x,r.y,-n)}}}const N=h+f;for(let t=0;t<q;t++){const e=c?R(E[t],I[t],N):E[t];if(!_){B(e.x,e.y,0)}else{M.copy(x.normals[0]).multiplyScalar(e.x);v.copy(x.binormals[0]).multiplyScalar(e.y);y.copy(g[0]).add(M).add(v);B(y.x,y.y,y.z)}}for(let t=1;t<=o;t++){for(let e=0;e<q;e++){const n=c?R(E[e],I[e],N):E[e];if(!_){B(n.x,n.y,l/o*t)}else{M.copy(x.normals[t]).multiplyScalar(n.x);v.copy(x.binormals[t]).multiplyScalar(n.y);y.copy(g[t]).add(M).add(v);B(y.x,y.y,y.z)}}}for(let t=d-1;t>=0;t--){const e=t/d;const n=u*Math.cos(e*Math.PI/2);const i=h*Math.sin(e*Math.PI/2)+f;for(let t=0,e=A.length;t<e;t++){const e=R(A[t],P[t],i);B(e.x,e.y,l+n)}for(let t=0,e=T.length;t<e;t++){const e=T[t];D=U[t];for(let t=0,r=e.length;t<r;t++){const r=R(e[t],D[t],i);if(!_){B(r.x,r.y,l+n)}else{B(r.x,r.y+g[o-1].y,g[o-1].x+n)}}}}O();F();function O(){const t=i.length/3;if(c){let t=0;let e=q*t;for(let t=0;t<C;t++){const n=w[t];H(n[2]+e,n[1]+e,n[0]+e)}t=o+d*2;e=q*t;for(let t=0;t<C;t++){const n=w[t];H(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<C;t++){const e=w[t];H(e[2],e[1],e[0])}for(let t=0;t<C;t++){const e=w[t];H(e[0]+q*o,e[1]+q*o,e[2]+q*o)}}n.addGroup(t,i.length/3-t,0)}function F(){const t=i.length/3;let e=0;z(A,e);e+=A.length;for(let t=0,n=T.length;t<n;t++){const n=T[t];z(n,e);e+=n.length}n.addGroup(t,i.length/3-t,1)}function z(t,e){let n=t.length;while(--n>=0){const i=n;let r=n-1;if(r<0)r=t.length-1;for(let t=0,n=o+d*2;t<n;t++){const n=q*t;const s=q*(t+1);const a=e+i+n,o=e+r+n,l=e+r+s,c=e+i+s;G(a,o,l,c)}}}function B(t,e,n){s.push(t);s.push(e);s.push(n)}function H(t,e,r){V(t);V(e);V(r);const s=i.length/3;const a=m.generateTopUV(n,i,s-3,s-2,s-1);k(a[0]);k(a[1]);k(a[2])}function G(t,e,r,s){V(t);V(e);V(s);V(e);V(r);V(s);const a=i.length/3;const o=m.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);k(o[0]);k(o[1]);k(o[3]);k(o[1]);k(o[2]);k(o[3])}function V(t){i.push(s[t*3+0]);i.push(s[t*3+1]);i.push(s[t*3+2])}function k(t){r.push(t.x);r.push(t.y)}}}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}toJSON(){const t=super.toJSON();const e=this.parameters.shapes;const n=this.parameters.options;return Wh(e,n,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}const i=t.options.extrudePath;if(i!==undefined){t.options.extrudePath=(new rh[i.type]).fromJSON(i)}return new Vh(n,t.options)}}const kh={generateTopUV:function(t,e,n,i,r){const s=e[n*3];const a=e[n*3+1];const o=e[i*3];const l=e[i*3+1];const c=e[r*3];const u=e[r*3+1];return[new Fe(s,a),new Fe(o,l),new Fe(c,u)]},generateSideWallUV:function(t,e,n,i,r,s){const a=e[n*3];const o=e[n*3+1];const l=e[n*3+2];const c=e[i*3];const u=e[i*3+1];const h=e[i*3+2];const f=e[r*3];const d=e[r*3+1];const p=e[r*3+2];const m=e[s*3];const g=e[s*3+1];const _=e[s*3+2];if(Math.abs(o-u)<Math.abs(a-c)){return[new Fe(a,1-l),new Fe(c,1-h),new Fe(f,1-p),new Fe(m,1-_)]}else{return[new Fe(o,1-l),new Fe(u,1-h),new Fe(d,1-p),new Fe(g,1-_)]}}};function Wh(t,e,n){n.shapes=[];if(Array.isArray(t)){for(let e=0,i=t.length;e<i;e++){const i=t[e];n.shapes.push(i.uuid)}}else{n.shapes.push(t.uuid)}n.options=Object.assign({},e);if(e.extrudePath!==undefined)n.options.extrudePath=e.extrudePath.toJSON();return n}class Xh extends Yi{constructor(t=1,e=32,n=16,i=0,r=Math.PI*2,s=0,a=Math.PI){super();this.type="SphereGeometry";this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:s,thetaLength:a};e=Math.max(3,Math.floor(e));n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const c=[];const u=new fn;const h=new fn;const f=[];const d=[];const p=[];const m=[];for(let f=0;f<=n;f++){const g=[];const _=f/n;let x=0;if(f===0&&s===0){x=.5/e}else if(f===n&&o===Math.PI){x=-.5/e}for(let n=0;n<=e;n++){const o=n/e;u.x=-t*Math.cos(i+o*r)*Math.sin(s+_*a);u.y=t*Math.cos(s+_*a);u.z=t*Math.sin(i+o*r)*Math.sin(s+_*a);d.push(u.x,u.y,u.z);h.copy(u).normalize();p.push(h.x,h.y,h.z);m.push(o+x,1-_);g.push(l++)}c.push(g)}for(let t=0;t<n;t++){for(let i=0;i<e;i++){const e=c[t][i+1];const r=c[t][i];const a=c[t+1][i];const l=c[t+1][i+1];if(t!==0||s>0)f.push(e,r,l);if(t!==n-1||o<Math.PI)f.push(r,a,l)}}this.setIndex(f);this.setAttribute("position",new Bi(d,3));this.setAttribute("normal",new Bi(p,3));this.setAttribute("uv",new Bi(m,2))}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}static fromJSON(t){return new Xh(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class jh extends Ai{constructor(t){super();this.isMeshLambertMaterial=true;this.type="MeshLambertMaterial";this.color=new Pi(16777215);this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new Pi(0);this.emissiveIntensity=1;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=me;this.normalScale=new Fe(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=V;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.flatShading=false;this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.lightMap=t.lightMap;this.lightMapIntensity=t.lightMapIntensity;this.aoMap=t.aoMap;this.aoMapIntensity=t.aoMapIntensity;this.emissive.copy(t.emissive);this.emissiveMap=t.emissiveMap;this.emissiveIntensity=t.emissiveIntensity;this.bumpMap=t.bumpMap;this.bumpScale=t.bumpScale;this.normalMap=t.normalMap;this.normalMapType=t.normalMapType;this.normalScale.copy(t.normalScale);this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;this.specularMap=t.specularMap;this.alphaMap=t.alphaMap;this.envMap=t.envMap;this.combine=t.combine;this.reflectivity=t.reflectivity;this.refractionRatio=t.refractionRatio;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;this.wireframeLinecap=t.wireframeLinecap;this.wireframeLinejoin=t.wireframeLinejoin;this.flatShading=t.flatShading;this.fog=t.fog;return this}}const Yh={enabled:false,files:{},add:function(t,e){if(this.enabled===false)return;this.files[t]=e},get:function(t){if(this.enabled===false)return;return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Jh{constructor(t,e,n){const i=this;let r=false;let s=0;let a=0;let o=undefined;const l=[];this.onStart=undefined;this.onLoad=t;this.onProgress=e;this.onError=n;this.itemStart=function(t){a++;if(r===false){if(i.onStart!==undefined){i.onStart(t,s,a)}}r=true};this.itemEnd=function(t){s++;if(i.onProgress!==undefined){i.onProgress(t,s,a)}if(s===a){r=false;if(i.onLoad!==undefined){i.onLoad()}}};this.itemError=function(t){if(i.onError!==undefined){i.onError(t)}};this.resolveURL=function(t){if(o){return o(t)}return t};this.setURLModifier=function(t){o=t;return this};this.addHandler=function(t,e){l.push(t,e);return this};this.removeHandler=function(t){const e=l.indexOf(t);if(e!==-1){l.splice(e,2)}return this};this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e];const i=l[e+1];if(n.global)n.lastIndex=0;if(n.test(t)){return i}}return null}}}const Zh=new Jh;class Kh{constructor(t){this.manager=t!==undefined?t:Zh;this.crossOrigin="anonymous";this.withCredentials=false;this.path="";this.resourcePath="";this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(i,r){n.load(t,i,e,r)}))}parse(){}setCrossOrigin(t){this.crossOrigin=t;return this}setWithCredentials(t){this.withCredentials=t;return this}setPath(t){this.path=t;return this}setResourcePath(t){this.resourcePath=t;return this}setRequestHeader(t){this.requestHeader=t;return this}}const Qh={};class $h extends Error{constructor(t,e){super(t);this.response=e}}class tf extends Kh{constructor(t){super(t)}load(t,e,n,i){if(t===undefined)t="";if(this.path!==undefined)t=this.path+t;t=this.manager.resolveURL(t);const r=Yh.get(t);if(r!==undefined){this.manager.itemStart(t);setTimeout((()=>{if(e)e(r);this.manager.itemEnd(t)}),0);return r}if(Qh[t]!==undefined){Qh[t].push({onLoad:e,onProgress:n,onError:i});return}Qh[t]=[];Qh[t].push({onLoad:e,onProgress:n,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});const a=this.mimeType;const o=this.responseType;fetch(s).then((e=>{if(e.status===200||e.status===0){if(e.status===0){console.warn("THREE.FileLoader: HTTP Status 0 received.")}if(typeof ReadableStream==="undefined"||e.body===undefined||e.body.getReader===undefined){return e}const n=Qh[t];const i=e.body.getReader();const r=e.headers.get("Content-Length")||e.headers.get("X-File-Size");const s=r?parseInt(r):0;const a=s!==0;let o=0;const l=new ReadableStream({start(t){e();function e(){i.read().then((({done:i,value:r})=>{if(i){t.close()}else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=n.length;t<e;t++){const e=n[t];if(e.onProgress)e.onProgress(i)}t.enqueue(r);e()}}))}}});return new Response(l)}else{throw new $h(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>{const e=new DOMParser;return e.parseFromString(t,a)}));case"json":return t.json();default:if(a===undefined){return t.text()}else{const e=/charset="?([^;"\s]*)"?/i;const n=e.exec(a);const i=n&&n[1]?n[1].toLowerCase():undefined;const r=new TextDecoder(i);return t.arrayBuffer().then((t=>r.decode(t)))}}})).then((e=>{Yh.add(t,e);const n=Qh[t];delete Qh[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];if(i.onLoad)i.onLoad(e)}})).catch((e=>{const n=Qh[t];if(n===undefined){this.manager.itemError(t);throw e}delete Qh[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];if(i.onError)i.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)}));this.manager.itemStart(t)}setResponseType(t){this.responseType=t;return this}setMimeType(t){this.mimeType=t;return this}}class ef extends di{constructor(t,e=1){super();this.isLight=true;this.type="Light";this.color=new Pi(t);this.intensity=e}dispose(){}copy(t,e){super.copy(t,e);this.color.copy(t.color);this.intensity=t.intensity;return this}toJSON(t){const e=super.toJSON(t);e.object.color=this.color.getHex();e.object.intensity=this.intensity;if(this.groundColor!==undefined)e.object.groundColor=this.groundColor.getHex();if(this.distance!==undefined)e.object.distance=this.distance;if(this.angle!==undefined)e.object.angle=this.angle;if(this.decay!==undefined)e.object.decay=this.decay;if(this.penumbra!==undefined)e.object.penumbra=this.penumbra;if(this.shadow!==undefined)e.object.shadow=this.shadow.toJSON();return e}}const nf=new Gn;const rf=new fn;const sf=new fn;class af{constructor(t){this.camera=t;this.bias=0;this.normalBias=0;this.radius=1;this.blurSamples=8;this.mapSize=new Fe(512,512);this.map=null;this.mapPass=null;this.matrix=new Gn;this.autoUpdate=true;this.needsUpdate=false;this._frustum=new Or;this._frameExtents=new Fe(1,1);this._viewportCount=1;this._viewports=[new on(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera;const n=this.matrix;rf.setFromMatrixPosition(t.matrixWorld);e.position.copy(rf);sf.setFromMatrixPosition(t.target.matrixWorld);e.lookAt(sf);e.updateMatrixWorld();nf.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse);this._frustum.setFromProjectionMatrix(nf);n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);n.multiply(nf)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){if(this.map){this.map.dispose()}if(this.mapPass){this.mapPass.dispose()}}copy(t){this.camera=t.camera.clone();this.bias=t.bias;this.radius=t.radius;this.mapSize.copy(t.mapSize);return this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};if(this.bias!==0)t.bias=this.bias;if(this.normalBias!==0)t.normalBias=this.normalBias;if(this.radius!==1)t.radius=this.radius;if(this.mapSize.x!==512||this.mapSize.y!==512)t.mapSize=this.mapSize.toArray();t.camera=this.camera.toJSON(false).object;delete t.camera.matrix;return t}}class of extends af{constructor(){super(new Ao(-5,5,5,-5,.5,500));this.isDirectionalLightShadow=true}}class lf extends ef{constructor(t,e){super(t,e);this.isDirectionalLight=true;this.type="DirectionalLight";this.position.copy(di.DEFAULT_UP);this.updateMatrix();this.target=new di;this.shadow=new of}dispose(){this.shadow.dispose()}copy(t){super.copy(t);this.target=t.target.clone();this.shadow=t.shadow.clone();return this}}class cf{constructor(t,e,n=0,i=Infinity){this.ray=new Hn(t,e);this.near=n;this.far=i;this.camera=null;this.layers=new $n;this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){if(e.isPerspectiveCamera){this.ray.origin.setFromMatrixPosition(e.matrixWorld);this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize();this.camera=e}else if(e.isOrthographicCamera){this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e);this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld);this.camera=e}else{console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}}intersectObject(t,e=true,n=[]){hf(t,this,n,e);n.sort(uf);return n}intersectObjects(t,e=true,n=[]){for(let i=0,r=t.length;i<r;i++){hf(t[i],this,n,e)}n.sort(uf);return n}}function uf(t,e){return t.distance-e.distance}function hf(t,e,n,i){if(t.layers.test(e.layers)){t.raycast(e,n)}if(i===true){const i=t.children;for(let t=0,r=i.length;t<r;t++){hf(i[t],e,n,true)}}}class ff{constructor(t=1,e=0,n=0){this.radius=t;this.phi=e;this.theta=n;return this}set(t,e,n){this.radius=t;this.phi=e;this.theta=n;return this}copy(t){this.radius=t.radius;this.phi=t.phi;this.theta=t.theta;return this}makeSafe(){const t=1e-6;this.phi=Math.max(t,Math.min(Math.PI-t,this.phi));return this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){this.radius=Math.sqrt(t*t+e*e+n*n);if(this.radius===0){this.theta=0;this.phi=0}else{this.theta=Math.atan2(t,n);this.phi=Math.acos(Le(e/this.radius,-1,1))}return this}clone(){return(new this.constructor).copy(this)}}class df extends Eu{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t];const n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1];const i=new Yi;i.setAttribute("position",new Bi(e,3));i.setAttribute("color",new Bi(n,3));const r=new pu({vertexColors:true,toneMapped:false});super(i,r);this.type="AxesHelper"}setColors(t,e,n){const i=new Pi;const r=this.geometry.attributes.color.array;i.set(t);i.toArray(r,0);i.toArray(r,3);i.set(e);i.toArray(r,6);i.toArray(r,9);i.set(n);i.toArray(r,12);i.toArray(r,15);this.geometry.attributes.color.needsUpdate=true;return this}dispose(){this.geometry.dispose();this.material.dispose()}}class pf{constructor(){this.type="ShapePath";this.color=new Pi;this.subPaths=[];this.currentPath=null}moveTo(t,e){this.currentPath=new ah;this.subPaths.push(this.currentPath);this.currentPath.moveTo(t,e);return this}lineTo(t,e){this.currentPath.lineTo(t,e);return this}quadraticCurveTo(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i);return this}bezierCurveTo(t,e,n,i,r,s){this.currentPath.bezierCurveTo(t,e,n,i,r,s);return this}splineThru(t){this.currentPath.splineThru(t);return this}toShapes(t){function e(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];const r=new oh;r.curves=i.curves;e.push(r)}return e}function n(t,e){const n=e.length;let i=false;for(let r=n-1,s=0;s<n;r=s++){let n=e[r];let a=e[s];let o=a.x-n.x;let l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0){n=e[s];o=-o;a=e[r];l=-l}if(t.y<n.y||t.y>a.y)continue;if(t.y===n.y){if(t.x===n.x)return true}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(e===0)return true;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return true}}return i}const i=Bh.isClockWise;const r=this.subPaths;if(r.length===0)return[];let s,a,o;const l=[];if(r.length===1){a=r[0];o=new oh;o.curves=a.curves;l.push(o);return l}let c=!i(r[0].getPoints());c=t?!c:c;const u=[];const h=[];let f=[];let d=0;let p;h[d]=undefined;f[d]=[];for(let e=0,n=r.length;e<n;e++){a=r[e];p=a.getPoints();s=i(p);s=t?!s:s;if(s){if(!c&&h[d])d++;h[d]={s:new oh,p:p};h[d].s.curves=a.curves;if(c)d++;f[d]=[]}else{f[d].push({h:a,p:p[0]})}}if(!h[0])return e(r);if(h.length>1){let t=false;let e=0;for(let t=0,e=h.length;t<e;t++){u[t]=[]}for(let i=0,r=h.length;i<r;i++){const r=f[i];for(let s=0;s<r.length;s++){const a=r[s];let o=true;for(let r=0;r<h.length;r++){if(n(a.p,h[r].p)){if(i!==r)e++;if(o){o=false;u[r].push(a)}else{t=true}}}if(o){u[i].push(a)}}}if(e>0&&t===false){f=u}}let m;for(let t=0,e=h.length;t<e;t++){o=h[t].s;l.push(o);m=f[t];for(let t=0,e=m.length;t<e;t++){o.holes.push(m[t].h)}}return l}}if(typeof __THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:e}}))}if(typeof window!=="undefined"){if(window.__THREE__){console.warn("WARNING: Multiple instances of Three.js being imported.")}else{window.__THREE__=e}}class mf extends Vh{constructor(t,e={}){const n=e.font;if(n===undefined){super()}else{const i=n.generateShapes(t,e.size);e.depth=e.height!==undefined?e.height:50;if(e.bevelThickness===undefined)e.bevelThickness=10;if(e.bevelSize===undefined)e.bevelSize=8;if(e.bevelEnabled===undefined)e.bevelEnabled=false;super(i,e)}this.type="TextGeometry"}}class gf extends Kh{constructor(t){super(t)}load(t,e,n,i){const r=this;const s=new tf(this.manager);s.setPath(this.path);s.setRequestHeader(this.requestHeader);s.setWithCredentials(this.withCredentials);s.load(t,(function(t){const n=r.parse(JSON.parse(t));if(e)e(n)}),n,i)}parse(t){return new _f(t)}}class _f{constructor(t){this.isFont=true;this.type="Font";this.data=t}generateShapes(t,e=100){const n=[];const i=xf(t,e,this.data);for(let t=0,e=i.length;t<e;t++){n.push(...i[t].toShapes())}return n}}function xf(t,e,n){const i=Array.from(t);const r=e/n.resolution;const s=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r;const a=[];let o=0,l=0;for(let t=0;t<i.length;t++){const e=i[t];if(e==="\n"){o=0;l-=s}else{const t=vf(e,r,o,l,n);o+=t.offsetX;a.push(t.path)}}return a}function vf(t,e,n,i,r){const s=r.glyphs[t]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");return}const a=new pf;let o,l,c,u,h,f,d,p;if(s.o){const t=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let r=0,s=t.length;r<s;){const s=t[r++];switch(s){case"m":o=t[r++]*e+n;l=t[r++]*e+i;a.moveTo(o,l);break;case"l":o=t[r++]*e+n;l=t[r++]*e+i;a.lineTo(o,l);break;case"q":c=t[r++]*e+n;u=t[r++]*e+i;h=t[r++]*e+n;f=t[r++]*e+i;a.quadraticCurveTo(h,f,c,u);break;case"b":c=t[r++]*e+n;u=t[r++]*e+i;h=t[r++]*e+n;f=t[r++]*e+i;d=t[r++]*e+n;p=t[r++]*e+i;a.bezierCurveTo(h,f,d,p,c,u);break}}}return{offsetX:s.ha*e,path:a}}var Mf={0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}};var yf="normal";var Sf=1189;var Ef=-100;var Tf="normal";var bf={yMin:-334,xMin:-111,yMax:1189,xMax:1672};var wf=1e3;var Af={postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"};var Rf=-334;var qf="Helvetiker";var Cf=1522;var Lf=50;var Pf={glyphs:Mf,cssFontWeight:yf,ascender:Sf,underlinePosition:Ef,cssFontStyle:Tf,boundingBox:bf,resolution:wf,original_font_information:Af,descender:Rf,familyName:qf,lineHeight:Cf,underlineThickness:Lf};function Uf(e){e.render2DSerieLarge=async function(n){const i=await import("./DragControls-e3b6a937.js");e.mainDiv.selectAll("*").remove();e.canvas=e.mainDiv.insert("div").style("display","inline-block").append("canvas").node();e.canvas.width=e.settings.svgw;e.canvas.height=e.settings.svgh;n.chartDiv.style("margin","20px 20px");n.legendDiv=e.mainDiv.insert("div").style("display","inline-block").style("vertical-align","top");let r=Math.min(20*40/n.colorLegend.size,20);if(r<12)r=12;const s=(n.colorLegend.size+6)*r;n.legendG=n.legendDiv.append("svg").attr("width",e.settings.svgw/2).attr("height",s).append("g").attr("transform","translate(20, 0)");e.renderLegend(n,r);const a=e.settings.threeFOV;const o=.1;const l=1e3;const c=new br(a,1,o,l);const u=new du;c.position.set(0,0,1);c.lookAt(u.position);c.updateMatrix();const h=new Pi("rgb(255,255,255)");u.background=h;const f=new Yi;new Fe;const{vertices:d,colors:p}=v();f.setAttribute("position",new Bi(d,3));f.setAttribute("color",new Bi(p,3));const m=M(128);const g=new Tu({size:e.settings.threeSize,sizeAttenuation:true,transparent:true,opacity:e.settings.opacity,map:m,vertexColors:true});const _=new qu(f,g);u.add(_);const x=new hu({antialias:true,canvas:e.canvas,preserveDrawingBuffer:true});x.setPixelRatio(window.devicePixelRatio);new i.DragControls([_],c,x.domElement);document.addEventListener("mousewheel",(t=>{if(t.ctrlKey)c.position.z+=t.deltaY/500}));function v(){const i=[];const r=[];for(const s of n.data.samples){const a=e.getOpacity(s);if(a==0)continue;let o=(n.xAxisScale(s.x)-n.xScaleMin)/e.canvas.width;let l=(n.yAxisScale(s.y)-n.yScaleMax)/-e.canvas.height;let c=(n.zAxisScale(s.z)-n.zScaleMin)/e.settings.svgd;i.push(o-.5,l+.7,c);const u=new Pi(t(e.getColor(s,n)).toString());r.push(u.r,u.g,u.b)}return{vertices:i,colors:r}}function M(t){const e=document.createElement("canvas");e.width=t;e.height=t;const n=e.getContext("2d");n.clearRect(0,0,t,t);n.fillStyle="white";n.beginPath();n.arc(t/2,t/2,t/2,0,2*Math.PI);n.fill();const i=new Lu(e);return i}function y(){requestAnimationFrame(y);c.zoom=e.zoom;c.updateProjectionMatrix();x.render(u,c)}y()};e.render3DSerie=async function(n){const i=await import("./OrbitControls-694652cd.js");n.chartDiv.selectAll("*").remove();e.canvas=e.mainDiv.insert("div").style("display","inline-block").append("canvas").node();e.canvas.width=e.settings.svgw;e.canvas.height=e.settings.svgh;n.chartDiv.style("margin","20px 20px");n.legendDiv=e.mainDiv.insert("div").style("display","inline-block").style("vertical-align","top");n.legendG=n.legendDiv.append("svg").attr("width",e.settings.svgw/2).attr("height",e.settings.svgh).attr("width",e.settings.svgw).attr("height",e.settings.svgh).append("g").attr("transform","translate(20, 20)");e.renderLegend(n);const r=e.settings.fov;const s=.1;const a=1e3;const o=new br(r,1,s,a);const l=new du;const c=new i.OrbitControls(o,e.canvas);c.enableZoom=false;c.update();o.position.set(1.5,.5,2);o.lookAt(l.position);if(e.settings.showAxes){const t=new df(1);l.add(t);e.addLabels(l,n)}o.updateMatrix();const u=new Pi("rgb(255,255,255)");l.background=u;const h=new lf(u,2);h.position.set(.1,.1,2);l.add(h);const f=new Xh(.005,32);for(const i of n.data.samples){const r=e.getOpacity(i);if(r==0)continue;let s=n.xMax==n.xMin?0:Math.abs((i.x-n.xMin)/(n.xMax-n.xMin));let a=n.yMax==n.yMin?0:Math.abs((i.y-n.yMin)/(n.yMax-n.yMin));let o=n.zMax==n.zMin?0:Math.abs((i.z-n.zMin)/(n.zMax-n.zMin));const c=new Pi(t(e.getColor(i,n)).toString());const u=new jh({color:c});const h=new fr(f,u);l.add(h);h.position.set(s,a,o);l.add(h)}const d=new hu({antialias:true,canvas:e.canvas,preserveDrawingBuffer:true});d.setPixelRatio(window.devicePixelRatio);document.addEventListener("mousewheel",(t=>{c.enableZoom=t.ctrlKey}));function p(){requestAnimationFrame(p);c.update();d.render(l,o)}p()};e.addLabels=async function(t){const n=.7;let i=s(e.config.term.term.name);let r=new fr(i,new Di({color:new Pi(n,n/4,n/4)}));r.position.x=.01;r.position.y=-.03;t.add(r);i=s(e.config.term2.term.name);i.rotateZ(Math.PI/2);r=new fr(i,new Di({color:new Pi(n/4,n,n/4)}));r.position.x=-.03;r.position.y=.01;t.add(r);i=s(e.config.term0.term.name);i.rotateY(Math.PI/2);r=new fr(i,new Di({color:new Pi(n/4,n/4,n)}));r.position.z=.98;r.position.y=-.03;t.add(r);function s(t){const e=new gf;const n=e.parse(Pf);const i=new mf(t,{font:n,size:.02,height:.005,curveSegments:8,bevelEnabled:false});return i}}}var Df=Object.freeze({__proto__:null,setRenderersThree:Uf});export{we as E,Gn as M,Dr as P,hn as Q,cf as R,ff as S,i as T,Fe as V,fn as a,n as b,Df as c,Uf as s};
6
+ */const e="152";const n={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2};const i={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};const r=0;const s=1;const a=2;const o=1;const l=2;const c=3;const u=0;const h=1;const f=2;const d=0;const p=1;const m=2;const g=3;const _=4;const x=5;const v=100;const M=101;const y=102;const S=103;const E=104;const T=200;const b=201;const w=202;const A=203;const R=204;const q=205;const C=206;const L=207;const P=208;const U=209;const D=210;const I=0;const N=1;const O=2;const F=3;const z=4;const B=5;const H=6;const G=7;const V=0;const k=1;const W=2;const X=0;const j=1;const Y=2;const J=3;const Z=4;const K=5;const Q=300;const $=301;const tt=302;const et=303;const nt=304;const it=306;const rt=1e3;const st=1001;const at=1002;const ot=1003;const lt=1004;const ct=1005;const ut=1006;const ht=1007;const ft=1008;const dt=1009;const pt=1010;const mt=1011;const gt=1012;const _t=1013;const xt=1014;const vt=1015;const Mt=1016;const yt=1017;const St=1018;const Et=1020;const Tt=1021;const bt=1023;const wt=1024;const At=1025;const Rt=1026;const qt=1027;const Ct=1028;const Lt=1029;const Pt=1030;const Ut=1031;const Dt=1033;const It=33776;const Nt=33777;const Ot=33778;const Ft=33779;const zt=35840;const Bt=35841;const Ht=35842;const Gt=35843;const Vt=36196;const kt=37492;const Wt=37496;const Xt=37808;const jt=37809;const Yt=37810;const Jt=37811;const Zt=37812;const Kt=37813;const Qt=37814;const $t=37815;const te=37816;const ee=37817;const ne=37818;const ie=37819;const re=37820;const se=37821;const ae=36492;const oe=36283;const le=36284;const ce=36285;const ue=36286;const he=3e3;const fe=3001;const de=3200;const pe=3201;const me=0;const ge=1;const _e="";const xe="srgb";const ve="srgb-linear";const Me="display-p3";const ye=7680;const Se=519;const Ee=35044;const Te="300 es";const be=1035;class we{addEventListener(t,e){if(this._listeners===undefined)this._listeners={};const n=this._listeners;if(n[t]===undefined){n[t]=[]}if(n[t].indexOf(e)===-1){n[t].push(e)}}hasEventListener(t,e){if(this._listeners===undefined)return false;const n=this._listeners;return n[t]!==undefined&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===undefined)return;const n=this._listeners;const i=n[t];if(i!==undefined){const t=i.indexOf(e);if(t!==-1){i.splice(t,1)}}}dispatchEvent(t){if(this._listeners===undefined)return;const e=this._listeners;const n=e[t.type];if(n!==undefined){t.target=this;const e=n.slice(0);for(let n=0,i=e.length;n<i;n++){e[n].call(this,t)}t.target=null}}}const Ae=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];const Re=Math.PI/180;const qe=180/Math.PI;function Ce(){const t=Math.random()*4294967295|0;const e=Math.random()*4294967295|0;const n=Math.random()*4294967295|0;const i=Math.random()*4294967295|0;const r=Ae[t&255]+Ae[t>>8&255]+Ae[t>>16&255]+Ae[t>>24&255]+"-"+Ae[e&255]+Ae[e>>8&255]+"-"+Ae[e>>16&15|64]+Ae[e>>24&255]+"-"+Ae[n&63|128]+Ae[n>>8&255]+"-"+Ae[n>>16&255]+Ae[n>>24&255]+Ae[i&255]+Ae[i>>8&255]+Ae[i>>16&255]+Ae[i>>24&255];return r.toLowerCase()}function Le(t,e,n){return Math.max(e,Math.min(n,t))}function Pe(t,e){return(t%e+e)%e}function Ue(t,e,n){return(1-n)*t+n*e}function De(t){return(t&t-1)===0&&t!==0}function Ie(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ne(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Oe(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class Fe{constructor(t=0,e=0){Fe.prototype.isVector2=true;this.x=t;this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){this.x=t;this.y=e;return this}setScalar(t){this.x=t;this.y=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){this.x=t.x;this.y=t.y;return this}add(t){this.x+=t.x;this.y+=t.y;return this}addScalar(t){this.x+=t;this.y+=t;return this}addVectors(t,e){this.x=t.x+e.x;this.y=t.y+e.y;return this}addScaledVector(t,e){this.x+=t.x*e;this.y+=t.y*e;return this}sub(t){this.x-=t.x;this.y-=t.y;return this}subScalar(t){this.x-=t;this.y-=t;return this}subVectors(t,e){this.x=t.x-e.x;this.y=t.y-e.y;return this}multiply(t){this.x*=t.x;this.y*=t.y;return this}multiplyScalar(t){this.x*=t;this.y*=t;return this}divide(t){this.x/=t.x;this.y/=t.y;return this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y;const i=t.elements;this.x=i[0]*e+i[3]*n+i[6];this.y=i[1]*e+i[4]*n+i[7];return this}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);return this}clamp(t,e){this.x=Math.max(t.x,Math.min(e.x,this.x));this.y=Math.max(t.y,Math.min(e.y,this.y));return this}clampScalar(t,e){this.x=Math.max(t,Math.min(e,this.x));this.y=Math.max(t,Math.min(e,this.y));return this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);return this}negate(){this.x=-this.x;this.y=-this.y;return this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){const t=Math.atan2(-this.y,-this.x)+Math.PI;return t}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Le(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){this.x+=(t.x-this.x)*e;this.y+=(t.y-this.y)*e;return this}lerpVectors(t,e,n){this.x=t.x+(e.x-t.x)*n;this.y=t.y+(e.y-t.y)*n;return this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){this.x=t[e];this.y=t[e+1];return this}toArray(t=[],e=0){t[e]=this.x;t[e+1]=this.y;return t}fromBufferAttribute(t,e){this.x=t.getX(e);this.y=t.getY(e);return this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e);const r=this.x-t.x;const s=this.y-t.y;this.x=r*n-s*i+t.x;this.y=r*i+s*n+t.y;return this}random(){this.x=Math.random();this.y=Math.random();return this}*[Symbol.iterator](){yield this.x;yield this.y}}class ze{constructor(){ze.prototype.isMatrix3=true;this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,n,i,r,s,a,o,l){const c=this.elements;c[0]=t;c[1]=i;c[2]=a;c[3]=e;c[4]=r;c[5]=o;c[6]=n;c[7]=s;c[8]=l;return this}identity(){this.set(1,0,0,0,1,0,0,0,1);return this}copy(t){const e=this.elements;const n=t.elements;e[0]=n[0];e[1]=n[1];e[2]=n[2];e[3]=n[3];e[4]=n[4];e[5]=n[5];e[6]=n[6];e[7]=n[7];e[8]=n[8];return this}extractBasis(t,e,n){t.setFromMatrix3Column(this,0);e.setFromMatrix3Column(this,1);n.setFromMatrix3Column(this,2);return this}setFromMatrix4(t){const e=t.elements;this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]);return this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements;const i=e.elements;const r=this.elements;const s=n[0],a=n[3],o=n[6];const l=n[1],c=n[4],u=n[7];const h=n[2],f=n[5],d=n[8];const p=i[0],m=i[3],g=i[6];const _=i[1],x=i[4],v=i[7];const M=i[2],y=i[5],S=i[8];r[0]=s*p+a*_+o*M;r[3]=s*m+a*x+o*y;r[6]=s*g+a*v+o*S;r[1]=l*p+c*_+u*M;r[4]=l*m+c*x+u*y;r[7]=l*g+c*v+u*S;r[2]=h*p+f*_+d*M;r[5]=h*m+f*x+d*y;r[8]=h*g+f*v+d*S;return this}multiplyScalar(t){const e=this.elements;e[0]*=t;e[3]*=t;e[6]*=t;e[1]*=t;e[4]*=t;e[7]*=t;e[2]*=t;e[5]*=t;e[8]*=t;return this}determinant(){const t=this.elements;const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],u=c*s-a*l,h=a*o-c*r,f=l*r-s*o,d=e*u+n*h+i*f;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;t[0]=u*p;t[1]=(i*l-c*n)*p;t[2]=(a*n-i*s)*p;t[3]=h*p;t[4]=(c*e-i*o)*p;t[5]=(i*r-a*e)*p;t[6]=f*p;t[7]=(n*o-l*e)*p;t[8]=(s*e-n*r)*p;return this}transpose(){let t;const e=this.elements;t=e[1];e[1]=e[3];e[3]=t;t=e[2];e[2]=e[6];e[6]=t;t=e[5];e[5]=e[7];e[7]=t;return this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;t[0]=e[0];t[1]=e[3];t[2]=e[6];t[3]=e[1];t[4]=e[4];t[5]=e[7];t[6]=e[2];t[7]=e[5];t[8]=e[8];return this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r);const l=Math.sin(r);this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1);return this}scale(t,e){this.premultiply(Be.makeScale(t,e));return this}rotate(t){this.premultiply(Be.makeRotation(-t));return this}translate(t,e){this.premultiply(Be.makeTranslation(t,e));return this}makeTranslation(t,e){this.set(1,0,t,0,1,e,0,0,1);return this}makeRotation(t){const e=Math.cos(t);const n=Math.sin(t);this.set(e,-n,0,n,e,0,0,0,1);return this}makeScale(t,e){this.set(t,0,0,0,e,0,0,0,1);return this}equals(t){const e=this.elements;const n=t.elements;for(let t=0;t<9;t++){if(e[t]!==n[t])return false}return true}fromArray(t,e=0){for(let n=0;n<9;n++){this.elements[n]=t[n+e]}return this}toArray(t=[],e=0){const n=this.elements;t[e]=n[0];t[e+1]=n[1];t[e+2]=n[2];t[e+3]=n[3];t[e+4]=n[4];t[e+5]=n[5];t[e+6]=n[6];t[e+7]=n[7];t[e+8]=n[8];return t}clone(){return(new this.constructor).fromArray(this.elements)}}const Be=new ze;function He(t){for(let e=t.length-1;e>=0;--e){if(t[e]>=65535)return true}return false}function Ge(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const Ve={};function ke(t){if(t in Ve)return;Ve[t]=true;console.warn(t)}function We(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Xe(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const je=(new ze).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]);const Ye=(new ze).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function Je(t){return t.convertSRGBToLinear().applyMatrix3(Ye)}function Ze(t){return t.applyMatrix3(je).convertLinearToSRGB()}const Ke={[ve]:t=>t,[xe]:t=>t.convertSRGBToLinear(),[Me]:Je};const Qe={[ve]:t=>t,[xe]:t=>t.convertLinearToSRGB(),[Me]:Ze};const $e={enabled:true,get legacyMode(){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.");return!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.");this.enabled=!t},get workingColorSpace(){return ve},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.enabled===false||e===n||!e||!n){return t}const i=Ke[e];const r=Qe[n];if(i===undefined||r===undefined){throw new Error(`Unsupported color space conversion, "${e}" to "${n}".`)}return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}};let tn;class en{static getDataURL(t){if(/^data:/i.test(t.src)){return t.src}if(typeof HTMLCanvasElement==="undefined"){return t.src}let e;if(t instanceof HTMLCanvasElement){e=t}else{if(tn===undefined)tn=Ge("canvas");tn.width=t.width;tn.height=t.height;const n=tn.getContext("2d");if(t instanceof ImageData){n.putImageData(t,0,0)}else{n.drawImage(t,0,0,t.width,t.height)}e=tn}if(e.width>2048||e.height>2048){console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t);return e.toDataURL("image/jpeg",.6)}else{return e.toDataURL("image/png")}}static sRGBToLinear(t){if(typeof HTMLImageElement!=="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&t instanceof ImageBitmap){const e=Ge("canvas");e.width=t.width;e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height);const r=i.data;for(let t=0;t<r.length;t++){r[t]=We(r[t]/255)*255}n.putImageData(i,0,0);return e}else if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++){if(e instanceof Uint8Array||e instanceof Uint8ClampedArray){e[t]=Math.floor(We(e[t]/255)*255)}else{e[t]=We(e[t])}}return{data:e,width:t.width,height:t.height}}else{console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.");return t}}}class nn{constructor(t=null){this.isSource=true;this.uuid=Ce();this.data=t;this.version=0}set needsUpdate(t){if(t===true)this.version++}toJSON(t){const e=t===undefined||typeof t==="string";if(!e&&t.images[this.uuid]!==undefined){return t.images[this.uuid]}const n={uuid:this.uuid,url:""};const i=this.data;if(i!==null){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++){if(i[e].isDataTexture){t.push(rn(i[e].image))}else{t.push(rn(i[e]))}}}else{t=rn(i)}n.url=t}if(!e){t.images[this.uuid]=n}return n}}function rn(t){if(typeof HTMLImageElement!=="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&t instanceof ImageBitmap){return en.getDataURL(t)}else{if(t.data){return{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}}else{console.warn("THREE.Texture: Unable to serialize Texture.");return{}}}}let sn=0;class an extends we{constructor(t=an.DEFAULT_IMAGE,e=an.DEFAULT_MAPPING,n=st,i=st,r=ut,s=ft,a=bt,o=dt,l=an.DEFAULT_ANISOTROPY,c=_e){super();this.isTexture=true;Object.defineProperty(this,"id",{value:sn++});this.uuid=Ce();this.name="";this.source=new nn(t);this.mipmaps=[];this.mapping=e;this.channel=0;this.wrapS=n;this.wrapT=i;this.magFilter=r;this.minFilter=s;this.anisotropy=l;this.format=a;this.internalFormat=null;this.type=o;this.offset=new Fe(0,0);this.repeat=new Fe(1,1);this.center=new Fe(0,0);this.rotation=0;this.matrixAutoUpdate=true;this.matrix=new ze;this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.unpackAlignment=4;if(typeof c==="string"){this.colorSpace=c}else{ke("THREE.Texture: Property .encoding has been replaced by .colorSpace.");this.colorSpace=c===fe?xe:_e}this.userData={};this.version=0;this.onUpdate=null;this.isRenderTargetTexture=false;this.needsPMREMUpdate=false}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name;this.source=t.source;this.mipmaps=t.mipmaps.slice(0);this.mapping=t.mapping;this.channel=t.channel;this.wrapS=t.wrapS;this.wrapT=t.wrapT;this.magFilter=t.magFilter;this.minFilter=t.minFilter;this.anisotropy=t.anisotropy;this.format=t.format;this.internalFormat=t.internalFormat;this.type=t.type;this.offset.copy(t.offset);this.repeat.copy(t.repeat);this.center.copy(t.center);this.rotation=t.rotation;this.matrixAutoUpdate=t.matrixAutoUpdate;this.matrix.copy(t.matrix);this.generateMipmaps=t.generateMipmaps;this.premultiplyAlpha=t.premultiplyAlpha;this.flipY=t.flipY;this.unpackAlignment=t.unpackAlignment;this.colorSpace=t.colorSpace;this.userData=JSON.parse(JSON.stringify(t.userData));this.needsUpdate=true;return this}toJSON(t){const e=t===undefined||typeof t==="string";if(!e&&t.textures[this.uuid]!==undefined){return t.textures[this.uuid]}const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(Object.keys(this.userData).length>0)n.userData=this.userData;if(!e){t.textures[this.uuid]=n}return n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Q)return t;t.applyMatrix3(this.matrix);if(t.x<0||t.x>1){switch(this.wrapS){case rt:t.x=t.x-Math.floor(t.x);break;case st:t.x=t.x<0?0:1;break;case at:if(Math.abs(Math.floor(t.x)%2)===1){t.x=Math.ceil(t.x)-t.x}else{t.x=t.x-Math.floor(t.x)}break}}if(t.y<0||t.y>1){switch(this.wrapT){case rt:t.y=t.y-Math.floor(t.y);break;case st:t.y=t.y<0?0:1;break;case at:if(Math.abs(Math.floor(t.y)%2)===1){t.y=Math.ceil(t.y)-t.y}else{t.y=t.y-Math.floor(t.y)}break}}if(this.flipY){t.y=1-t.y}return t}set needsUpdate(t){if(t===true){this.version++;this.source.needsUpdate=true}}get encoding(){ke("THREE.Texture: Property .encoding has been replaced by .colorSpace.");return this.colorSpace===xe?fe:he}set encoding(t){ke("THREE.Texture: Property .encoding has been replaced by .colorSpace.");this.colorSpace=t===fe?xe:_e}}an.DEFAULT_IMAGE=null;an.DEFAULT_MAPPING=Q;an.DEFAULT_ANISOTROPY=1;class on{constructor(t=0,e=0,n=0,i=1){on.prototype.isVector4=true;this.x=t;this.y=e;this.z=n;this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){this.x=t;this.y=e;this.z=n;this.w=i;return this}setScalar(t){this.x=t;this.y=t;this.z=t;this.w=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setZ(t){this.z=t;return this}setW(t){this.w=t;return this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){this.x=t.x;this.y=t.y;this.z=t.z;this.w=t.w!==undefined?t.w:1;return this}add(t){this.x+=t.x;this.y+=t.y;this.z+=t.z;this.w+=t.w;return this}addScalar(t){this.x+=t;this.y+=t;this.z+=t;this.w+=t;return this}addVectors(t,e){this.x=t.x+e.x;this.y=t.y+e.y;this.z=t.z+e.z;this.w=t.w+e.w;return this}addScaledVector(t,e){this.x+=t.x*e;this.y+=t.y*e;this.z+=t.z*e;this.w+=t.w*e;return this}sub(t){this.x-=t.x;this.y-=t.y;this.z-=t.z;this.w-=t.w;return this}subScalar(t){this.x-=t;this.y-=t;this.z-=t;this.w-=t;return this}subVectors(t,e){this.x=t.x-e.x;this.y=t.y-e.y;this.z=t.z-e.z;this.w=t.w-e.w;return this}multiply(t){this.x*=t.x;this.y*=t.y;this.z*=t.z;this.w*=t.w;return this}multiplyScalar(t){this.x*=t;this.y*=t;this.z*=t;this.w*=t;return this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w;const s=t.elements;this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r;this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r;this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r;this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r;return this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);if(e<1e-4){this.x=1;this.y=0;this.z=0}else{this.x=t.x/e;this.y=t.y/e;this.z=t.z/e}return this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],u=o[8],h=o[1],f=o[5],d=o[9],p=o[2],m=o[6],g=o[10];if(Math.abs(c-h)<s&&Math.abs(u-p)<s&&Math.abs(d-m)<s){if(Math.abs(c+h)<a&&Math.abs(u+p)<a&&Math.abs(d+m)<a&&Math.abs(l+f+g-3)<a){this.set(1,0,0,0);return this}e=Math.PI;const t=(l+1)/2;const o=(f+1)/2;const _=(g+1)/2;const x=(c+h)/4;const v=(u+p)/4;const M=(d+m)/4;if(t>o&&t>_){if(t<s){n=0;i=.707106781;r=.707106781}else{n=Math.sqrt(t);i=x/n;r=v/n}}else if(o>_){if(o<s){n=.707106781;i=0;r=.707106781}else{i=Math.sqrt(o);n=x/i;r=M/i}}else{if(_<s){n=.707106781;i=.707106781;r=0}else{r=Math.sqrt(_);n=v/r;i=M/r}}this.set(n,i,r,e);return this}let _=Math.sqrt((m-d)*(m-d)+(u-p)*(u-p)+(h-c)*(h-c));if(Math.abs(_)<.001)_=1;this.x=(m-d)/_;this.y=(u-p)/_;this.z=(h-c)/_;this.w=Math.acos((l+f+g-1)/2);return this}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);this.z=Math.min(this.z,t.z);this.w=Math.min(this.w,t.w);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);this.z=Math.max(this.z,t.z);this.w=Math.max(this.w,t.w);return this}clamp(t,e){this.x=Math.max(t.x,Math.min(e.x,this.x));this.y=Math.max(t.y,Math.min(e.y,this.y));this.z=Math.max(t.z,Math.min(e.z,this.z));this.w=Math.max(t.w,Math.min(e.w,this.w));return this}clampScalar(t,e){this.x=Math.max(t,Math.min(e,this.x));this.y=Math.max(t,Math.min(e,this.y));this.z=Math.max(t,Math.min(e,this.z));this.w=Math.max(t,Math.min(e,this.w));return this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w);return this}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){this.x+=(t.x-this.x)*e;this.y+=(t.y-this.y)*e;this.z+=(t.z-this.z)*e;this.w+=(t.w-this.w)*e;return this}lerpVectors(t,e,n){this.x=t.x+(e.x-t.x)*n;this.y=t.y+(e.y-t.y)*n;this.z=t.z+(e.z-t.z)*n;this.w=t.w+(e.w-t.w)*n;return this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){this.x=t[e];this.y=t[e+1];this.z=t[e+2];this.w=t[e+3];return this}toArray(t=[],e=0){t[e]=this.x;t[e+1]=this.y;t[e+2]=this.z;t[e+3]=this.w;return t}fromBufferAttribute(t,e){this.x=t.getX(e);this.y=t.getY(e);this.z=t.getZ(e);this.w=t.getW(e);return this}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();this.w=Math.random();return this}*[Symbol.iterator](){yield this.x;yield this.y;yield this.z;yield this.w}}class ln extends we{constructor(t=1,e=1,n={}){super();this.isWebGLRenderTarget=true;this.width=t;this.height=e;this.depth=1;this.scissor=new on(0,0,t,e);this.scissorTest=false;this.viewport=new on(0,0,t,e);const i={width:t,height:e,depth:1};if(n.encoding!==undefined){ke("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.");n.colorSpace=n.encoding===fe?xe:_e}this.texture=new an(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);this.texture.isRenderTargetTexture=true;this.texture.flipY=false;this.texture.generateMipmaps=n.generateMipmaps!==undefined?n.generateMipmaps:false;this.texture.internalFormat=n.internalFormat!==undefined?n.internalFormat:null;this.texture.minFilter=n.minFilter!==undefined?n.minFilter:ut;this.depthBuffer=n.depthBuffer!==undefined?n.depthBuffer:true;this.stencilBuffer=n.stencilBuffer!==undefined?n.stencilBuffer:false;this.depthTexture=n.depthTexture!==undefined?n.depthTexture:null;this.samples=n.samples!==undefined?n.samples:0}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t;this.height=e;this.depth=n;this.texture.image.width=t;this.texture.image.height=e;this.texture.image.depth=n;this.dispose()}this.viewport.set(0,0,t,e);this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width;this.height=t.height;this.depth=t.depth;this.scissor.copy(t.scissor);this.scissorTest=t.scissorTest;this.viewport.copy(t.viewport);this.texture=t.texture.clone();this.texture.isRenderTargetTexture=true;const e=Object.assign({},t.texture.image);this.texture.source=new nn(e);this.depthBuffer=t.depthBuffer;this.stencilBuffer=t.stencilBuffer;if(t.depthTexture!==null)this.depthTexture=t.depthTexture.clone();this.samples=t.samples;return this}dispose(){this.dispatchEvent({type:"dispose"})}}class cn extends an{constructor(t=null,e=1,n=1,i=1){super(null);this.isDataArrayTexture=true;this.image={data:t,width:e,height:n,depth:i};this.magFilter=ot;this.minFilter=ot;this.wrapR=st;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1}}class un extends an{constructor(t=null,e=1,n=1,i=1){super(null);this.isData3DTexture=true;this.image={data:t,width:e,height:n,depth:i};this.magFilter=ot;this.minFilter=ot;this.wrapR=st;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1}}class hn{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=true;this._x=t;this._y=e;this._z=n;this._w=i}static slerpFlat(t,e,n,i,r,s,a){let o=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const h=r[s+0],f=r[s+1],d=r[s+2],p=r[s+3];if(a===0){t[e+0]=o;t[e+1]=l;t[e+2]=c;t[e+3]=u;return}if(a===1){t[e+0]=h;t[e+1]=f;t[e+2]=d;t[e+3]=p;return}if(u!==p||o!==h||l!==f||c!==d){let t=1-a;const e=o*h+l*f+c*d+u*p,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r;a=Math.sin(a*s)/r}const r=a*n;o=o*t+h*r;l=l*t+f*r;c=c*t+d*r;u=u*t+p*r;if(t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=t;l*=t;c*=t;u*=t}}t[e]=o;t[e+1]=l;t[e+2]=c;t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i];const o=n[i+1];const l=n[i+2];const c=n[i+3];const u=r[s];const h=r[s+1];const f=r[s+2];const d=r[s+3];t[e]=a*d+c*u+o*f-l*h;t[e+1]=o*d+c*h+l*u-a*f;t[e+2]=l*d+c*f+a*h-o*u;t[e+3]=c*d-a*u-o*h-l*f;return t}get x(){return this._x}set x(t){this._x=t;this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t;this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t;this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t;this._onChangeCallback()}set(t,e,n,i){this._x=t;this._y=e;this._z=n;this._w=i;this._onChangeCallback();return this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){this._x=t.x;this._y=t.y;this._z=t.z;this._w=t.w;this._onChangeCallback();return this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,s=t._order;const a=Math.cos;const o=Math.sin;const l=a(n/2);const c=a(i/2);const u=a(r/2);const h=o(n/2);const f=o(i/2);const d=o(r/2);switch(s){case"XYZ":this._x=h*c*u+l*f*d;this._y=l*f*u-h*c*d;this._z=l*c*d+h*f*u;this._w=l*c*u-h*f*d;break;case"YXZ":this._x=h*c*u+l*f*d;this._y=l*f*u-h*c*d;this._z=l*c*d-h*f*u;this._w=l*c*u+h*f*d;break;case"ZXY":this._x=h*c*u-l*f*d;this._y=l*f*u+h*c*d;this._z=l*c*d+h*f*u;this._w=l*c*u-h*f*d;break;case"ZYX":this._x=h*c*u-l*f*d;this._y=l*f*u+h*c*d;this._z=l*c*d-h*f*u;this._w=l*c*u+h*f*d;break;case"YZX":this._x=h*c*u+l*f*d;this._y=l*f*u+h*c*d;this._z=l*c*d-h*f*u;this._w=l*c*u-h*f*d;break;case"XZY":this._x=h*c*u-l*f*d;this._y=l*f*u-h*c*d;this._z=l*c*d+h*f*u;this._w=l*c*u+h*f*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}if(e!==false)this._onChangeCallback();return this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);this._x=t.x*i;this._y=t.y*i;this._z=t.z*i;this._w=Math.cos(n);this._onChangeCallback();return this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],u=e[10],h=n+a+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t;this._x=(c-o)*t;this._y=(r-l)*t;this._z=(s-i)*t}else if(n>a&&n>u){const t=2*Math.sqrt(1+n-a-u);this._w=(c-o)/t;this._x=.25*t;this._y=(i+s)/t;this._z=(r+l)/t}else if(a>u){const t=2*Math.sqrt(1+a-n-u);this._w=(r-l)/t;this._x=(i+s)/t;this._y=.25*t;this._z=(o+c)/t}else{const t=2*Math.sqrt(1+u-n-a);this._w=(s-i)/t;this._x=(r+l)/t;this._y=(o+c)/t;this._z=.25*t}this._onChangeCallback();return this}setFromUnitVectors(t,e){let n=t.dot(e)+1;if(n<Number.EPSILON){n=0;if(Math.abs(t.x)>Math.abs(t.z)){this._x=-t.y;this._y=t.x;this._z=0;this._w=n}else{this._x=0;this._y=-t.z;this._z=t.y;this._w=n}}else{this._x=t.y*e.z-t.z*e.y;this._y=t.z*e.x-t.x*e.z;this._z=t.x*e.y-t.y*e.x;this._w=n}return this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Le(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);this.slerp(t,i);return this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();if(t===0){this._x=0;this._y=0;this._z=0;this._w=1}else{t=1/t;this._x=this._x*t;this._y=this._y*t;this._z=this._z*t;this._w=this._w*t}this._onChangeCallback();return this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w;const a=e._x,o=e._y,l=e._z,c=e._w;this._x=n*c+s*a+i*l-r*o;this._y=i*c+s*o+r*a-n*l;this._z=r*c+s*l+n*o-i*a;this._w=s*c-n*a-i*o-r*l;this._onChangeCallback();return this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0){this._w=-t._w;this._x=-t._x;this._y=-t._y;this._z=-t._z;a=-a}else{this.copy(t)}if(a>=1){this._w=s;this._x=n;this._y=i;this._z=r;return this}const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;this._w=t*s+e*this._w;this._x=t*n+e*this._x;this._y=t*i+e*this._y;this._z=t*r+e*this._z;this.normalize();this._onChangeCallback();return this}const l=Math.sqrt(o);const c=Math.atan2(l,a);const u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;this._w=s*u+this._w*h;this._x=n*u+this._x*h;this._y=i*u+this._y*h;this._z=r*u+this._z*h;this._onChangeCallback();return this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random();const e=Math.sqrt(1-t);const n=Math.sqrt(t);const i=2*Math.PI*Math.random();const r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){this._x=t[e];this._y=t[e+1];this._z=t[e+2];this._w=t[e+3];this._onChangeCallback();return this}toArray(t=[],e=0){t[e]=this._x;t[e+1]=this._y;t[e+2]=this._z;t[e+3]=this._w;return t}fromBufferAttribute(t,e){this._x=t.getX(e);this._y=t.getY(e);this._z=t.getZ(e);this._w=t.getW(e);return this}toJSON(){return this.toArray()}_onChange(t){this._onChangeCallback=t;return this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x;yield this._y;yield this._z;yield this._w}}class fn{constructor(t=0,e=0,n=0){fn.prototype.isVector3=true;this.x=t;this.y=e;this.z=n}set(t,e,n){if(n===undefined)n=this.z;this.x=t;this.y=e;this.z=n;return this}setScalar(t){this.x=t;this.y=t;this.z=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setZ(t){this.z=t;return this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){this.x=t.x;this.y=t.y;this.z=t.z;return this}add(t){this.x+=t.x;this.y+=t.y;this.z+=t.z;return this}addScalar(t){this.x+=t;this.y+=t;this.z+=t;return this}addVectors(t,e){this.x=t.x+e.x;this.y=t.y+e.y;this.z=t.z+e.z;return this}addScaledVector(t,e){this.x+=t.x*e;this.y+=t.y*e;this.z+=t.z*e;return this}sub(t){this.x-=t.x;this.y-=t.y;this.z-=t.z;return this}subScalar(t){this.x-=t;this.y-=t;this.z-=t;return this}subVectors(t,e){this.x=t.x-e.x;this.y=t.y-e.y;this.z=t.z-e.z;return this}multiply(t){this.x*=t.x;this.y*=t.y;this.z*=t.z;return this}multiplyScalar(t){this.x*=t;this.y*=t;this.z*=t;return this}multiplyVectors(t,e){this.x=t.x*e.x;this.y=t.y*e.y;this.z=t.z*e.z;return this}applyEuler(t){return this.applyQuaternion(pn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(pn.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z;const r=t.elements;this.x=r[0]*e+r[3]*n+r[6]*i;this.y=r[1]*e+r[4]*n+r[7]*i;this.z=r[2]*e+r[5]*n+r[8]*i;return this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z;const r=t.elements;const s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s;this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s;this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s;return this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z;const r=t.x,s=t.y,a=t.z,o=t.w;const l=o*e+s*i-a*n;const c=o*n+a*e-r*i;const u=o*i+r*n-s*e;const h=-r*e-s*n-a*i;this.x=l*o+h*-r+c*-a-u*-s;this.y=c*o+h*-s+u*-r-l*-a;this.z=u*o+h*-a+l*-s-c*-r;return this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z;const r=t.elements;this.x=r[0]*e+r[4]*n+r[8]*i;this.y=r[1]*e+r[5]*n+r[9]*i;this.z=r[2]*e+r[6]*n+r[10]*i;return this.normalize()}divide(t){this.x/=t.x;this.y/=t.y;this.z/=t.z;return this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);this.z=Math.min(this.z,t.z);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);this.z=Math.max(this.z,t.z);return this}clamp(t,e){this.x=Math.max(t.x,Math.min(e.x,this.x));this.y=Math.max(t.y,Math.min(e.y,this.y));this.z=Math.max(t.z,Math.min(e.z,this.z));return this}clampScalar(t,e){this.x=Math.max(t,Math.min(e,this.x));this.y=Math.max(t,Math.min(e,this.y));this.z=Math.max(t,Math.min(e,this.z));return this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);return this}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){this.x+=(t.x-this.x)*e;this.y+=(t.y-this.y)*e;this.z+=(t.z-this.z)*e;return this}lerpVectors(t,e,n){this.x=t.x+(e.x-t.x)*n;this.y=t.y+(e.y-t.y)*n;this.z=t.z+(e.z-t.z)*n;return this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z;const s=e.x,a=e.y,o=e.z;this.x=i*o-r*a;this.y=r*s-n*o;this.z=n*a-i*s;return this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){dn.copy(this).projectOnVector(t);return this.sub(dn)}reflect(t){return this.sub(dn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Le(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;this.x=i*Math.sin(n);this.y=Math.cos(e)*t;this.z=i*Math.cos(n);return this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){this.x=t*Math.sin(e);this.y=n;this.z=t*Math.cos(e);return this}setFromMatrixPosition(t){const e=t.elements;this.x=e[12];this.y=e[13];this.z=e[14];return this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length();const n=this.setFromMatrixColumn(t,1).length();const i=this.setFromMatrixColumn(t,2).length();this.x=e;this.y=n;this.z=i;return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){this.x=t._x;this.y=t._y;this.z=t._z;return this}setFromColor(t){this.x=t.r;this.y=t.g;this.z=t.b;return this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){this.x=t[e];this.y=t[e+1];this.z=t[e+2];return this}toArray(t=[],e=0){t[e]=this.x;t[e+1]=this.y;t[e+2]=this.z;return t}fromBufferAttribute(t,e){this.x=t.getX(e);this.y=t.getY(e);this.z=t.getZ(e);return this}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this}randomDirection(){const t=(Math.random()-.5)*2;const e=Math.random()*Math.PI*2;const n=Math.sqrt(1-t**2);this.x=n*Math.cos(e);this.y=n*Math.sin(e);this.z=t;return this}*[Symbol.iterator](){yield this.x;yield this.y;yield this.z}}const dn=new fn;const pn=new hn;class mn{constructor(t=new fn(+Infinity,+Infinity,+Infinity),e=new fn(-Infinity,-Infinity,-Infinity)){this.isBox3=true;this.min=t;this.max=e}set(t,e){this.min.copy(t);this.max.copy(e);return this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3){this.expandByPoint(_n.fromArray(t,e))}return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++){this.expandByPoint(_n.fromBufferAttribute(t,e))}return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++){this.expandByPoint(t[e])}return this}setFromCenterAndSize(t,e){const n=_n.copy(e).multiplyScalar(.5);this.min.copy(t).sub(n);this.max.copy(t).add(n);return this}setFromObject(t,e=false){this.makeEmpty();return this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.min.copy(t.min);this.max.copy(t.max);return this}makeEmpty(){this.min.x=this.min.y=this.min.z=+Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){this.min.min(t);this.max.max(t);return this}expandByVector(t){this.min.sub(t);this.max.add(t);return this}expandByScalar(t){this.min.addScalar(-t);this.max.addScalar(t);return this}expandByObject(t,e=false){t.updateWorldMatrix(false,false);if(t.boundingBox!==undefined){if(t.boundingBox===null){t.computeBoundingBox()}xn.copy(t.boundingBox);xn.applyMatrix4(t.matrixWorld);this.union(xn)}else{const n=t.geometry;if(n!==undefined){if(e&&n.attributes!==undefined&&n.attributes.position!==undefined){const e=n.attributes.position;for(let n=0,i=e.count;n<i;n++){_n.fromBufferAttribute(e,n).applyMatrix4(t.matrixWorld);this.expandByPoint(_n)}}else{if(n.boundingBox===null){n.computeBoundingBox()}xn.copy(n.boundingBox);xn.applyMatrix4(t.matrixWorld);this.union(xn)}}}const n=t.children;for(let t=0,i=n.length;t<i;t++){this.expandByObject(n[t],e)}return this}containsPoint(t){return t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z?false:true}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z?false:true}intersectsSphere(t){this.clampPoint(t.center,_n);return _n.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;if(t.normal.x>0){e=t.normal.x*this.min.x;n=t.normal.x*this.max.x}else{e=t.normal.x*this.max.x;n=t.normal.x*this.min.x}if(t.normal.y>0){e+=t.normal.y*this.min.y;n+=t.normal.y*this.max.y}else{e+=t.normal.y*this.max.y;n+=t.normal.y*this.min.y}if(t.normal.z>0){e+=t.normal.z*this.min.z;n+=t.normal.z*this.max.z}else{e+=t.normal.z*this.max.z;n+=t.normal.z*this.min.z}return e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty()){return false}this.getCenter(bn);wn.subVectors(this.max,bn);vn.subVectors(t.a,bn);Mn.subVectors(t.b,bn);yn.subVectors(t.c,bn);Sn.subVectors(Mn,vn);En.subVectors(yn,Mn);Tn.subVectors(vn,yn);let e=[0,-Sn.z,Sn.y,0,-En.z,En.y,0,-Tn.z,Tn.y,Sn.z,0,-Sn.x,En.z,0,-En.x,Tn.z,0,-Tn.x,-Sn.y,Sn.x,0,-En.y,En.x,0,-Tn.y,Tn.x,0];if(!qn(e,vn,Mn,yn,wn)){return false}e=[1,0,0,0,1,0,0,0,1];if(!qn(e,vn,Mn,yn,wn)){return false}An.crossVectors(Sn,En);e=[An.x,An.y,An.z];return qn(e,vn,Mn,yn,wn)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_n).distanceTo(t)}getBoundingSphere(t){if(this.isEmpty()){t.makeEmpty()}else{this.getCenter(t.center);t.radius=this.getSize(_n).length()*.5}return t}intersect(t){this.min.max(t.min);this.max.min(t.max);if(this.isEmpty())this.makeEmpty();return this}union(t){this.min.min(t.min);this.max.max(t.max);return this}applyMatrix4(t){if(this.isEmpty())return this;gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t);gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t);gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t);gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t);gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t);gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t);gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t);gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t);this.setFromPoints(gn);return this}translate(t){this.min.add(t);this.max.add(t);return this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const gn=[new fn,new fn,new fn,new fn,new fn,new fn,new fn,new fn];const _n=new fn;const xn=new mn;const vn=new fn;const Mn=new fn;const yn=new fn;const Sn=new fn;const En=new fn;const Tn=new fn;const bn=new fn;const wn=new fn;const An=new fn;const Rn=new fn;function qn(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Rn.fromArray(t,s);const a=r.x*Math.abs(Rn.x)+r.y*Math.abs(Rn.y)+r.z*Math.abs(Rn.z);const o=e.dot(Rn);const l=n.dot(Rn);const c=i.dot(Rn);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a){return false}}return true}const Cn=new mn;const Ln=new fn;const Pn=new fn;class Un{constructor(t=new fn,e=-1){this.center=t;this.radius=e}set(t,e){this.center.copy(t);this.radius=e;return this}setFromPoints(t,e){const n=this.center;if(e!==undefined){n.copy(e)}else{Cn.setFromPoints(t).getCenter(n)}let i=0;for(let e=0,r=t.length;e<r;e++){i=Math.max(i,n.distanceToSquared(t[e]))}this.radius=Math.sqrt(i);return this}copy(t){this.center.copy(t.center);this.radius=t.radius;return this}isEmpty(){return this.radius<0}makeEmpty(){this.center.set(0,0,0);this.radius=-1;return this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);e.copy(t);if(n>this.radius*this.radius){e.sub(this.center).normalize();e.multiplyScalar(this.radius).add(this.center)}return e}getBoundingBox(t){if(this.isEmpty()){t.makeEmpty();return t}t.set(this.center,this.center);t.expandByScalar(this.radius);return t}applyMatrix4(t){this.center.applyMatrix4(t);this.radius=this.radius*t.getMaxScaleOnAxis();return this}translate(t){this.center.add(t);return this}expandByPoint(t){if(this.isEmpty()){this.center.copy(t);this.radius=0;return this}Ln.subVectors(t,this.center);const e=Ln.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e);const n=(t-this.radius)*.5;this.center.addScaledVector(Ln,n/t);this.radius+=n}return this}union(t){if(t.isEmpty()){return this}if(this.isEmpty()){this.copy(t);return this}if(this.center.equals(t.center)===true){this.radius=Math.max(this.radius,t.radius)}else{Pn.subVectors(t.center,this.center).setLength(t.radius);this.expandByPoint(Ln.copy(t.center).add(Pn));this.expandByPoint(Ln.copy(t.center).sub(Pn))}return this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Dn=new fn;const In=new fn;const Nn=new fn;const On=new fn;const Fn=new fn;const zn=new fn;const Bn=new fn;class Hn{constructor(t=new fn,e=new fn(0,0,-1)){this.origin=t;this.direction=e}set(t,e){this.origin.copy(t);this.direction.copy(e);return this}copy(t){this.origin.copy(t.origin);this.direction.copy(t.direction);return this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){this.direction.copy(t).sub(this.origin).normalize();return this}recast(t){this.origin.copy(this.at(t,Dn));return this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);if(n<0){return e.copy(this.origin)}return e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Dn.subVectors(t,this.origin).dot(this.direction);if(e<0){return this.origin.distanceToSquared(t)}Dn.copy(this.origin).addScaledVector(this.direction,e);return Dn.distanceToSquared(t)}distanceSqToSegment(t,e,n,i){In.copy(t).add(e).multiplyScalar(.5);Nn.copy(e).sub(t).normalize();On.copy(this.origin).sub(In);const r=t.distanceTo(e)*.5;const s=-this.direction.dot(Nn);const a=On.dot(this.direction);const o=-On.dot(Nn);const l=On.lengthSq();const c=Math.abs(1-s*s);let u,h,f,d;if(c>0){u=s*o-a;h=s*a-o;d=r*c;if(u>=0){if(h>=-d){if(h<=d){const t=1/c;u*=t;h*=t;f=u*(u+s*h+2*a)+h*(s*u+h+2*o)+l}else{h=r;u=Math.max(0,-(s*h+a));f=-u*u+h*(h+2*o)+l}}else{h=-r;u=Math.max(0,-(s*h+a));f=-u*u+h*(h+2*o)+l}}else{if(h<=-d){u=Math.max(0,-(-s*r+a));h=u>0?-r:Math.min(Math.max(-r,-o),r);f=-u*u+h*(h+2*o)+l}else if(h<=d){u=0;h=Math.min(Math.max(-r,-o),r);f=h*(h+2*o)+l}else{u=Math.max(0,-(s*r+a));h=u>0?r:Math.min(Math.max(-r,-o),r);f=-u*u+h*(h+2*o)+l}}}else{h=s>0?-r:r;u=Math.max(0,-(s*h+a));f=-u*u+h*(h+2*o)+l}if(n){n.copy(this.origin).addScaledVector(this.direction,u)}if(i){i.copy(In).addScaledVector(Nn,h)}return f}intersectSphere(t,e){Dn.subVectors(t.center,this.origin);const n=Dn.dot(this.direction);const i=Dn.dot(Dn)-n*n;const r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i);const a=n-s;const o=n+s;if(o<0)return null;if(a<0)return this.at(o,e);return this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0){if(t.distanceToPoint(this.origin)===0){return 0}return null}const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);if(n===null){return null}return this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(e===0){return true}const n=t.normal.dot(this.direction);if(n*e<0){return true}return false}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z;const h=this.origin;if(l>=0){n=(t.min.x-h.x)*l;i=(t.max.x-h.x)*l}else{n=(t.max.x-h.x)*l;i=(t.min.x-h.x)*l}if(c>=0){r=(t.min.y-h.y)*c;s=(t.max.y-h.y)*c}else{r=(t.max.y-h.y)*c;s=(t.min.y-h.y)*c}if(n>s||r>i)return null;if(r>n||isNaN(n))n=r;if(s<i||isNaN(i))i=s;if(u>=0){a=(t.min.z-h.z)*u;o=(t.max.z-h.z)*u}else{a=(t.max.z-h.z)*u;o=(t.min.z-h.z)*u}if(n>o||a>i)return null;if(a>n||n!==n)n=a;if(o<i||i!==i)i=o;if(i<0)return null;return this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Dn)!==null}intersectTriangle(t,e,n,i,r){Fn.subVectors(e,t);zn.subVectors(n,t);Bn.crossVectors(Fn,zn);let s=this.direction.dot(Bn);let a;if(s>0){if(i)return null;a=1}else if(s<0){a=-1;s=-s}else{return null}On.subVectors(this.origin,t);const o=a*this.direction.dot(zn.crossVectors(On,zn));if(o<0){return null}const l=a*this.direction.dot(Fn.cross(On));if(l<0){return null}if(o+l>s){return null}const c=-a*On.dot(Bn);if(c<0){return null}return this.at(c/s,r)}applyMatrix4(t){this.origin.applyMatrix4(t);this.direction.transformDirection(t);return this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Gn{constructor(){Gn.prototype.isMatrix4=true;this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,n,i,r,s,a,o,l,c,u,h,f,d,p,m){const g=this.elements;g[0]=t;g[4]=e;g[8]=n;g[12]=i;g[1]=r;g[5]=s;g[9]=a;g[13]=o;g[2]=l;g[6]=c;g[10]=u;g[14]=h;g[3]=f;g[7]=d;g[11]=p;g[15]=m;return this}identity(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this}clone(){return(new Gn).fromArray(this.elements)}copy(t){const e=this.elements;const n=t.elements;e[0]=n[0];e[1]=n[1];e[2]=n[2];e[3]=n[3];e[4]=n[4];e[5]=n[5];e[6]=n[6];e[7]=n[7];e[8]=n[8];e[9]=n[9];e[10]=n[10];e[11]=n[11];e[12]=n[12];e[13]=n[13];e[14]=n[14];e[15]=n[15];return this}copyPosition(t){const e=this.elements,n=t.elements;e[12]=n[12];e[13]=n[13];e[14]=n[14];return this}setFromMatrix3(t){const e=t.elements;this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1);return this}extractBasis(t,e,n){t.setFromMatrixColumn(this,0);e.setFromMatrixColumn(this,1);n.setFromMatrixColumn(this,2);return this}makeBasis(t,e,n){this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1);return this}extractRotation(t){const e=this.elements;const n=t.elements;const i=1/Vn.setFromMatrixColumn(t,0).length();const r=1/Vn.setFromMatrixColumn(t,1).length();const s=1/Vn.setFromMatrixColumn(t,2).length();e[0]=n[0]*i;e[1]=n[1]*i;e[2]=n[2]*i;e[3]=0;e[4]=n[4]*r;e[5]=n[5]*r;e[6]=n[6]*r;e[7]=0;e[8]=n[8]*s;e[9]=n[9]*s;e[10]=n[10]*s;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return this}makeRotationFromEuler(t){const e=this.elements;const n=t.x,i=t.y,r=t.z;const s=Math.cos(n),a=Math.sin(n);const o=Math.cos(i),l=Math.sin(i);const c=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const t=s*c,n=s*u,i=a*c,r=a*u;e[0]=o*c;e[4]=-o*u;e[8]=l;e[1]=n+i*l;e[5]=t-r*l;e[9]=-a*o;e[2]=r-t*l;e[6]=i+n*l;e[10]=s*o}else if(t.order==="YXZ"){const t=o*c,n=o*u,i=l*c,r=l*u;e[0]=t+r*a;e[4]=i*a-n;e[8]=s*l;e[1]=s*u;e[5]=s*c;e[9]=-a;e[2]=n*a-i;e[6]=r+t*a;e[10]=s*o}else if(t.order==="ZXY"){const t=o*c,n=o*u,i=l*c,r=l*u;e[0]=t-r*a;e[4]=-s*u;e[8]=i+n*a;e[1]=n+i*a;e[5]=s*c;e[9]=r-t*a;e[2]=-s*l;e[6]=a;e[10]=s*o}else if(t.order==="ZYX"){const t=s*c,n=s*u,i=a*c,r=a*u;e[0]=o*c;e[4]=i*l-n;e[8]=t*l+r;e[1]=o*u;e[5]=r*l+t;e[9]=n*l-i;e[2]=-l;e[6]=a*o;e[10]=s*o}else if(t.order==="YZX"){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c;e[4]=r-t*u;e[8]=i*u+n;e[1]=u;e[5]=s*c;e[9]=-a*c;e[2]=-l*c;e[6]=n*u+i;e[10]=t-r*u}else if(t.order==="XZY"){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c;e[4]=-u;e[8]=l*c;e[1]=t*u+r;e[5]=s*c;e[9]=n*u-i;e[2]=i*u-n;e[6]=a*c;e[10]=r*u+t}e[3]=0;e[7]=0;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return this}makeRotationFromQuaternion(t){return this.compose(Wn,t,Xn)}lookAt(t,e,n){const i=this.elements;Jn.subVectors(t,e);if(Jn.lengthSq()===0){Jn.z=1}Jn.normalize();jn.crossVectors(n,Jn);if(jn.lengthSq()===0){if(Math.abs(n.z)===1){Jn.x+=1e-4}else{Jn.z+=1e-4}Jn.normalize();jn.crossVectors(n,Jn)}jn.normalize();Yn.crossVectors(Jn,jn);i[0]=jn.x;i[4]=Yn.x;i[8]=Jn.x;i[1]=jn.y;i[5]=Yn.y;i[9]=Jn.y;i[2]=jn.z;i[6]=Yn.z;i[10]=Jn.z;return this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements;const i=e.elements;const r=this.elements;const s=n[0],a=n[4],o=n[8],l=n[12];const c=n[1],u=n[5],h=n[9],f=n[13];const d=n[2],p=n[6],m=n[10],g=n[14];const _=n[3],x=n[7],v=n[11],M=n[15];const y=i[0],S=i[4],E=i[8],T=i[12];const b=i[1],w=i[5],A=i[9],R=i[13];const q=i[2],C=i[6],L=i[10],P=i[14];const U=i[3],D=i[7],I=i[11],N=i[15];r[0]=s*y+a*b+o*q+l*U;r[4]=s*S+a*w+o*C+l*D;r[8]=s*E+a*A+o*L+l*I;r[12]=s*T+a*R+o*P+l*N;r[1]=c*y+u*b+h*q+f*U;r[5]=c*S+u*w+h*C+f*D;r[9]=c*E+u*A+h*L+f*I;r[13]=c*T+u*R+h*P+f*N;r[2]=d*y+p*b+m*q+g*U;r[6]=d*S+p*w+m*C+g*D;r[10]=d*E+p*A+m*L+g*I;r[14]=d*T+p*R+m*P+g*N;r[3]=_*y+x*b+v*q+M*U;r[7]=_*S+x*w+v*C+M*D;r[11]=_*E+x*A+v*L+M*I;r[15]=_*T+x*R+v*P+M*N;return this}multiplyScalar(t){const e=this.elements;e[0]*=t;e[4]*=t;e[8]*=t;e[12]*=t;e[1]*=t;e[5]*=t;e[9]*=t;e[13]*=t;e[2]*=t;e[6]*=t;e[10]*=t;e[14]*=t;e[3]*=t;e[7]*=t;e[11]*=t;e[15]*=t;return this}determinant(){const t=this.elements;const e=t[0],n=t[4],i=t[8],r=t[12];const s=t[1],a=t[5],o=t[9],l=t[13];const c=t[2],u=t[6],h=t[10],f=t[14];const d=t[3],p=t[7],m=t[11],g=t[15];return d*(+r*o*u-i*l*u-r*a*h+n*l*h+i*a*f-n*o*f)+p*(+e*o*f-e*l*h+r*s*h-i*s*f+i*l*c-r*o*c)+m*(+e*l*u-e*a*f-r*s*u+n*s*f+r*a*c-n*l*c)+g*(-i*a*c-e*o*u+e*a*h+i*s*u-n*s*h+n*o*c)}transpose(){const t=this.elements;let e;e=t[1];t[1]=t[4];t[4]=e;e=t[2];t[2]=t[8];t[8]=e;e=t[6];t[6]=t[9];t[9]=e;e=t[3];t[3]=t[12];t[12]=e;e=t[7];t[7]=t[13];t[13]=e;e=t[11];t[11]=t[14];t[14]=e;return this}setPosition(t,e,n){const i=this.elements;if(t.isVector3){i[12]=t.x;i[13]=t.y;i[14]=t.z}else{i[12]=t;i[13]=e;i[14]=n}return this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15],_=u*m*l-p*h*l+p*o*f-a*m*f-u*o*g+a*h*g,x=d*h*l-c*m*l-d*o*f+s*m*f+c*o*g-s*h*g,v=c*p*l-d*u*l+d*a*f-s*p*f-c*a*g+s*u*g,M=d*u*o-c*p*o-d*a*h+s*p*h+c*a*m-s*u*m;const y=e*_+n*x+i*v+r*M;if(y===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/y;t[0]=_*S;t[1]=(p*h*r-u*m*r-p*i*f+n*m*f+u*i*g-n*h*g)*S;t[2]=(a*m*r-p*o*r+p*i*l-n*m*l-a*i*g+n*o*g)*S;t[3]=(u*o*r-a*h*r-u*i*l+n*h*l+a*i*f-n*o*f)*S;t[4]=x*S;t[5]=(c*m*r-d*h*r+d*i*f-e*m*f-c*i*g+e*h*g)*S;t[6]=(d*o*r-s*m*r-d*i*l+e*m*l+s*i*g-e*o*g)*S;t[7]=(s*h*r-c*o*r+c*i*l-e*h*l-s*i*f+e*o*f)*S;t[8]=v*S;t[9]=(d*u*r-c*p*r-d*n*f+e*p*f+c*n*g-e*u*g)*S;t[10]=(s*p*r-d*a*r+d*n*l-e*p*l-s*n*g+e*a*g)*S;t[11]=(c*a*r-s*u*r-c*n*l+e*u*l+s*n*f-e*a*f)*S;t[12]=M*S;t[13]=(c*p*i-d*u*i+d*n*h-e*p*h-c*n*m+e*u*m)*S;t[14]=(d*a*i-s*p*i-d*n*o+e*p*o+s*n*m-e*a*m)*S;t[15]=(s*u*i-c*a*i+c*n*o-e*u*o-s*n*h+e*a*h)*S;return this}scale(t){const e=this.elements;const n=t.x,i=t.y,r=t.z;e[0]*=n;e[4]*=i;e[8]*=r;e[1]*=n;e[5]*=i;e[9]*=r;e[2]*=n;e[6]*=i;e[10]*=r;e[3]*=n;e[7]*=i;e[11]*=r;return this}getMaxScaleOnAxis(){const t=this.elements;const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];const n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6];const i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1);return this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1);return this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1);return this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1);return this}makeRotationAxis(t,e){const n=Math.cos(e);const i=Math.sin(e);const r=1-n;const s=t.x,a=t.y,o=t.z;const l=r*s,c=r*a;this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1);return this}makeScale(t,e,n){this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1);return this}makeShear(t,e,n,i,r,s){this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1);return this}compose(t,e,n){const i=this.elements;const r=e._x,s=e._y,a=e._z,o=e._w;const l=r+r,c=s+s,u=a+a;const h=r*l,f=r*c,d=r*u;const p=s*c,m=s*u,g=a*u;const _=o*l,x=o*c,v=o*u;const M=n.x,y=n.y,S=n.z;i[0]=(1-(p+g))*M;i[1]=(f+v)*M;i[2]=(d-x)*M;i[3]=0;i[4]=(f-v)*y;i[5]=(1-(h+g))*y;i[6]=(m+_)*y;i[7]=0;i[8]=(d+x)*S;i[9]=(m-_)*S;i[10]=(1-(h+p))*S;i[11]=0;i[12]=t.x;i[13]=t.y;i[14]=t.z;i[15]=1;return this}decompose(t,e,n){const i=this.elements;let r=Vn.set(i[0],i[1],i[2]).length();const s=Vn.set(i[4],i[5],i[6]).length();const a=Vn.set(i[8],i[9],i[10]).length();const o=this.determinant();if(o<0)r=-r;t.x=i[12];t.y=i[13];t.z=i[14];kn.copy(this);const l=1/r;const c=1/s;const u=1/a;kn.elements[0]*=l;kn.elements[1]*=l;kn.elements[2]*=l;kn.elements[4]*=c;kn.elements[5]*=c;kn.elements[6]*=c;kn.elements[8]*=u;kn.elements[9]*=u;kn.elements[10]*=u;e.setFromRotationMatrix(kn);n.x=r;n.y=s;n.z=a;return this}makePerspective(t,e,n,i,r,s){const a=this.elements;const o=2*r/(e-t);const l=2*r/(n-i);const c=(e+t)/(e-t);const u=(n+i)/(n-i);const h=-(s+r)/(s-r);const f=-2*s*r/(s-r);a[0]=o;a[4]=0;a[8]=c;a[12]=0;a[1]=0;a[5]=l;a[9]=u;a[13]=0;a[2]=0;a[6]=0;a[10]=h;a[14]=f;a[3]=0;a[7]=0;a[11]=-1;a[15]=0;return this}makeOrthographic(t,e,n,i,r,s){const a=this.elements;const o=1/(e-t);const l=1/(n-i);const c=1/(s-r);const u=(e+t)*o;const h=(n+i)*l;const f=(s+r)*c;a[0]=2*o;a[4]=0;a[8]=0;a[12]=-u;a[1]=0;a[5]=2*l;a[9]=0;a[13]=-h;a[2]=0;a[6]=0;a[10]=-2*c;a[14]=-f;a[3]=0;a[7]=0;a[11]=0;a[15]=1;return this}equals(t){const e=this.elements;const n=t.elements;for(let t=0;t<16;t++){if(e[t]!==n[t])return false}return true}fromArray(t,e=0){for(let n=0;n<16;n++){this.elements[n]=t[n+e]}return this}toArray(t=[],e=0){const n=this.elements;t[e]=n[0];t[e+1]=n[1];t[e+2]=n[2];t[e+3]=n[3];t[e+4]=n[4];t[e+5]=n[5];t[e+6]=n[6];t[e+7]=n[7];t[e+8]=n[8];t[e+9]=n[9];t[e+10]=n[10];t[e+11]=n[11];t[e+12]=n[12];t[e+13]=n[13];t[e+14]=n[14];t[e+15]=n[15];return t}}const Vn=new fn;const kn=new Gn;const Wn=new fn(0,0,0);const Xn=new fn(1,1,1);const jn=new fn;const Yn=new fn;const Jn=new fn;const Zn=new Gn;const Kn=new hn;class Qn{constructor(t=0,e=0,n=0,i=Qn.DEFAULT_ORDER){this.isEuler=true;this._x=t;this._y=e;this._z=n;this._order=i}get x(){return this._x}set x(t){this._x=t;this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t;this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t;this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t;this._onChangeCallback()}set(t,e,n,i=this._order){this._x=t;this._y=e;this._z=n;this._order=i;this._onChangeCallback();return this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){this._x=t._x;this._y=t._y;this._z=t._z;this._order=t._order;this._onChangeCallback();return this}setFromRotationMatrix(t,e=this._order,n=true){const i=t.elements;const r=i[0],s=i[4],a=i[8];const o=i[1],l=i[5],c=i[9];const u=i[2],h=i[6],f=i[10];switch(e){case"XYZ":this._y=Math.asin(Le(a,-1,1));if(Math.abs(a)<.9999999){this._x=Math.atan2(-c,f);this._z=Math.atan2(-s,r)}else{this._x=Math.atan2(h,l);this._z=0}break;case"YXZ":this._x=Math.asin(-Le(c,-1,1));if(Math.abs(c)<.9999999){this._y=Math.atan2(a,f);this._z=Math.atan2(o,l)}else{this._y=Math.atan2(-u,r);this._z=0}break;case"ZXY":this._x=Math.asin(Le(h,-1,1));if(Math.abs(h)<.9999999){this._y=Math.atan2(-u,f);this._z=Math.atan2(-s,l)}else{this._y=0;this._z=Math.atan2(o,r)}break;case"ZYX":this._y=Math.asin(-Le(u,-1,1));if(Math.abs(u)<.9999999){this._x=Math.atan2(h,f);this._z=Math.atan2(o,r)}else{this._x=0;this._z=Math.atan2(-s,l)}break;case"YZX":this._z=Math.asin(Le(o,-1,1));if(Math.abs(o)<.9999999){this._x=Math.atan2(-c,l);this._y=Math.atan2(-u,r)}else{this._x=0;this._y=Math.atan2(a,f)}break;case"XZY":this._z=Math.asin(-Le(s,-1,1));if(Math.abs(s)<.9999999){this._x=Math.atan2(h,l);this._y=Math.atan2(a,r)}else{this._x=Math.atan2(-c,f);this._y=0}break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}this._order=e;if(n===true)this._onChangeCallback();return this}setFromQuaternion(t,e,n){Zn.makeRotationFromQuaternion(t);return this.setFromRotationMatrix(Zn,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){Kn.setFromEuler(this);return this.setFromQuaternion(Kn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){this._x=t[0];this._y=t[1];this._z=t[2];if(t[3]!==undefined)this._order=t[3];this._onChangeCallback();return this}toArray(t=[],e=0){t[e]=this._x;t[e+1]=this._y;t[e+2]=this._z;t[e+3]=this._order;return t}_onChange(t){this._onChangeCallback=t;return this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x;yield this._y;yield this._z;yield this._order}}Qn.DEFAULT_ORDER="XYZ";class $n{constructor(){this.mask=1|0}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=4294967295|0}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let ti=0;const ei=new fn;const ni=new hn;const ii=new Gn;const ri=new fn;const si=new fn;const ai=new fn;const oi=new hn;const li=new fn(1,0,0);const ci=new fn(0,1,0);const ui=new fn(0,0,1);const hi={type:"added"};const fi={type:"removed"};class di extends we{constructor(){super();this.isObject3D=true;Object.defineProperty(this,"id",{value:ti++});this.uuid=Ce();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=di.DEFAULT_UP.clone();const t=new fn;const e=new Qn;const n=new hn;const i=new fn(1,1,1);function r(){n.setFromEuler(e,false)}function s(){e.setFromQuaternion(n,undefined,false)}e._onChange(r);n._onChange(s);Object.defineProperties(this,{position:{configurable:true,enumerable:true,value:t},rotation:{configurable:true,enumerable:true,value:e},quaternion:{configurable:true,enumerable:true,value:n},scale:{configurable:true,enumerable:true,value:i},modelViewMatrix:{value:new Gn},normalMatrix:{value:new ze}});this.matrix=new Gn;this.matrixWorld=new Gn;this.matrixAutoUpdate=di.DEFAULT_MATRIX_AUTO_UPDATE;this.matrixWorldNeedsUpdate=false;this.matrixWorldAutoUpdate=di.DEFAULT_MATRIX_WORLD_AUTO_UPDATE;this.layers=new $n;this.visible=true;this.castShadow=false;this.receiveShadow=false;this.frustumCulled=true;this.renderOrder=0;this.animations=[];this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){if(this.matrixAutoUpdate)this.updateMatrix();this.matrix.premultiply(t);this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){this.quaternion.premultiply(t);return this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,true)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){ni.setFromAxisAngle(t,e);this.quaternion.multiply(ni);return this}rotateOnWorldAxis(t,e){ni.setFromAxisAngle(t,e);this.quaternion.premultiply(ni);return this}rotateX(t){return this.rotateOnAxis(li,t)}rotateY(t){return this.rotateOnAxis(ci,t)}rotateZ(t){return this.rotateOnAxis(ui,t)}translateOnAxis(t,e){ei.copy(t).applyQuaternion(this.quaternion);this.position.add(ei.multiplyScalar(e));return this}translateX(t){return this.translateOnAxis(li,t)}translateY(t){return this.translateOnAxis(ci,t)}translateZ(t){return this.translateOnAxis(ui,t)}localToWorld(t){this.updateWorldMatrix(true,false);return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){this.updateWorldMatrix(true,false);return t.applyMatrix4(ii.copy(this.matrixWorld).invert())}lookAt(t,e,n){if(t.isVector3){ri.copy(t)}else{ri.set(t,e,n)}const i=this.parent;this.updateWorldMatrix(true,false);si.setFromMatrixPosition(this.matrixWorld);if(this.isCamera||this.isLight){ii.lookAt(si,ri,this.up)}else{ii.lookAt(ri,si,this.up)}this.quaternion.setFromRotationMatrix(ii);if(i){ii.extractRotation(i.matrixWorld);ni.setFromRotationMatrix(ii);this.quaternion.premultiply(ni.invert())}}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++){this.add(arguments[t])}return this}if(t===this){console.error("THREE.Object3D.add: object can't be added as a child of itself.",t);return this}if(t&&t.isObject3D){if(t.parent!==null){t.parent.remove(t)}t.parent=this;this.children.push(t);t.dispatchEvent(hi)}else{console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t)}return this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++){this.remove(arguments[t])}return this}const e=this.children.indexOf(t);if(e!==-1){t.parent=null;this.children.splice(e,1);t.dispatchEvent(fi)}return this}removeFromParent(){const t=this.parent;if(t!==null){t.remove(this)}return this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null;e.dispatchEvent(fi)}this.children.length=0;return this}attach(t){this.updateWorldMatrix(true,false);ii.copy(this.matrixWorld).invert();if(t.parent!==null){t.parent.updateWorldMatrix(true,false);ii.multiply(t.parent.matrixWorld)}t.applyMatrix4(ii);this.add(t);t.updateWorldMatrix(false,true);return this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n];const r=i.getObjectByProperty(t,e);if(r!==undefined){return r}}return undefined}getObjectsByProperty(t,e){let n=[];if(this[t]===e)n.push(this);for(let i=0,r=this.children.length;i<r;i++){const r=this.children[i].getObjectsByProperty(t,e);if(r.length>0){n=n.concat(r)}}return n}getWorldPosition(t){this.updateWorldMatrix(true,false);return t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){this.updateWorldMatrix(true,false);this.matrixWorld.decompose(si,t,ai);return t}getWorldScale(t){this.updateWorldMatrix(true,false);this.matrixWorld.decompose(si,oi,t);return t}getWorldDirection(t){this.updateWorldMatrix(true,false);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].traverse(t)}}traverseVisible(t){if(this.visible===false)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].traverseVisible(t)}}traverseAncestors(t){const e=this.parent;if(e!==null){t(e);e.traverseAncestors(t)}}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=true}updateMatrixWorld(t){if(this.matrixAutoUpdate)this.updateMatrix();if(this.matrixWorldNeedsUpdate||t){if(this.parent===null){this.matrixWorld.copy(this.matrix)}else{this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)}this.matrixWorldNeedsUpdate=false;t=true}const e=this.children;for(let n=0,i=e.length;n<i;n++){const i=e[n];if(i.matrixWorldAutoUpdate===true||t===true){i.updateMatrixWorld(t)}}}updateWorldMatrix(t,e){const n=this.parent;if(t===true&&n!==null&&n.matrixWorldAutoUpdate===true){n.updateWorldMatrix(true,false)}if(this.matrixAutoUpdate)this.updateMatrix();if(this.parent===null){this.matrixWorld.copy(this.matrix)}else{this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)}if(e===true){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n.matrixWorldAutoUpdate===true){n.updateWorldMatrix(false,true)}}}}toJSON(t){const e=t===undefined||typeof t==="string";const n={};if(e){t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}};n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}}const i={};i.uuid=this.uuid;i.type=this.type;if(this.name!=="")i.name=this.name;if(this.castShadow===true)i.castShadow=true;if(this.receiveShadow===true)i.receiveShadow=true;if(this.visible===false)i.visible=false;if(this.frustumCulled===false)i.frustumCulled=false;if(this.renderOrder!==0)i.renderOrder=this.renderOrder;if(Object.keys(this.userData).length>0)i.userData=this.userData;i.layers=this.layers.mask;i.matrix=this.matrix.toArray();i.up=this.up.toArray();if(this.matrixAutoUpdate===false)i.matrixAutoUpdate=false;if(this.isInstancedMesh){i.type="InstancedMesh";i.count=this.count;i.instanceMatrix=this.instanceMatrix.toJSON();if(this.instanceColor!==null)i.instanceColor=this.instanceColor.toJSON()}function r(e,n){if(e[n.uuid]===undefined){e[n.uuid]=n.toJSON(t)}return n.uuid}if(this.isScene){if(this.background){if(this.background.isColor){i.background=this.background.toJSON()}else if(this.background.isTexture){i.background=this.background.toJSON(t).uuid}}if(this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==true){i.environment=this.environment.toJSON(t).uuid}}else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(e!==undefined&&e.shapes!==undefined){const n=e.shapes;if(Array.isArray(n)){for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}}else{r(t.shapes,n)}}}if(this.isSkinnedMesh){i.bindMode=this.bindMode;i.bindMatrix=this.bindMatrix.toArray();if(this.skeleton!==undefined){r(t.skeletons,this.skeleton);i.skeleton=this.skeleton.uuid}}if(this.material!==undefined){if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++){e.push(r(t.materials,this.material[n]))}i.material=e}else{i.material=r(t.materials,this.material)}}if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++){i.children.push(this.children[e].toJSON(t).object)}}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=s(t.geometries);const i=s(t.materials);const r=s(t.textures);const a=s(t.images);const o=s(t.shapes);const l=s(t.skeletons);const c=s(t.animations);const u=s(t.nodes);if(e.length>0)n.geometries=e;if(i.length>0)n.materials=i;if(r.length>0)n.textures=r;if(a.length>0)n.images=a;if(o.length>0)n.shapes=o;if(l.length>0)n.skeletons=l;if(c.length>0)n.animations=c;if(u.length>0)n.nodes=u}n.object=i;return n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata;e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=true){this.name=t.name;this.up.copy(t.up);this.position.copy(t.position);this.rotation.order=t.rotation.order;this.quaternion.copy(t.quaternion);this.scale.copy(t.scale);this.matrix.copy(t.matrix);this.matrixWorld.copy(t.matrixWorld);this.matrixAutoUpdate=t.matrixAutoUpdate;this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate;this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate;this.layers.mask=t.layers.mask;this.visible=t.visible;this.castShadow=t.castShadow;this.receiveShadow=t.receiveShadow;this.frustumCulled=t.frustumCulled;this.renderOrder=t.renderOrder;this.animations=t.animations;this.userData=JSON.parse(JSON.stringify(t.userData));if(e===true){for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}}return this}}di.DEFAULT_UP=new fn(0,1,0);di.DEFAULT_MATRIX_AUTO_UPDATE=true;di.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=true;const pi=new fn;const mi=new fn;const gi=new fn;const _i=new fn;const xi=new fn;const vi=new fn;const Mi=new fn;const yi=new fn;const Si=new fn;const Ei=new fn;let Ti=false;class bi{constructor(t=new fn,e=new fn,n=new fn){this.a=t;this.b=e;this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e);pi.subVectors(t,e);i.cross(pi);const r=i.lengthSq();if(r>0){return i.multiplyScalar(1/Math.sqrt(r))}return i.set(0,0,0)}static getBarycoord(t,e,n,i,r){pi.subVectors(i,e);mi.subVectors(n,e);gi.subVectors(t,e);const s=pi.dot(pi);const a=pi.dot(mi);const o=pi.dot(gi);const l=mi.dot(mi);const c=mi.dot(gi);const u=s*l-a*a;if(u===0){return r.set(-2,-1,-1)}const h=1/u;const f=(l*o-a*c)*h;const d=(s*c-a*o)*h;return r.set(1-f-d,d,f)}static containsPoint(t,e,n,i){this.getBarycoord(t,e,n,i,_i);return _i.x>=0&&_i.y>=0&&_i.x+_i.y<=1}static getUV(t,e,n,i,r,s,a,o){if(Ti===false){console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().");Ti=true}return this.getInterpolation(t,e,n,i,r,s,a,o)}static getInterpolation(t,e,n,i,r,s,a,o){this.getBarycoord(t,e,n,i,_i);o.setScalar(0);o.addScaledVector(r,_i.x);o.addScaledVector(s,_i.y);o.addScaledVector(a,_i.z);return o}static isFrontFacing(t,e,n,i){pi.subVectors(n,e);mi.subVectors(t,e);return pi.cross(mi).dot(i)<0?true:false}set(t,e,n){this.a.copy(t);this.b.copy(e);this.c.copy(n);return this}setFromPointsAndIndices(t,e,n,i){this.a.copy(t[e]);this.b.copy(t[n]);this.c.copy(t[i]);return this}setFromAttributeAndIndices(t,e,n,i){this.a.fromBufferAttribute(t,e);this.b.fromBufferAttribute(t,n);this.c.fromBufferAttribute(t,i);return this}clone(){return(new this.constructor).copy(this)}copy(t){this.a.copy(t.a);this.b.copy(t.b);this.c.copy(t.c);return this}getArea(){pi.subVectors(this.c,this.b);mi.subVectors(this.a,this.b);return pi.cross(mi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return bi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return bi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){if(Ti===false){console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().");Ti=true}return bi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}getInterpolation(t,e,n,i,r){return bi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return bi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return bi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;xi.subVectors(i,n);vi.subVectors(r,n);yi.subVectors(t,n);const o=xi.dot(yi);const l=vi.dot(yi);if(o<=0&&l<=0){return e.copy(n)}Si.subVectors(t,i);const c=xi.dot(Si);const u=vi.dot(Si);if(c>=0&&u<=c){return e.copy(i)}const h=o*u-c*l;if(h<=0&&o>=0&&c<=0){s=o/(o-c);return e.copy(n).addScaledVector(xi,s)}Ei.subVectors(t,r);const f=xi.dot(Ei);const d=vi.dot(Ei);if(d>=0&&f<=d){return e.copy(r)}const p=f*l-o*d;if(p<=0&&l>=0&&d<=0){a=l/(l-d);return e.copy(n).addScaledVector(vi,a)}const m=c*d-f*u;if(m<=0&&u-c>=0&&f-d>=0){Mi.subVectors(r,i);a=(u-c)/(u-c+(f-d));return e.copy(i).addScaledVector(Mi,a)}const g=1/(m+p+h);s=p*g;a=h*g;return e.copy(n).addScaledVector(xi,s).addScaledVector(vi,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let wi=0;class Ai extends we{constructor(){super();this.isMaterial=true;Object.defineProperty(this,"id",{value:wi++});this.uuid=Ce();this.name="";this.type="Material";this.blending=p;this.side=u;this.vertexColors=false;this.opacity=1;this.transparent=false;this.blendSrc=R;this.blendDst=q;this.blendEquation=v;this.blendSrcAlpha=null;this.blendDstAlpha=null;this.blendEquationAlpha=null;this.depthFunc=F;this.depthTest=true;this.depthWrite=true;this.stencilWriteMask=255;this.stencilFunc=Se;this.stencilRef=0;this.stencilFuncMask=255;this.stencilFail=ye;this.stencilZFail=ye;this.stencilZPass=ye;this.stencilWrite=false;this.clippingPlanes=null;this.clipIntersection=false;this.clipShadows=false;this.shadowSide=null;this.colorWrite=true;this.precision=null;this.polygonOffset=false;this.polygonOffsetFactor=0;this.polygonOffsetUnits=0;this.dithering=false;this.alphaToCoverage=false;this.premultipliedAlpha=false;this.forceSinglePass=false;this.visible=true;this.toneMapped=true;this.userData={};this.version=0;this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){if(this._alphaTest>0!==t>0){this.version++}this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t===undefined)return;for(const e in t){const n=t[e];if(n===undefined){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];if(i===undefined){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}if(i&&i.isColor){i.set(n)}else if(i&&i.isVector3&&(n&&n.isVector3)){i.copy(n)}else{this[e]=n}}}toJSON(t){const e=t===undefined||typeof t==="string";if(e){t={textures:{},images:{}}}const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid;n.type=this.type;if(this.name!=="")n.name=this.name;if(this.color&&this.color.isColor)n.color=this.color.getHex();if(this.roughness!==undefined)n.roughness=this.roughness;if(this.metalness!==undefined)n.metalness=this.metalness;if(this.sheen!==undefined)n.sheen=this.sheen;if(this.sheenColor&&this.sheenColor.isColor)n.sheenColor=this.sheenColor.getHex();if(this.sheenRoughness!==undefined)n.sheenRoughness=this.sheenRoughness;if(this.emissive&&this.emissive.isColor)n.emissive=this.emissive.getHex();if(this.emissiveIntensity&&this.emissiveIntensity!==1)n.emissiveIntensity=this.emissiveIntensity;if(this.specular&&this.specular.isColor)n.specular=this.specular.getHex();if(this.specularIntensity!==undefined)n.specularIntensity=this.specularIntensity;if(this.specularColor&&this.specularColor.isColor)n.specularColor=this.specularColor.getHex();if(this.shininess!==undefined)n.shininess=this.shininess;if(this.clearcoat!==undefined)n.clearcoat=this.clearcoat;if(this.clearcoatRoughness!==undefined)n.clearcoatRoughness=this.clearcoatRoughness;if(this.clearcoatMap&&this.clearcoatMap.isTexture){n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid}if(this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture){n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid}if(this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture){n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid;n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()}if(this.iridescence!==undefined)n.iridescence=this.iridescence;if(this.iridescenceIOR!==undefined)n.iridescenceIOR=this.iridescenceIOR;if(this.iridescenceThicknessRange!==undefined)n.iridescenceThicknessRange=this.iridescenceThicknessRange;if(this.iridescenceMap&&this.iridescenceMap.isTexture){n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid}if(this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture){n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid}if(this.map&&this.map.isTexture)n.map=this.map.toJSON(t).uuid;if(this.matcap&&this.matcap.isTexture)n.matcap=this.matcap.toJSON(t).uuid;if(this.alphaMap&&this.alphaMap.isTexture)n.alphaMap=this.alphaMap.toJSON(t).uuid;if(this.lightMap&&this.lightMap.isTexture){n.lightMap=this.lightMap.toJSON(t).uuid;n.lightMapIntensity=this.lightMapIntensity}if(this.aoMap&&this.aoMap.isTexture){n.aoMap=this.aoMap.toJSON(t).uuid;n.aoMapIntensity=this.aoMapIntensity}if(this.bumpMap&&this.bumpMap.isTexture){n.bumpMap=this.bumpMap.toJSON(t).uuid;n.bumpScale=this.bumpScale}if(this.normalMap&&this.normalMap.isTexture){n.normalMap=this.normalMap.toJSON(t).uuid;n.normalMapType=this.normalMapType;n.normalScale=this.normalScale.toArray()}if(this.displacementMap&&this.displacementMap.isTexture){n.displacementMap=this.displacementMap.toJSON(t).uuid;n.displacementScale=this.displacementScale;n.displacementBias=this.displacementBias}if(this.roughnessMap&&this.roughnessMap.isTexture)n.roughnessMap=this.roughnessMap.toJSON(t).uuid;if(this.metalnessMap&&this.metalnessMap.isTexture)n.metalnessMap=this.metalnessMap.toJSON(t).uuid;if(this.emissiveMap&&this.emissiveMap.isTexture)n.emissiveMap=this.emissiveMap.toJSON(t).uuid;if(this.specularMap&&this.specularMap.isTexture)n.specularMap=this.specularMap.toJSON(t).uuid;if(this.specularIntensityMap&&this.specularIntensityMap.isTexture)n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid;if(this.specularColorMap&&this.specularColorMap.isTexture)n.specularColorMap=this.specularColorMap.toJSON(t).uuid;if(this.envMap&&this.envMap.isTexture){n.envMap=this.envMap.toJSON(t).uuid;if(this.combine!==undefined)n.combine=this.combine}if(this.envMapIntensity!==undefined)n.envMapIntensity=this.envMapIntensity;if(this.reflectivity!==undefined)n.reflectivity=this.reflectivity;if(this.refractionRatio!==undefined)n.refractionRatio=this.refractionRatio;if(this.gradientMap&&this.gradientMap.isTexture){n.gradientMap=this.gradientMap.toJSON(t).uuid}if(this.transmission!==undefined)n.transmission=this.transmission;if(this.transmissionMap&&this.transmissionMap.isTexture)n.transmissionMap=this.transmissionMap.toJSON(t).uuid;if(this.thickness!==undefined)n.thickness=this.thickness;if(this.thicknessMap&&this.thicknessMap.isTexture)n.thicknessMap=this.thicknessMap.toJSON(t).uuid;if(this.attenuationDistance!==undefined&&this.attenuationDistance!==Infinity)n.attenuationDistance=this.attenuationDistance;if(this.attenuationColor!==undefined)n.attenuationColor=this.attenuationColor.getHex();if(this.size!==undefined)n.size=this.size;if(this.shadowSide!==null)n.shadowSide=this.shadowSide;if(this.sizeAttenuation!==undefined)n.sizeAttenuation=this.sizeAttenuation;if(this.blending!==p)n.blending=this.blending;if(this.side!==u)n.side=this.side;if(this.vertexColors)n.vertexColors=true;if(this.opacity<1)n.opacity=this.opacity;if(this.transparent===true)n.transparent=this.transparent;n.depthFunc=this.depthFunc;n.depthTest=this.depthTest;n.depthWrite=this.depthWrite;n.colorWrite=this.colorWrite;n.stencilWrite=this.stencilWrite;n.stencilWriteMask=this.stencilWriteMask;n.stencilFunc=this.stencilFunc;n.stencilRef=this.stencilRef;n.stencilFuncMask=this.stencilFuncMask;n.stencilFail=this.stencilFail;n.stencilZFail=this.stencilZFail;n.stencilZPass=this.stencilZPass;if(this.rotation!==undefined&&this.rotation!==0)n.rotation=this.rotation;if(this.polygonOffset===true)n.polygonOffset=true;if(this.polygonOffsetFactor!==0)n.polygonOffsetFactor=this.polygonOffsetFactor;if(this.polygonOffsetUnits!==0)n.polygonOffsetUnits=this.polygonOffsetUnits;if(this.linewidth!==undefined&&this.linewidth!==1)n.linewidth=this.linewidth;if(this.dashSize!==undefined)n.dashSize=this.dashSize;if(this.gapSize!==undefined)n.gapSize=this.gapSize;if(this.scale!==undefined)n.scale=this.scale;if(this.dithering===true)n.dithering=true;if(this.alphaTest>0)n.alphaTest=this.alphaTest;if(this.alphaToCoverage===true)n.alphaToCoverage=this.alphaToCoverage;if(this.premultipliedAlpha===true)n.premultipliedAlpha=this.premultipliedAlpha;if(this.forceSinglePass===true)n.forceSinglePass=this.forceSinglePass;if(this.wireframe===true)n.wireframe=this.wireframe;if(this.wireframeLinewidth>1)n.wireframeLinewidth=this.wireframeLinewidth;if(this.wireframeLinecap!=="round")n.wireframeLinecap=this.wireframeLinecap;if(this.wireframeLinejoin!=="round")n.wireframeLinejoin=this.wireframeLinejoin;if(this.flatShading===true)n.flatShading=this.flatShading;if(this.visible===false)n.visible=false;if(this.toneMapped===false)n.toneMapped=false;if(this.fog===false)n.fog=false;if(Object.keys(this.userData).length>0)n.userData=this.userData;function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata;e.push(i)}return e}if(e){const e=i(t.textures);const r=i(t.images);if(e.length>0)n.textures=e;if(r.length>0)n.images=r}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name;this.blending=t.blending;this.side=t.side;this.vertexColors=t.vertexColors;this.opacity=t.opacity;this.transparent=t.transparent;this.blendSrc=t.blendSrc;this.blendDst=t.blendDst;this.blendEquation=t.blendEquation;this.blendSrcAlpha=t.blendSrcAlpha;this.blendDstAlpha=t.blendDstAlpha;this.blendEquationAlpha=t.blendEquationAlpha;this.depthFunc=t.depthFunc;this.depthTest=t.depthTest;this.depthWrite=t.depthWrite;this.stencilWriteMask=t.stencilWriteMask;this.stencilFunc=t.stencilFunc;this.stencilRef=t.stencilRef;this.stencilFuncMask=t.stencilFuncMask;this.stencilFail=t.stencilFail;this.stencilZFail=t.stencilZFail;this.stencilZPass=t.stencilZPass;this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i){n[i]=e[i].clone()}}this.clippingPlanes=n;this.clipIntersection=t.clipIntersection;this.clipShadows=t.clipShadows;this.shadowSide=t.shadowSide;this.colorWrite=t.colorWrite;this.precision=t.precision;this.polygonOffset=t.polygonOffset;this.polygonOffsetFactor=t.polygonOffsetFactor;this.polygonOffsetUnits=t.polygonOffsetUnits;this.dithering=t.dithering;this.alphaTest=t.alphaTest;this.alphaToCoverage=t.alphaToCoverage;this.premultipliedAlpha=t.premultipliedAlpha;this.forceSinglePass=t.forceSinglePass;this.visible=t.visible;this.toneMapped=t.toneMapped;this.userData=JSON.parse(JSON.stringify(t.userData));return this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){if(t===true)this.version++}}const Ri={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};const qi={h:0,s:0,l:0};const Ci={h:0,s:0,l:0};function Li(t,e,n){if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return t+(e-t)*6*n;if(n<1/2)return e;if(n<2/3)return t+(e-t)*6*(2/3-n);return t}class Pi{constructor(t,e,n){this.isColor=true;this.r=1;this.g=1;this.b=1;if(e===undefined&&n===undefined){return this.set(t)}return this.setRGB(t,e,n)}set(t){if(t&&t.isColor){this.copy(t)}else if(typeof t==="number"){this.setHex(t)}else if(typeof t==="string"){this.setStyle(t)}return this}setScalar(t){this.r=t;this.g=t;this.b=t;return this}setHex(t,e=xe){t=Math.floor(t);this.r=(t>>16&255)/255;this.g=(t>>8&255)/255;this.b=(t&255)/255;$e.toWorkingColorSpace(this,e);return this}setRGB(t,e,n,i=$e.workingColorSpace){this.r=t;this.g=e;this.b=n;$e.toWorkingColorSpace(this,i);return this}setHSL(t,e,n,i=$e.workingColorSpace){t=Pe(t,1);e=Le(e,0,1);n=Le(n,0,1);if(e===0){this.r=this.g=this.b=n}else{const i=n<=.5?n*(1+e):n+e-n*e;const r=2*n-i;this.r=Li(r,i,t+1/3);this.g=Li(r,i,t);this.b=Li(r,i,t-1/3)}$e.toWorkingColorSpace(this,i);return this}setStyle(t,e=xe){function n(e){if(e===undefined)return;if(parseFloat(e)<1){console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1];const a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){n(r[4]);return this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e)}if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){n(r[4]);return this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e)}break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){n(r[4]);return this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e)}break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1];const r=n.length;if(r===3){return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e)}else if(r===6){return this.setHex(parseInt(n,16),e)}else{console.warn("THREE.Color: Invalid hex color "+t)}}else if(t&&t.length>0){return this.setColorName(t,e)}return this}setColorName(t,e=xe){const n=Ri[t.toLowerCase()];if(n!==undefined){this.setHex(n,e)}else{console.warn("THREE.Color: Unknown color "+t)}return this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){this.r=t.r;this.g=t.g;this.b=t.b;return this}copySRGBToLinear(t){this.r=We(t.r);this.g=We(t.g);this.b=We(t.b);return this}copyLinearToSRGB(t){this.r=Xe(t.r);this.g=Xe(t.g);this.b=Xe(t.b);return this}convertSRGBToLinear(){this.copySRGBToLinear(this);return this}convertLinearToSRGB(){this.copyLinearToSRGB(this);return this}getHex(t=xe){$e.fromWorkingColorSpace(Ui.copy(this),t);return Math.round(Le(Ui.r*255,0,255))*65536+Math.round(Le(Ui.g*255,0,255))*256+Math.round(Le(Ui.b*255,0,255))}getHexString(t=xe){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=$e.workingColorSpace){$e.fromWorkingColorSpace(Ui.copy(this),e);const n=Ui.r,i=Ui.g,r=Ui.b;const s=Math.max(n,i,r);const a=Math.min(n,i,r);let o,l;const c=(a+s)/2;if(a===s){o=0;l=0}else{const t=s-a;l=c<=.5?t/(s+a):t/(2-s-a);switch(s){case n:o=(i-r)/t+(i<r?6:0);break;case i:o=(r-n)/t+2;break;case r:o=(n-i)/t+4;break}o/=6}t.h=o;t.s=l;t.l=c;return t}getRGB(t,e=$e.workingColorSpace){$e.fromWorkingColorSpace(Ui.copy(this),e);t.r=Ui.r;t.g=Ui.g;t.b=Ui.b;return t}getStyle(t=xe){$e.fromWorkingColorSpace(Ui.copy(this),t);const e=Ui.r,n=Ui.g,i=Ui.b;if(t!==xe){return`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`}return`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){this.getHSL(qi);qi.h+=t;qi.s+=e;qi.l+=n;this.setHSL(qi.h,qi.s,qi.l);return this}add(t){this.r+=t.r;this.g+=t.g;this.b+=t.b;return this}addColors(t,e){this.r=t.r+e.r;this.g=t.g+e.g;this.b=t.b+e.b;return this}addScalar(t){this.r+=t;this.g+=t;this.b+=t;return this}sub(t){this.r=Math.max(0,this.r-t.r);this.g=Math.max(0,this.g-t.g);this.b=Math.max(0,this.b-t.b);return this}multiply(t){this.r*=t.r;this.g*=t.g;this.b*=t.b;return this}multiplyScalar(t){this.r*=t;this.g*=t;this.b*=t;return this}lerp(t,e){this.r+=(t.r-this.r)*e;this.g+=(t.g-this.g)*e;this.b+=(t.b-this.b)*e;return this}lerpColors(t,e,n){this.r=t.r+(e.r-t.r)*n;this.g=t.g+(e.g-t.g)*n;this.b=t.b+(e.b-t.b)*n;return this}lerpHSL(t,e){this.getHSL(qi);t.getHSL(Ci);const n=Ue(qi.h,Ci.h,e);const i=Ue(qi.s,Ci.s,e);const r=Ue(qi.l,Ci.l,e);this.setHSL(n,i,r);return this}setFromVector3(t){this.r=t.x;this.g=t.y;this.b=t.z;return this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b;const r=t.elements;this.r=r[0]*e+r[3]*n+r[6]*i;this.g=r[1]*e+r[4]*n+r[7]*i;this.b=r[2]*e+r[5]*n+r[8]*i;return this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){this.r=t[e];this.g=t[e+1];this.b=t[e+2];return this}toArray(t=[],e=0){t[e]=this.r;t[e+1]=this.g;t[e+2]=this.b;return t}fromBufferAttribute(t,e){this.r=t.getX(e);this.g=t.getY(e);this.b=t.getZ(e);return this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r;yield this.g;yield this.b}}const Ui=new Pi;Pi.NAMES=Ri;class Di extends Ai{constructor(t){super();this.isMeshBasicMaterial=true;this.type="MeshBasicMaterial";this.color=new Pi(16777215);this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=V;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.lightMap=t.lightMap;this.lightMapIntensity=t.lightMapIntensity;this.aoMap=t.aoMap;this.aoMapIntensity=t.aoMapIntensity;this.specularMap=t.specularMap;this.alphaMap=t.alphaMap;this.envMap=t.envMap;this.combine=t.combine;this.reflectivity=t.reflectivity;this.refractionRatio=t.refractionRatio;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;this.wireframeLinecap=t.wireframeLinecap;this.wireframeLinejoin=t.wireframeLinejoin;this.fog=t.fog;return this}}const Ii=new fn;const Ni=new Fe;class Oi{constructor(t,e,n=false){if(Array.isArray(t)){throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.")}this.isBufferAttribute=true;this.name="";this.array=t;this.itemSize=e;this.count=t!==undefined?t.length/e:0;this.normalized=n;this.usage=Ee;this.updateRange={offset:0,count:-1};this.version=0}onUploadCallback(){}set needsUpdate(t){if(t===true)this.version++}setUsage(t){this.usage=t;return this}copy(t){this.name=t.name;this.array=new t.array.constructor(t.array);this.itemSize=t.itemSize;this.count=t.count;this.normalized=t.normalized;this.usage=t.usage;return this}copyAt(t,e,n){t*=this.itemSize;n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++){this.array[t+i]=e.array[n+i]}return this}copyArray(t){this.array.set(t);return this}applyMatrix3(t){if(this.itemSize===2){for(let e=0,n=this.count;e<n;e++){Ni.fromBufferAttribute(this,e);Ni.applyMatrix3(t);this.setXY(e,Ni.x,Ni.y)}}else if(this.itemSize===3){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.applyMatrix3(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}}return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.applyMatrix4(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.applyNormalMatrix(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++){Ii.fromBufferAttribute(this,e);Ii.transformDirection(t);this.setXYZ(e,Ii.x,Ii.y,Ii.z)}return this}set(t,e=0){this.array.set(t,e);return this}getX(t){let e=this.array[t*this.itemSize];if(this.normalized)e=Ne(e,this.array);return e}setX(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize]=e;return this}getY(t){let e=this.array[t*this.itemSize+1];if(this.normalized)e=Ne(e,this.array);return e}setY(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize+1]=e;return this}getZ(t){let e=this.array[t*this.itemSize+2];if(this.normalized)e=Ne(e,this.array);return e}setZ(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize+2]=e;return this}getW(t){let e=this.array[t*this.itemSize+3];if(this.normalized)e=Ne(e,this.array);return e}setW(t,e){if(this.normalized)e=Oe(e,this.array);this.array[t*this.itemSize+3]=e;return this}setXY(t,e,n){t*=this.itemSize;if(this.normalized){e=Oe(e,this.array);n=Oe(n,this.array)}this.array[t+0]=e;this.array[t+1]=n;return this}setXYZ(t,e,n,i){t*=this.itemSize;if(this.normalized){e=Oe(e,this.array);n=Oe(n,this.array);i=Oe(i,this.array)}this.array[t+0]=e;this.array[t+1]=n;this.array[t+2]=i;return this}setXYZW(t,e,n,i,r){t*=this.itemSize;if(this.normalized){e=Oe(e,this.array);n=Oe(n,this.array);i=Oe(i,this.array);r=Oe(r,this.array)}this.array[t+0]=e;this.array[t+1]=n;this.array[t+2]=i;this.array[t+3]=r;return this}onUpload(t){this.onUploadCallback=t;return this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};if(this.name!=="")t.name=this.name;if(this.usage!==Ee)t.usage=this.usage;if(this.updateRange.offset!==0||this.updateRange.count!==-1)t.updateRange=this.updateRange;return t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class Fi extends Oi{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class zi extends Oi{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class Bi extends Oi{constructor(t,e,n){super(new Float32Array(t),e,n)}}let Hi=0;const Gi=new Gn;const Vi=new di;const ki=new fn;const Wi=new mn;const Xi=new mn;const ji=new fn;class Yi extends we{constructor(){super();this.isBufferGeometry=true;Object.defineProperty(this,"id",{value:Hi++});this.uuid=Ce();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=false;this.groups=[];this.boundingBox=null;this.boundingSphere=null;this.drawRange={start:0,count:Infinity};this.userData={}}getIndex(){return this.index}setIndex(t){if(Array.isArray(t)){this.index=new(He(t)?zi:Fi)(t,1)}else{this.index=t}return this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){this.attributes[t]=e;return this}deleteAttribute(t){delete this.attributes[t];return this}hasAttribute(t){return this.attributes[t]!==undefined}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t;this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;if(e!==undefined){e.applyMatrix4(t);e.needsUpdate=true}const n=this.attributes.normal;if(n!==undefined){const e=(new ze).getNormalMatrix(t);n.applyNormalMatrix(e);n.needsUpdate=true}const i=this.attributes.tangent;if(i!==undefined){i.transformDirection(t);i.needsUpdate=true}if(this.boundingBox!==null){this.computeBoundingBox()}if(this.boundingSphere!==null){this.computeBoundingSphere()}return this}applyQuaternion(t){Gi.makeRotationFromQuaternion(t);this.applyMatrix4(Gi);return this}rotateX(t){Gi.makeRotationX(t);this.applyMatrix4(Gi);return this}rotateY(t){Gi.makeRotationY(t);this.applyMatrix4(Gi);return this}rotateZ(t){Gi.makeRotationZ(t);this.applyMatrix4(Gi);return this}translate(t,e,n){Gi.makeTranslation(t,e,n);this.applyMatrix4(Gi);return this}scale(t,e,n){Gi.makeScale(t,e,n);this.applyMatrix4(Gi);return this}lookAt(t){Vi.lookAt(t);Vi.updateMatrix();this.applyMatrix4(Vi.matrix);return this}center(){this.computeBoundingBox();this.boundingBox.getCenter(ki).negate();this.translate(ki.x,ki.y,ki.z);return this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}this.setAttribute("position",new Bi(e,3));return this}computeBoundingBox(){if(this.boundingBox===null){this.boundingBox=new mn}const t=this.attributes.position;const e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this);this.boundingBox.set(new fn(-Infinity,-Infinity,-Infinity),new fn(+Infinity,+Infinity,+Infinity));return}if(t!==undefined){this.boundingBox.setFromBufferAttribute(t);if(e){for(let t=0,n=e.length;t<n;t++){const n=e[t];Wi.setFromBufferAttribute(n);if(this.morphTargetsRelative){ji.addVectors(this.boundingBox.min,Wi.min);this.boundingBox.expandByPoint(ji);ji.addVectors(this.boundingBox.max,Wi.max);this.boundingBox.expandByPoint(ji)}else{this.boundingBox.expandByPoint(Wi.min);this.boundingBox.expandByPoint(Wi.max)}}}}else{this.boundingBox.makeEmpty()}if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)){console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}computeBoundingSphere(){if(this.boundingSphere===null){this.boundingSphere=new Un}const t=this.attributes.position;const e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this);this.boundingSphere.set(new fn,Infinity);return}if(t){const n=this.boundingSphere.center;Wi.setFromBufferAttribute(t);if(e){for(let t=0,n=e.length;t<n;t++){const n=e[t];Xi.setFromBufferAttribute(n);if(this.morphTargetsRelative){ji.addVectors(Wi.min,Xi.min);Wi.expandByPoint(ji);ji.addVectors(Wi.max,Xi.max);Wi.expandByPoint(ji)}else{Wi.expandByPoint(Xi.min);Wi.expandByPoint(Xi.max)}}}Wi.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++){ji.fromBufferAttribute(t,e);i=Math.max(i,n.distanceToSquared(ji))}if(e){for(let r=0,s=e.length;r<s;r++){const s=e[r];const a=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++){ji.fromBufferAttribute(s,e);if(a){ki.fromBufferAttribute(t,e);ji.add(ki)}i=Math.max(i,n.distanceToSquared(ji))}}}this.boundingSphere.radius=Math.sqrt(i);if(isNaN(this.boundingSphere.radius)){console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}computeTangents(){const t=this.index;const e=this.attributes;if(t===null||e.position===undefined||e.normal===undefined||e.uv===undefined){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.array;const i=e.position.array;const r=e.normal.array;const s=e.uv.array;const a=i.length/3;if(this.hasAttribute("tangent")===false){this.setAttribute("tangent",new Oi(new Float32Array(4*a),4))}const o=this.getAttribute("tangent").array;const l=[],c=[];for(let t=0;t<a;t++){l[t]=new fn;c[t]=new fn}const u=new fn,h=new fn,f=new fn,d=new Fe,p=new Fe,m=new Fe,g=new fn,_=new fn;function x(t,e,n){u.fromArray(i,t*3);h.fromArray(i,e*3);f.fromArray(i,n*3);d.fromArray(s,t*2);p.fromArray(s,e*2);m.fromArray(s,n*2);h.sub(u);f.sub(u);p.sub(d);m.sub(d);const r=1/(p.x*m.y-m.x*p.y);if(!isFinite(r))return;g.copy(h).multiplyScalar(m.y).addScaledVector(f,-p.y).multiplyScalar(r);_.copy(f).multiplyScalar(p.x).addScaledVector(h,-m.x).multiplyScalar(r);l[t].add(g);l[e].add(g);l[n].add(g);c[t].add(_);c[e].add(_);c[n].add(_)}let v=this.groups;if(v.length===0){v=[{start:0,count:n.length}]}for(let t=0,e=v.length;t<e;++t){const e=v[t];const i=e.start;const r=e.count;for(let t=i,e=i+r;t<e;t+=3){x(n[t+0],n[t+1],n[t+2])}}const M=new fn,y=new fn;const S=new fn,E=new fn;function T(t){S.fromArray(r,t*3);E.copy(S);const e=l[t];M.copy(e);M.sub(S.multiplyScalar(S.dot(e))).normalize();y.crossVectors(E,e);const n=y.dot(c[t]);const i=n<0?-1:1;o[t*4]=M.x;o[t*4+1]=M.y;o[t*4+2]=M.z;o[t*4+3]=i}for(let t=0,e=v.length;t<e;++t){const e=v[t];const i=e.start;const r=e.count;for(let t=i,e=i+r;t<e;t+=3){T(n[t+0]);T(n[t+1]);T(n[t+2])}}}computeVertexNormals(){const t=this.index;const e=this.getAttribute("position");if(e!==undefined){let n=this.getAttribute("normal");if(n===undefined){n=new Oi(new Float32Array(e.count*3),3);this.setAttribute("normal",n)}else{for(let t=0,e=n.count;t<e;t++){n.setXYZ(t,0,0,0)}}const i=new fn,r=new fn,s=new fn;const a=new fn,o=new fn,l=new fn;const c=new fn,u=new fn;if(t){for(let h=0,f=t.count;h<f;h+=3){const f=t.getX(h+0);const d=t.getX(h+1);const p=t.getX(h+2);i.fromBufferAttribute(e,f);r.fromBufferAttribute(e,d);s.fromBufferAttribute(e,p);c.subVectors(s,r);u.subVectors(i,r);c.cross(u);a.fromBufferAttribute(n,f);o.fromBufferAttribute(n,d);l.fromBufferAttribute(n,p);a.add(c);o.add(c);l.add(c);n.setXYZ(f,a.x,a.y,a.z);n.setXYZ(d,o.x,o.y,o.z);n.setXYZ(p,l.x,l.y,l.z)}}else{for(let t=0,a=e.count;t<a;t+=3){i.fromBufferAttribute(e,t+0);r.fromBufferAttribute(e,t+1);s.fromBufferAttribute(e,t+2);c.subVectors(s,r);u.subVectors(i,r);c.cross(u);n.setXYZ(t+0,c.x,c.y,c.z);n.setXYZ(t+1,c.x,c.y,c.z);n.setXYZ(t+2,c.x,c.y,c.z)}}this.normalizeNormals();n.needsUpdate=true}}merge(){console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.");return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++){ji.fromBufferAttribute(t,e);ji.normalize();t.setXYZ(e,ji.x,ji.y,ji.z)}}toNonIndexed(){function t(t,e){const n=t.array;const i=t.itemSize;const r=t.normalized;const s=new n.constructor(e.length*i);let a=0,o=0;for(let r=0,l=e.length;r<l;r++){if(t.isInterleavedBufferAttribute){a=e[r]*t.data.stride+t.offset}else{a=e[r]*i}for(let t=0;t<i;t++){s[o++]=n[a++]}}return new Oi(s,i,r)}if(this.index===null){console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.");return this}const e=new Yi;const n=this.index.array;const i=this.attributes;for(const r in i){const s=i[r];const a=t(s,n);e.setAttribute(r,a)}const r=this.morphAttributes;for(const i in r){const s=[];const a=r[i];for(let e=0,i=a.length;e<i;e++){const i=a[e];const r=t(i,n);s.push(r)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,n=s.length;t<n;t++){const n=s[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};t.uuid=this.uuid;t.type=this.type;if(this.name!=="")t.name=this.name;if(Object.keys(this.userData).length>0)t.userData=this.userData;if(this.parameters!==undefined){const e=this.parameters;for(const n in e){if(e[n]!==undefined)t[n]=e[n]}return t}t.data={attributes:{}};const e=this.index;if(e!==null){t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)}}const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=false;for(const e in this.morphAttributes){const n=this.morphAttributes[e];const s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];s.push(i.toJSON(t.data))}if(s.length>0){i[e]=s;r=true}}if(r){t.data.morphAttributes=i;t.data.morphTargetsRelative=this.morphTargetsRelative}const s=this.groups;if(s.length>0){t.data.groups=JSON.parse(JSON.stringify(s))}const a=this.boundingSphere;if(a!==null){t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}}return t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingBox=null;this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;if(n!==null){this.setIndex(n.clone(e))}const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[];const i=r[t];for(let t=0,r=i.length;t<r;t++){n.push(i[t].clone(e))}this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;if(a!==null){this.boundingBox=a.clone()}const o=t.boundingSphere;if(o!==null){this.boundingSphere=o.clone()}this.drawRange.start=t.drawRange.start;this.drawRange.count=t.drawRange.count;this.userData=t.userData;return this}dispose(){this.dispatchEvent({type:"dispose"})}}const Ji=new Gn;const Zi=new Hn;const Ki=new Un;const Qi=new fn;const $i=new fn;const tr=new fn;const er=new fn;const nr=new fn;const ir=new fn;const rr=new Fe;const sr=new Fe;const ar=new Fe;const or=new fn;const lr=new fn;const cr=new fn;const ur=new fn;const hr=new fn;class fr extends di{constructor(t=new Yi,e=new Di){super();this.isMesh=true;this.type="Mesh";this.geometry=t;this.material=e;this.updateMorphTargets()}copy(t,e){super.copy(t,e);if(t.morphTargetInfluences!==undefined){this.morphTargetInfluences=t.morphTargetInfluences.slice()}if(t.morphTargetDictionary!==undefined){this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)}this.material=t.material;this.geometry=t.geometry;return this}updateMorphTargets(){const t=this.geometry;const e=t.morphAttributes;const n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(t!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0);this.morphTargetDictionary[n]=e}}}}getVertexPosition(t,e){const n=this.geometry;const i=n.attributes.position;const r=n.morphAttributes.position;const s=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const a=this.morphTargetInfluences;if(r&&a){ir.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=a[n];const o=r[n];if(i===0)continue;nr.fromBufferAttribute(o,t);if(s){ir.addScaledVector(nr,i)}else{ir.addScaledVector(nr.sub(e),i)}}e.add(ir)}return e}raycast(t,e){const n=this.geometry;const i=this.material;const r=this.matrixWorld;if(i===undefined)return;if(n.boundingSphere===null)n.computeBoundingSphere();Ki.copy(n.boundingSphere);Ki.applyMatrix4(r);Zi.copy(t.ray).recast(t.near);if(Ki.containsPoint(Zi.origin)===false){if(Zi.intersectSphere(Ki,Qi)===null)return;if(Zi.origin.distanceToSquared(Qi)>(t.far-t.near)**2)return}Ji.copy(r).invert();Zi.copy(t.ray).applyMatrix4(Ji);if(n.boundingBox!==null){if(Zi.intersectsBox(n.boundingBox)===false)return}this._computeIntersections(t,e)}_computeIntersections(t,e){let n;const i=this.geometry;const r=this.material;const s=i.index;const a=i.attributes.position;const o=i.attributes.uv;const l=i.attributes.uv1;const c=i.attributes.normal;const u=i.groups;const h=i.drawRange;if(s!==null){if(Array.isArray(r)){for(let i=0,a=u.length;i<a;i++){const a=u[i];const f=r[a.materialIndex];const d=Math.max(a.start,h.start);const p=Math.min(s.count,Math.min(a.start+a.count,h.start+h.count));for(let i=d,r=p;i<r;i+=3){const r=s.getX(i);const u=s.getX(i+1);const h=s.getX(i+2);n=pr(this,f,t,Zi,o,l,c,r,u,h);if(n){n.faceIndex=Math.floor(i/3);n.face.materialIndex=a.materialIndex;e.push(n)}}}}else{const i=Math.max(0,h.start);const a=Math.min(s.count,h.start+h.count);for(let u=i,h=a;u<h;u+=3){const i=s.getX(u);const a=s.getX(u+1);const h=s.getX(u+2);n=pr(this,r,t,Zi,o,l,c,i,a,h);if(n){n.faceIndex=Math.floor(u/3);e.push(n)}}}}else if(a!==undefined){if(Array.isArray(r)){for(let i=0,s=u.length;i<s;i++){const s=u[i];const f=r[s.materialIndex];const d=Math.max(s.start,h.start);const p=Math.min(a.count,Math.min(s.start+s.count,h.start+h.count));for(let i=d,r=p;i<r;i+=3){const r=i;const a=i+1;const u=i+2;n=pr(this,f,t,Zi,o,l,c,r,a,u);if(n){n.faceIndex=Math.floor(i/3);n.face.materialIndex=s.materialIndex;e.push(n)}}}}else{const i=Math.max(0,h.start);const s=Math.min(a.count,h.start+h.count);for(let a=i,u=s;a<u;a+=3){const i=a;const s=a+1;const u=a+2;n=pr(this,r,t,Zi,o,l,c,i,s,u);if(n){n.faceIndex=Math.floor(a/3);e.push(n)}}}}}}function dr(t,e,n,i,r,s,a,o){let l;if(e.side===h){l=i.intersectTriangle(a,s,r,true,o)}else{l=i.intersectTriangle(r,s,a,e.side===u,o)}if(l===null)return null;hr.copy(o);hr.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(hr);if(c<n.near||c>n.far)return null;return{distance:c,point:hr.clone(),object:t}}function pr(t,e,n,i,r,s,a,o,l,c){t.getVertexPosition(o,$i);t.getVertexPosition(l,tr);t.getVertexPosition(c,er);const u=dr(t,e,n,i,$i,tr,er,ur);if(u){if(r){rr.fromBufferAttribute(r,o);sr.fromBufferAttribute(r,l);ar.fromBufferAttribute(r,c);u.uv=bi.getInterpolation(ur,$i,tr,er,rr,sr,ar,new Fe)}if(s){rr.fromBufferAttribute(s,o);sr.fromBufferAttribute(s,l);ar.fromBufferAttribute(s,c);u.uv1=bi.getInterpolation(ur,$i,tr,er,rr,sr,ar,new Fe);u.uv2=u.uv1}if(a){or.fromBufferAttribute(a,o);lr.fromBufferAttribute(a,l);cr.fromBufferAttribute(a,c);u.normal=bi.getInterpolation(ur,$i,tr,er,or,lr,cr,new fn);if(u.normal.dot(i.direction)>0){u.normal.multiplyScalar(-1)}}const t={a:o,b:l,c:c,normal:new fn,materialIndex:0};bi.getNormal($i,tr,er,t.normal);u.face=t}return u}class mr extends Yi{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super();this.type="BoxGeometry";this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i);r=Math.floor(r);s=Math.floor(s);const o=[];const l=[];const c=[];const u=[];let h=0;let f=0;d("z","y","x",-1,-1,n,e,t,s,r,0);d("z","y","x",1,-1,n,e,-t,s,r,1);d("x","z","y",1,1,t,n,e,i,s,2);d("x","z","y",1,-1,t,n,-e,i,s,3);d("x","y","z",1,-1,t,e,n,i,r,4);d("x","y","z",-1,-1,t,e,-n,i,r,5);this.setIndex(o);this.setAttribute("position",new Bi(l,3));this.setAttribute("normal",new Bi(c,3));this.setAttribute("uv",new Bi(u,2));function d(t,e,n,i,r,s,d,p,m,g,_){const x=s/m;const v=d/g;const M=s/2;const y=d/2;const S=p/2;const E=m+1;const T=g+1;let b=0;let w=0;const A=new fn;for(let s=0;s<T;s++){const a=s*v-y;for(let o=0;o<E;o++){const h=o*x-M;A[t]=h*i;A[e]=a*r;A[n]=S;l.push(A.x,A.y,A.z);A[t]=0;A[e]=0;A[n]=p>0?1:-1;c.push(A.x,A.y,A.z);u.push(o/m);u.push(1-s/g);b+=1}}for(let t=0;t<g;t++){for(let e=0;e<m;e++){const n=h+e+E*t;const i=h+e+E*(t+1);const r=h+(e+1)+E*(t+1);const s=h+(e+1)+E*t;o.push(n,i,s);o.push(i,r,s);w+=6}}a.addGroup(f,w,_);f+=w;h+=b}}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}static fromJSON(t){return new mr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function gr(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];if(r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)){if(r.isRenderTargetTexture){console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().");e[n][i]=null}else{e[n][i]=r.clone()}}else if(Array.isArray(r)){e[n][i]=r.slice()}else{e[n][i]=r}}}return e}function _r(t){const e={};for(let n=0;n<t.length;n++){const i=gr(t[n]);for(const t in i){e[t]=i[t]}}return e}function xr(t){const e=[];for(let n=0;n<t.length;n++){e.push(t[n].clone())}return e}function vr(t){if(t.getRenderTarget()===null){return t.outputColorSpace}return ve}const Mr={clone:gr,merge:_r};var yr="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";var Sr="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";class Er extends Ai{constructor(t){super();this.isShaderMaterial=true;this.type="ShaderMaterial";this.defines={};this.uniforms={};this.uniformsGroups=[];this.vertexShader=yr;this.fragmentShader=Sr;this.linewidth=1;this.wireframe=false;this.wireframeLinewidth=1;this.fog=false;this.lights=false;this.clipping=false;this.forceSinglePass=true;this.extensions={derivatives:false,fragDepth:false,drawBuffers:false,shaderTextureLOD:false};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]};this.index0AttributeName=undefined;this.uniformsNeedUpdate=false;this.glslVersion=null;if(t!==undefined){this.setValues(t)}}copy(t){super.copy(t);this.fragmentShader=t.fragmentShader;this.vertexShader=t.vertexShader;this.uniforms=gr(t.uniforms);this.uniformsGroups=xr(t.uniformsGroups);this.defines=Object.assign({},t.defines);this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;this.fog=t.fog;this.lights=t.lights;this.clipping=t.clipping;this.extensions=Object.assign({},t.extensions);this.glslVersion=t.glslVersion;return this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion;e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n];const r=i.value;if(r&&r.isTexture){e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}}else if(r&&r.isColor){e.uniforms[n]={type:"c",value:r.getHex()}}else if(r&&r.isVector2){e.uniforms[n]={type:"v2",value:r.toArray()}}else if(r&&r.isVector3){e.uniforms[n]={type:"v3",value:r.toArray()}}else if(r&&r.isVector4){e.uniforms[n]={type:"v4",value:r.toArray()}}else if(r&&r.isMatrix3){e.uniforms[n]={type:"m3",value:r.toArray()}}else if(r&&r.isMatrix4){e.uniforms[n]={type:"m4",value:r.toArray()}}else{e.uniforms[n]={value:r}}}if(Object.keys(this.defines).length>0)e.defines=this.defines;e.vertexShader=this.vertexShader;e.fragmentShader=this.fragmentShader;e.lights=this.lights;e.clipping=this.clipping;const n={};for(const t in this.extensions){if(this.extensions[t]===true)n[t]=true}if(Object.keys(n).length>0)e.extensions=n;return e}}class Tr extends di{constructor(){super();this.isCamera=true;this.type="Camera";this.matrixWorldInverse=new Gn;this.projectionMatrix=new Gn;this.projectionMatrixInverse=new Gn}copy(t,e){super.copy(t,e);this.matrixWorldInverse.copy(t.matrixWorldInverse);this.projectionMatrix.copy(t.projectionMatrix);this.projectionMatrixInverse.copy(t.projectionMatrixInverse);return this}getWorldDirection(t){this.updateWorldMatrix(true,false);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t);this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e);this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class br extends Tr{constructor(t=50,e=1,n=.1,i=2e3){super();this.isPerspectiveCamera=true;this.type="PerspectiveCamera";this.fov=t;this.zoom=1;this.near=n;this.far=i;this.focus=10;this.aspect=e;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}copy(t,e){super.copy(t,e);this.fov=t.fov;this.zoom=t.zoom;this.near=t.near;this.far=t.far;this.focus=t.focus;this.aspect=t.aspect;this.view=t.view===null?null:Object.assign({},t.view);this.filmGauge=t.filmGauge;this.filmOffset=t.filmOffset;return this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=qe*2*Math.atan(e);this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Re*.5*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return qe*2*Math.atan(Math.tan(Re*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e;if(this.view===null){this.view={enabled:true,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}}this.view.enabled=true;this.view.fullWidth=t;this.view.fullHeight=e;this.view.offsetX=n;this.view.offsetY=i;this.view.width=r;this.view.height=s;this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null){this.view.enabled=false}this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Re*.5*this.fov)/this.zoom;let n=2*e;let i=this.aspect*n;let r=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t;e-=s.offsetY*n/a;i*=s.width/t;n*=s.height/a}const a=this.filmOffset;if(a!==0)r+=t*a/this.getFilmWidth();this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far);this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);e.object.fov=this.fov;e.object.zoom=this.zoom;e.object.near=this.near;e.object.far=this.far;e.object.focus=this.focus;e.object.aspect=this.aspect;if(this.view!==null)e.object.view=Object.assign({},this.view);e.object.filmGauge=this.filmGauge;e.object.filmOffset=this.filmOffset;return e}}const wr=-90;const Ar=1;class Rr extends di{constructor(t,e,n){super();this.type="CubeCamera";this.renderTarget=n;const i=new br(wr,Ar,t,e);i.layers=this.layers;i.up.set(0,1,0);i.lookAt(1,0,0);this.add(i);const r=new br(wr,Ar,t,e);r.layers=this.layers;r.up.set(0,1,0);r.lookAt(-1,0,0);this.add(r);const s=new br(wr,Ar,t,e);s.layers=this.layers;s.up.set(0,0,-1);s.lookAt(0,1,0);this.add(s);const a=new br(wr,Ar,t,e);a.layers=this.layers;a.up.set(0,0,1);a.lookAt(0,-1,0);this.add(a);const o=new br(wr,Ar,t,e);o.layers=this.layers;o.up.set(0,1,0);o.lookAt(0,0,1);this.add(o);const l=new br(wr,Ar,t,e);l.layers=this.layers;l.up.set(0,1,0);l.lookAt(0,0,-1);this.add(l)}update(t,e){if(this.parent===null)this.updateMatrixWorld();const n=this.renderTarget;const[i,r,s,a,o,l]=this.children;const c=t.getRenderTarget();const u=t.toneMapping;const h=t.xr.enabled;t.toneMapping=X;t.xr.enabled=false;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=false;t.setRenderTarget(n,0);t.render(e,i);t.setRenderTarget(n,1);t.render(e,r);t.setRenderTarget(n,2);t.render(e,s);t.setRenderTarget(n,3);t.render(e,a);t.setRenderTarget(n,4);t.render(e,o);n.texture.generateMipmaps=f;t.setRenderTarget(n,5);t.render(e,l);t.setRenderTarget(c);t.toneMapping=u;t.xr.enabled=h;n.texture.needsPMREMUpdate=true}}class qr extends an{constructor(t,e,n,i,r,s,a,o,l,c){t=t!==undefined?t:[];e=e!==undefined?e:$;super(t,e,n,i,r,s,a,o,l,c);this.isCubeTexture=true;this.flipY=false}get images(){return this.image}set images(t){this.image=t}}class Cr extends ln{constructor(t=1,e={}){super(t,t,e);this.isWebGLCubeRenderTarget=true;const n={width:t,height:t,depth:1};const i=[n,n,n,n,n,n];if(e.encoding!==undefined){ke("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.");e.colorSpace=e.encoding===fe?xe:_e}this.texture=new qr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace);this.texture.isRenderTargetTexture=true;this.texture.generateMipmaps=e.generateMipmaps!==undefined?e.generateMipmaps:false;this.texture.minFilter=e.minFilter!==undefined?e.minFilter:ut}fromEquirectangularTexture(t,e){this.texture.type=e.type;this.texture.colorSpace=e.colorSpace;this.texture.generateMipmaps=e.generateMipmaps;this.texture.minFilter=e.minFilter;this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,fragmentShader:`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`};const i=new mr(5,5,5);const r=new Er({name:"CubemapFromEquirect",uniforms:gr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:h,blending:d});r.uniforms.tEquirect.value=e;const s=new fr(i,r);const a=e.minFilter;if(e.minFilter===ft)e.minFilter=ut;const o=new Rr(1,10,this);o.update(t,s);e.minFilter=a;s.geometry.dispose();s.material.dispose();return this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++){t.setRenderTarget(this,r);t.clear(e,n,i)}t.setRenderTarget(r)}}const Lr=new fn;const Pr=new fn;const Ur=new ze;class Dr{constructor(t=new fn(1,0,0),e=0){this.isPlane=true;this.normal=t;this.constant=e}set(t,e){this.normal.copy(t);this.constant=e;return this}setComponents(t,e,n,i){this.normal.set(t,e,n);this.constant=i;return this}setFromNormalAndCoplanarPoint(t,e){this.normal.copy(t);this.constant=-e.dot(this.normal);return this}setFromCoplanarPoints(t,e,n){const i=Lr.subVectors(n,e).cross(Pr.subVectors(t,e)).normalize();this.setFromNormalAndCoplanarPoint(i,t);return this}copy(t){this.normal.copy(t.normal);this.constant=t.constant;return this}normalize(){const t=1/this.normal.length();this.normal.multiplyScalar(t);this.constant*=t;return this}negate(){this.constant*=-1;this.normal.negate();return this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Lr);const i=this.normal.dot(n);if(i===0){if(this.distanceToPoint(t.start)===0){return e.copy(t.start)}return null}const r=-(t.start.dot(this.normal)+this.constant)/i;if(r<0||r>1){return null}return e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start);const n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Ur.getNormalMatrix(t);const i=this.coplanarPoint(Lr).applyMatrix4(t);const r=this.normal.applyMatrix3(n).normalize();this.constant=-i.dot(r);return this}translate(t){this.constant-=t.dot(this.normal);return this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Ir=new Un;const Nr=new fn;class Or{constructor(t=new Dr,e=new Dr,n=new Dr,i=new Dr,r=new Dr,s=new Dr){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;a[0].copy(t);a[1].copy(e);a[2].copy(n);a[3].copy(i);a[4].copy(r);a[5].copy(s);return this}copy(t){const e=this.planes;for(let n=0;n<6;n++){e[n].copy(t.planes[n])}return this}setFromProjectionMatrix(t){const e=this.planes;const n=t.elements;const i=n[0],r=n[1],s=n[2],a=n[3];const o=n[4],l=n[5],c=n[6],u=n[7];const h=n[8],f=n[9],d=n[10],p=n[11];const m=n[12],g=n[13],_=n[14],x=n[15];e[0].setComponents(a-i,u-o,p-h,x-m).normalize();e[1].setComponents(a+i,u+o,p+h,x+m).normalize();e[2].setComponents(a+r,u+l,p+f,x+g).normalize();e[3].setComponents(a-r,u-l,p-f,x-g).normalize();e[4].setComponents(a-s,u-c,p-d,x-_).normalize();e[5].setComponents(a+s,u+c,p+d,x+_).normalize();return this}intersectsObject(t){if(t.boundingSphere!==undefined){if(t.boundingSphere===null)t.computeBoundingSphere();Ir.copy(t.boundingSphere).applyMatrix4(t.matrixWorld)}else{const e=t.geometry;if(e.boundingSphere===null)e.computeBoundingSphere();Ir.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Ir)}intersectsSprite(t){Ir.center.set(0,0,0);Ir.radius=.7071067811865476;Ir.applyMatrix4(t.matrixWorld);return this.intersectsSphere(Ir)}intersectsSphere(t){const e=this.planes;const n=t.center;const i=-t.radius;for(let t=0;t<6;t++){const r=e[t].distanceToPoint(n);if(r<i){return false}}return true}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];Nr.x=i.normal.x>0?t.max.x:t.min.x;Nr.y=i.normal.y>0?t.max.y:t.min.y;Nr.z=i.normal.z>0?t.max.z:t.min.z;if(i.distanceToPoint(Nr)<0){return false}}return true}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++){if(e[n].distanceToPoint(t)<0){return false}}return true}clone(){return(new this.constructor).copy(this)}}function Fr(){let t=null;let e=false;let n=null;let i=null;function r(e,s){n(e,s);i=t.requestAnimationFrame(r)}return{start:function(){if(e===true)return;if(n===null)return;i=t.requestAnimationFrame(r);e=true},stop:function(){t.cancelAnimationFrame(i);e=false},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function zr(t,e){const n=e.isWebGL2;const i=new WeakMap;function r(e,i){const r=e.array;const s=e.usage;const a=t.createBuffer();t.bindBuffer(i,a);t.bufferData(i,r,s);e.onUploadCallback();let o;if(r instanceof Float32Array){o=t.FLOAT}else if(r instanceof Uint16Array){if(e.isFloat16BufferAttribute){if(n){o=t.HALF_FLOAT}else{throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.")}}else{o=t.UNSIGNED_SHORT}}else if(r instanceof Int16Array){o=t.SHORT}else if(r instanceof Uint32Array){o=t.UNSIGNED_INT}else if(r instanceof Int32Array){o=t.INT}else if(r instanceof Int8Array){o=t.BYTE}else if(r instanceof Uint8Array){o=t.UNSIGNED_BYTE}else if(r instanceof Uint8ClampedArray){o=t.UNSIGNED_BYTE}else{throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r)}return{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}function s(e,i,r){const s=i.array;const a=i.updateRange;t.bindBuffer(r,e);if(a.count===-1){t.bufferSubData(r,0,s)}else{if(n){t.bufferSubData(r,a.offset*s.BYTES_PER_ELEMENT,s,a.offset,a.count)}else{t.bufferSubData(r,a.offset*s.BYTES_PER_ELEMENT,s.subarray(a.offset,a.offset+a.count))}a.count=-1}i.onUploadCallback()}function a(t){if(t.isInterleavedBufferAttribute)t=t.data;return i.get(t)}function o(e){if(e.isInterleavedBufferAttribute)e=e.data;const n=i.get(e);if(n){t.deleteBuffer(n.buffer);i.delete(e)}}function l(t,e){if(t.isGLBufferAttribute){const e=i.get(t);if(!e||e.version<t.version){i.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version})}return}if(t.isInterleavedBufferAttribute)t=t.data;const n=i.get(t);if(n===undefined){i.set(t,r(t,e))}else if(n.version<t.version){s(n.buffer,t,e);n.version=t.version}}return{get:a,remove:o,update:l}}class Br extends Yi{constructor(t=1,e=1,n=1,i=1){super();this.type="PlaneGeometry";this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2;const s=e/2;const a=Math.floor(n);const o=Math.floor(i);const l=a+1;const c=o+1;const u=t/a;const h=e/o;const f=[];const d=[];const p=[];const m=[];for(let t=0;t<c;t++){const e=t*h-s;for(let n=0;n<l;n++){const i=n*u-r;d.push(i,-e,0);p.push(0,0,1);m.push(n/a);m.push(1-t/o)}}for(let t=0;t<o;t++){for(let e=0;e<a;e++){const n=e+l*t;const i=e+l*(t+1);const r=e+1+l*(t+1);const s=e+1+l*t;f.push(n,i,s);f.push(i,r,s)}}this.setIndex(f);this.setAttribute("position",new Bi(d,3));this.setAttribute("normal",new Bi(p,3));this.setAttribute("uv",new Bi(m,2))}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}static fromJSON(t){return new Br(t.width,t.height,t.widthSegments,t.heightSegments)}}var Hr="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif";var Gr="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";var Vr="#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif";var kr="#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif";var Wr="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif";var Xr="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif";var jr="vec3 transformed = vec3( position );";var Yr="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";var Jr="float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated";var Zr="#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif";var Kr="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif";var Qr="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif";var $r="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif";var ts="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif";var es="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif";var ns="#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif";var is="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif";var rs="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif";var ss="#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif";var as="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated";var os="#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif";var ls="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif";var cs="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif";var us="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif";var hs="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif";var fs="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif";var ds="gl_FragColor = linearToOutputTexel( gl_FragColor );";var ps="vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";var ms="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";var gs="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";var _s="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif";var xs="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif";var vs="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif";var Ms="#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif";var ys="#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif";var Ss="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif";var Es="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif";var Ts="#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}";var bs="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif";var ws="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif";var As="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";var Rs="varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert";var qs="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";var Cs="#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif";var Ls="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";var Ps="varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon";var Us="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";var Ds="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong";var Is="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif";var Ns="struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";var Os="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif";var Fs="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";var zs="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif";var Bs="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";var Hs="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif";var Gs="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif";var Vs="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";var ks="#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif";var Ws="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";var Xs="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif";var js="#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";var Ys="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif";var Js="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif";var Zs="#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif";var Ks="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif";var Qs="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";var $s="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif";var ta="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_NORMALMAP_TANGENTSPACE\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;";var ea="#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";var na="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif";var ia="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif";var ra="#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif";var sa="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif";var aa="#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif";var oa="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif";var la="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif";var ca="#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif";var ua="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";var ha="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}";var fa="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif";var da="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;";var pa="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif";var ma="#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif";var ga="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif";var _a="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif";var xa="#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif";var va="#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif";var Ma="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif";var ya="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}";var Sa="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";var Ea="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif";var Ta="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif";var ba="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif";var wa="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif";var Aa="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif";var Ra="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";var qa="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";var Ca="#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif";var La="#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif";var Pa="#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";var Ua="#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";var Da="#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif";var Ia="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";const Na="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";const Oa="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Fa="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";const za="#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Ba="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";const Ha="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Ga="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";const Va="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";const ka="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";const Wa="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";const Xa="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}";const ja="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";const Ya="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";const Ja="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";const Za="#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";const Ka="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const Qa="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const $a="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const to="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";const eo="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const no="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";const io="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}";const ro="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const so="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const ao="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";const oo="#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const lo="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const co="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";const uo="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";const ho="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";const fo="#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";const po="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";const mo="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";const go="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";const _o={alphamap_fragment:Hr,alphamap_pars_fragment:Gr,alphatest_fragment:Vr,alphatest_pars_fragment:kr,aomap_fragment:Wr,aomap_pars_fragment:Xr,begin_vertex:jr,beginnormal_vertex:Yr,bsdfs:Jr,iridescence_fragment:Zr,bumpmap_pars_fragment:Kr,clipping_planes_fragment:Qr,clipping_planes_pars_fragment:$r,clipping_planes_pars_vertex:ts,clipping_planes_vertex:es,color_fragment:ns,color_pars_fragment:is,color_pars_vertex:rs,color_vertex:ss,common:as,cube_uv_reflection_fragment:os,defaultnormal_vertex:ls,displacementmap_pars_vertex:cs,displacementmap_vertex:us,emissivemap_fragment:hs,emissivemap_pars_fragment:fs,encodings_fragment:ds,encodings_pars_fragment:ps,envmap_fragment:ms,envmap_common_pars_fragment:gs,envmap_pars_fragment:_s,envmap_pars_vertex:xs,envmap_physical_pars_fragment:Cs,envmap_vertex:vs,fog_vertex:Ms,fog_pars_vertex:ys,fog_fragment:Ss,fog_pars_fragment:Es,gradientmap_pars_fragment:Ts,lightmap_fragment:bs,lightmap_pars_fragment:ws,lights_lambert_fragment:As,lights_lambert_pars_fragment:Rs,lights_pars_begin:qs,lights_toon_fragment:Ls,lights_toon_pars_fragment:Ps,lights_phong_fragment:Us,lights_phong_pars_fragment:Ds,lights_physical_fragment:Is,lights_physical_pars_fragment:Ns,lights_fragment_begin:Os,lights_fragment_maps:Fs,lights_fragment_end:zs,logdepthbuf_fragment:Bs,logdepthbuf_pars_fragment:Hs,logdepthbuf_pars_vertex:Gs,logdepthbuf_vertex:Vs,map_fragment:ks,map_pars_fragment:Ws,map_particle_fragment:Xs,map_particle_pars_fragment:js,metalnessmap_fragment:Ys,metalnessmap_pars_fragment:Js,morphcolor_vertex:Zs,morphnormal_vertex:Ks,morphtarget_pars_vertex:Qs,morphtarget_vertex:$s,normal_fragment_begin:ta,normal_fragment_maps:ea,normal_pars_fragment:na,normal_pars_vertex:ia,normal_vertex:ra,normalmap_pars_fragment:sa,clearcoat_normal_fragment_begin:aa,clearcoat_normal_fragment_maps:oa,clearcoat_pars_fragment:la,iridescence_pars_fragment:ca,output_fragment:ua,packing:ha,premultiplied_alpha_fragment:fa,project_vertex:da,dithering_fragment:pa,dithering_pars_fragment:ma,roughnessmap_fragment:ga,roughnessmap_pars_fragment:_a,shadowmap_pars_fragment:xa,shadowmap_pars_vertex:va,shadowmap_vertex:Ma,shadowmask_pars_fragment:ya,skinbase_vertex:Sa,skinning_pars_vertex:Ea,skinning_vertex:Ta,skinnormal_vertex:ba,specularmap_fragment:wa,specularmap_pars_fragment:Aa,tonemapping_fragment:Ra,tonemapping_pars_fragment:qa,transmission_fragment:Ca,transmission_pars_fragment:La,uv_pars_fragment:Pa,uv_pars_vertex:Ua,uv_vertex:Da,worldpos_vertex:Ia,background_vert:Na,background_frag:Oa,backgroundCube_vert:Fa,backgroundCube_frag:za,cube_vert:Ba,cube_frag:Ha,depth_vert:Ga,depth_frag:Va,distanceRGBA_vert:ka,distanceRGBA_frag:Wa,equirect_vert:Xa,equirect_frag:ja,linedashed_vert:Ya,linedashed_frag:Ja,meshbasic_vert:Za,meshbasic_frag:Ka,meshlambert_vert:Qa,meshlambert_frag:$a,meshmatcap_vert:to,meshmatcap_frag:eo,meshnormal_vert:no,meshnormal_frag:io,meshphong_vert:ro,meshphong_frag:so,meshphysical_vert:ao,meshphysical_frag:oo,meshtoon_vert:lo,meshtoon_frag:co,points_vert:uo,points_frag:ho,shadow_vert:fo,shadow_frag:po,sprite_vert:mo,sprite_frag:go};const xo={common:{diffuse:{value:new Pi(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ze},alphaMap:{value:null},alphaMapTransform:{value:new ze},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ze}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ze}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ze}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ze},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ze},normalScale:{value:new Fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ze},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ze}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ze}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ze}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ze}},sprite:{diffuse:{value:new Pi(16777215)},opacity:{value:1},center:{value:new Fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ze},alphaMap:{value:null},alphaTest:{value:0}}};const vo={basic:{uniforms:_r([xo.common,xo.specularmap,xo.envmap,xo.aomap,xo.lightmap,xo.fog]),vertexShader:_o.meshbasic_vert,fragmentShader:_o.meshbasic_frag},lambert:{uniforms:_r([xo.common,xo.specularmap,xo.envmap,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)}}]),vertexShader:_o.meshlambert_vert,fragmentShader:_o.meshlambert_frag},phong:{uniforms:_r([xo.common,xo.specularmap,xo.envmap,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)},specular:{value:new Pi(1118481)},shininess:{value:30}}]),vertexShader:_o.meshphong_vert,fragmentShader:_o.meshphong_frag},standard:{uniforms:_r([xo.common,xo.envmap,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.roughnessmap,xo.metalnessmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag},toon:{uniforms:_r([xo.common,xo.aomap,xo.lightmap,xo.emissivemap,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.gradientmap,xo.fog,xo.lights,{emissive:{value:new Pi(0)}}]),vertexShader:_o.meshtoon_vert,fragmentShader:_o.meshtoon_frag},matcap:{uniforms:_r([xo.common,xo.bumpmap,xo.normalmap,xo.displacementmap,xo.fog,{matcap:{value:null}}]),vertexShader:_o.meshmatcap_vert,fragmentShader:_o.meshmatcap_frag},points:{uniforms:_r([xo.points,xo.fog]),vertexShader:_o.points_vert,fragmentShader:_o.points_frag},dashed:{uniforms:_r([xo.common,xo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_o.linedashed_vert,fragmentShader:_o.linedashed_frag},depth:{uniforms:_r([xo.common,xo.displacementmap]),vertexShader:_o.depth_vert,fragmentShader:_o.depth_frag},normal:{uniforms:_r([xo.common,xo.bumpmap,xo.normalmap,xo.displacementmap,{opacity:{value:1}}]),vertexShader:_o.meshnormal_vert,fragmentShader:_o.meshnormal_frag},sprite:{uniforms:_r([xo.sprite,xo.fog]),vertexShader:_o.sprite_vert,fragmentShader:_o.sprite_frag},background:{uniforms:{uvTransform:{value:new ze},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_o.background_vert,fragmentShader:_o.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_o.backgroundCube_vert,fragmentShader:_o.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_o.cube_vert,fragmentShader:_o.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_o.equirect_vert,fragmentShader:_o.equirect_frag},distanceRGBA:{uniforms:_r([xo.common,xo.displacementmap,{referencePosition:{value:new fn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_o.distanceRGBA_vert,fragmentShader:_o.distanceRGBA_frag},shadow:{uniforms:_r([xo.lights,xo.fog,{color:{value:new Pi(0)},opacity:{value:1}}]),vertexShader:_o.shadow_vert,fragmentShader:_o.shadow_frag}};vo.physical={uniforms:_r([vo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ze},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ze},clearcoatNormalScale:{value:new Fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ze},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ze},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ze},sheen:{value:0},sheenColor:{value:new Pi(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ze},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ze},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ze},transmissionSamplerSize:{value:new Fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ze},attenuationDistance:{value:0},attenuationColor:{value:new Pi(0)},specularColor:{value:new Pi(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ze},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ze}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag};const Mo={r:0,b:0,g:0};function yo(t,e,n,i,r,s,a){const o=new Pi(0);let l=s===true?0:1;let c;let f;let d=null;let p=0;let m=null;function g(s,g){let x=false;let v=g.isScene===true?g.background:null;if(v&&v.isTexture){const t=g.backgroundBlurriness>0;v=(t?n:e).get(v)}if(v===null){_(o,l)}else if(v&&v.isColor){_(v,1);x=true}const M=t.xr;const y=M.getEnvironmentBlendMode();switch(y){case"opaque":x=true;break;case"additive":i.buffers.color.setClear(0,0,0,1,a);x=true;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,a);x=true;break}if(t.autoClear||x){t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil)}if(v&&(v.isCubeTexture||v.mapping===it)){if(f===undefined){f=new fr(new mr(1,1,1),new Er({name:"BackgroundCubeMaterial",uniforms:gr(vo.backgroundCube.uniforms),vertexShader:vo.backgroundCube.vertexShader,fragmentShader:vo.backgroundCube.fragmentShader,side:h,depthTest:false,depthWrite:false,fog:false}));f.geometry.deleteAttribute("normal");f.geometry.deleteAttribute("uv");f.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)};Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}});r.update(f)}f.material.uniforms.envMap.value=v;f.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===false?-1:1;f.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness;f.material.uniforms.backgroundIntensity.value=g.backgroundIntensity;f.material.toneMapped=v.colorSpace===xe?false:true;if(d!==v||p!==v.version||m!==t.toneMapping){f.material.needsUpdate=true;d=v;p=v.version;m=t.toneMapping}f.layers.enableAll();s.unshift(f,f.geometry,f.material,0,0,null)}else if(v&&v.isTexture){if(c===undefined){c=new fr(new Br(2,2),new Er({name:"BackgroundMaterial",uniforms:gr(vo.background.uniforms),vertexShader:vo.background.vertexShader,fragmentShader:vo.background.fragmentShader,side:u,depthTest:false,depthWrite:false,fog:false}));c.geometry.deleteAttribute("normal");Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}});r.update(c)}c.material.uniforms.t2D.value=v;c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity;c.material.toneMapped=v.colorSpace===xe?false:true;if(v.matrixAutoUpdate===true){v.updateMatrix()}c.material.uniforms.uvTransform.value.copy(v.matrix);if(d!==v||p!==v.version||m!==t.toneMapping){c.material.needsUpdate=true;d=v;p=v.version;m=t.toneMapping}c.layers.enableAll();s.unshift(c,c.geometry,c.material,0,0,null)}}function _(e,n){e.getRGB(Mo,vr(t));i.buffers.color.setClear(Mo.r,Mo.g,Mo.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t);l=e;_(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t;_(o,l)},render:g}}function So(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS);const s=i.isWebGL2?null:e.get("OES_vertex_array_object");const a=i.isWebGL2||s!==null;const o={};const l=g(null);let c=l;let u=false;function h(e,i,r,s,o){let l=false;if(a){const t=m(s,r,i);if(c!==t){c=t;d(c.object)}l=_(e,s,r,o);if(l)x(e,s,r,o)}else{const t=i.wireframe===true;if(c.geometry!==s.id||c.program!==r.id||c.wireframe!==t){c.geometry=s.id;c.program=r.id;c.wireframe=t;l=true}}if(o!==null){n.update(o,t.ELEMENT_ARRAY_BUFFER)}if(l||u){u=false;T(e,i,r,s);if(o!==null){t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(o).buffer)}}}function f(){if(i.isWebGL2)return t.createVertexArray();return s.createVertexArrayOES()}function d(e){if(i.isWebGL2)return t.bindVertexArray(e);return s.bindVertexArrayOES(e)}function p(e){if(i.isWebGL2)return t.deleteVertexArray(e);return s.deleteVertexArrayOES(e)}function m(t,e,n){const i=n.wireframe===true;let r=o[t.id];if(r===undefined){r={};o[t.id]=r}let s=r[e.id];if(s===undefined){s={};r[e.id]=s}let a=s[i];if(a===undefined){a=g(f());s[i]=a}return a}function g(t){const e=[];const n=[];const i=[];for(let t=0;t<r;t++){e[t]=0;n[t]=0;i[t]=0}return{geometry:null,program:null,wireframe:false,newAttributes:e,enabledAttributes:n,attributeDivisors:i,object:t,attributes:{},index:null}}function _(t,e,n,i){const r=c.attributes;const s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){const n=o[e];if(n.location>=0){const n=r[e];let i=s[e];if(i===undefined){if(e==="instanceMatrix"&&t.instanceMatrix)i=t.instanceMatrix;if(e==="instanceColor"&&t.instanceColor)i=t.instanceColor}if(n===undefined)return true;if(n.attribute!==i)return true;if(i&&n.data!==i.data)return true;a++}}if(c.attributesNum!==a)return true;if(c.index!==i)return true;return false}function x(t,e,n,i){const r={};const s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){const n=o[e];if(n.location>=0){let n=s[e];if(n===undefined){if(e==="instanceMatrix"&&t.instanceMatrix)n=t.instanceMatrix;if(e==="instanceColor"&&t.instanceColor)n=t.instanceColor}const i={};i.attribute=n;if(n&&n.data){i.data=n.data}r[e]=i;a++}}c.attributes=r;c.attributesNum=a;c.index=i}function v(){const t=c.newAttributes;for(let e=0,n=t.length;e<n;e++){t[e]=0}}function M(t){y(t,0)}function y(n,r){const s=c.newAttributes;const a=c.enabledAttributes;const o=c.attributeDivisors;s[n]=1;if(a[n]===0){t.enableVertexAttribArray(n);a[n]=1}if(o[n]!==r){const s=i.isWebGL2?t:e.get("ANGLE_instanced_arrays");s[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r);o[n]=r}}function S(){const e=c.newAttributes;const n=c.enabledAttributes;for(let i=0,r=n.length;i<r;i++){if(n[i]!==e[i]){t.disableVertexAttribArray(i);n[i]=0}}}function E(e,n,r,s,a,o){if(i.isWebGL2===true&&(r===t.INT||r===t.UNSIGNED_INT)){t.vertexAttribIPointer(e,n,r,a,o)}else{t.vertexAttribPointer(e,n,r,s,a,o)}}function T(r,s,a,o){if(i.isWebGL2===false&&(r.isInstancedMesh||o.isInstancedBufferGeometry)){if(e.get("ANGLE_instanced_arrays")===null)return}v();const l=o.attributes;const c=a.getAttributes();const u=s.defaultAttributeValues;for(const e in c){const i=c[e];if(i.location>=0){let s=l[e];if(s===undefined){if(e==="instanceMatrix"&&r.instanceMatrix)s=r.instanceMatrix;if(e==="instanceColor"&&r.instanceColor)s=r.instanceColor}if(s!==undefined){const e=s.normalized;const a=s.itemSize;const l=n.get(s);if(l===undefined)continue;const c=l.buffer;const u=l.type;const h=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data;const l=n.stride;const f=s.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<i.locationSize;t++){y(i.location+t,n.meshPerAttribute)}if(r.isInstancedMesh!==true&&o._maxInstanceCount===undefined){o._maxInstanceCount=n.meshPerAttribute*n.count}}else{for(let t=0;t<i.locationSize;t++){M(i.location+t)}}t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<i.locationSize;t++){E(i.location+t,a/i.locationSize,u,e,l*h,(f+a/i.locationSize*t)*h)}}else{if(s.isInstancedBufferAttribute){for(let t=0;t<i.locationSize;t++){y(i.location+t,s.meshPerAttribute)}if(r.isInstancedMesh!==true&&o._maxInstanceCount===undefined){o._maxInstanceCount=s.meshPerAttribute*s.count}}else{for(let t=0;t<i.locationSize;t++){M(i.location+t)}}t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<i.locationSize;t++){E(i.location+t,a/i.locationSize,u,e,a*h,a/i.locationSize*t*h)}}}else if(u!==undefined){const n=u[e];if(n!==undefined){switch(n.length){case 2:t.vertexAttrib2fv(i.location,n);break;case 3:t.vertexAttrib3fv(i.location,n);break;case 4:t.vertexAttrib4fv(i.location,n);break;default:t.vertexAttrib1fv(i.location,n)}}}}}S()}function b(){R();for(const t in o){const e=o[t];for(const t in e){const n=e[t];for(const t in n){p(n[t].object);delete n[t]}delete e[t]}delete o[t]}}function w(t){if(o[t.id]===undefined)return;const e=o[t.id];for(const t in e){const n=e[t];for(const t in n){p(n[t].object);delete n[t]}delete e[t]}delete o[t.id]}function A(t){for(const e in o){const n=o[e];if(n[t.id]===undefined)continue;const i=n[t.id];for(const t in i){p(i[t].object);delete i[t]}delete n[t.id]}}function R(){q();u=true;if(c===l)return;c=l;d(c.object)}function q(){l.geometry=null;l.program=null;l.wireframe=false}return{setup:h,reset:R,resetDefaultState:q,dispose:b,releaseStatesOfGeometry:w,releaseStatesOfProgram:A,initAttributes:v,enableAttribute:M,disableUnusedAttributes:S}}function Eo(t,e,n,i){const r=i.isWebGL2;let s;function a(t){s=t}function o(e,i){t.drawArrays(s,e,i);n.update(i,s,1)}function l(i,a,o){if(o===0)return;let l,c;if(r){l=t;c="drawArraysInstanced"}else{l=e.get("ANGLE_instanced_arrays");c="drawArraysInstancedANGLE";if(l===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}}l[c](s,i,a,o);n.update(a,s,o)}this.setMode=a;this.render=o;this.renderInstances=l}function To(t,e,n){let i;function r(){if(i!==undefined)return i;if(e.has("EXT_texture_filter_anisotropic")===true){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else{i=0}return i}function s(e){if(e==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0){return"highp"}e="mediump"}if(e==="mediump"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0){return"mediump"}}return"lowp"}const a=typeof WebGL2RenderingContext!=="undefined"&&t.constructor.name==="WebGL2RenderingContext";let o=n.precision!==undefined?n.precision:"highp";const l=s(o);if(l!==o){console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead.");o=l}const c=a||e.has("WEBGL_draw_buffers");const u=n.logarithmicDepthBuffer===true;const h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);const f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);const d=t.getParameter(t.MAX_TEXTURE_SIZE);const p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);const m=t.getParameter(t.MAX_VERTEX_ATTRIBS);const g=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS);const _=t.getParameter(t.MAX_VARYING_VECTORS);const x=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS);const v=f>0;const M=a||e.has("OES_texture_float");const y=v&&M;const S=a?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:f,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:_,maxFragmentUniforms:x,vertexTextures:v,floatFragmentTextures:M,floatVertexTextures:y,maxSamples:S}}function bo(t){const e=this;let n=null,i=0,r=false,s=false;const a=new Dr,o=new ze,l={value:null,needsUpdate:false};this.uniform=l;this.numPlanes=0;this.numIntersection=0;this.init=function(t,e){const n=t.length!==0||e||i!==0||r;r=e;i=t.length;return n};this.beginShadows=function(){s=true;u(null)};this.endShadows=function(){s=false};this.setGlobalState=function(t,e){n=u(t,e,0)};this.setState=function(e,a,o){const h=e.clippingPlanes,f=e.clipIntersection,d=e.clipShadows;const p=t.get(e);if(!r||h===null||h.length===0||s&&!d){if(s){u(null)}else{c()}}else{const t=s?0:i,e=t*4;let r=p.clippingState||null;l.value=r;r=u(h,a,e,o);for(let t=0;t!==e;++t){r[t]=n[t]}p.clippingState=r;this.numIntersection=f?this.numPlanes:0;this.numPlanes+=t}};function c(){if(l.value!==n){l.value=n;l.needsUpdate=i>0}e.numPlanes=i;e.numIntersection=0}function u(t,n,i,r){const s=t!==null?t.length:0;let c=null;if(s!==0){c=l.value;if(r!==true||c===null){const e=i+s*4,r=n.matrixWorldInverse;o.getNormalMatrix(r);if(c===null||c.length<e){c=new Float32Array(e)}for(let e=0,n=i;e!==s;++e,n+=4){a.copy(t[e]).applyMatrix4(r,o);a.normal.toArray(c,n);c[n+3]=a.constant}}l.value=c;l.needsUpdate=true}e.numPlanes=s;e.numIntersection=0;return c}}function wo(t){let e=new WeakMap;function n(t,e){if(e===et){t.mapping=$}else if(e===nt){t.mapping=tt}return t}function i(i){if(i&&i.isTexture&&i.isRenderTargetTexture===false){const s=i.mapping;if(s===et||s===nt){if(e.has(i)){const t=e.get(i).texture;return n(t,i.mapping)}else{const s=i.image;if(s&&s.height>0){const a=new Cr(s.height/2);a.fromEquirectangularTexture(t,i);e.set(i,a);i.addEventListener("dispose",r);return n(a.texture,i.mapping)}else{return null}}}}return i}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);if(i!==undefined){e.delete(n);i.dispose()}}function s(){e=new WeakMap}return{get:i,dispose:s}}class Ao extends Tr{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super();this.isOrthographicCamera=true;this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=t;this.right=e;this.top=n;this.bottom=i;this.near=r;this.far=s;this.updateProjectionMatrix()}copy(t,e){super.copy(t,e);this.left=t.left;this.right=t.right;this.top=t.top;this.bottom=t.bottom;this.near=t.near;this.far=t.far;this.zoom=t.zoom;this.view=t.view===null?null:Object.assign({},t.view);return this}setViewOffset(t,e,n,i,r,s){if(this.view===null){this.view={enabled:true,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}}this.view.enabled=true;this.view.fullWidth=t;this.view.fullHeight=e;this.view.offsetX=n;this.view.offsetY=i;this.view.width=r;this.view.height=s;this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null){this.view.enabled=false}this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom);const e=(this.top-this.bottom)/(2*this.zoom);const n=(this.right+this.left)/2;const i=(this.top+this.bottom)/2;let r=n-t;let s=n+t;let a=i+e;let o=i-e;if(this.view!==null&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom;const e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX;s=r+t*this.view.width;a-=e*this.view.offsetY;o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far);this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);e.object.zoom=this.zoom;e.object.left=this.left;e.object.right=this.right;e.object.top=this.top;e.object.bottom=this.bottom;e.object.near=this.near;e.object.far=this.far;if(this.view!==null)e.object.view=Object.assign({},this.view);return e}}const Ro=4;const qo=[.125,.215,.35,.446,.526,.582];const Co=20;const Lo=new Ao;const Po=new Pi;let Uo=null;const Do=(1+Math.sqrt(5))/2;const Io=1/Do;const No=[new fn(1,1,1),new fn(-1,1,1),new fn(1,1,-1),new fn(-1,1,-1),new fn(0,Do,Io),new fn(0,Do,-Io),new fn(Io,0,Do),new fn(-Io,0,Do),new fn(Do,Io,0),new fn(-Do,Io,0)];class Oo{constructor(t){this._renderer=t;this._pingPongRenderTarget=null;this._lodMax=0;this._cubeSize=0;this._lodPlanes=[];this._sizeLods=[];this._sigmas=[];this._blurMaterial=null;this._cubemapMaterial=null;this._equirectMaterial=null;this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Uo=this._renderer.getRenderTarget();this._setSize(256);const r=this._allocateTargets();r.depthBuffer=true;this._sceneToCubeUV(t,n,i,r);if(e>0){this._blur(r,0,0,e)}this._applyPMREM(r);this._cleanup(r);return r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){if(this._cubemapMaterial===null){this._cubemapMaterial=Vo();this._compileMaterial(this._cubemapMaterial)}}compileEquirectangularShader(){if(this._equirectMaterial===null){this._equirectMaterial=Go();this._compileMaterial(this._equirectMaterial)}}dispose(){this._dispose();if(this._cubemapMaterial!==null)this._cubemapMaterial.dispose();if(this._equirectMaterial!==null)this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t));this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){if(this._blurMaterial!==null)this._blurMaterial.dispose();if(this._pingPongRenderTarget!==null)this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++){this._lodPlanes[t].dispose()}}_cleanup(t){this._renderer.setRenderTarget(Uo);t.scissorTest=false;Bo(t,0,0,t.width,t.height)}_fromTexture(t,e){if(t.mapping===$||t.mapping===tt){this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width)}else{this._setSize(t.image.width/4)}Uo=this._renderer.getRenderTarget();const n=e||this._allocateTargets();this._textureToCubeUV(t,n);this._applyPMREM(n);this._cleanup(n);return n}_allocateTargets(){const t=3*Math.max(this._cubeSize,16*7);const e=4*this._cubeSize;const n={magFilter:ut,minFilter:ut,generateMipmaps:false,type:Mt,format:bt,colorSpace:ve,depthBuffer:false};const i=zo(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){if(this._pingPongRenderTarget!==null){this._dispose()}this._pingPongRenderTarget=zo(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Fo(i));this._blurMaterial=Ho(i,t,e)}return i}_compileMaterial(t){const e=new fr(this._lodPlanes[0],t);this._renderer.compile(e,Lo)}_sceneToCubeUV(t,e,n,i){const r=90;const s=1;const a=new br(r,s,e,n);const o=[1,-1,1,1,1,1];const l=[1,1,1,-1,-1,-1];const c=this._renderer;const u=c.autoClear;const f=c.toneMapping;c.getClearColor(Po);c.toneMapping=X;c.autoClear=false;const d=new Di({name:"PMREM.Background",side:h,depthWrite:false,depthTest:false});const p=new fr(new mr,d);let m=false;const g=t.background;if(g){if(g.isColor){d.color.copy(g);t.background=null;m=true}}else{d.color.copy(Po);m=true}for(let e=0;e<6;e++){const n=e%3;if(n===0){a.up.set(0,o[e],0);a.lookAt(l[e],0,0)}else if(n===1){a.up.set(0,0,o[e]);a.lookAt(0,l[e],0)}else{a.up.set(0,o[e],0);a.lookAt(0,0,l[e])}const r=this._cubeSize;Bo(i,n*r,e>2?r:0,r,r);c.setRenderTarget(i);if(m){c.render(p,a)}c.render(t,a)}p.geometry.dispose();p.material.dispose();c.toneMapping=f;c.autoClear=u;t.background=g}_textureToCubeUV(t,e){const n=this._renderer;const i=t.mapping===$||t.mapping===tt;if(i){if(this._cubemapMaterial===null){this._cubemapMaterial=Vo()}this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===false?-1:1}else{if(this._equirectMaterial===null){this._equirectMaterial=Go()}}const r=i?this._cubemapMaterial:this._equirectMaterial;const s=new fr(this._lodPlanes[0],r);const a=r.uniforms;a["envMap"].value=t;const o=this._cubeSize;Bo(e,0,0,3*o,2*o);n.setRenderTarget(e);n.render(s,Lo)}_applyPMREM(t){const e=this._renderer;const n=e.autoClear;e.autoClear=false;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]);const i=No[(e-1)%No.length];this._blur(t,e-1,e,n,i)}e.autoClear=n}_blur(t,e,n,i,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,n,i,"latitudinal",r);this._halfBlur(s,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,s,a){const o=this._renderer;const l=this._blurMaterial;if(s!=="latitudinal"&&s!=="longitudinal"){console.error("blur direction must be either latitudinal or longitudinal!")}const c=3;const u=new fr(this._lodPlanes[i],l);const h=l.uniforms;const f=this._sizeLods[n]-1;const d=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*Co-1);const p=r/d;const m=isFinite(r)?1+Math.floor(c*p):Co;if(m>Co){console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Co}`)}const g=[];let _=0;for(let t=0;t<Co;++t){const e=t/p;const n=Math.exp(-e*e/2);g.push(n);if(t===0){_+=n}else if(t<m){_+=2*n}}for(let t=0;t<g.length;t++){g[t]=g[t]/_}h["envMap"].value=t.texture;h["samples"].value=m;h["weights"].value=g;h["latitudinal"].value=s==="latitudinal";if(a){h["poleAxis"].value=a}const{_lodMax:x}=this;h["dTheta"].value=d;h["mipInt"].value=x-n;const v=this._sizeLods[i];const M=3*v*(i>x-Ro?i-x+Ro:0);const y=4*(this._cubeSize-v);Bo(e,M,y,3*v,2*v);o.setRenderTarget(e);o.render(u,Lo)}}function Fo(t){const e=[];const n=[];const i=[];let r=t;const s=t-Ro+1+qo.length;for(let a=0;a<s;a++){const s=Math.pow(2,r);n.push(s);let o=1/s;if(a>t-Ro){o=qo[a-t+Ro-1]}else if(a===0){o=0}i.push(o);const l=1/(s-2);const c=-l;const u=1+l;const h=[c,c,u,c,u,u,c,c,u,u,c,u];const f=6;const d=6;const p=3;const m=2;const g=1;const _=new Float32Array(p*d*f);const x=new Float32Array(m*d*f);const v=new Float32Array(g*d*f);for(let t=0;t<f;t++){const e=t%3*2/3-1;const n=t>2?0:-1;const i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];_.set(i,p*d*t);x.set(h,m*d*t);const r=[t,t,t,t,t,t];v.set(r,g*d*t)}const M=new Yi;M.setAttribute("position",new Oi(_,p));M.setAttribute("uv",new Oi(x,m));M.setAttribute("faceIndex",new Oi(v,g));e.push(M);if(r>Ro){r--}}return{lodPlanes:e,sizeLods:n,sigmas:i}}function zo(t,e,n){const i=new ln(t,e,n);i.texture.mapping=it;i.texture.name="PMREM.cubeUv";i.scissorTest=true;return i}function Bo(t,e,n,i,r){t.viewport.set(e,n,i,r);t.scissor.set(e,n,i,r)}function Ho(t,e,n){const i=new Float32Array(Co);const r=new fn(0,1,0);const s=new Er({name:"SphericalGaussianBlur",defines:{n:Co,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:false},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ko(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,blending:d,depthTest:false,depthWrite:false});return s}function Go(){return new Er({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ko(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,blending:d,depthTest:false,depthWrite:false})}function Vo(){return new Er({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ko(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,blending:d,depthTest:false,depthWrite:false})}function ko(){return`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`}function Wo(t){let e=new WeakMap;let n=null;function i(i){if(i&&i.isTexture){const a=i.mapping;const o=a===et||a===nt;const l=a===$||a===tt;if(o||l){if(i.isRenderTargetTexture&&i.needsPMREMUpdate===true){i.needsPMREMUpdate=false;let r=e.get(i);if(n===null)n=new Oo(t);r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r);e.set(i,r);return r.texture}else{if(e.has(i)){return e.get(i).texture}else{const a=i.image;if(o&&a&&a.height>0||l&&a&&r(a)){if(n===null)n=new Oo(t);const r=o?n.fromEquirectangular(i):n.fromCubemap(i);e.set(i,r);i.addEventListener("dispose",s);return r.texture}else{return null}}}}}return i}function r(t){let e=0;const n=6;for(let i=0;i<n;i++){if(t[i]!==undefined)e++}return e===n}function s(t){const n=t.target;n.removeEventListener("dispose",s);const i=e.get(n);if(i!==undefined){e.delete(n);i.dispose()}}function a(){e=new WeakMap;if(n!==null){n.dispose();n=null}}return{get:i,dispose:a}}function Xo(t){const e={};function n(n){if(e[n]!==undefined){return e[n]}let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}e[n]=i;return i}return{has:function(t){return n(t)!==null},init:function(t){if(t.isWebGL2){n("EXT_color_buffer_float")}else{n("WEBGL_depth_texture");n("OES_texture_float");n("OES_texture_half_float");n("OES_texture_half_float_linear");n("OES_standard_derivatives");n("OES_element_index_uint");n("OES_vertex_array_object");n("ANGLE_instanced_arrays")}n("OES_texture_float_linear");n("EXT_color_buffer_half_float");n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);if(e===null){console.warn("THREE.WebGLRenderer: "+t+" extension not supported.")}return e}}}function jo(t,e,n,i){const r={};const s=new WeakMap;function a(t){const o=t.target;if(o.index!==null){e.remove(o.index)}for(const t in o.attributes){e.remove(o.attributes[t])}o.removeEventListener("dispose",a);delete r[o.id];const l=s.get(o);if(l){e.remove(l);s.delete(o)}i.releaseStatesOfGeometry(o);if(o.isInstancedBufferGeometry===true){delete o._maxInstanceCount}n.memory.geometries--}function o(t,e){if(r[e.id]===true)return e;e.addEventListener("dispose",a);r[e.id]=true;n.memory.geometries++;return e}function l(n){const i=n.attributes;for(const n in i){e.update(i[n],t.ARRAY_BUFFER)}const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++){e.update(i[n],t.ARRAY_BUFFER)}}}function c(t){const n=[];const i=t.index;const r=t.attributes.position;let a=0;if(i!==null){const t=i.array;a=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0];const r=t[e+1];const s=t[e+2];n.push(i,r,r,s,s,i)}}else{const t=r.array;a=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0;const i=e+1;const r=e+2;n.push(t,i,i,r,r,t)}}const o=new(He(n)?zi:Fi)(n,1);o.version=a;const l=s.get(t);if(l)e.remove(l);s.set(t,o)}function u(t){const e=s.get(t);if(e){const n=t.index;if(n!==null){if(e.version<n.version){c(t)}}}else{c(t)}return s.get(t)}return{get:o,update:l,getWireframeAttribute:u}}function Yo(t,e,n,i){const r=i.isWebGL2;let s;function a(t){s=t}let o,l;function c(t){o=t.type;l=t.bytesPerElement}function u(e,i){t.drawElements(s,i,o,e*l);n.update(i,s,1)}function h(i,a,c){if(c===0)return;let u,h;if(r){u=t;h="drawElementsInstanced"}else{u=e.get("ANGLE_instanced_arrays");h="drawElementsInstancedANGLE";if(u===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}}u[h](s,a,o,i*l,c);n.update(a,s,c)}this.setMode=a;this.setIndex=c;this.render=u;this.renderInstances=h}function Jo(t){const e={geometries:0,textures:0};const n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(e,i,r){n.calls++;switch(i){case t.TRIANGLES:n.triangles+=r*(e/3);break;case t.LINES:n.lines+=r*(e/2);break;case t.LINE_STRIP:n.lines+=r*(e-1);break;case t.LINE_LOOP:n.lines+=r*e;break;case t.POINTS:n.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i);break}}function r(){n.frame++;n.calls=0;n.triangles=0;n.points=0;n.lines=0}return{memory:e,render:n,programs:null,autoReset:true,reset:r,update:i}}function Zo(t,e){return t[0]-e[0]}function Ko(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Qo(t,e,n){const i={};const r=new Float32Array(8);const s=new WeakMap;const a=new on;const o=[];for(let t=0;t<8;t++){o[t]=[t,0]}function l(l,c,u){const h=l.morphTargetInfluences;if(e.isWebGL2===true){const f=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color;const d=f!==undefined?f.length:0;let p=s.get(c);if(p===undefined||p.count!==d){if(p!==undefined)p.texture.dispose();const _=c.morphAttributes.position!==undefined;const x=c.morphAttributes.normal!==undefined;const v=c.morphAttributes.color!==undefined;const M=c.morphAttributes.position||[];const y=c.morphAttributes.normal||[];const S=c.morphAttributes.color||[];let E=0;if(_===true)E=1;if(x===true)E=2;if(v===true)E=3;let T=c.attributes.position.count*E;let b=1;if(T>e.maxTextureSize){b=Math.ceil(T/e.maxTextureSize);T=e.maxTextureSize}const w=new Float32Array(T*b*4*d);const A=new cn(w,T,b,d);A.type=vt;A.needsUpdate=true;const R=E*4;for(let C=0;C<d;C++){const L=M[C];const P=y[C];const U=S[C];const D=T*b*4*C;for(let I=0;I<L.count;I++){const N=I*R;if(_===true){a.fromBufferAttribute(L,I);w[D+N+0]=a.x;w[D+N+1]=a.y;w[D+N+2]=a.z;w[D+N+3]=0}if(x===true){a.fromBufferAttribute(P,I);w[D+N+4]=a.x;w[D+N+5]=a.y;w[D+N+6]=a.z;w[D+N+7]=0}if(v===true){a.fromBufferAttribute(U,I);w[D+N+8]=a.x;w[D+N+9]=a.y;w[D+N+10]=a.z;w[D+N+11]=U.itemSize===4?a.w:1}}}p={count:d,texture:A,size:new Fe(T,b)};s.set(c,p);function q(){A.dispose();s.delete(c);c.removeEventListener("dispose",q)}c.addEventListener("dispose",q)}let m=0;for(let O=0;O<h.length;O++){m+=h[O]}const g=c.morphTargetsRelative?1:1-m;u.getUniforms().setValue(t,"morphTargetBaseInfluence",g);u.getUniforms().setValue(t,"morphTargetInfluences",h);u.getUniforms().setValue(t,"morphTargetsTexture",p.texture,n);u.getUniforms().setValue(t,"morphTargetsTextureSize",p.size)}else{const F=h===undefined?0:h.length;let z=i[c.id];if(z===undefined||z.length!==F){z=[];for(let k=0;k<F;k++){z[k]=[k,0]}i[c.id]=z}for(let W=0;W<F;W++){const X=z[W];X[0]=W;X[1]=h[W]}z.sort(Ko);for(let j=0;j<8;j++){if(j<F&&z[j][1]){o[j][0]=z[j][0];o[j][1]=z[j][1]}else{o[j][0]=Number.MAX_SAFE_INTEGER;o[j][1]=0}}o.sort(Zo);const B=c.morphAttributes.position;const H=c.morphAttributes.normal;let G=0;for(let Y=0;Y<8;Y++){const J=o[Y];const Z=J[0];const K=J[1];if(Z!==Number.MAX_SAFE_INTEGER&&K){if(B&&c.getAttribute("morphTarget"+Y)!==B[Z]){c.setAttribute("morphTarget"+Y,B[Z])}if(H&&c.getAttribute("morphNormal"+Y)!==H[Z]){c.setAttribute("morphNormal"+Y,H[Z])}r[Y]=K;G+=K}else{if(B&&c.hasAttribute("morphTarget"+Y)===true){c.deleteAttribute("morphTarget"+Y)}if(H&&c.hasAttribute("morphNormal"+Y)===true){c.deleteAttribute("morphNormal"+Y)}r[Y]=0}}const V=c.morphTargetsRelative?1:1-G;u.getUniforms().setValue(t,"morphTargetBaseInfluence",V);u.getUniforms().setValue(t,"morphTargetInfluences",r)}}return{update:l}}function $o(t,e,n,i){let r=new WeakMap;function s(s){const a=i.render.frame;const l=s.geometry;const c=e.get(s,l);if(r.get(c)!==a){e.update(c);r.set(c,a)}if(s.isInstancedMesh){if(s.hasEventListener("dispose",o)===false){s.addEventListener("dispose",o)}n.update(s.instanceMatrix,t.ARRAY_BUFFER);if(s.instanceColor!==null){n.update(s.instanceColor,t.ARRAY_BUFFER)}}return c}function a(){r=new WeakMap}function o(t){const e=t.target;e.removeEventListener("dispose",o);n.remove(e.instanceMatrix);if(e.instanceColor!==null)n.remove(e.instanceColor)}return{update:s,dispose:a}}const tl=new an;const el=new cn;const nl=new un;const il=new qr;const rl=[];const sl=[];const al=new Float32Array(16);const ol=new Float32Array(9);const ll=new Float32Array(4);function cl(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let s=rl[r];if(s===undefined){s=new Float32Array(r);rl[r]=s}if(e!==0){i.toArray(s,0);for(let i=1,r=0;i!==e;++i){r+=n;t[i].toArray(s,r)}}return s}function ul(t,e){if(t.length!==e.length)return false;for(let n=0,i=t.length;n<i;n++){if(t[n]!==e[n])return false}return true}function hl(t,e){for(let n=0,i=e.length;n<i;n++){t[n]=e[n]}}function fl(t,e){let n=sl[e];if(n===undefined){n=new Int32Array(e);sl[e]=n}for(let i=0;i!==e;++i){n[i]=t.allocateTextureUnit()}return n}function dl(t,e){const n=this.cache;if(n[0]===e)return;t.uniform1f(this.addr,e);n[0]=e}function pl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y){t.uniform2f(this.addr,e.x,e.y);n[0]=e.x;n[1]=e.y}}else{if(ul(n,e))return;t.uniform2fv(this.addr,e);hl(n,e)}}function ml(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z){t.uniform3f(this.addr,e.x,e.y,e.z);n[0]=e.x;n[1]=e.y;n[2]=e.z}}else if(e.r!==undefined){if(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b){t.uniform3f(this.addr,e.r,e.g,e.b);n[0]=e.r;n[1]=e.g;n[2]=e.b}}else{if(ul(n,e))return;t.uniform3fv(this.addr,e);hl(n,e)}}function gl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w){t.uniform4f(this.addr,e.x,e.y,e.z,e.w);n[0]=e.x;n[1]=e.y;n[2]=e.z;n[3]=e.w}}else{if(ul(n,e))return;t.uniform4fv(this.addr,e);hl(n,e)}}function _l(t,e){const n=this.cache;const i=e.elements;if(i===undefined){if(ul(n,e))return;t.uniformMatrix2fv(this.addr,false,e);hl(n,e)}else{if(ul(n,i))return;ll.set(i);t.uniformMatrix2fv(this.addr,false,ll);hl(n,i)}}function xl(t,e){const n=this.cache;const i=e.elements;if(i===undefined){if(ul(n,e))return;t.uniformMatrix3fv(this.addr,false,e);hl(n,e)}else{if(ul(n,i))return;ol.set(i);t.uniformMatrix3fv(this.addr,false,ol);hl(n,i)}}function vl(t,e){const n=this.cache;const i=e.elements;if(i===undefined){if(ul(n,e))return;t.uniformMatrix4fv(this.addr,false,e);hl(n,e)}else{if(ul(n,i))return;al.set(i);t.uniformMatrix4fv(this.addr,false,al);hl(n,i)}}function Ml(t,e){const n=this.cache;if(n[0]===e)return;t.uniform1i(this.addr,e);n[0]=e}function yl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y){t.uniform2i(this.addr,e.x,e.y);n[0]=e.x;n[1]=e.y}}else{if(ul(n,e))return;t.uniform2iv(this.addr,e);hl(n,e)}}function Sl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z){t.uniform3i(this.addr,e.x,e.y,e.z);n[0]=e.x;n[1]=e.y;n[2]=e.z}}else{if(ul(n,e))return;t.uniform3iv(this.addr,e);hl(n,e)}}function El(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w){t.uniform4i(this.addr,e.x,e.y,e.z,e.w);n[0]=e.x;n[1]=e.y;n[2]=e.z;n[3]=e.w}}else{if(ul(n,e))return;t.uniform4iv(this.addr,e);hl(n,e)}}function Tl(t,e){const n=this.cache;if(n[0]===e)return;t.uniform1ui(this.addr,e);n[0]=e}function bl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y){t.uniform2ui(this.addr,e.x,e.y);n[0]=e.x;n[1]=e.y}}else{if(ul(n,e))return;t.uniform2uiv(this.addr,e);hl(n,e)}}function wl(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z){t.uniform3ui(this.addr,e.x,e.y,e.z);n[0]=e.x;n[1]=e.y;n[2]=e.z}}else{if(ul(n,e))return;t.uniform3uiv(this.addr,e);hl(n,e)}}function Al(t,e){const n=this.cache;if(e.x!==undefined){if(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w){t.uniform4ui(this.addr,e.x,e.y,e.z,e.w);n[0]=e.x;n[1]=e.y;n[2]=e.z;n[3]=e.w}}else{if(ul(n,e))return;t.uniform4uiv(this.addr,e);hl(n,e)}}function Rl(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTexture2D(e||tl,r)}function ql(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTexture3D(e||nl,r)}function Cl(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTextureCube(e||il,r)}function Ll(t,e,n){const i=this.cache;const r=n.allocateTextureUnit();if(i[0]!==r){t.uniform1i(this.addr,r);i[0]=r}n.setTexture2DArray(e||el,r)}function Pl(t){switch(t){case 5126:return dl;case 35664:return pl;case 35665:return ml;case 35666:return gl;case 35674:return _l;case 35675:return xl;case 35676:return vl;case 5124:case 35670:return Ml;case 35667:case 35671:return yl;case 35668:case 35672:return Sl;case 35669:case 35673:return El;case 5125:return Tl;case 36294:return bl;case 36295:return wl;case 36296:return Al;case 35678:case 36198:case 36298:case 36306:case 35682:return Rl;case 35679:case 36299:case 36307:return ql;case 35680:case 36300:case 36308:case 36293:return Cl;case 36289:case 36303:case 36311:case 36292:return Ll}}function Ul(t,e){t.uniform1fv(this.addr,e)}function Dl(t,e){const n=cl(e,this.size,2);t.uniform2fv(this.addr,n)}function Il(t,e){const n=cl(e,this.size,3);t.uniform3fv(this.addr,n)}function Nl(t,e){const n=cl(e,this.size,4);t.uniform4fv(this.addr,n)}function Ol(t,e){const n=cl(e,this.size,4);t.uniformMatrix2fv(this.addr,false,n)}function Fl(t,e){const n=cl(e,this.size,9);t.uniformMatrix3fv(this.addr,false,n)}function zl(t,e){const n=cl(e,this.size,16);t.uniformMatrix4fv(this.addr,false,n)}function Bl(t,e){t.uniform1iv(this.addr,e)}function Hl(t,e){t.uniform2iv(this.addr,e)}function Gl(t,e){t.uniform3iv(this.addr,e)}function Vl(t,e){t.uniform4iv(this.addr,e)}function kl(t,e){t.uniform1uiv(this.addr,e)}function Wl(t,e){t.uniform2uiv(this.addr,e)}function Xl(t,e){t.uniform3uiv(this.addr,e)}function jl(t,e){t.uniform4uiv(this.addr,e)}function Yl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTexture2D(e[t]||tl,s[t])}}function Jl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTexture3D(e[t]||nl,s[t])}}function Zl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTextureCube(e[t]||il,s[t])}}function Kl(t,e,n){const i=this.cache;const r=e.length;const s=fl(n,r);if(!ul(i,s)){t.uniform1iv(this.addr,s);hl(i,s)}for(let t=0;t!==r;++t){n.setTexture2DArray(e[t]||el,s[t])}}function Ql(t){switch(t){case 5126:return Ul;case 35664:return Dl;case 35665:return Il;case 35666:return Nl;case 35674:return Ol;case 35675:return Fl;case 35676:return zl;case 5124:case 35670:return Bl;case 35667:case 35671:return Hl;case 35668:case 35672:return Gl;case 35669:case 35673:return Vl;case 5125:return kl;case 36294:return Wl;case 36295:return Xl;case 36296:return jl;case 35678:case 36198:case 36298:case 36306:case 35682:return Yl;case 35679:case 36299:case 36307:return Jl;case 35680:case 36300:case 36308:case 36293:return Zl;case 36289:case 36303:case 36311:case 36292:return Kl}}class $l{constructor(t,e,n){this.id=t;this.addr=n;this.cache=[];this.setValue=Pl(e.type)}}class tc{constructor(t,e,n){this.id=t;this.addr=n;this.cache=[];this.size=e.size;this.setValue=Ql(e.type)}}class ec{constructor(t){this.id=t;this.seq=[];this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const s=i[r];s.setValue(t,e[s.id],n)}}}const nc=/(\w+)(\])?(\[|\.)?/g;function ic(t,e){t.seq.push(e);t.map[e.id]=e}function rc(t,e,n){const i=t.name,r=i.length;nc.lastIndex=0;while(true){const s=nc.exec(i),a=nc.lastIndex;let o=s[1];const l=s[2]==="]",c=s[3];if(l)o=o|0;if(c===undefined||c==="["&&a+2===r){ic(n,c===undefined?new $l(o,t,e):new tc(o,t,e));break}else{const t=n.map;let e=t[o];if(e===undefined){e=new ec(o);ic(n,e)}n=e}}}class sc{constructor(t,e){this.seq=[];this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i),r=t.getUniformLocation(e,n.name);rc(n,r,this)}}setValue(t,e,n,i){const r=this.map[e];if(r!==undefined)r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];if(i!==undefined)this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,s=e.length;r!==s;++r){const s=e[r],a=n[s.id];if(a.needsUpdate!==false){s.setValue(t,a.value,i)}}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];if(r.id in e)n.push(r)}return n}}function ac(t,e,n){const i=t.createShader(e);t.shaderSource(i,n);t.compileShader(i);return i}let oc=0;function lc(t,e){const n=t.split("\n");const i=[];const r=Math.max(e-6,0);const s=Math.min(e+6,n.length);for(let t=r;t<s;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}function cc(t){switch(t){case ve:return["Linear","( value )"];case xe:return["sRGB","( value )"];default:console.warn("THREE.WebGLProgram: Unsupported color space:",t);return["Linear","( value )"]}}function uc(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS);const r=t.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const i=parseInt(s[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+lc(t.getShaderSource(e),i)}else{return r}}function hc(t,e){const n=cc(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function fc(t,e){let n;switch(e){case j:n="Linear";break;case Y:n="Reinhard";break;case J:n="OptimizedCineon";break;case Z:n="ACESFilmic";break;case K:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e);n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function dc(t){const e=[t.extensionDerivatives||!!t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return e.filter(gc).join("\n")}function pc(t){const e=[];for(const n in t){const i=t[n];if(i===false)continue;e.push("#define "+n+" "+i)}return e.join("\n")}function mc(t,e){const n={};const i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r);const s=i.name;let a=1;if(i.type===t.FLOAT_MAT2)a=2;if(i.type===t.FLOAT_MAT3)a=3;if(i.type===t.FLOAT_MAT4)a=4;n[s]={type:i.type,location:t.getAttribLocation(e,s),locationSize:a}}return n}function gc(t){return t!==""}function _c(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function xc(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const vc=/^[ \t]*#include +<([\w\d./]+)>/gm;function Mc(t){return t.replace(vc,yc)}function yc(t,e){const n=_o[e];if(n===undefined){throw new Error("Can not resolve #include <"+e+">")}return Mc(n)}const Sc=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ec(t){return t.replace(Sc,Tc)}function Tc(t,e,n,i){let r="";for(let t=parseInt(e);t<parseInt(n);t++){r+=i.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t)}return r}function bc(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";if(t.precision==="highp"){e+="\n#define HIGH_PRECISION"}else if(t.precision==="mediump"){e+="\n#define MEDIUM_PRECISION"}else if(t.precision==="lowp"){e+="\n#define LOW_PRECISION"}return e}function wc(t){let e="SHADOWMAP_TYPE_BASIC";if(t.shadowMapType===o){e="SHADOWMAP_TYPE_PCF"}else if(t.shadowMapType===l){e="SHADOWMAP_TYPE_PCF_SOFT"}else if(t.shadowMapType===c){e="SHADOWMAP_TYPE_VSM"}return e}function Ac(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap){switch(t.envMapMode){case $:case tt:e="ENVMAP_TYPE_CUBE";break;case it:e="ENVMAP_TYPE_CUBE_UV";break}}return e}function Rc(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap){switch(t.envMapMode){case tt:e="ENVMAP_MODE_REFRACTION";break}}return e}function qc(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap){switch(t.combine){case V:e="ENVMAP_BLENDING_MULTIPLY";break;case k:e="ENVMAP_BLENDING_MIX";break;case W:e="ENVMAP_BLENDING_ADD";break}}return e}function Cc(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2;const i=1/e;const r=1/(3*Math.max(Math.pow(2,n),7*16));return{texelWidth:r,texelHeight:i,maxMip:n}}function Lc(t,e,n,i){const r=t.getContext();const s=n.defines;let a=n.vertexShader;let o=n.fragmentShader;const l=wc(n);const c=Ac(n);const u=Rc(n);const h=qc(n);const f=Cc(n);const d=n.isWebGL2?"":dc(n);const p=pc(s);const m=r.createProgram();let g,_;let x=n.glslVersion?"#version "+n.glslVersion+"\n":"";if(n.isRawShaderMaterial){g=[p].filter(gc).join("\n");if(g.length>0){g+="\n"}_=[d,p].filter(gc).join("\n");if(_.length>0){_+="\n"}}else{g=[bc(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===false?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(gc).join("\n");_=[d,bc(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==X?"#define TONE_MAPPING":"",n.toneMapping!==X?_o["tonemapping_pars_fragment"]:"",n.toneMapping!==X?fc("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",_o["encodings_pars_fragment"],hc("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(gc).join("\n")}a=Mc(a);a=_c(a,n);a=xc(a,n);o=Mc(o);o=_c(o,n);o=xc(o,n);a=Ec(a);o=Ec(o);if(n.isWebGL2&&n.isRawShaderMaterial!==true){x="#version 300 es\n";g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g;_=["#define varying in",n.glslVersion===Te?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Te?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+_}const v=x+g+a;const M=x+_+o;const y=ac(r,r.VERTEX_SHADER,v);const S=ac(r,r.FRAGMENT_SHADER,M);r.attachShader(m,y);r.attachShader(m,S);if(n.index0AttributeName!==undefined){r.bindAttribLocation(m,0,n.index0AttributeName)}else if(n.morphTargets===true){r.bindAttribLocation(m,0,"position")}r.linkProgram(m);if(t.debug.checkShaderErrors){const e=r.getProgramInfoLog(m).trim();const n=r.getShaderInfoLog(y).trim();const i=r.getShaderInfoLog(S).trim();let s=true;let a=true;if(r.getProgramParameter(m,r.LINK_STATUS)===false){s=false;if(typeof t.debug.onShaderError==="function"){t.debug.onShaderError(r,m,y,S)}else{const t=uc(r,y,"vertex");const n=uc(r,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - "+"VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+"\n\n"+"Program Info Log: "+e+"\n"+t+"\n"+n)}}else if(e!==""){console.warn("THREE.WebGLProgram: Program Info Log:",e)}else if(n===""||i===""){a=false}if(a){this.diagnostics={runnable:s,programLog:e,vertexShader:{log:n,prefix:g},fragmentShader:{log:i,prefix:_}}}}r.deleteShader(y);r.deleteShader(S);let E;this.getUniforms=function(){if(E===undefined){E=new sc(r,m)}return E};let T;this.getAttributes=function(){if(T===undefined){T=mc(r,m)}return T};this.destroy=function(){i.releaseStatesOfProgram(this);r.deleteProgram(m);this.program=undefined};this.name=n.shaderName;this.id=oc++;this.cacheKey=e;this.usedTimes=1;this.program=m;this.vertexShader=y;this.fragmentShader=S;return this}let Pc=0;class Uc{constructor(){this.shaderCache=new Map;this.materialCache=new Map}update(t){const e=t.vertexShader;const n=t.fragmentShader;const i=this._getShaderStage(e);const r=this._getShaderStage(n);const s=this._getShaderCacheForMaterial(t);if(s.has(i)===false){s.add(i);i.usedTimes++}if(s.has(r)===false){s.add(r);r.usedTimes++}return this}remove(t){const e=this.materialCache.get(t);for(const t of e){t.usedTimes--;if(t.usedTimes===0)this.shaderCache.delete(t.code)}this.materialCache.delete(t);return this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear();this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);if(n===undefined){n=new Set;e.set(t,n)}return n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);if(n===undefined){n=new Dc(t);e.set(t,n)}return n}}class Dc{constructor(t){this.id=Pc++;this.code=t;this.usedTimes=0}}function Ic(t,e,n,i,r,s,a){const o=new $n;const l=new Uc;const c=[];const u=r.isWebGL2;const d=r.logarithmicDepthBuffer;const m=r.vertexTextures;let g=r.precision;const _={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(t){if(t===1)return"uv1";if(t===2)return"uv2";if(t===3)return"uv3";return"uv"}function v(s,o,c,v,M){const y=v.fog;const S=M.geometry;const E=s.isMeshStandardMaterial?v.environment:null;const T=(s.isMeshStandardMaterial?n:e).get(s.envMap||E);const b=!!T&&T.mapping===it?T.image.height:null;const w=_[s.type];if(s.precision!==null){g=r.getMaxPrecision(s.precision);if(g!==s.precision){console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",g,"instead.")}}const A=S.morphAttributes.position||S.morphAttributes.normal||S.morphAttributes.color;const R=A!==undefined?A.length:0;let q=0;if(S.morphAttributes.position!==undefined)q=1;if(S.morphAttributes.normal!==undefined)q=2;if(S.morphAttributes.color!==undefined)q=3;let C,L;let P,U;if(w){const t=vo[w];C=t.vertexShader;L=t.fragmentShader}else{C=s.vertexShader;L=s.fragmentShader;l.update(s);P=l.getVertexShaderID(s);U=l.getFragmentShaderID(s)}const D=t.getRenderTarget();const I=M.isInstancedMesh===true;const N=!!s.map;const O=!!s.matcap;const F=!!T;const z=!!s.aoMap;const B=!!s.lightMap;const H=!!s.bumpMap;const G=!!s.normalMap;const V=!!s.displacementMap;const k=!!s.emissiveMap;const W=!!s.metalnessMap;const j=!!s.roughnessMap;const Y=s.clearcoat>0;const J=s.iridescence>0;const Z=s.sheen>0;const K=s.transmission>0;const Q=Y&&!!s.clearcoatMap;const $=Y&&!!s.clearcoatNormalMap;const tt=Y&&!!s.clearcoatRoughnessMap;const et=J&&!!s.iridescenceMap;const nt=J&&!!s.iridescenceThicknessMap;const rt=Z&&!!s.sheenColorMap;const st=Z&&!!s.sheenRoughnessMap;const at=!!s.specularMap;const ot=!!s.specularColorMap;const lt=!!s.specularIntensityMap;const ct=K&&!!s.transmissionMap;const ut=K&&!!s.thicknessMap;const ht=!!s.gradientMap;const ft=!!s.alphaMap;const dt=s.alphaTest>0;const pt=!!s.extensions;const mt=!!S.attributes.uv1;const gt=!!S.attributes.uv2;const _t=!!S.attributes.uv3;const xt={isWebGL2:u,shaderID:w,shaderName:s.type,vertexShader:C,fragmentShader:L,defines:s.defines,customVertexShaderID:P,customFragmentShaderID:U,isRawShaderMaterial:s.isRawShaderMaterial===true,glslVersion:s.glslVersion,precision:g,instancing:I,instancingColor:I&&M.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:D===null?t.outputColorSpace:D.isXRRenderTarget===true?D.texture.colorSpace:ve,map:N,matcap:O,envMap:F,envMapMode:F&&T.mapping,envMapCubeUVHeight:b,aoMap:z,lightMap:B,bumpMap:H,normalMap:G,displacementMap:m&&V,emissiveMap:k,normalMapObjectSpace:G&&s.normalMapType===ge,normalMapTangentSpace:G&&s.normalMapType===me,metalnessMap:W,roughnessMap:j,clearcoat:Y,clearcoatMap:Q,clearcoatNormalMap:$,clearcoatRoughnessMap:tt,iridescence:J,iridescenceMap:et,iridescenceThicknessMap:nt,sheen:Z,sheenColorMap:rt,sheenRoughnessMap:st,specularMap:at,specularColorMap:ot,specularIntensityMap:lt,transmission:K,transmissionMap:ct,thicknessMap:ut,gradientMap:ht,opaque:s.transparent===false&&s.blending===p,alphaMap:ft,alphaTest:dt,combine:s.combine,mapUv:N&&x(s.map.channel),aoMapUv:z&&x(s.aoMap.channel),lightMapUv:B&&x(s.lightMap.channel),bumpMapUv:H&&x(s.bumpMap.channel),normalMapUv:G&&x(s.normalMap.channel),displacementMapUv:V&&x(s.displacementMap.channel),emissiveMapUv:k&&x(s.emissiveMap.channel),metalnessMapUv:W&&x(s.metalnessMap.channel),roughnessMapUv:j&&x(s.roughnessMap.channel),clearcoatMapUv:Q&&x(s.clearcoatMap.channel),clearcoatNormalMapUv:$&&x(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&x(s.clearcoatRoughnessMap.channel),iridescenceMapUv:et&&x(s.iridescenceMap.channel),iridescenceThicknessMapUv:nt&&x(s.iridescenceThicknessMap.channel),sheenColorMapUv:rt&&x(s.sheenColorMap.channel),sheenRoughnessMapUv:st&&x(s.sheenRoughnessMap.channel),specularMapUv:at&&x(s.specularMap.channel),specularColorMapUv:ot&&x(s.specularColorMap.channel),specularIntensityMapUv:lt&&x(s.specularIntensityMap.channel),transmissionMapUv:ct&&x(s.transmissionMap.channel),thicknessMapUv:ut&&x(s.thicknessMap.channel),alphaMapUv:ft&&x(s.alphaMap.channel),vertexTangents:G&&!!S.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:s.vertexColors===true&&!!S.attributes.color&&S.attributes.color.itemSize===4,vertexUv1s:mt,vertexUv2s:gt,vertexUv3s:_t,pointsUvs:M.isPoints===true&&!!S.attributes.uv&&(N||ft),fog:!!y,useFog:s.fog===true,fogExp2:y&&y.isFogExp2,flatShading:s.flatShading===true,sizeAttenuation:s.sizeAttenuation===true,logarithmicDepthBuffer:d,skinning:M.isSkinnedMesh===true,morphTargets:S.morphAttributes.position!==undefined,morphNormals:S.morphAttributes.normal!==undefined,morphColors:S.morphAttributes.color!==undefined,morphTargetsCount:R,morphTextureStride:q,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:X,useLegacyLights:t.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===f,flipSided:s.side===h,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:pt&&s.extensions.derivatives===true,extensionFragDepth:pt&&s.extensions.fragDepth===true,extensionDrawBuffers:pt&&s.extensions.drawBuffers===true,extensionShaderTextureLOD:pt&&s.extensions.shaderTextureLOD===true,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()};return xt}function M(e){const n=[];if(e.shaderID){n.push(e.shaderID)}else{n.push(e.customVertexShaderID);n.push(e.customFragmentShaderID)}if(e.defines!==undefined){for(const t in e.defines){n.push(t);n.push(e.defines[t])}}if(e.isRawShaderMaterial===false){y(n,e);S(n,e);n.push(t.outputColorSpace)}n.push(e.customProgramCacheKey);return n.join()}function y(t,e){t.push(e.precision);t.push(e.outputColorSpace);t.push(e.envMapMode);t.push(e.envMapCubeUVHeight);t.push(e.mapUv);t.push(e.alphaMapUv);t.push(e.lightMapUv);t.push(e.aoMapUv);t.push(e.bumpMapUv);t.push(e.normalMapUv);t.push(e.displacementMapUv);t.push(e.emissiveMapUv);t.push(e.metalnessMapUv);t.push(e.roughnessMapUv);t.push(e.clearcoatMapUv);t.push(e.clearcoatNormalMapUv);t.push(e.clearcoatRoughnessMapUv);t.push(e.iridescenceMapUv);t.push(e.iridescenceThicknessMapUv);t.push(e.sheenColorMapUv);t.push(e.sheenRoughnessMapUv);t.push(e.specularMapUv);t.push(e.specularColorMapUv);t.push(e.specularIntensityMapUv);t.push(e.transmissionMapUv);t.push(e.thicknessMapUv);t.push(e.combine);t.push(e.fogExp2);t.push(e.sizeAttenuation);t.push(e.morphTargetsCount);t.push(e.morphAttributeCount);t.push(e.numDirLights);t.push(e.numPointLights);t.push(e.numSpotLights);t.push(e.numSpotLightMaps);t.push(e.numHemiLights);t.push(e.numRectAreaLights);t.push(e.numDirLightShadows);t.push(e.numPointLightShadows);t.push(e.numSpotLightShadows);t.push(e.numSpotLightShadowsWithMaps);t.push(e.shadowMapType);t.push(e.toneMapping);t.push(e.numClippingPlanes);t.push(e.numClipIntersection);t.push(e.depthPacking)}function S(t,e){o.disableAll();if(e.isWebGL2)o.enable(0);if(e.supportsVertexTextures)o.enable(1);if(e.instancing)o.enable(2);if(e.instancingColor)o.enable(3);if(e.matcap)o.enable(4);if(e.envMap)o.enable(5);if(e.normalMapObjectSpace)o.enable(6);if(e.normalMapTangentSpace)o.enable(7);if(e.clearcoat)o.enable(8);if(e.iridescence)o.enable(9);if(e.alphaTest)o.enable(10);if(e.vertexColors)o.enable(11);if(e.vertexAlphas)o.enable(12);if(e.vertexUv1s)o.enable(13);if(e.vertexUv2s)o.enable(14);if(e.vertexUv3s)o.enable(15);if(e.vertexTangents)o.enable(16);t.push(o.mask);o.disableAll();if(e.fog)o.enable(0);if(e.useFog)o.enable(1);if(e.flatShading)o.enable(2);if(e.logarithmicDepthBuffer)o.enable(3);if(e.skinning)o.enable(4);if(e.morphTargets)o.enable(5);if(e.morphNormals)o.enable(6);if(e.morphColors)o.enable(7);if(e.premultipliedAlpha)o.enable(8);if(e.shadowMapEnabled)o.enable(9);if(e.useLegacyLights)o.enable(10);if(e.doubleSided)o.enable(11);if(e.flipSided)o.enable(12);if(e.useDepthPacking)o.enable(13);if(e.dithering)o.enable(14);if(e.transmission)o.enable(15);if(e.sheen)o.enable(16);if(e.opaque)o.enable(17);if(e.pointsUvs)o.enable(18);t.push(o.mask)}function E(t){const e=_[t.type];let n;if(e){const t=vo[e];n=Mr.clone(t.uniforms)}else{n=t.uniforms}return n}function T(e,n){let i;for(let t=0,e=c.length;t<e;t++){const e=c[t];if(e.cacheKey===n){i=e;++i.usedTimes;break}}if(i===undefined){i=new Lc(t,n,e,s);c.push(i)}return i}function b(t){if(--t.usedTimes===0){const e=c.indexOf(t);c[e]=c[c.length-1];c.pop();t.destroy()}}function w(t){l.remove(t)}function A(){l.dispose()}return{getParameters:v,getProgramCacheKey:M,getUniforms:E,acquireProgram:T,releaseProgram:b,releaseShaderCache:w,programs:c,dispose:A}}function Nc(){let t=new WeakMap;function e(e){let n=t.get(e);if(n===undefined){n={};t.set(e,n)}return n}function n(e){t.delete(e)}function i(e,n,i){t.get(e)[n]=i}function r(){t=new WeakMap}return{get:e,remove:n,update:i,dispose:r}}function Oc(t,e){if(t.groupOrder!==e.groupOrder){return t.groupOrder-e.groupOrder}else if(t.renderOrder!==e.renderOrder){return t.renderOrder-e.renderOrder}else if(t.material.id!==e.material.id){return t.material.id-e.material.id}else if(t.z!==e.z){return t.z-e.z}else{return t.id-e.id}}function Fc(t,e){if(t.groupOrder!==e.groupOrder){return t.groupOrder-e.groupOrder}else if(t.renderOrder!==e.renderOrder){return t.renderOrder-e.renderOrder}else if(t.z!==e.z){return e.z-t.z}else{return t.id-e.id}}function zc(){const t=[];let e=0;const n=[];const i=[];const r=[];function s(){e=0;n.length=0;i.length=0;r.length=0}function a(n,i,r,s,a,o){let l=t[e];if(l===undefined){l={id:n.id,object:n,geometry:i,material:r,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o};t[e]=l}else{l.id=n.id;l.object=n;l.geometry=i;l.material=r;l.groupOrder=s;l.renderOrder=n.renderOrder;l.z=a;l.group=o}e++;return l}function o(t,e,s,o,l,c){const u=a(t,e,s,o,l,c);if(s.transmission>0){i.push(u)}else if(s.transparent===true){r.push(u)}else{n.push(u)}}function l(t,e,s,o,l,c){const u=a(t,e,s,o,l,c);if(s.transmission>0){i.unshift(u)}else if(s.transparent===true){r.unshift(u)}else{n.unshift(u)}}function c(t,e){if(n.length>1)n.sort(t||Oc);if(i.length>1)i.sort(e||Fc);if(r.length>1)r.sort(e||Fc)}function u(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(e.id===null)break;e.id=null;e.object=null;e.geometry=null;e.material=null;e.group=null}}return{opaque:n,transmissive:i,transparent:r,init:s,push:o,unshift:l,finish:u,sort:c}}function Bc(){let t=new WeakMap;function e(e,n){const i=t.get(e);let r;if(i===undefined){r=new zc;t.set(e,[r])}else{if(n>=i.length){r=new zc;i.push(r)}else{r=i[n]}}return r}function n(){t=new WeakMap}return{get:e,dispose:n}}function Hc(){const t={};return{get:function(e){if(t[e.id]!==undefined){return t[e.id]}let n;switch(e.type){case"DirectionalLight":n={direction:new fn,color:new Pi};break;case"SpotLight":n={position:new fn,direction:new fn,color:new Pi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new fn,color:new Pi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new fn,skyColor:new Pi,groundColor:new Pi};break;case"RectAreaLight":n={color:new Pi,position:new fn,halfWidth:new fn,halfHeight:new fn};break}t[e.id]=n;return n}}}function Gc(){const t={};return{get:function(e){if(t[e.id]!==undefined){return t[e.id]}let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe,shadowCameraNear:1,shadowCameraFar:1e3};break}t[e.id]=n;return n}}}let Vc=0;function kc(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Wc(t,e){const n=new Hc;const i=Gc();const r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new fn);const s=new fn;const a=new Gn;const o=new Gn;function l(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let u=0;let h=0;let f=0;let d=0;let p=0;let m=0;let g=0;let _=0;let x=0;let v=0;s.sort(kc);const M=a===true?Math.PI:1;for(let t=0,e=s.length;t<e;t++){const e=s[t];const a=e.color;const y=e.intensity;const S=e.distance;const E=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight){o+=a.r*y*M;l+=a.g*y*M;c+=a.b*y*M}else if(e.isLightProbe){for(let t=0;t<9;t++){r.probe[t].addScaledVector(e.sh.coefficients[t],y)}}else if(e.isDirectionalLight){const t=n.get(e);t.color.copy(e.color).multiplyScalar(e.intensity*M);if(e.castShadow){const t=e.shadow;const n=i.get(e);n.shadowBias=t.bias;n.shadowNormalBias=t.normalBias;n.shadowRadius=t.radius;n.shadowMapSize=t.mapSize;r.directionalShadow[u]=n;r.directionalShadowMap[u]=E;r.directionalShadowMatrix[u]=e.shadow.matrix;m++}r.directional[u]=t;u++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld);t.color.copy(a).multiplyScalar(y*M);t.distance=S;t.coneCos=Math.cos(e.angle);t.penumbraCos=Math.cos(e.angle*(1-e.penumbra));t.decay=e.decay;r.spot[f]=t;const s=e.shadow;if(e.map){r.spotLightMap[x]=e.map;x++;s.updateMatrices(e);if(e.castShadow)v++}r.spotLightMatrix[f]=s.matrix;if(e.castShadow){const t=i.get(e);t.shadowBias=s.bias;t.shadowNormalBias=s.normalBias;t.shadowRadius=s.radius;t.shadowMapSize=s.mapSize;r.spotShadow[f]=t;r.spotShadowMap[f]=E;_++}f++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(a).multiplyScalar(y);t.halfWidth.set(e.width*.5,0,0);t.halfHeight.set(0,e.height*.5,0);r.rectArea[d]=t;d++}else if(e.isPointLight){const t=n.get(e);t.color.copy(e.color).multiplyScalar(e.intensity*M);t.distance=e.distance;t.decay=e.decay;if(e.castShadow){const t=e.shadow;const n=i.get(e);n.shadowBias=t.bias;n.shadowNormalBias=t.normalBias;n.shadowRadius=t.radius;n.shadowMapSize=t.mapSize;n.shadowCameraNear=t.camera.near;n.shadowCameraFar=t.camera.far;r.pointShadow[h]=n;r.pointShadowMap[h]=E;r.pointShadowMatrix[h]=e.shadow.matrix;g++}r.point[h]=t;h++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(y*M);t.groundColor.copy(e.groundColor).multiplyScalar(y*M);r.hemi[p]=t;p++}}if(d>0){if(e.isWebGL2){r.rectAreaLTC1=xo.LTC_FLOAT_1;r.rectAreaLTC2=xo.LTC_FLOAT_2}else{if(t.has("OES_texture_float_linear")===true){r.rectAreaLTC1=xo.LTC_FLOAT_1;r.rectAreaLTC2=xo.LTC_FLOAT_2}else if(t.has("OES_texture_half_float_linear")===true){r.rectAreaLTC1=xo.LTC_HALF_1;r.rectAreaLTC2=xo.LTC_HALF_2}else{console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")}}}r.ambient[0]=o;r.ambient[1]=l;r.ambient[2]=c;const y=r.hash;if(y.directionalLength!==u||y.pointLength!==h||y.spotLength!==f||y.rectAreaLength!==d||y.hemiLength!==p||y.numDirectionalShadows!==m||y.numPointShadows!==g||y.numSpotShadows!==_||y.numSpotMaps!==x){r.directional.length=u;r.spot.length=f;r.rectArea.length=d;r.point.length=h;r.hemi.length=p;r.directionalShadow.length=m;r.directionalShadowMap.length=m;r.pointShadow.length=g;r.pointShadowMap.length=g;r.spotShadow.length=_;r.spotShadowMap.length=_;r.directionalShadowMatrix.length=m;r.pointShadowMatrix.length=g;r.spotLightMatrix.length=_+x-v;r.spotLightMap.length=x;r.numSpotLightShadowsWithMaps=v;y.directionalLength=u;y.pointLength=h;y.spotLength=f;y.rectAreaLength=d;y.hemiLength=p;y.numDirectionalShadows=m;y.numPointShadows=g;y.numSpotShadows=_;y.numSpotMaps=x;r.version=Vc++}}function c(t,e){let n=0;let i=0;let l=0;let c=0;let u=0;const h=e.matrixWorldInverse;for(let e=0,f=t.length;e<f;e++){const f=t[e];if(f.isDirectionalLight){const t=r.directional[n];t.direction.setFromMatrixPosition(f.matrixWorld);s.setFromMatrixPosition(f.target.matrixWorld);t.direction.sub(s);t.direction.transformDirection(h);n++}else if(f.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(f.matrixWorld);t.position.applyMatrix4(h);t.direction.setFromMatrixPosition(f.matrixWorld);s.setFromMatrixPosition(f.target.matrixWorld);t.direction.sub(s);t.direction.transformDirection(h);l++}else if(f.isRectAreaLight){const t=r.rectArea[c];t.position.setFromMatrixPosition(f.matrixWorld);t.position.applyMatrix4(h);o.identity();a.copy(f.matrixWorld);a.premultiply(h);o.extractRotation(a);t.halfWidth.set(f.width*.5,0,0);t.halfHeight.set(0,f.height*.5,0);t.halfWidth.applyMatrix4(o);t.halfHeight.applyMatrix4(o);c++}else if(f.isPointLight){const t=r.point[i];t.position.setFromMatrixPosition(f.matrixWorld);t.position.applyMatrix4(h);i++}else if(f.isHemisphereLight){const t=r.hemi[u];t.direction.setFromMatrixPosition(f.matrixWorld);t.direction.transformDirection(h);u++}}}return{setup:l,setupView:c,state:r}}function Xc(t,e){const n=new Wc(t,e);const i=[];const r=[];function s(){i.length=0;r.length=0}function a(t){i.push(t)}function o(t){r.push(t)}function l(t){n.setup(i,t)}function c(t){n.setupView(i,t)}const u={lightsArray:i,shadowsArray:r,lights:n};return{init:s,state:u,setupLights:l,setupLightsView:c,pushLight:a,pushShadow:o}}function jc(t,e){let n=new WeakMap;function i(i,r=0){const s=n.get(i);let a;if(s===undefined){a=new Xc(t,e);n.set(i,[a])}else{if(r>=s.length){a=new Xc(t,e);s.push(a)}else{a=s[r]}}return a}function r(){n=new WeakMap}return{get:i,dispose:r}}class Yc extends Ai{constructor(t){super();this.isMeshDepthMaterial=true;this.type="MeshDepthMaterial";this.depthPacking=de;this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(t)}copy(t){super.copy(t);this.depthPacking=t.depthPacking;this.map=t.map;this.alphaMap=t.alphaMap;this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;return this}}class Jc extends Ai{constructor(t){super();this.isMeshDistanceMaterial=true;this.type="MeshDistanceMaterial";this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.setValues(t)}copy(t){super.copy(t);this.map=t.map;this.alphaMap=t.alphaMap;this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;return this}}const Zc="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";const Kc="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function Qc(t,e,n){let i=new Or;const r=new Fe,s=new Fe,a=new on,l=new Yc({depthPacking:pe}),p=new Jc,m={},g=n.maxTextureSize;const _={[u]:h,[h]:u,[f]:f};const x=new Er({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fe},radius:{value:4}},vertexShader:Zc,fragmentShader:Kc});const v=x.clone();v.defines.HORIZONTAL_PASS=1;const M=new Yi;M.setAttribute("position",new Oi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new fr(M,x);const S=this;this.enabled=false;this.autoUpdate=true;this.needsUpdate=false;this.type=o;let E=this.type;this.render=function(e,n,o){if(S.enabled===false)return;if(S.autoUpdate===false&&S.needsUpdate===false)return;if(e.length===0)return;const l=t.getRenderTarget();const u=t.getActiveCubeFace();const h=t.getActiveMipmapLevel();const f=t.state;f.setBlending(d);f.buffers.color.setClear(1,1,1,1);f.buffers.depth.setTest(true);f.setScissorTest(false);const p=E!==c&&this.type===c;const m=E===c&&this.type!==c;for(let l=0,u=e.length;l<u;l++){const u=e[l];const h=u.shadow;if(h===undefined){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(h.autoUpdate===false&&h.needsUpdate===false)continue;r.copy(h.mapSize);const d=h.getFrameExtents();r.multiply(d);s.copy(h.mapSize);if(r.x>g||r.y>g){if(r.x>g){s.x=Math.floor(g/d.x);r.x=s.x*d.x;h.mapSize.x=s.x}if(r.y>g){s.y=Math.floor(g/d.y);r.y=s.y*d.y;h.mapSize.y=s.y}}if(h.map===null||p===true||m===true){const t=this.type!==c?{minFilter:ot,magFilter:ot}:{};if(h.map!==null){h.map.dispose()}h.map=new ln(r.x,r.y,t);h.map.texture.name=u.name+".shadowMap";h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map);t.clear();const _=h.getViewportCount();for(let t=0;t<_;t++){const e=h.getViewport(t);a.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w);f.viewport(a);h.updateMatrices(u,t);i=h.getFrustum();w(n,o,h.camera,u,this.type)}if(h.isPointLightShadow!==true&&this.type===c){T(h,o)}h.needsUpdate=false}E=this.type;S.needsUpdate=false;t.setRenderTarget(l,u,h)};function T(n,i){const s=e.update(y);if(x.defines.VSM_SAMPLES!==n.blurSamples){x.defines.VSM_SAMPLES=n.blurSamples;v.defines.VSM_SAMPLES=n.blurSamples;x.needsUpdate=true;v.needsUpdate=true}if(n.mapPass===null){n.mapPass=new ln(r.x,r.y)}x.uniforms.shadow_pass.value=n.map.texture;x.uniforms.resolution.value=n.mapSize;x.uniforms.radius.value=n.radius;t.setRenderTarget(n.mapPass);t.clear();t.renderBufferDirect(i,null,s,x,y,null);v.uniforms.shadow_pass.value=n.mapPass.texture;v.uniforms.resolution.value=n.mapSize;v.uniforms.radius.value=n.radius;t.setRenderTarget(n.map);t.clear();t.renderBufferDirect(i,null,s,v,y,null)}function b(e,n,i,r){let s=null;const a=i.isPointLight===true?e.customDistanceMaterial:e.customDepthMaterial;if(a!==undefined){s=a}else{s=i.isPointLight===true?p:l;if(t.localClippingEnabled&&n.clipShadows===true&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=m[t];if(i===undefined){i={};m[t]=i}let r=i[e];if(r===undefined){r=s.clone();i[e]=r}s=r}}s.visible=n.visible;s.wireframe=n.wireframe;if(r===c){s.side=n.shadowSide!==null?n.shadowSide:n.side}else{s.side=n.shadowSide!==null?n.shadowSide:_[n.side]}s.alphaMap=n.alphaMap;s.alphaTest=n.alphaTest;s.map=n.map;s.clipShadows=n.clipShadows;s.clippingPlanes=n.clippingPlanes;s.clipIntersection=n.clipIntersection;s.displacementMap=n.displacementMap;s.displacementScale=n.displacementScale;s.displacementBias=n.displacementBias;s.wireframeLinewidth=n.wireframeLinewidth;s.linewidth=n.linewidth;if(i.isPointLight===true&&s.isMeshDistanceMaterial===true){const e=t.properties.get(s);e.light=i}return s}function w(n,r,s,a,o){if(n.visible===false)return;const l=n.layers.test(r.layers);if(l&&(n.isMesh||n.isLine||n.isPoints)){if((n.castShadow||n.receiveShadow&&o===c)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n);const r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l];const u=r[c.materialIndex];if(u&&u.visible){const e=b(n,u,a,o);t.renderBufferDirect(s,null,i,e,n,c)}}}else if(r.visible){const e=b(n,r,a,o);t.renderBufferDirect(s,null,i,e,n,null)}}}const u=n.children;for(let t=0,e=u.length;t<e;t++){w(u[t],r,s,a,o)}}}function $c(t,e,n){const i=n.isWebGL2;function o(){let e=false;const n=new on;let i=null;const r=new on(0,0,0,0);return{setMask:function(n){if(i!==n&&!e){t.colorMask(n,n,n,n);i=n}},setLocked:function(t){e=t},setClear:function(e,i,s,a,o){if(o===true){e*=a;i*=a;s*=a}n.set(e,i,s,a);if(r.equals(n)===false){t.clearColor(e,i,s,a);r.copy(n)}},reset:function(){e=false;i=null;r.set(-1,0,0,0)}}}function l(){let e=false;let n=null;let i=null;let r=null;return{setTest:function(e){if(e){Tt(t.DEPTH_TEST)}else{bt(t.DEPTH_TEST)}},setMask:function(i){if(n!==i&&!e){t.depthMask(i);n=i}},setFunc:function(e){if(i!==e){switch(e){case I:t.depthFunc(t.NEVER);break;case N:t.depthFunc(t.ALWAYS);break;case O:t.depthFunc(t.LESS);break;case F:t.depthFunc(t.LEQUAL);break;case z:t.depthFunc(t.EQUAL);break;case B:t.depthFunc(t.GEQUAL);break;case H:t.depthFunc(t.GREATER);break;case G:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}i=e}},setLocked:function(t){e=t},setClear:function(e){if(r!==e){t.clearDepth(e);r=e}},reset:function(){e=false;n=null;i=null;r=null}}}function c(){let e=false;let n=null;let i=null;let r=null;let s=null;let a=null;let o=null;let l=null;let c=null;return{setTest:function(n){if(!e){if(n){Tt(t.STENCIL_TEST)}else{bt(t.STENCIL_TEST)}}},setMask:function(i){if(n!==i&&!e){t.stencilMask(i);n=i}},setFunc:function(e,n,a){if(i!==e||r!==n||s!==a){t.stencilFunc(e,n,a);i=e;r=n;s=a}},setOp:function(e,n,i){if(a!==e||o!==n||l!==i){t.stencilOp(e,n,i);a=e;o=n;l=i}},setLocked:function(t){e=t},setClear:function(e){if(c!==e){t.clearStencil(e);c=e}},reset:function(){e=false;n=null;i=null;r=null;s=null;a=null;o=null;l=null;c=null}}}const u=new o;const V=new l;const k=new c;const W=new WeakMap;const X=new WeakMap;let j={};let Y={};let J=new WeakMap;let Z=[];let K=null;let Q=false;let $=null;let tt=null;let et=null;let nt=null;let it=null;let rt=null;let st=null;let at=false;let ot=null;let lt=null;let ct=null;let ut=null;let ht=null;const ft=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let dt=false;let pt=0;const mt=t.getParameter(t.VERSION);if(mt.indexOf("WebGL")!==-1){pt=parseFloat(/^WebGL (\d)/.exec(mt)[1]);dt=pt>=1}else if(mt.indexOf("OpenGL ES")!==-1){pt=parseFloat(/^OpenGL ES (\d)/.exec(mt)[1]);dt=pt>=2}let gt=null;let _t={};const xt=t.getParameter(t.SCISSOR_BOX);const vt=t.getParameter(t.VIEWPORT);const Mt=(new on).fromArray(xt);const yt=(new on).fromArray(vt);function St(e,n,r,s){const a=new Uint8Array(4);const o=t.createTexture();t.bindTexture(e,o);t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST);t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o=0;o<r;o++){if(i&&(e===t.TEXTURE_3D||e===t.TEXTURE_2D_ARRAY)){t.texImage3D(n,0,t.RGBA,1,1,s,0,t.RGBA,t.UNSIGNED_BYTE,a)}else{t.texImage2D(n+o,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,a)}}return o}const Et={};Et[t.TEXTURE_2D]=St(t.TEXTURE_2D,t.TEXTURE_2D,1);Et[t.TEXTURE_CUBE_MAP]=St(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6);if(i){Et[t.TEXTURE_2D_ARRAY]=St(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1);Et[t.TEXTURE_3D]=St(t.TEXTURE_3D,t.TEXTURE_3D,1,1)}u.setClear(0,0,0,1);V.setClear(1);k.setClear(0);Tt(t.DEPTH_TEST);V.setFunc(F);Ut(false);Dt(s);Tt(t.CULL_FACE);Lt(d);function Tt(e){if(j[e]!==true){t.enable(e);j[e]=true}}function bt(e){if(j[e]!==false){t.disable(e);j[e]=false}}function wt(e,n){if(Y[e]!==n){t.bindFramebuffer(e,n);Y[e]=n;if(i){if(e===t.DRAW_FRAMEBUFFER){Y[t.FRAMEBUFFER]=n}if(e===t.FRAMEBUFFER){Y[t.DRAW_FRAMEBUFFER]=n}}return true}return false}function At(i,r){let s=Z;let a=false;if(i){s=J.get(r);if(s===undefined){s=[];J.set(r,s)}if(i.isWebGLMultipleRenderTargets){const e=i.texture;if(s.length!==e.length||s[0]!==t.COLOR_ATTACHMENT0){for(let n=0,i=e.length;n<i;n++){s[n]=t.COLOR_ATTACHMENT0+n}s.length=e.length;a=true}}else{if(s[0]!==t.COLOR_ATTACHMENT0){s[0]=t.COLOR_ATTACHMENT0;a=true}}}else{if(s[0]!==t.BACK){s[0]=t.BACK;a=true}}if(a){if(n.isWebGL2){t.drawBuffers(s)}else{e.get("WEBGL_draw_buffers").drawBuffersWEBGL(s)}}}function Rt(e){if(K!==e){t.useProgram(e);K=e;return true}return false}const qt={[v]:t.FUNC_ADD,[M]:t.FUNC_SUBTRACT,[y]:t.FUNC_REVERSE_SUBTRACT};if(i){qt[S]=t.MIN;qt[E]=t.MAX}else{const t=e.get("EXT_blend_minmax");if(t!==null){qt[S]=t.MIN_EXT;qt[E]=t.MAX_EXT}}const Ct={[T]:t.ZERO,[b]:t.ONE,[w]:t.SRC_COLOR,[R]:t.SRC_ALPHA,[D]:t.SRC_ALPHA_SATURATE,[P]:t.DST_COLOR,[C]:t.DST_ALPHA,[A]:t.ONE_MINUS_SRC_COLOR,[q]:t.ONE_MINUS_SRC_ALPHA,[U]:t.ONE_MINUS_DST_COLOR,[L]:t.ONE_MINUS_DST_ALPHA};function Lt(e,n,i,r,s,a,o,l){if(e===d){if(Q===true){bt(t.BLEND);Q=false}return}if(Q===false){Tt(t.BLEND);Q=true}if(e!==x){if(e!==$||l!==at){if(tt!==v||it!==v){t.blendEquation(t.FUNC_ADD);tt=v;it=v}if(l){switch(e){case p:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case m:t.blendFunc(t.ONE,t.ONE);break;case g:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case _:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}}else{switch(e){case p:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case m:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case g:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case _:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}}et=null;nt=null;rt=null;st=null;$=e;at=l}return}s=s||n;a=a||i;o=o||r;if(n!==tt||s!==it){t.blendEquationSeparate(qt[n],qt[s]);tt=n;it=s}if(i!==et||r!==nt||a!==rt||o!==st){t.blendFuncSeparate(Ct[i],Ct[r],Ct[a],Ct[o]);et=i;nt=r;rt=a;st=o}$=e;at=false}function Pt(e,n){e.side===f?bt(t.CULL_FACE):Tt(t.CULL_FACE);let i=e.side===h;if(n)i=!i;Ut(i);e.blending===p&&e.transparent===false?Lt(d):Lt(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha);V.setFunc(e.depthFunc);V.setTest(e.depthTest);V.setMask(e.depthWrite);u.setMask(e.colorWrite);const r=e.stencilWrite;k.setTest(r);if(r){k.setMask(e.stencilWriteMask);k.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask);k.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)}Nt(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits);e.alphaToCoverage===true?Tt(t.SAMPLE_ALPHA_TO_COVERAGE):bt(t.SAMPLE_ALPHA_TO_COVERAGE)}function Ut(e){if(ot!==e){if(e){t.frontFace(t.CW)}else{t.frontFace(t.CCW)}ot=e}}function Dt(e){if(e!==r){Tt(t.CULL_FACE);if(e!==lt){if(e===s){t.cullFace(t.BACK)}else if(e===a){t.cullFace(t.FRONT)}else{t.cullFace(t.FRONT_AND_BACK)}}}else{bt(t.CULL_FACE)}lt=e}function It(e){if(e!==ct){if(dt)t.lineWidth(e);ct=e}}function Nt(e,n,i){if(e){Tt(t.POLYGON_OFFSET_FILL);if(ut!==n||ht!==i){t.polygonOffset(n,i);ut=n;ht=i}}else{bt(t.POLYGON_OFFSET_FILL)}}function Ot(e){if(e){Tt(t.SCISSOR_TEST)}else{bt(t.SCISSOR_TEST)}}function Ft(e){if(e===undefined)e=t.TEXTURE0+ft-1;if(gt!==e){t.activeTexture(e);gt=e}}function zt(e,n,i){if(i===undefined){if(gt===null){i=t.TEXTURE0+ft-1}else{i=gt}}let r=_t[i];if(r===undefined){r={type:undefined,texture:undefined};_t[i]=r}if(r.type!==e||r.texture!==n){if(gt!==i){t.activeTexture(i);gt=i}t.bindTexture(e,n||Et[e]);r.type=e;r.texture=n}}function Bt(){const e=_t[gt];if(e!==undefined&&e.type!==undefined){t.bindTexture(e.type,null);e.type=undefined;e.texture=undefined}}function Ht(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Gt(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Vt(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function kt(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Wt(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Xt(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function jt(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Yt(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Jt(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Zt(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function Kt(e){if(Mt.equals(e)===false){t.scissor(e.x,e.y,e.z,e.w);Mt.copy(e)}}function Qt(e){if(yt.equals(e)===false){t.viewport(e.x,e.y,e.z,e.w);yt.copy(e)}}function $t(e,n){let i=X.get(n);if(i===undefined){i=new WeakMap;X.set(n,i)}let r=i.get(e);if(r===undefined){r=t.getUniformBlockIndex(n,e.name);i.set(e,r)}}function te(e,n){const i=X.get(n);const r=i.get(e);if(W.get(n)!==r){t.uniformBlockBinding(n,r,e.__bindingPointIndex);W.set(n,r)}}function ee(){t.disable(t.BLEND);t.disable(t.CULL_FACE);t.disable(t.DEPTH_TEST);t.disable(t.POLYGON_OFFSET_FILL);t.disable(t.SCISSOR_TEST);t.disable(t.STENCIL_TEST);t.disable(t.SAMPLE_ALPHA_TO_COVERAGE);t.blendEquation(t.FUNC_ADD);t.blendFunc(t.ONE,t.ZERO);t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO);t.colorMask(true,true,true,true);t.clearColor(0,0,0,0);t.depthMask(true);t.depthFunc(t.LESS);t.clearDepth(1);t.stencilMask(4294967295);t.stencilFunc(t.ALWAYS,0,4294967295);t.stencilOp(t.KEEP,t.KEEP,t.KEEP);t.clearStencil(0);t.cullFace(t.BACK);t.frontFace(t.CCW);t.polygonOffset(0,0);t.activeTexture(t.TEXTURE0);t.bindFramebuffer(t.FRAMEBUFFER,null);if(i===true){t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null);t.bindFramebuffer(t.READ_FRAMEBUFFER,null)}t.useProgram(null);t.lineWidth(1);t.scissor(0,0,t.canvas.width,t.canvas.height);t.viewport(0,0,t.canvas.width,t.canvas.height);j={};gt=null;_t={};Y={};J=new WeakMap;Z=[];K=null;Q=false;$=null;tt=null;et=null;nt=null;it=null;rt=null;st=null;at=false;ot=null;lt=null;ct=null;ut=null;ht=null;Mt.set(0,0,t.canvas.width,t.canvas.height);yt.set(0,0,t.canvas.width,t.canvas.height);u.reset();V.reset();k.reset()}return{buffers:{color:u,depth:V,stencil:k},enable:Tt,disable:bt,bindFramebuffer:wt,drawBuffers:At,useProgram:Rt,setBlending:Lt,setMaterial:Pt,setFlipSided:Ut,setCullFace:Dt,setLineWidth:It,setPolygonOffset:Nt,setScissorTest:Ot,activeTexture:Ft,bindTexture:zt,unbindTexture:Bt,compressedTexImage2D:Ht,compressedTexImage3D:Gt,texImage2D:Jt,texImage3D:Zt,updateUBOMapping:$t,uniformBlockBinding:te,texStorage2D:jt,texStorage3D:Yt,texSubImage2D:Vt,texSubImage3D:kt,compressedTexSubImage2D:Wt,compressedTexSubImage3D:Xt,scissor:Kt,viewport:Qt,reset:ee}}function tu(t,e,n,i,r,s,a){const o=r.isWebGL2;const l=r.maxTextures;const c=r.maxCubemapSize;const u=r.maxTextureSize;const h=r.maxSamples;const f=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null;const d=typeof navigator==="undefined"?false:/OculusBrowser/g.test(navigator.userAgent);const p=new WeakMap;let m;const g=new WeakMap;let _=false;try{_=typeof OffscreenCanvas!=="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(t){}function x(t,e){return _?new OffscreenCanvas(t,e):Ge("canvas")}function v(t,e,n,i){let r=1;if(t.width>i||t.height>i){r=i/Math.max(t.width,t.height)}if(r<1||e===true){if(typeof HTMLImageElement!=="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&t instanceof ImageBitmap){const i=e?Ie:Math.floor;const s=i(r*t.width);const a=i(r*t.height);if(m===undefined)m=x(s,a);const o=n?x(s,a):m;o.width=s;o.height=a;const l=o.getContext("2d");l.drawImage(t,0,0,s,a);console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+").");return o}else{if("data"in t){console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+").")}return t}}return t}function M(t){return De(t.width)&&De(t.height)}function y(t){if(o)return false;return t.wrapS!==st||t.wrapT!==st||t.minFilter!==ot&&t.minFilter!==ut}function S(t,e){return t.generateMipmaps&&e&&t.minFilter!==ot&&t.minFilter!==ut}function E(e){t.generateMipmap(e)}function T(n,i,r,s,a=false){if(o===false)return i;if(n!==null){if(t[n]!==undefined)return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;if(i===t.RED){if(r===t.FLOAT)l=t.R32F;if(r===t.HALF_FLOAT)l=t.R16F;if(r===t.UNSIGNED_BYTE)l=t.R8}if(i===t.RG){if(r===t.FLOAT)l=t.RG32F;if(r===t.HALF_FLOAT)l=t.RG16F;if(r===t.UNSIGNED_BYTE)l=t.RG8}if(i===t.RGBA){if(r===t.FLOAT)l=t.RGBA32F;if(r===t.HALF_FLOAT)l=t.RGBA16F;if(r===t.UNSIGNED_BYTE)l=s===xe&&a===false?t.SRGB8_ALPHA8:t.RGBA8;if(r===t.UNSIGNED_SHORT_4_4_4_4)l=t.RGBA4;if(r===t.UNSIGNED_SHORT_5_5_5_1)l=t.RGB5_A1}if(l===t.R16F||l===t.R32F||l===t.RG16F||l===t.RG32F||l===t.RGBA16F||l===t.RGBA32F){e.get("EXT_color_buffer_float")}return l}function b(t,e,n){if(S(t,n)===true||t.isFramebufferTexture&&t.minFilter!==ot&&t.minFilter!==ut){return Math.log2(Math.max(e.width,e.height))+1}else if(t.mipmaps!==undefined&&t.mipmaps.length>0){return t.mipmaps.length}else if(t.isCompressedTexture&&Array.isArray(t.image)){return e.mipmaps.length}else{return 1}}function w(e){if(e===ot||e===lt||e===ct){return t.NEAREST}return t.LINEAR}function A(t){const e=t.target;e.removeEventListener("dispose",A);q(e);if(e.isVideoTexture){p.delete(e)}}function R(t){const e=t.target;e.removeEventListener("dispose",R);L(e)}function q(t){const e=i.get(t);if(e.__webglInit===undefined)return;const n=t.source;const r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--;if(i.usedTimes===0){C(t)}if(Object.keys(r).length===0){g.delete(n)}}i.remove(t)}function C(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source;const s=g.get(r);delete s[n.__cacheKey];a.memory.textures--}function L(e){const n=e.texture;const r=i.get(e);const s=i.get(n);if(s.__webglTexture!==undefined){t.deleteTexture(s.__webglTexture);a.memory.textures--}if(e.depthTexture){e.depthTexture.dispose()}if(e.isWebGLCubeRenderTarget){for(let e=0;e<6;e++){t.deleteFramebuffer(r.__webglFramebuffer[e]);if(r.__webglDepthbuffer)t.deleteRenderbuffer(r.__webglDepthbuffer[e])}}else{t.deleteFramebuffer(r.__webglFramebuffer);if(r.__webglDepthbuffer)t.deleteRenderbuffer(r.__webglDepthbuffer);if(r.__webglMultisampledFramebuffer)t.deleteFramebuffer(r.__webglMultisampledFramebuffer);if(r.__webglColorRenderbuffer){for(let e=0;e<r.__webglColorRenderbuffer.length;e++){if(r.__webglColorRenderbuffer[e])t.deleteRenderbuffer(r.__webglColorRenderbuffer[e])}}if(r.__webglDepthRenderbuffer)t.deleteRenderbuffer(r.__webglDepthRenderbuffer)}if(e.isWebGLMultipleRenderTargets){for(let e=0,r=n.length;e<r;e++){const r=i.get(n[e]);if(r.__webglTexture){t.deleteTexture(r.__webglTexture);a.memory.textures--}i.remove(n[e])}}i.remove(n);i.remove(e)}let P=0;function U(){P=0}function D(){const t=P;if(t>=l){console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l)}P+=1;return t}function I(t){const e=[];e.push(t.wrapS);e.push(t.wrapT);e.push(t.wrapR||0);e.push(t.magFilter);e.push(t.minFilter);e.push(t.anisotropy);e.push(t.internalFormat);e.push(t.format);e.push(t.type);e.push(t.generateMipmaps);e.push(t.premultiplyAlpha);e.push(t.flipY);e.push(t.unpackAlignment);e.push(t.colorSpace);return e.join()}function N(e,r){const s=i.get(e);if(e.isVideoTexture)nt(e);if(e.isRenderTargetTexture===false&&e.version>0&&s.__version!==e.version){const t=e.image;if(t===null){console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.")}else if(t.complete===false){console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}else{k(s,e,r);return}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}function O(e,r){const s=i.get(e);if(e.version>0&&s.__version!==e.version){k(s,e,r);return}n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)}function F(e,r){const s=i.get(e);if(e.version>0&&s.__version!==e.version){k(s,e,r);return}n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)}function z(e,r){const s=i.get(e);if(e.version>0&&s.__version!==e.version){W(s,e,r);return}n.bindTexture(t.TEXTURE_CUBE_MAP,s.__webglTexture,t.TEXTURE0+r)}const B={[rt]:t.REPEAT,[st]:t.CLAMP_TO_EDGE,[at]:t.MIRRORED_REPEAT};const H={[ot]:t.NEAREST,[lt]:t.NEAREST_MIPMAP_NEAREST,[ct]:t.NEAREST_MIPMAP_LINEAR,[ut]:t.LINEAR,[ht]:t.LINEAR_MIPMAP_NEAREST,[ft]:t.LINEAR_MIPMAP_LINEAR};function G(n,s,a){if(a){t.texParameteri(n,t.TEXTURE_WRAP_S,B[s.wrapS]);t.texParameteri(n,t.TEXTURE_WRAP_T,B[s.wrapT]);if(n===t.TEXTURE_3D||n===t.TEXTURE_2D_ARRAY){t.texParameteri(n,t.TEXTURE_WRAP_R,B[s.wrapR])}t.texParameteri(n,t.TEXTURE_MAG_FILTER,H[s.magFilter]);t.texParameteri(n,t.TEXTURE_MIN_FILTER,H[s.minFilter])}else{t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE);t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);if(n===t.TEXTURE_3D||n===t.TEXTURE_2D_ARRAY){t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE)}if(s.wrapS!==st||s.wrapT!==st){console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.")}t.texParameteri(n,t.TEXTURE_MAG_FILTER,w(s.magFilter));t.texParameteri(n,t.TEXTURE_MIN_FILTER,w(s.minFilter));if(s.minFilter!==ot&&s.minFilter!==ut){console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")}}if(e.has("EXT_texture_filter_anisotropic")===true){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===ot)return;if(s.minFilter!==ct&&s.minFilter!==ft)return;if(s.type===vt&&e.has("OES_texture_float_linear")===false)return;if(o===false&&(s.type===Mt&&e.has("OES_texture_half_float_linear")===false))return;if(s.anisotropy>1||i.get(s).__currentAnisotropy){t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy()));i.get(s).__currentAnisotropy=s.anisotropy}}}function V(e,n){let i=false;if(e.__webglInit===undefined){e.__webglInit=true;n.addEventListener("dispose",A)}const r=n.source;let s=g.get(r);if(s===undefined){s={};g.set(r,s)}const o=I(n);if(o!==e.__cacheKey){if(s[o]===undefined){s[o]={texture:t.createTexture(),usedTimes:0};a.memory.textures++;i=true}s[o].usedTimes++;const r=s[e.__cacheKey];if(r!==undefined){s[e.__cacheKey].usedTimes--;if(r.usedTimes===0){C(n)}}e.__cacheKey=o;e.__webglTexture=s[o].texture}return i}function k(e,r,a){let l=t.TEXTURE_2D;if(r.isDataArrayTexture||r.isCompressedArrayTexture)l=t.TEXTURE_2D_ARRAY;if(r.isData3DTexture)l=t.TEXTURE_3D;const c=V(e,r);const h=r.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const f=i.get(h);if(h.version!==f.__version||c===true){n.activeTexture(t.TEXTURE0+a);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY);t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha);t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment);t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=y(r)&&M(r.image)===false;let i=v(r.image,e,false,u);i=it(r,i);const d=M(i)||o,p=s.convert(r.format,r.colorSpace);let m=s.convert(r.type),g=T(r.internalFormat,p,m,r.colorSpace);G(l,r,d);let _;const x=r.mipmaps;const w=o&&r.isVideoTexture!==true;const A=f.__version===undefined||c===true;const R=b(r,i,d);if(r.isDepthTexture){g=t.DEPTH_COMPONENT;if(o){if(r.type===vt){g=t.DEPTH_COMPONENT32F}else if(r.type===xt){g=t.DEPTH_COMPONENT24}else if(r.type===Et){g=t.DEPTH24_STENCIL8}else{g=t.DEPTH_COMPONENT16}}else{if(r.type===vt){console.error("WebGLRenderer: Floating point depth texture requires WebGL2.")}}if(r.format===Rt&&g===t.DEPTH_COMPONENT){if(r.type!==gt&&r.type!==xt){console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.");r.type=xt;m=s.convert(r.type)}}if(r.format===qt&&g===t.DEPTH_COMPONENT){g=t.DEPTH_STENCIL;if(r.type!==Et){console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.");r.type=Et;m=s.convert(r.type)}}if(A){if(w){n.texStorage2D(t.TEXTURE_2D,1,g,i.width,i.height)}else{n.texImage2D(t.TEXTURE_2D,0,g,i.width,i.height,0,p,m,null)}}}else if(r.isDataTexture){if(x.length>0&&d){if(w&&A){n.texStorage2D(t.TEXTURE_2D,R,g,x[0].width,x[0].height)}for(let e=0,i=x.length;e<i;e++){_=x[e];if(w){n.texSubImage2D(t.TEXTURE_2D,e,0,0,_.width,_.height,p,m,_.data)}else{n.texImage2D(t.TEXTURE_2D,e,g,_.width,_.height,0,p,m,_.data)}}r.generateMipmaps=false}else{if(w){if(A){n.texStorage2D(t.TEXTURE_2D,R,g,i.width,i.height)}n.texSubImage2D(t.TEXTURE_2D,0,0,0,i.width,i.height,p,m,i.data)}else{n.texImage2D(t.TEXTURE_2D,0,g,i.width,i.height,0,p,m,i.data)}}}else if(r.isCompressedTexture){if(r.isCompressedArrayTexture){if(w&&A){n.texStorage3D(t.TEXTURE_2D_ARRAY,R,g,x[0].width,x[0].height,i.depth)}for(let e=0,s=x.length;e<s;e++){_=x[e];if(r.format!==bt){if(p!==null){if(w){n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,_.width,_.height,i.depth,p,_.data,0,0)}else{n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,g,_.width,_.height,i.depth,0,_.data,0,0)}}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()")}}else{if(w){n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,_.width,_.height,i.depth,p,m,_.data)}else{n.texImage3D(t.TEXTURE_2D_ARRAY,e,g,_.width,_.height,i.depth,0,p,m,_.data)}}}}else{if(w&&A){n.texStorage2D(t.TEXTURE_2D,R,g,x[0].width,x[0].height)}for(let e=0,i=x.length;e<i;e++){_=x[e];if(r.format!==bt){if(p!==null){if(w){n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,_.width,_.height,p,_.data)}else{n.compressedTexImage2D(t.TEXTURE_2D,e,g,_.width,_.height,0,_.data)}}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()")}}else{if(w){n.texSubImage2D(t.TEXTURE_2D,e,0,0,_.width,_.height,p,m,_.data)}else{n.texImage2D(t.TEXTURE_2D,e,g,_.width,_.height,0,p,m,_.data)}}}}}else if(r.isDataArrayTexture){if(w){if(A){n.texStorage3D(t.TEXTURE_2D_ARRAY,R,g,i.width,i.height,i.depth)}n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,i.width,i.height,i.depth,p,m,i.data)}else{n.texImage3D(t.TEXTURE_2D_ARRAY,0,g,i.width,i.height,i.depth,0,p,m,i.data)}}else if(r.isData3DTexture){if(w){if(A){n.texStorage3D(t.TEXTURE_3D,R,g,i.width,i.height,i.depth)}n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,i.width,i.height,i.depth,p,m,i.data)}else{n.texImage3D(t.TEXTURE_3D,0,g,i.width,i.height,i.depth,0,p,m,i.data)}}else if(r.isFramebufferTexture){if(A){if(w){n.texStorage2D(t.TEXTURE_2D,R,g,i.width,i.height)}else{let e=i.width,r=i.height;for(let i=0;i<R;i++){n.texImage2D(t.TEXTURE_2D,i,g,e,r,0,p,m,null);e>>=1;r>>=1}}}}else{if(x.length>0&&d){if(w&&A){n.texStorage2D(t.TEXTURE_2D,R,g,x[0].width,x[0].height)}for(let e=0,i=x.length;e<i;e++){_=x[e];if(w){n.texSubImage2D(t.TEXTURE_2D,e,0,0,p,m,_)}else{n.texImage2D(t.TEXTURE_2D,e,g,p,m,_)}}r.generateMipmaps=false}else{if(w){if(A){n.texStorage2D(t.TEXTURE_2D,R,g,i.width,i.height)}n.texSubImage2D(t.TEXTURE_2D,0,0,0,p,m,i)}else{n.texImage2D(t.TEXTURE_2D,0,g,p,m,i)}}}if(S(r,d)){E(l)}f.__version=h.version;if(r.onUpdate)r.onUpdate(r)}e.__version=r.version}function W(e,r,a){if(r.image.length!==6)return;const l=V(e,r);const u=r.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const h=i.get(u);if(u.version!==h.__version||l===true){n.activeTexture(t.TEXTURE0+a);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY);t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha);t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment);t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture;const i=r.image[0]&&r.image[0].isDataTexture;const f=[];for(let t=0;t<6;t++){if(!e&&!i){f[t]=v(r.image[t],false,true,c)}else{f[t]=i?r.image[t].image:r.image[t]}f[t]=it(r,f[t])}const d=f[0],p=M(d)||o,m=s.convert(r.format,r.colorSpace),g=s.convert(r.type),_=T(r.internalFormat,m,g,r.colorSpace);const x=o&&r.isVideoTexture!==true;const y=h.__version===undefined||l===true;let w=b(r,d,p);G(t.TEXTURE_CUBE_MAP,r,p);let A;if(e){if(x&&y){n.texStorage2D(t.TEXTURE_CUBE_MAP,w,_,d.width,d.height)}for(let e=0;e<6;e++){A=f[e].mipmaps;for(let i=0;i<A.length;i++){const s=A[i];if(r.format!==bt){if(m!==null){if(x){n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,s.width,s.height,m,s.data)}else{n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,_,s.width,s.height,0,s.data)}}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()")}}else{if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,s.width,s.height,m,g,s.data)}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,_,s.width,s.height,0,m,g,s.data)}}}}}else{A=r.mipmaps;if(x&&y){if(A.length>0)w++;n.texStorage2D(t.TEXTURE_CUBE_MAP,w,_,f[0].width,f[0].height)}for(let e=0;e<6;e++){if(i){if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,f[e].width,f[e].height,m,g,f[e].data)}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,_,f[e].width,f[e].height,0,m,g,f[e].data)}for(let i=0;i<A.length;i++){const r=A[i];const s=r.image[e].image;if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,s.width,s.height,m,g,s.data)}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,_,s.width,s.height,0,m,g,s.data)}}}else{if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m,g,f[e])}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,_,m,g,f[e])}for(let i=0;i<A.length;i++){const r=A[i];if(x){n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,m,g,r.image[e])}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,_,m,g,r.image[e])}}}}}if(S(r,p)){E(t.TEXTURE_CUBE_MAP)}h.__version=u.version;if(r.onUpdate)r.onUpdate(r)}e.__version=r.version}function X(e,r,a,o,l){const c=s.convert(a.format,a.colorSpace);const u=s.convert(a.type);const h=T(a.internalFormat,c,u,a.colorSpace);const d=i.get(r);if(!d.__hasExternalTextures){if(l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY){n.texImage3D(l,0,h,r.width,r.height,r.depth,0,c,u,null)}else{n.texImage2D(l,0,h,r.width,r.height,0,c,u,null)}}n.bindFramebuffer(t.FRAMEBUFFER,e);if(et(r)){f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0,tt(r))}else if(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z){t.framebufferTexture2D(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0)}n.bindFramebuffer(t.FRAMEBUFFER,null)}function j(e,n,i){t.bindRenderbuffer(t.RENDERBUFFER,e);if(n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i||et(n)){const e=n.depthTexture;if(e&&e.isDepthTexture){if(e.type===vt){r=t.DEPTH_COMPONENT32F}else if(e.type===xt){r=t.DEPTH_COMPONENT24}}const i=tt(n);if(et(n)){f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height)}else{t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}}else{t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height)}t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=tt(n);if(i&&et(n)===false){t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height)}else if(et(n)){f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height)}else{t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height)}t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=n.isWebGLMultipleRenderTargets===true?n.texture:[n.texture];for(let r=0;r<e.length;r++){const a=e[r];const o=s.convert(a.format,a.colorSpace);const l=s.convert(a.type);const c=T(a.internalFormat,o,l,a.colorSpace);const u=tt(n);if(i&&et(n)===false){t.renderbufferStorageMultisample(t.RENDERBUFFER,u,c,n.width,n.height)}else if(et(n)){f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,c,n.width,n.height)}else{t.renderbufferStorage(t.RENDERBUFFER,c,n.width,n.height)}}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function Y(e,r){const s=r&&r.isWebGLCubeRenderTarget;if(s)throw new Error("Depth Texture with cube render targets is not supported");n.bindFramebuffer(t.FRAMEBUFFER,e);if(!(r.depthTexture&&r.depthTexture.isDepthTexture)){throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture")}if(!i.get(r.depthTexture).__webglTexture||r.depthTexture.image.width!==r.width||r.depthTexture.image.height!==r.height){r.depthTexture.image.width=r.width;r.depthTexture.image.height=r.height;r.depthTexture.needsUpdate=true}N(r.depthTexture,0);const a=i.get(r.depthTexture).__webglTexture;const o=tt(r);if(r.depthTexture.format===Rt){if(et(r)){f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0,o)}else{t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0)}}else if(r.depthTexture.format===qt){if(et(r)){f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0,o)}else{t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0)}}else{throw new Error("Unknown depthTexture format")}}function J(e){const r=i.get(e);const s=e.isWebGLCubeRenderTarget===true;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");Y(r.__webglFramebuffer,e)}else{if(s){r.__webglDepthbuffer=[];for(let i=0;i<6;i++){n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[i]);r.__webglDepthbuffer[i]=t.createRenderbuffer();j(r.__webglDepthbuffer[i],e,false)}}else{n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer);r.__webglDepthbuffer=t.createRenderbuffer();j(r.__webglDepthbuffer,e,false)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function Z(e,n,r){const s=i.get(e);if(n!==undefined){X(s.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D)}if(r!==undefined){J(e)}}function K(e){const l=e.texture;const c=i.get(e);const u=i.get(l);e.addEventListener("dispose",R);if(e.isWebGLMultipleRenderTargets!==true){if(u.__webglTexture===undefined){u.__webglTexture=t.createTexture()}u.__version=l.version;a.memory.textures++}const h=e.isWebGLCubeRenderTarget===true;const f=e.isWebGLMultipleRenderTargets===true;const d=M(e)||o;if(h){c.__webglFramebuffer=[];for(let e=0;e<6;e++){c.__webglFramebuffer[e]=t.createFramebuffer()}}else{c.__webglFramebuffer=t.createFramebuffer();if(f){if(r.drawBuffers){const n=e.texture;for(let e=0,r=n.length;e<r;e++){const r=i.get(n[e]);if(r.__webglTexture===undefined){r.__webglTexture=t.createTexture();a.memory.textures++}}}else{console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.")}}if(o&&e.samples>0&&et(e)===false){const i=f?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer();c.__webglColorRenderbuffer=[];n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n<i.length;n++){const r=i[n];c.__webglColorRenderbuffer[n]=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,c.__webglColorRenderbuffer[n]);const a=s.convert(r.format,r.colorSpace);const o=s.convert(r.type);const l=T(r.internalFormat,a,o,r.colorSpace,e.isXRRenderTarget===true);const u=tt(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,u,l,e.width,e.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,c.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null);if(e.depthBuffer){c.__webglDepthRenderbuffer=t.createRenderbuffer();j(c.__webglDepthRenderbuffer,e,true)}n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(h){n.bindTexture(t.TEXTURE_CUBE_MAP,u.__webglTexture);G(t.TEXTURE_CUBE_MAP,l,d);for(let n=0;n<6;n++){X(c.__webglFramebuffer[n],e,l,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n)}if(S(l,d)){E(t.TEXTURE_CUBE_MAP)}n.unbindTexture()}else if(f){const r=e.texture;for(let s=0,a=r.length;s<a;s++){const a=r[s];const o=i.get(a);n.bindTexture(t.TEXTURE_2D,o.__webglTexture);G(t.TEXTURE_2D,a,d);X(c.__webglFramebuffer,e,a,t.COLOR_ATTACHMENT0+s,t.TEXTURE_2D);if(S(a,d)){E(t.TEXTURE_2D)}}n.unbindTexture()}else{let i=t.TEXTURE_2D;if(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget){if(o){i=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY}else{console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")}}n.bindTexture(i,u.__webglTexture);G(i,l,d);X(c.__webglFramebuffer,e,l,t.COLOR_ATTACHMENT0,i);if(S(l,d)){E(i)}n.unbindTexture()}if(e.depthBuffer){J(e)}}function Q(e){const r=M(e)||o;const s=e.isWebGLMultipleRenderTargets===true?e.texture:[e.texture];for(let a=0,o=s.length;a<o;a++){const o=s[a];if(S(o,r)){const r=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D;const s=i.get(o).__webglTexture;n.bindTexture(r,s);E(r);n.unbindTexture()}}}function $(e){if(o&&e.samples>0&&et(e)===false){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture];const s=e.width;const a=e.height;let o=t.COLOR_BUFFER_BIT;const l=[];const c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;const u=i.get(e);const h=e.isWebGLMultipleRenderTargets===true;if(h){for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null);n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer);t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0)}}n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<r.length;n++){l.push(t.COLOR_ATTACHMENT0+n);if(e.depthBuffer){l.push(c)}const f=u.__ignoreDepthValues!==undefined?u.__ignoreDepthValues:false;if(f===false){if(e.depthBuffer)o|=t.DEPTH_BUFFER_BIT;if(e.stencilBuffer)o|=t.STENCIL_BUFFER_BIT}if(h){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n])}if(f===true){t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]);t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])}if(h){const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,s,a,0,0,s,a,o,t.NEAREST);if(d){t.invalidateFramebuffer(t.READ_FRAMEBUFFER,l)}}n.bindFramebuffer(t.READ_FRAMEBUFFER,null);n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null);if(h){for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const s=i.get(r[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer);t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,s,0)}}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}}function tt(t){return Math.min(h,t.samples)}function et(t){const n=i.get(t);return o&&t.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===true&&n.__useRenderToTexture!==false}function nt(t){const e=a.render.frame;if(p.get(t)!==e){p.set(t,e);t.update()}}function it(t,n){const i=t.colorSpace;const r=t.format;const s=t.type;if(t.isCompressedTexture===true||t.format===be)return n;if(i!==ve&&i!==_e){if(i===xe){if(o===false){if(e.has("EXT_sRGB")===true&&r===bt){t.format=be;t.minFilter=ut;t.generateMipmaps=false}else{n=en.sRGBToLinear(n)}}else{if(r!==bt||s!==dt){console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.")}}}else{console.error("THREE.WebGLTextures: Unsupported texture color space:",i)}}return n}this.allocateTextureUnit=D;this.resetTextureUnits=U;this.setTexture2D=N;this.setTexture2DArray=O;this.setTexture3D=F;this.setTextureCube=z;this.rebindTextures=Z;this.setupRenderTarget=K;this.updateRenderTargetMipmap=Q;this.updateMultisampleRenderTarget=$;this.setupDepthRenderbuffer=J;this.setupFrameBufferTexture=X;this.useMultisampledRTT=et}function eu(t,e,n){const i=n.isWebGL2;function r(n,r=_e){let s;if(n===dt)return t.UNSIGNED_BYTE;if(n===yt)return t.UNSIGNED_SHORT_4_4_4_4;if(n===St)return t.UNSIGNED_SHORT_5_5_5_1;if(n===pt)return t.BYTE;if(n===mt)return t.SHORT;if(n===gt)return t.UNSIGNED_SHORT;if(n===_t)return t.INT;if(n===xt)return t.UNSIGNED_INT;if(n===vt)return t.FLOAT;if(n===Mt){if(i)return t.HALF_FLOAT;s=e.get("OES_texture_half_float");if(s!==null){return s.HALF_FLOAT_OES}else{return null}}if(n===Tt)return t.ALPHA;if(n===bt)return t.RGBA;if(n===wt)return t.LUMINANCE;if(n===At)return t.LUMINANCE_ALPHA;if(n===Rt)return t.DEPTH_COMPONENT;if(n===qt)return t.DEPTH_STENCIL;if(n===be){s=e.get("EXT_sRGB");if(s!==null){return s.SRGB_ALPHA_EXT}else{return null}}if(n===Ct)return t.RED;if(n===Lt)return t.RED_INTEGER;if(n===Pt)return t.RG;if(n===Ut)return t.RG_INTEGER;if(n===Dt)return t.RGBA_INTEGER;if(n===It||n===Nt||n===Ot||n===Ft){if(r===xe){s=e.get("WEBGL_compressed_texture_s3tc_srgb");if(s!==null){if(n===It)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Nt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Ot)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ft)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{return null}}else{s=e.get("WEBGL_compressed_texture_s3tc");if(s!==null){if(n===It)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Nt)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Ot)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ft)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else{return null}}}if(n===zt||n===Bt||n===Ht||n===Gt){s=e.get("WEBGL_compressed_texture_pvrtc");if(s!==null){if(n===zt)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Bt)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ht)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Gt)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else{return null}}if(n===Vt){s=e.get("WEBGL_compressed_texture_etc1");if(s!==null){return s.COMPRESSED_RGB_ETC1_WEBGL}else{return null}}if(n===kt||n===Wt){s=e.get("WEBGL_compressed_texture_etc");if(s!==null){if(n===kt)return r===xe?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Wt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else{return null}}if(n===Xt||n===jt||n===Yt||n===Jt||n===Zt||n===Kt||n===Qt||n===$t||n===te||n===ee||n===ne||n===ie||n===re||n===se){s=e.get("WEBGL_compressed_texture_astc");if(s!==null){if(n===Xt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===jt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Yt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Jt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Zt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Kt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Qt)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===$t)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===te)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ee)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ne)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ie)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===re)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===se)return r===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else{return null}}if(n===ae){s=e.get("EXT_texture_compression_bptc");if(s!==null){if(n===ae)return r===xe?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else{return null}}if(n===oe||n===le||n===ce||n===ue){s=e.get("EXT_texture_compression_rgtc");if(s!==null){if(n===ae)return s.COMPRESSED_RED_RGTC1_EXT;if(n===le)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ce)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===ue)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else{return null}}if(n===Et){if(i)return t.UNSIGNED_INT_24_8;s=e.get("WEBGL_depth_texture");if(s!==null){return s.UNSIGNED_INT_24_8_WEBGL}else{return null}}return t[n]!==undefined?t[n]:null}return{convert:r}}class nu extends br{constructor(t=[]){super();this.isArrayCamera=true;this.cameras=t}}class iu extends di{constructor(){super();this.isGroup=true;this.type="Group"}}const ru={type:"move"};class su{constructor(){this._targetRay=null;this._grip=null;this._hand=null}getHandSpace(){if(this._hand===null){this._hand=new iu;this._hand.matrixAutoUpdate=false;this._hand.visible=false;this._hand.joints={};this._hand.inputState={pinching:false}}return this._hand}getTargetRaySpace(){if(this._targetRay===null){this._targetRay=new iu;this._targetRay.matrixAutoUpdate=false;this._targetRay.visible=false;this._targetRay.hasLinearVelocity=false;this._targetRay.linearVelocity=new fn;this._targetRay.hasAngularVelocity=false;this._targetRay.angularVelocity=new fn}return this._targetRay}getGripSpace(){if(this._grip===null){this._grip=new iu;this._grip.matrixAutoUpdate=false;this._grip.visible=false;this._grip.hasLinearVelocity=false;this._grip.linearVelocity=new fn;this._grip.hasAngularVelocity=false;this._grip.angularVelocity=new fn}return this._grip}dispatchEvent(t){if(this._targetRay!==null){this._targetRay.dispatchEvent(t)}if(this._grip!==null){this._grip.dispatchEvent(t)}if(this._hand!==null){this._hand.dispatchEvent(t)}return this}connect(t){if(t&&t.hand){const e=this._hand;if(e){for(const n of t.hand.values()){this._getHandJoint(e,n)}}}this.dispatchEvent({type:"connected",data:t});return this}disconnect(t){this.dispatchEvent({type:"disconnected",data:t});if(this._targetRay!==null){this._targetRay.visible=false}if(this._grip!==null){this._grip.visible=false}if(this._hand!==null){this._hand.visible=false}return this}update(t,e,n){let i=null;let r=null;let s=null;const a=this._targetRay;const o=this._grip;const l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){s=true;for(const i of t.hand.values()){const t=e.getJointPose(i,n);const r=this._getHandJoint(l,i);if(t!==null){r.matrix.fromArray(t.transform.matrix);r.matrix.decompose(r.position,r.rotation,r.scale);r.matrixWorldNeedsUpdate=true;r.jointRadius=t.radius}r.visible=t!==null}const i=l.joints["index-finger-tip"];const r=l.joints["thumb-tip"];const a=i.position.distanceTo(r.position);const o=.02;const c=.005;if(l.inputState.pinching&&a>o+c){l.inputState.pinching=false;this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})}else if(!l.inputState.pinching&&a<=o-c){l.inputState.pinching=true;this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this})}}else{if(o!==null&&t.gripSpace){r=e.getPose(t.gripSpace,n);if(r!==null){o.matrix.fromArray(r.transform.matrix);o.matrix.decompose(o.position,o.rotation,o.scale);o.matrixWorldNeedsUpdate=true;if(r.linearVelocity){o.hasLinearVelocity=true;o.linearVelocity.copy(r.linearVelocity)}else{o.hasLinearVelocity=false}if(r.angularVelocity){o.hasAngularVelocity=true;o.angularVelocity.copy(r.angularVelocity)}else{o.hasAngularVelocity=false}}}}if(a!==null){i=e.getPose(t.targetRaySpace,n);if(i===null&&r!==null){i=r}if(i!==null){a.matrix.fromArray(i.transform.matrix);a.matrix.decompose(a.position,a.rotation,a.scale);a.matrixWorldNeedsUpdate=true;if(i.linearVelocity){a.hasLinearVelocity=true;a.linearVelocity.copy(i.linearVelocity)}else{a.hasLinearVelocity=false}if(i.angularVelocity){a.hasAngularVelocity=true;a.angularVelocity.copy(i.angularVelocity)}else{a.hasAngularVelocity=false}this.dispatchEvent(ru)}}}if(a!==null){a.visible=i!==null}if(o!==null){o.visible=r!==null}if(l!==null){l.visible=s!==null}return this}_getHandJoint(t,e){if(t.joints[e.jointName]===undefined){const n=new iu;n.matrixAutoUpdate=false;n.visible=false;t.joints[e.jointName]=n;t.add(n)}return t.joints[e.jointName]}}class au extends an{constructor(t,e,n,i,r,s,a,o,l,c){c=c!==undefined?c:Rt;if(c!==Rt&&c!==qt){throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat")}if(n===undefined&&c===Rt)n=xt;if(n===undefined&&c===qt)n=Et;super(null,i,r,s,a,o,c,n,l);this.isDepthTexture=true;this.image={width:t,height:e};this.magFilter=a!==undefined?a:ot;this.minFilter=o!==undefined?o:ot;this.flipY=false;this.generateMipmaps=false}}class ou extends we{constructor(t,e){super();const n=this;let i=null;let r=1;let s=null;let a="local-floor";let o=1;let l=null;let c=null;let u=null;let h=null;let f=null;let d=null;const p=e.getContextAttributes();let m=null;let g=null;const _=[];const x=[];const v=new Set;const M=new Map;const y=new br;y.layers.enable(1);y.viewport=new on;const S=new br;S.layers.enable(2);S.viewport=new on;const E=[y,S];const T=new nu;T.layers.enable(1);T.layers.enable(2);let b=null;let w=null;this.cameraAutoUpdate=true;this.enabled=false;this.isPresenting=false;this.getController=function(t){let e=_[t];if(e===undefined){e=new su;_[t]=e}return e.getTargetRaySpace()};this.getControllerGrip=function(t){let e=_[t];if(e===undefined){e=new su;_[t]=e}return e.getGripSpace()};this.getHand=function(t){let e=_[t];if(e===undefined){e=new su;_[t]=e}return e.getHandSpace()};function A(t){const e=x.indexOf(t.inputSource);if(e===-1){return}const n=_[e];if(n!==undefined){n.update(t.inputSource,t.frame,l||s);n.dispatchEvent({type:t.type,data:t.inputSource})}}function R(){i.removeEventListener("select",A);i.removeEventListener("selectstart",A);i.removeEventListener("selectend",A);i.removeEventListener("squeeze",A);i.removeEventListener("squeezestart",A);i.removeEventListener("squeezeend",A);i.removeEventListener("end",R);i.removeEventListener("inputsourceschange",q);for(let t=0;t<_.length;t++){const e=x[t];if(e===null)continue;x[t]=null;_[t].disconnect(e)}b=null;w=null;t.setRenderTarget(m);f=null;h=null;u=null;i=null;g=null;O.stop();n.isPresenting=false;n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(t){r=t;if(n.isPresenting===true){console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")}};this.setReferenceSpaceType=function(t){a=t;if(n.isPresenting===true){console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")}};this.getReferenceSpace=function(){return l||s};this.setReferenceSpace=function(t){l=t};this.getBaseLayer=function(){return h!==null?h:f};this.getBinding=function(){return u};this.getFrame=function(){return d};this.getSession=function(){return i};this.setSession=async function(c){i=c;if(i!==null){m=t.getRenderTarget();i.addEventListener("select",A);i.addEventListener("selectstart",A);i.addEventListener("selectend",A);i.addEventListener("squeeze",A);i.addEventListener("squeezestart",A);i.addEventListener("squeezeend",A);i.addEventListener("end",R);i.addEventListener("inputsourceschange",q);if(p.xrCompatible!==true){await e.makeXRCompatible()}if(i.renderState.layers===undefined||t.capabilities.isWebGL2===false){const n={antialias:i.renderState.layers===undefined?p.antialias:true,alpha:true,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(i,e,n);i.updateRenderState({baseLayer:f});g=new ln(f.framebufferWidth,f.framebufferHeight,{format:bt,type:dt,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let n=null;let s=null;let a=null;if(p.depth){a=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24;n=p.stencil?qt:Rt;s=p.stencil?Et:xt}const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};u=new XRWebGLBinding(i,e);h=u.createProjectionLayer(o);i.updateRenderState({layers:[h]});g=new ln(h.textureWidth,h.textureHeight,{format:bt,type:dt,depthTexture:new au(h.textureWidth,h.textureHeight,s,undefined,undefined,undefined,undefined,undefined,undefined,n),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0});const l=t.properties.get(g);l.__ignoreDepthValues=h.ignoreDepthValues}g.isXRRenderTarget=true;this.setFoveation(o);l=null;s=await i.requestReferenceSpace(a);O.setContext(i);O.start();n.isPresenting=true;n.dispatchEvent({type:"sessionstart"})}};this.getEnvironmentBlendMode=function(){if(i!==null){return i.environmentBlendMode}};function q(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e];const i=x.indexOf(n);if(i>=0){x[i]=null;_[i].disconnect(n)}}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=x.indexOf(n);if(i===-1){for(let t=0;t<_.length;t++){if(t>=x.length){x.push(n);i=t;break}else if(x[t]===null){x[t]=n;i=t;break}}if(i===-1)break}const r=_[i];if(r){r.connect(n)}}}const C=new fn;const L=new fn;function P(t,e,n){C.setFromMatrixPosition(e.matrixWorld);L.setFromMatrixPosition(n.matrixWorld);const i=C.distanceTo(L);const r=e.projectionMatrix.elements;const s=n.projectionMatrix.elements;const a=r[14]/(r[10]-1);const o=r[14]/(r[10]+1);const l=(r[9]+1)/r[5];const c=(r[9]-1)/r[5];const u=(r[8]-1)/r[0];const h=(s[8]+1)/s[0];const f=a*u;const d=a*h;const p=i/(-u+h);const m=p*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale);t.translateX(m);t.translateZ(p);t.matrixWorld.compose(t.position,t.quaternion,t.scale);t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=a+p;const _=o+p;const x=f-m;const v=d+(i-m);const M=l*o/_*g;const y=c*o/_*g;t.projectionMatrix.makePerspective(x,v,M,y,g,_);t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}function U(t,e){if(e===null){t.matrixWorld.copy(t.matrix)}else{t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix)}t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(i===null)return;T.near=S.near=y.near=t.near;T.far=S.far=y.far=t.far;if(b!==T.near||w!==T.far){i.updateRenderState({depthNear:T.near,depthFar:T.far});b=T.near;w=T.far}const e=t.parent;const n=T.cameras;U(T,e);for(let t=0;t<n.length;t++){U(n[t],e)}if(n.length===2){P(T,y,S)}else{T.projectionMatrix.copy(y.projectionMatrix)}D(t,T,e)};function D(t,e,n){if(n===null){t.matrix.copy(e.matrixWorld)}else{t.matrix.copy(n.matrixWorld);t.matrix.invert();t.matrix.multiply(e.matrixWorld)}t.matrix.decompose(t.position,t.quaternion,t.scale);t.updateMatrixWorld(true);const i=t.children;for(let t=0,e=i.length;t<e;t++){i[t].updateMatrixWorld(true)}t.projectionMatrix.copy(e.projectionMatrix);t.projectionMatrixInverse.copy(e.projectionMatrixInverse);if(t.isPerspectiveCamera){t.fov=qe*2*Math.atan(1/t.projectionMatrix.elements[5]);t.zoom=1}}this.getCamera=function(){return T};this.getFoveation=function(){if(h===null&&f===null){return undefined}return o};this.setFoveation=function(t){o=t;if(h!==null){h.fixedFoveation=t}if(f!==null&&f.fixedFoveation!==undefined){f.fixedFoveation=t}};this.getPlanes=function(){return v};let I=null;function N(e,i){c=i.getViewerPose(l||s);d=i;if(c!==null){const e=c.views;if(f!==null){t.setRenderTargetFramebuffer(g,f.framebuffer);t.setRenderTarget(g)}let n=false;if(e.length!==T.cameras.length){T.cameras.length=0;n=true}for(let i=0;i<e.length;i++){const r=e[i];let s=null;if(f!==null){s=f.getViewport(r)}else{const e=u.getViewSubImage(h,r);s=e.viewport;if(i===0){t.setRenderTargetTextures(g,e.colorTexture,h.ignoreDepthValues?undefined:e.depthStencilTexture);t.setRenderTarget(g)}}let a=E[i];if(a===undefined){a=new br;a.layers.enable(i);a.viewport=new on;E[i]=a}a.matrix.fromArray(r.transform.matrix);a.matrix.decompose(a.position,a.quaternion,a.scale);a.projectionMatrix.fromArray(r.projectionMatrix);a.projectionMatrixInverse.copy(a.projectionMatrix).invert();a.viewport.set(s.x,s.y,s.width,s.height);if(i===0){T.matrix.copy(a.matrix);T.matrix.decompose(T.position,T.quaternion,T.scale)}if(n===true){T.cameras.push(a)}}}for(let t=0;t<_.length;t++){const e=x[t];const n=_[t];if(e!==null&&n!==undefined){n.update(e,i,l||s)}}if(I)I(e,i);if(i.detectedPlanes){n.dispatchEvent({type:"planesdetected",data:i.detectedPlanes});let t=null;for(const e of v){if(!i.detectedPlanes.has(e)){if(t===null){t=[]}t.push(e)}}if(t!==null){for(const e of t){v.delete(e);M.delete(e);n.dispatchEvent({type:"planeremoved",data:e})}}for(const t of i.detectedPlanes){if(!v.has(t)){v.add(t);M.set(t,i.lastChangedTime);n.dispatchEvent({type:"planeadded",data:t})}else{const e=M.get(t);if(t.lastChangedTime>e){M.set(t,t.lastChangedTime);n.dispatchEvent({type:"planechanged",data:t})}}}}d=null}const O=new Fr;O.setAnimationLoop(N);this.setAnimationLoop=function(t){I=t};this.dispose=function(){}}}function lu(t,e){function n(t,e){if(t.matrixAutoUpdate===true){t.updateMatrix()}e.value.copy(t.matrix)}function i(e,n){n.color.getRGB(e.fogColor.value,vr(t));if(n.isFog){e.fogNear.value=n.near;e.fogFar.value=n.far}else if(n.isFogExp2){e.fogDensity.value=n.density}}function r(t,e,n,i,r){if(e.isMeshBasicMaterial){s(t,e)}else if(e.isMeshLambertMaterial){s(t,e)}else if(e.isMeshToonMaterial){s(t,e);f(t,e)}else if(e.isMeshPhongMaterial){s(t,e);u(t,e)}else if(e.isMeshStandardMaterial){s(t,e);d(t,e);if(e.isMeshPhysicalMaterial){p(t,e,r)}}else if(e.isMeshMatcapMaterial){s(t,e);m(t,e)}else if(e.isMeshDepthMaterial){s(t,e)}else if(e.isMeshDistanceMaterial){s(t,e);g(t,e)}else if(e.isMeshNormalMaterial){s(t,e)}else if(e.isLineBasicMaterial){a(t,e);if(e.isLineDashedMaterial){o(t,e)}}else if(e.isPointsMaterial){l(t,e,n,i)}else if(e.isSpriteMaterial){c(t,e)}else if(e.isShadowMaterial){t.color.value.copy(e.color);t.opacity.value=e.opacity}else if(e.isShaderMaterial){e.uniformsNeedUpdate=false}}function s(i,r){i.opacity.value=r.opacity;if(r.color){i.diffuse.value.copy(r.color)}if(r.emissive){i.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity)}if(r.map){i.map.value=r.map;n(r.map,i.mapTransform)}if(r.alphaMap){i.alphaMap.value=r.alphaMap;n(r.alphaMap,i.alphaMapTransform)}if(r.bumpMap){i.bumpMap.value=r.bumpMap;n(r.bumpMap,i.bumpMapTransform);i.bumpScale.value=r.bumpScale;if(r.side===h){i.bumpScale.value*=-1}}if(r.normalMap){i.normalMap.value=r.normalMap;n(r.normalMap,i.normalMapTransform);i.normalScale.value.copy(r.normalScale);if(r.side===h){i.normalScale.value.negate()}}if(r.displacementMap){i.displacementMap.value=r.displacementMap;n(r.displacementMap,i.displacementMapTransform);i.displacementScale.value=r.displacementScale;i.displacementBias.value=r.displacementBias}if(r.emissiveMap){i.emissiveMap.value=r.emissiveMap;n(r.emissiveMap,i.emissiveMapTransform)}if(r.specularMap){i.specularMap.value=r.specularMap;n(r.specularMap,i.specularMapTransform)}if(r.alphaTest>0){i.alphaTest.value=r.alphaTest}const s=e.get(r).envMap;if(s){i.envMap.value=s;i.flipEnvMap.value=s.isCubeTexture&&s.isRenderTargetTexture===false?-1:1;i.reflectivity.value=r.reflectivity;i.ior.value=r.ior;i.refractionRatio.value=r.refractionRatio}if(r.lightMap){i.lightMap.value=r.lightMap;const e=t.useLegacyLights===true?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e;n(r.lightMap,i.lightMapTransform)}if(r.aoMap){i.aoMap.value=r.aoMap;i.aoMapIntensity.value=r.aoMapIntensity;n(r.aoMap,i.aoMapTransform)}}function a(t,e){t.diffuse.value.copy(e.color);t.opacity.value=e.opacity;if(e.map){t.map.value=e.map;n(e.map,t.mapTransform)}}function o(t,e){t.dashSize.value=e.dashSize;t.totalSize.value=e.dashSize+e.gapSize;t.scale.value=e.scale}function l(t,e,i,r){t.diffuse.value.copy(e.color);t.opacity.value=e.opacity;t.size.value=e.size*i;t.scale.value=r*.5;if(e.map){t.map.value=e.map;n(e.map,t.uvTransform)}if(e.alphaMap){t.alphaMap.value=e.alphaMap}if(e.alphaTest>0){t.alphaTest.value=e.alphaTest}}function c(t,e){t.diffuse.value.copy(e.color);t.opacity.value=e.opacity;t.rotation.value=e.rotation;if(e.map){t.map.value=e.map;n(e.map,t.mapTransform)}if(e.alphaMap){t.alphaMap.value=e.alphaMap}if(e.alphaTest>0){t.alphaTest.value=e.alphaTest}}function u(t,e){t.specular.value.copy(e.specular);t.shininess.value=Math.max(e.shininess,1e-4)}function f(t,e){if(e.gradientMap){t.gradientMap.value=e.gradientMap}}function d(t,i){t.metalness.value=i.metalness;if(i.metalnessMap){t.metalnessMap.value=i.metalnessMap;n(i.metalnessMap,t.metalnessMapTransform)}t.roughness.value=i.roughness;if(i.roughnessMap){t.roughnessMap.value=i.roughnessMap;n(i.roughnessMap,t.roughnessMapTransform)}const r=e.get(i).envMap;if(r){t.envMapIntensity.value=i.envMapIntensity}}function p(t,e,i){t.ior.value=e.ior;if(e.sheen>0){t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen);t.sheenRoughness.value=e.sheenRoughness;if(e.sheenColorMap){t.sheenColorMap.value=e.sheenColorMap;n(e.sheenColorMap,t.sheenColorMapTransform)}if(e.sheenRoughnessMap){t.sheenRoughnessMap.value=e.sheenRoughnessMap;n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)}}if(e.clearcoat>0){t.clearcoat.value=e.clearcoat;t.clearcoatRoughness.value=e.clearcoatRoughness;if(e.clearcoatMap){t.clearcoatMap.value=e.clearcoatMap;n(e.clearcoatMap,t.clearcoatMapTransform)}if(e.clearcoatRoughnessMap){t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap;n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)}if(e.clearcoatNormalMap){t.clearcoatNormalMap.value=e.clearcoatNormalMap;n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform);t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale);if(e.side===h){t.clearcoatNormalScale.value.negate()}}}if(e.iridescence>0){t.iridescence.value=e.iridescence;t.iridescenceIOR.value=e.iridescenceIOR;t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0];t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1];if(e.iridescenceMap){t.iridescenceMap.value=e.iridescenceMap;n(e.iridescenceMap,t.iridescenceMapTransform)}if(e.iridescenceThicknessMap){t.iridescenceThicknessMap.value=e.iridescenceThicknessMap;n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)}}if(e.transmission>0){t.transmission.value=e.transmission;t.transmissionSamplerMap.value=i.texture;t.transmissionSamplerSize.value.set(i.width,i.height);if(e.transmissionMap){t.transmissionMap.value=e.transmissionMap;n(e.transmissionMap,t.transmissionMapTransform)}t.thickness.value=e.thickness;if(e.thicknessMap){t.thicknessMap.value=e.thicknessMap;n(e.thicknessMap,t.thicknessMapTransform)}t.attenuationDistance.value=e.attenuationDistance;t.attenuationColor.value.copy(e.attenuationColor)}t.specularIntensity.value=e.specularIntensity;t.specularColor.value.copy(e.specularColor);if(e.specularColorMap){t.specularColorMap.value=e.specularColorMap;n(e.specularColorMap,t.specularColorMapTransform)}if(e.specularIntensityMap){t.specularIntensityMap.value=e.specularIntensityMap;n(e.specularIntensityMap,t.specularIntensityMapTransform)}}function m(t,e){if(e.matcap){t.matcap.value=e.matcap}}function g(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld);t.nearDistance.value=i.shadow.camera.near;t.farDistance.value=i.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function cu(t,e,n,i){let r={};let s={};let a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e){const n=e.program;i.uniformBlockBinding(t,n)}function c(t,n){let a=r[t.id];if(a===undefined){p(t);a=u(t);r[t.id]=a;t.addEventListener("dispose",g)}const o=n.program;i.updateUBOMapping(t,o);const l=e.render.frame;if(s[t.id]!==l){f(t);s[t.id]=l}}function u(e){const n=h();e.__bindingPointIndex=n;const i=t.createBuffer();const r=e.__size;const s=e.usage;t.bindBuffer(t.UNIFORM_BUFFER,i);t.bufferData(t.UNIFORM_BUFFER,r,s);t.bindBuffer(t.UNIFORM_BUFFER,null);t.bindBufferBase(t.UNIFORM_BUFFER,n,i);return i}function h(){for(let t=0;t<o;t++){if(a.indexOf(t)===-1){a.push(t);return t}}console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.");return 0}function f(e){const n=r[e.id];const i=e.uniforms;const s=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=i.length;e<n;e++){const n=i[e];if(d(n,e,s)===true){const e=n.__offset;const i=Array.isArray(n.value)?n.value:[n.value];let r=0;for(let s=0;s<i.length;s++){const a=i[s];const o=m(a);if(typeof a==="number"){n.__data[0]=a;t.bufferSubData(t.UNIFORM_BUFFER,e+r,n.__data)}else if(a.isMatrix3){n.__data[0]=a.elements[0];n.__data[1]=a.elements[1];n.__data[2]=a.elements[2];n.__data[3]=a.elements[0];n.__data[4]=a.elements[3];n.__data[5]=a.elements[4];n.__data[6]=a.elements[5];n.__data[7]=a.elements[0];n.__data[8]=a.elements[6];n.__data[9]=a.elements[7];n.__data[10]=a.elements[8];n.__data[11]=a.elements[0]}else{a.toArray(n.__data,r);r+=o.storage/Float32Array.BYTES_PER_ELEMENT}}t.bufferSubData(t.UNIFORM_BUFFER,e,n.__data)}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function d(t,e,n){const i=t.value;if(n[e]===undefined){if(typeof i==="number"){n[e]=i}else{const t=Array.isArray(i)?i:[i];const r=[];for(let e=0;e<t.length;e++){r.push(t[e].clone())}n[e]=r}return true}else{if(typeof i==="number"){if(n[e]!==i){n[e]=i;return true}}else{const t=Array.isArray(n[e])?n[e]:[n[e]];const r=Array.isArray(i)?i:[i];for(let e=0;e<t.length;e++){const n=t[e];if(n.equals(r[e])===false){n.copy(r[e]);return true}}}}return false}function p(t){const e=t.uniforms;let n=0;const i=16;let r=0;for(let t=0,s=e.length;t<s;t++){const s=e[t];const a={boundary:0,storage:0};const o=Array.isArray(s.value)?s.value:[s.value];for(let t=0,e=o.length;t<e;t++){const e=o[t];const n=m(e);a.boundary+=n.boundary;a.storage+=n.storage}s.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT);s.__offset=n;if(t>0){r=n%i;const t=i-r;if(r!==0&&t-a.boundary<0){n+=i-r;s.__offset=n}}n+=a.storage}r=n%i;if(r>0)n+=i-r;t.__size=n;t.__cache={};return this}function m(t){const e={boundary:0,storage:0};if(typeof t==="number"){e.boundary=4;e.storage=4}else if(t.isVector2){e.boundary=8;e.storage=8}else if(t.isVector3||t.isColor){e.boundary=16;e.storage=12}else if(t.isVector4){e.boundary=16;e.storage=16}else if(t.isMatrix3){e.boundary=48;e.storage=48}else if(t.isMatrix4){e.boundary=64;e.storage=64}else if(t.isTexture){console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.")}else{console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t)}return e}function g(e){const n=e.target;n.removeEventListener("dispose",g);const i=a.indexOf(n.__bindingPointIndex);a.splice(i,1);t.deleteBuffer(r[n.id]);delete r[n.id];delete s[n.id]}function _(){for(const e in r){t.deleteBuffer(r[e])}a=[];r={};s={}}return{bind:l,update:c,dispose:_}}function uu(){const t=Ge("canvas");t.style.display="block";return t}class hu{constructor(t={}){const{canvas:n=uu(),context:i=null,depth:r=true,stencil:s=true,alpha:a=false,antialias:o=false,premultipliedAlpha:l=true,preserveDrawingBuffer:c=false,powerPreference:d="default",failIfMajorPerformanceCaveat:p=false}=t;this.isWebGLRenderer=true;let m;if(i!==null){m=i.getContextAttributes().alpha}else{m=a}let g=null;let _=null;const x=[];const v=[];this.domElement=n;this.debug={checkShaderErrors:true,onShaderError:null};this.autoClear=true;this.autoClearColor=true;this.autoClearDepth=true;this.autoClearStencil=true;this.sortObjects=true;this.clippingPlanes=[];this.localClippingEnabled=false;this.outputColorSpace=xe;this.useLegacyLights=true;this.toneMapping=X;this.toneMappingExposure=1;const M=this;let y=false;let S=0;let E=0;let T=null;let b=-1;let w=null;const A=new on;const R=new on;let q=null;let C=n.width;let L=n.height;let P=1;let U=null;let D=null;const I=new on(0,0,C,L);const N=new on(0,0,C,L);let O=false;const F=new Or;let z=false;let B=false;let H=null;const G=new Gn;const V=new fn;const k={background:null,fog:null,environment:null,overrideMaterial:null,isScene:true};function W(){return T===null?P:1}let j=i;function Y(t,e){for(let i=0;i<t.length;i++){const r=t[i];const s=n.getContext(r,e);if(s!==null)return s}return null}try{const t={alpha:true,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:d,failIfMajorPerformanceCaveat:p};if("setAttribute"in n)n.setAttribute("data-engine",`three.js r${e}`);n.addEventListener("webglcontextlost",wt,false);n.addEventListener("webglcontextrestored",At,false);n.addEventListener("webglcontextcreationerror",Rt,false);if(j===null){const e=["webgl2","webgl","experimental-webgl"];if(M.isWebGL1Renderer===true){e.shift()}j=Y(e,t);if(j===null){if(Y(e)){throw new Error("Error creating WebGL context with your selected attributes.")}else{throw new Error("Error creating WebGL context.")}}}if(j.getShaderPrecisionFormat===undefined){j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}}}catch(t){console.error("THREE.WebGLRenderer: "+t.message);throw t}let J,Z,K,Q;let $,tt,et,nt,it,rt,st;let at,ot,lt,ct,ut,ht;let pt,mt,gt,_t;let xt,yt,St;function Et(){J=new Xo(j);Z=new To(j,J,t);J.init(Z);xt=new eu(j,J,Z);K=new $c(j,J,Z);Q=new Jo(j);$=new Nc;tt=new tu(j,J,K,$,Z,xt,Q);et=new wo(M);nt=new Wo(M);it=new zr(j,Z);yt=new So(j,J,it,Z);rt=new jo(j,it,Q,yt);st=new $o(j,rt,it,Q);mt=new Qo(j,Z,tt);ut=new bo($);at=new Ic(M,et,nt,J,Z,yt,ut);ot=new lu(M,$);lt=new Bc;ct=new jc(J,Z);pt=new yo(M,et,nt,K,st,m,l);ht=new Qc(M,st,Z);St=new cu(j,Q,Z,K);gt=new Eo(j,J,Q,Z);_t=new Yo(j,J,Q,Z);Q.programs=at.programs;M.capabilities=Z;M.extensions=J;M.properties=$;M.renderLists=lt;M.shadowMap=ht;M.state=K;M.info=Q}Et();const Tt=new ou(M,j);this.xr=Tt;this.getContext=function(){return j};this.getContextAttributes=function(){return j.getContextAttributes()};this.forceContextLoss=function(){const t=J.get("WEBGL_lose_context");if(t)t.loseContext()};this.forceContextRestore=function(){const t=J.get("WEBGL_lose_context");if(t)t.restoreContext()};this.getPixelRatio=function(){return P};this.setPixelRatio=function(t){if(t===undefined)return;P=t;this.setSize(C,L,false)};this.getSize=function(t){return t.set(C,L)};this.setSize=function(t,e,i=true){if(Tt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}C=t;L=e;n.width=Math.floor(t*P);n.height=Math.floor(e*P);if(i===true){n.style.width=t+"px";n.style.height=e+"px"}this.setViewport(0,0,t,e)};this.getDrawingBufferSize=function(t){return t.set(C*P,L*P).floor()};this.setDrawingBufferSize=function(t,e,i){C=t;L=e;P=i;n.width=Math.floor(t*i);n.height=Math.floor(e*i);this.setViewport(0,0,t,e)};this.getCurrentViewport=function(t){return t.copy(A)};this.getViewport=function(t){return t.copy(I)};this.setViewport=function(t,e,n,i){if(t.isVector4){I.set(t.x,t.y,t.z,t.w)}else{I.set(t,e,n,i)}K.viewport(A.copy(I).multiplyScalar(P).floor())};this.getScissor=function(t){return t.copy(N)};this.setScissor=function(t,e,n,i){if(t.isVector4){N.set(t.x,t.y,t.z,t.w)}else{N.set(t,e,n,i)}K.scissor(R.copy(N).multiplyScalar(P).floor())};this.getScissorTest=function(){return O};this.setScissorTest=function(t){K.setScissorTest(O=t)};this.setOpaqueSort=function(t){U=t};this.setTransparentSort=function(t){D=t};this.getClearColor=function(t){return t.copy(pt.getClearColor())};this.setClearColor=function(){pt.setClearColor.apply(pt,arguments)};this.getClearAlpha=function(){return pt.getClearAlpha()};this.setClearAlpha=function(){pt.setClearAlpha.apply(pt,arguments)};this.clear=function(t=true,e=true,n=true){let i=0;if(t)i|=j.COLOR_BUFFER_BIT;if(e)i|=j.DEPTH_BUFFER_BIT;if(n)i|=j.STENCIL_BUFFER_BIT;j.clear(i)};this.clearColor=function(){this.clear(true,false,false)};this.clearDepth=function(){this.clear(false,true,false)};this.clearStencil=function(){this.clear(false,false,true)};this.dispose=function(){n.removeEventListener("webglcontextlost",wt,false);n.removeEventListener("webglcontextrestored",At,false);n.removeEventListener("webglcontextcreationerror",Rt,false);lt.dispose();ct.dispose();$.dispose();et.dispose();nt.dispose();st.dispose();yt.dispose();St.dispose();at.dispose();Tt.dispose();Tt.removeEventListener("sessionstart",Dt);Tt.removeEventListener("sessionend",It);if(H){H.dispose();H=null}Nt.stop()};function wt(t){t.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");y=true}function At(){console.log("THREE.WebGLRenderer: Context Restored.");y=false;const t=Q.autoReset;const e=ht.enabled;const n=ht.autoUpdate;const i=ht.needsUpdate;const r=ht.type;Et();Q.autoReset=t;ht.enabled=e;ht.autoUpdate=n;ht.needsUpdate=i;ht.type=r}function Rt(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function qt(t){const e=t.target;e.removeEventListener("dispose",qt);Ct(e)}function Ct(t){Lt(t);$.remove(t)}function Lt(t){const e=$.get(t).programs;if(e!==undefined){e.forEach((function(t){at.releaseProgram(t)}));if(t.isShaderMaterial){at.releaseShaderCache(t)}}}this.renderBufferDirect=function(t,e,n,i,r,s){if(e===null)e=k;const a=r.isMesh&&r.matrixWorld.determinant()<0;const o=kt(t,e,n,i,r);K.setMaterial(i,a);let l=n.index;let c=1;if(i.wireframe===true){l=rt.getWireframeAttribute(n);c=2}const u=n.drawRange;const h=n.attributes.position;let f=u.start*c;let d=(u.start+u.count)*c;if(s!==null){f=Math.max(f,s.start*c);d=Math.min(d,(s.start+s.count)*c)}if(l!==null){f=Math.max(f,0);d=Math.min(d,l.count)}else if(h!==undefined&&h!==null){f=Math.max(f,0);d=Math.min(d,h.count)}const p=d-f;if(p<0||p===Infinity)return;yt.setup(r,i,o,n,l);let m;let g=gt;if(l!==null){m=it.get(l);g=_t;g.setIndex(m)}if(r.isMesh){if(i.wireframe===true){K.setLineWidth(i.wireframeLinewidth*W());g.setMode(j.LINES)}else{g.setMode(j.TRIANGLES)}}else if(r.isLine){let t=i.linewidth;if(t===undefined)t=1;K.setLineWidth(t*W());if(r.isLineSegments){g.setMode(j.LINES)}else if(r.isLineLoop){g.setMode(j.LINE_LOOP)}else{g.setMode(j.LINE_STRIP)}}else if(r.isPoints){g.setMode(j.POINTS)}else if(r.isSprite){g.setMode(j.TRIANGLES)}if(r.isInstancedMesh){g.renderInstances(f,p,r.count)}else if(n.isInstancedBufferGeometry){const t=n._maxInstanceCount!==undefined?n._maxInstanceCount:Infinity;const e=Math.min(n.instanceCount,t);g.renderInstances(f,p,e)}else{g.render(f,p)}};this.compile=function(t,e){function n(t,e,n){if(t.transparent===true&&t.side===f&&t.forceSinglePass===false){t.side=h;t.needsUpdate=true;Gt(t,e,n);t.side=u;t.needsUpdate=true;Gt(t,e,n);t.side=f}else{Gt(t,e,n)}}_=ct.get(t);_.init();v.push(_);t.traverseVisible((function(t){if(t.isLight&&t.layers.test(e.layers)){_.pushLight(t);if(t.castShadow){_.pushShadow(t)}}}));_.setupLights(M.useLegacyLights);t.traverse((function(e){const i=e.material;if(i){if(Array.isArray(i)){for(let r=0;r<i.length;r++){const s=i[r];n(s,t,e)}}else{n(i,t,e)}}}));v.pop();_=null};let Pt=null;function Ut(t){if(Pt)Pt(t)}function Dt(){Nt.stop()}function It(){Nt.start()}const Nt=new Fr;Nt.setAnimationLoop(Ut);if(typeof self!=="undefined")Nt.setContext(self);this.setAnimationLoop=function(t){Pt=t;Tt.setAnimationLoop(t);t===null?Nt.stop():Nt.start()};Tt.addEventListener("sessionstart",Dt);Tt.addEventListener("sessionend",It);this.render=function(t,e){if(e!==undefined&&e.isCamera!==true){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(y===true)return;if(t.matrixWorldAutoUpdate===true)t.updateMatrixWorld();if(e.parent===null&&e.matrixWorldAutoUpdate===true)e.updateMatrixWorld();if(Tt.enabled===true&&Tt.isPresenting===true){if(Tt.cameraAutoUpdate===true)Tt.updateCamera(e);e=Tt.getCamera()}if(t.isScene===true)t.onBeforeRender(M,t,e,T);_=ct.get(t,v.length);_.init();v.push(_);G.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse);F.setFromProjectionMatrix(G);B=this.localClippingEnabled;z=ut.init(this.clippingPlanes,B);g=lt.get(t,x.length);g.init();x.push(g);Ot(t,e,0,M.sortObjects);g.finish();if(M.sortObjects===true){g.sort(U,D)}if(z===true)ut.beginShadows();const n=_.state.shadowsArray;ht.render(n,t,e);if(z===true)ut.endShadows();if(this.info.autoReset===true)this.info.reset();pt.render(g,t);_.setupLights(M.useLegacyLights);if(e.isArrayCamera){const n=e.cameras;for(let e=0,i=n.length;e<i;e++){const i=n[e];Ft(g,t,i,i.viewport)}}else{Ft(g,t,e)}if(T!==null){tt.updateMultisampleRenderTarget(T);tt.updateRenderTargetMipmap(T)}if(t.isScene===true)t.onAfterRender(M,t,e);yt.resetDefaultState();b=-1;w=null;v.pop();if(v.length>0){_=v[v.length-1]}else{_=null}x.pop();if(x.length>0){g=x[x.length-1]}else{g=null}};function Ot(t,e,n,i){if(t.visible===false)return;const r=t.layers.test(e.layers);if(r){if(t.isGroup){n=t.renderOrder}else if(t.isLOD){if(t.autoUpdate===true)t.update(e)}else if(t.isLight){_.pushLight(t);if(t.castShadow){_.pushShadow(t)}}else if(t.isSprite){if(!t.frustumCulled||F.intersectsSprite(t)){if(i){V.setFromMatrixPosition(t.matrixWorld).applyMatrix4(G)}const e=st.update(t);const r=t.material;if(r.visible){g.push(t,e,r,n,V.z,null)}}}else if(t.isMesh||t.isLine||t.isPoints){if(!t.frustumCulled||F.intersectsObject(t)){if(t.isSkinnedMesh){if(t.skeleton.frame!==Q.render.frame){t.skeleton.update();t.skeleton.frame=Q.render.frame}}const e=st.update(t);const r=t.material;if(i){if(e.boundingSphere===null)e.computeBoundingSphere();V.copy(e.boundingSphere.center).applyMatrix4(t.matrixWorld).applyMatrix4(G)}if(Array.isArray(r)){const i=e.groups;for(let s=0,a=i.length;s<a;s++){const a=i[s];const o=r[a.materialIndex];if(o&&o.visible){g.push(t,e,o,n,V.z,a)}}}else if(r.visible){g.push(t,e,r,n,V.z,null)}}}}const s=t.children;for(let t=0,r=s.length;t<r;t++){Ot(s[t],e,n,i)}}function Ft(t,e,n,i){const r=t.opaque;const s=t.transmissive;const a=t.transparent;_.setupLightsView(n);if(z===true)ut.setGlobalState(M.clippingPlanes,n);if(s.length>0)zt(r,s,e,n);if(i)K.viewport(A.copy(i));if(r.length>0)Bt(r,e,n);if(s.length>0)Bt(s,e,n);if(a.length>0)Bt(a,e,n);K.buffers.depth.setTest(true);K.buffers.depth.setMask(true);K.buffers.color.setMask(true);K.setPolygonOffset(false)}function zt(t,e,n,i){if(H===null){const t=Z.isWebGL2;H=new ln(1024,1024,{generateMipmaps:true,type:J.has("EXT_color_buffer_half_float")?Mt:dt,minFilter:ft,samples:t&&o===true?4:0})}const r=M.getRenderTarget();M.setRenderTarget(H);M.clear();const s=M.toneMapping;M.toneMapping=X;Bt(t,n,i);tt.updateMultisampleRenderTarget(H);tt.updateRenderTargetMipmap(H);let a=false;for(let t=0,r=e.length;t<r;t++){const r=e[t];const s=r.object;const o=r.geometry;const l=r.material;const c=r.group;if(l.side===f&&s.layers.test(i.layers)){const t=l.side;l.side=h;l.needsUpdate=true;Ht(s,n,i,o,l,c);l.side=t;l.needsUpdate=true;a=true}}if(a===true){tt.updateMultisampleRenderTarget(H);tt.updateRenderTargetMipmap(H)}M.setRenderTarget(r);M.toneMapping=s}function Bt(t,e,n){const i=e.isScene===true?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){const s=t[r];const a=s.object;const o=s.geometry;const l=i===null?s.material:i;const c=s.group;if(a.layers.test(n.layers)){Ht(a,e,n,o,l,c)}}}function Ht(t,e,n,i,r,s){t.onBeforeRender(M,e,n,i,r,s);t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld);t.normalMatrix.getNormalMatrix(t.modelViewMatrix);r.onBeforeRender(M,e,n,i,t,s);if(r.transparent===true&&r.side===f&&r.forceSinglePass===false){r.side=h;r.needsUpdate=true;M.renderBufferDirect(n,e,i,r,t,s);r.side=u;r.needsUpdate=true;M.renderBufferDirect(n,e,i,r,t,s);r.side=f}else{M.renderBufferDirect(n,e,i,r,t,s)}t.onAfterRender(M,e,n,i,r,s)}function Gt(t,e,n){if(e.isScene!==true)e=k;const i=$.get(t);const r=_.state.lights;const s=_.state.shadowsArray;const a=r.state.version;const o=at.getParameters(t,r.state,s,e,n);const l=at.getProgramCacheKey(o);let c=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null;i.fog=e.fog;i.envMap=(t.isMeshStandardMaterial?nt:et).get(t.envMap||i.environment);if(c===undefined){t.addEventListener("dispose",qt);c=new Map;i.programs=c}let u=c.get(l);if(u!==undefined){if(i.currentProgram===u&&i.lightsStateVersion===a){Vt(t,o);return u}}else{o.uniforms=at.getUniforms(t);t.onBuild(n,o,M);t.onBeforeCompile(o,M);u=at.acquireProgram(o,l);c.set(l,u);i.uniforms=o.uniforms}const h=i.uniforms;if(!t.isShaderMaterial&&!t.isRawShaderMaterial||t.clipping===true){h.clippingPlanes=ut.uniform}Vt(t,o);i.needsLights=Xt(t);i.lightsStateVersion=a;if(i.needsLights){h.ambientLightColor.value=r.state.ambient;h.lightProbe.value=r.state.probe;h.directionalLights.value=r.state.directional;h.directionalLightShadows.value=r.state.directionalShadow;h.spotLights.value=r.state.spot;h.spotLightShadows.value=r.state.spotShadow;h.rectAreaLights.value=r.state.rectArea;h.ltc_1.value=r.state.rectAreaLTC1;h.ltc_2.value=r.state.rectAreaLTC2;h.pointLights.value=r.state.point;h.pointLightShadows.value=r.state.pointShadow;h.hemisphereLights.value=r.state.hemi;h.directionalShadowMap.value=r.state.directionalShadowMap;h.directionalShadowMatrix.value=r.state.directionalShadowMatrix;h.spotShadowMap.value=r.state.spotShadowMap;h.spotLightMatrix.value=r.state.spotLightMatrix;h.spotLightMap.value=r.state.spotLightMap;h.pointShadowMap.value=r.state.pointShadowMap;h.pointShadowMatrix.value=r.state.pointShadowMatrix}const f=u.getUniforms();const d=sc.seqWithValue(f.seq,h);i.currentProgram=u;i.uniformsList=d;return u}function Vt(t,e){const n=$.get(t);n.outputColorSpace=e.outputColorSpace;n.instancing=e.instancing;n.skinning=e.skinning;n.morphTargets=e.morphTargets;n.morphNormals=e.morphNormals;n.morphColors=e.morphColors;n.morphTargetsCount=e.morphTargetsCount;n.numClippingPlanes=e.numClippingPlanes;n.numIntersection=e.numClipIntersection;n.vertexAlphas=e.vertexAlphas;n.vertexTangents=e.vertexTangents;n.toneMapping=e.toneMapping}function kt(t,e,n,i,r){if(e.isScene!==true)e=k;tt.resetTextureUnits();const s=e.fog;const a=i.isMeshStandardMaterial?e.environment:null;const o=T===null?M.outputColorSpace:T.isXRRenderTarget===true?T.texture.colorSpace:ve;const l=(i.isMeshStandardMaterial?nt:et).get(i.envMap||a);const c=i.vertexColors===true&&!!n.attributes.color&&n.attributes.color.itemSize===4;const u=!!i.normalMap&&!!n.attributes.tangent;const h=!!n.morphAttributes.position;const f=!!n.morphAttributes.normal;const d=!!n.morphAttributes.color;const p=i.toneMapped?M.toneMapping:X;const m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color;const g=m!==undefined?m.length:0;const x=$.get(i);const v=_.state.lights;if(z===true){if(B===true||t!==w){const e=t===w&&i.id===b;ut.setState(i,t,e)}}let y=false;if(i.version===x.__version){if(x.needsLights&&x.lightsStateVersion!==v.state.version){y=true}else if(x.outputColorSpace!==o){y=true}else if(r.isInstancedMesh&&x.instancing===false){y=true}else if(!r.isInstancedMesh&&x.instancing===true){y=true}else if(r.isSkinnedMesh&&x.skinning===false){y=true}else if(!r.isSkinnedMesh&&x.skinning===true){y=true}else if(x.envMap!==l){y=true}else if(i.fog===true&&x.fog!==s){y=true}else if(x.numClippingPlanes!==undefined&&(x.numClippingPlanes!==ut.numPlanes||x.numIntersection!==ut.numIntersection)){y=true}else if(x.vertexAlphas!==c){y=true}else if(x.vertexTangents!==u){y=true}else if(x.morphTargets!==h){y=true}else if(x.morphNormals!==f){y=true}else if(x.morphColors!==d){y=true}else if(x.toneMapping!==p){y=true}else if(Z.isWebGL2===true&&x.morphTargetsCount!==g){y=true}}else{y=true;x.__version=i.version}let S=x.currentProgram;if(y===true){S=Gt(i,e,r)}let E=false;let A=false;let R=false;const q=S.getUniforms(),C=x.uniforms;if(K.useProgram(S.program)){E=true;A=true;R=true}if(i.id!==b){b=i.id;A=true}if(E||w!==t){q.setValue(j,"projectionMatrix",t.projectionMatrix);if(Z.logarithmicDepthBuffer){q.setValue(j,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2))}if(w!==t){w=t;A=true;R=true}if(i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=q.map.cameraPosition;if(e!==undefined){e.setValue(j,V.setFromMatrixPosition(t.matrixWorld))}}if(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial){q.setValue(j,"isOrthographic",t.isOrthographicCamera===true)}if(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh){q.setValue(j,"viewMatrix",t.matrixWorldInverse)}}if(r.isSkinnedMesh){q.setOptional(j,r,"bindMatrix");q.setOptional(j,r,"bindMatrixInverse");const t=r.skeleton;if(t){if(Z.floatVertexTextures){if(t.boneTexture===null)t.computeBoneTexture();q.setValue(j,"boneTexture",t.boneTexture,tt);q.setValue(j,"boneTextureSize",t.boneTextureSize)}else{console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required.")}}}const U=n.morphAttributes;if(U.position!==undefined||U.normal!==undefined||U.color!==undefined&&Z.isWebGL2===true){mt.update(r,n,S)}if(A||x.receiveShadow!==r.receiveShadow){x.receiveShadow=r.receiveShadow;q.setValue(j,"receiveShadow",r.receiveShadow)}if(i.isMeshGouraudMaterial&&i.envMap!==null){C.envMap.value=l;C.flipEnvMap.value=l.isCubeTexture&&l.isRenderTargetTexture===false?-1:1}if(A){q.setValue(j,"toneMappingExposure",M.toneMappingExposure);if(x.needsLights){Wt(C,R)}if(s&&i.fog===true){ot.refreshFogUniforms(C,s)}ot.refreshMaterialUniforms(C,i,P,L,H);sc.upload(j,x.uniformsList,C,tt)}if(i.isShaderMaterial&&i.uniformsNeedUpdate===true){sc.upload(j,x.uniformsList,C,tt);i.uniformsNeedUpdate=false}if(i.isSpriteMaterial){q.setValue(j,"center",r.center)}q.setValue(j,"modelViewMatrix",r.modelViewMatrix);q.setValue(j,"normalMatrix",r.normalMatrix);q.setValue(j,"modelMatrix",r.matrixWorld);if(i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++){if(Z.isWebGL2){const n=t[e];St.update(n,S);St.bind(n,S)}else{console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}}}return S}function Wt(t,e){t.ambientLightColor.needsUpdate=e;t.lightProbe.needsUpdate=e;t.directionalLights.needsUpdate=e;t.directionalLightShadows.needsUpdate=e;t.pointLights.needsUpdate=e;t.pointLightShadows.needsUpdate=e;t.spotLights.needsUpdate=e;t.spotLightShadows.needsUpdate=e;t.rectAreaLights.needsUpdate=e;t.hemisphereLights.needsUpdate=e}function Xt(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&t.lights===true}this.getActiveCubeFace=function(){return S};this.getActiveMipmapLevel=function(){return E};this.getRenderTarget=function(){return T};this.setRenderTargetTextures=function(t,e,n){$.get(t.texture).__webglTexture=e;$.get(t.depthTexture).__webglTexture=n;const i=$.get(t);i.__hasExternalTextures=true;if(i.__hasExternalTextures){i.__autoAllocateDepthBuffer=n===undefined;if(!i.__autoAllocateDepthBuffer){if(J.has("WEBGL_multisampled_render_to_texture")===true){console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided");i.__useRenderToTexture=false}}}};this.setRenderTargetFramebuffer=function(t,e){const n=$.get(t);n.__webglFramebuffer=e;n.__useDefaultFramebuffer=e===undefined};this.setRenderTarget=function(t,e=0,n=0){T=t;S=e;E=n;let i=true;let r=null;let s=false;let a=false;if(t){const n=$.get(t);if(n.__useDefaultFramebuffer!==undefined){K.bindFramebuffer(j.FRAMEBUFFER,null);i=false}else if(n.__webglFramebuffer===undefined){tt.setupRenderTarget(t)}else if(n.__hasExternalTextures){tt.rebindTextures(t,$.get(t.texture).__webglTexture,$.get(t.depthTexture).__webglTexture)}const o=t.texture;if(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture){a=true}const l=$.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget){r=l[e];s=true}else if(Z.isWebGL2&&t.samples>0&&tt.useMultisampledRTT(t)===false){r=$.get(t).__webglMultisampledFramebuffer}else{r=l}A.copy(t.viewport);R.copy(t.scissor);q=t.scissorTest}else{A.copy(I).multiplyScalar(P).floor();R.copy(N).multiplyScalar(P).floor();q=O}const o=K.bindFramebuffer(j.FRAMEBUFFER,r);if(o&&Z.drawBuffers&&i){K.drawBuffers(t,r)}K.viewport(A);K.scissor(R);K.setScissorTest(q);if(s){const i=$.get(t.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=$.get(t.texture);const r=e||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}b=-1};this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!(t&&t.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let o=$.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&a!==undefined){o=o[a]}if(o){K.bindFramebuffer(j.FRAMEBUFFER,o);try{const a=t.texture;const o=a.format;const l=a.type;if(o!==bt&&xt.convert(o)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const c=l===Mt&&(J.has("EXT_color_buffer_half_float")||Z.isWebGL2&&J.has("EXT_color_buffer_float"));if(l!==dt&&xt.convert(l)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_TYPE)&&!(l===vt&&(Z.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float")))&&!c){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}if(e>=0&&e<=t.width-i&&(n>=0&&n<=t.height-r)){j.readPixels(e,n,i,r,xt.convert(o),xt.convert(l),s)}}finally{const t=T!==null?$.get(T).__webglFramebuffer:null;K.bindFramebuffer(j.FRAMEBUFFER,t)}}};this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n);const r=Math.floor(e.image.width*i);const s=Math.floor(e.image.height*i);tt.setTexture2D(e,0);j.copyTexSubImage2D(j.TEXTURE_2D,n,0,0,t.x,t.y,r,s);K.unbindTexture()};this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width;const s=e.image.height;const a=xt.convert(n.format);const o=xt.convert(n.type);tt.setTexture2D(n,0);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,n.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,n.unpackAlignment);if(e.isDataTexture){j.texSubImage2D(j.TEXTURE_2D,i,t.x,t.y,r,s,a,o,e.image.data)}else{if(e.isCompressedTexture){j.compressedTexSubImage2D(j.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data)}else{j.texSubImage2D(j.TEXTURE_2D,i,t.x,t.y,a,o,e.image)}}if(i===0&&n.generateMipmaps)j.generateMipmap(j.TEXTURE_2D);K.unbindTexture()};this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const s=t.max.x-t.min.x+1;const a=t.max.y-t.min.y+1;const o=t.max.z-t.min.z+1;const l=xt.convert(i.format);const c=xt.convert(i.type);let u;if(i.isData3DTexture){tt.setTexture3D(i,0);u=j.TEXTURE_3D}else if(i.isDataArrayTexture){tt.setTexture2DArray(i,0);u=j.TEXTURE_2D_ARRAY}else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,i.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,i.unpackAlignment);const h=j.getParameter(j.UNPACK_ROW_LENGTH);const f=j.getParameter(j.UNPACK_IMAGE_HEIGHT);const d=j.getParameter(j.UNPACK_SKIP_PIXELS);const p=j.getParameter(j.UNPACK_SKIP_ROWS);const m=j.getParameter(j.UNPACK_SKIP_IMAGES);const g=n.isCompressedTexture?n.mipmaps[0]:n.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,g.width);j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,g.height);j.pixelStorei(j.UNPACK_SKIP_PIXELS,t.min.x);j.pixelStorei(j.UNPACK_SKIP_ROWS,t.min.y);j.pixelStorei(j.UNPACK_SKIP_IMAGES,t.min.z);if(n.isDataTexture||n.isData3DTexture){j.texSubImage3D(u,r,e.x,e.y,e.z,s,a,o,l,c,g.data)}else{if(n.isCompressedArrayTexture){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.");j.compressedTexSubImage3D(u,r,e.x,e.y,e.z,s,a,o,l,g.data)}else{j.texSubImage3D(u,r,e.x,e.y,e.z,s,a,o,l,c,g)}}j.pixelStorei(j.UNPACK_ROW_LENGTH,h);j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,f);j.pixelStorei(j.UNPACK_SKIP_PIXELS,d);j.pixelStorei(j.UNPACK_SKIP_ROWS,p);j.pixelStorei(j.UNPACK_SKIP_IMAGES,m);if(r===0&&i.generateMipmaps)j.generateMipmap(u);K.unbindTexture()};this.initTexture=function(t){if(t.isCubeTexture){tt.setTextureCube(t,0)}else if(t.isData3DTexture){tt.setTexture3D(t,0)}else if(t.isDataArrayTexture||t.isCompressedArrayTexture){tt.setTexture2DArray(t,0)}else{tt.setTexture2D(t,0)}K.unbindTexture()};this.resetState=function(){S=0;E=0;T=null;K.reset();yt.reset()};if(typeof __THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}get physicallyCorrectLights(){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.");return!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.");this.useLegacyLights=!t}get outputEncoding(){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.");return this.outputColorSpace===xe?fe:he}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.");this.outputColorSpace=t===fe?xe:ve}}class fu extends hu{}fu.prototype.isWebGL1Renderer=true;class du extends di{constructor(){super();this.isScene=true;this.type="Scene";this.background=null;this.environment=null;this.fog=null;this.backgroundBlurriness=0;this.backgroundIntensity=1;this.overrideMaterial=null;if(typeof __THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}copy(t,e){super.copy(t,e);if(t.background!==null)this.background=t.background.clone();if(t.environment!==null)this.environment=t.environment.clone();if(t.fog!==null)this.fog=t.fog.clone();this.backgroundBlurriness=t.backgroundBlurriness;this.backgroundIntensity=t.backgroundIntensity;if(t.overrideMaterial!==null)this.overrideMaterial=t.overrideMaterial.clone();this.matrixAutoUpdate=t.matrixAutoUpdate;return this}toJSON(t){const e=super.toJSON(t);if(this.fog!==null)e.object.fog=this.fog.toJSON();if(this.backgroundBlurriness>0)e.object.backgroundBlurriness=this.backgroundBlurriness;if(this.backgroundIntensity!==1)e.object.backgroundIntensity=this.backgroundIntensity;return e}get autoUpdate(){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.");return this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.");this.matrixWorldAutoUpdate=t}}class pu extends Ai{constructor(t){super();this.isLineBasicMaterial=true;this.type="LineBasicMaterial";this.color=new Pi(16777215);this.map=null;this.linewidth=1;this.linecap="round";this.linejoin="round";this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.linewidth=t.linewidth;this.linecap=t.linecap;this.linejoin=t.linejoin;this.fog=t.fog;return this}}const mu=new fn;const gu=new fn;const _u=new Gn;const xu=new Hn;const vu=new Un;class Mu extends di{constructor(t=new Yi,e=new pu){super();this.isLine=true;this.type="Line";this.geometry=t;this.material=e;this.updateMorphTargets()}copy(t,e){super.copy(t,e);this.material=t.material;this.geometry=t.geometry;return this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position;const n=[0];for(let t=1,i=e.count;t<i;t++){mu.fromBufferAttribute(e,t-1);gu.fromBufferAttribute(e,t);n[t]=n[t-1];n[t]+=mu.distanceTo(gu)}t.setAttribute("lineDistance",new Bi(n,1))}else{console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.")}return this}raycast(t,e){const n=this.geometry;const i=this.matrixWorld;const r=t.params.Line.threshold;const s=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();vu.copy(n.boundingSphere);vu.applyMatrix4(i);vu.radius+=r;if(t.ray.intersectsSphere(vu)===false)return;_u.copy(i).invert();xu.copy(t.ray).applyMatrix4(_u);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3);const o=a*a;const l=new fn;const c=new fn;const u=new fn;const h=new fn;const f=this.isLineSegments?2:1;const d=n.index;const p=n.attributes;const m=p.position;if(d!==null){const n=Math.max(0,s.start);const i=Math.min(d.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=f){const n=d.getX(r);const i=d.getX(r+1);l.fromBufferAttribute(m,n);c.fromBufferAttribute(m,i);const s=xu.distanceSqToSegment(l,c,h,u);if(s>o)continue;h.applyMatrix4(this.matrixWorld);const a=t.ray.origin.distanceTo(h);if(a<t.near||a>t.far)continue;e.push({distance:a,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else{const n=Math.max(0,s.start);const i=Math.min(m.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=f){l.fromBufferAttribute(m,r);c.fromBufferAttribute(m,r+1);const n=xu.distanceSqToSegment(l,c,h,u);if(n>o)continue;h.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(h);if(i<t.near||i>t.far)continue;e.push({distance:i,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry;const e=t.morphAttributes;const n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(t!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0);this.morphTargetDictionary[n]=e}}}}}const yu=new fn;const Su=new fn;class Eu extends Mu{constructor(t,e){super(t,e);this.isLineSegments=true;this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position;const n=[];for(let t=0,i=e.count;t<i;t+=2){yu.fromBufferAttribute(e,t);Su.fromBufferAttribute(e,t+1);n[t]=t===0?0:n[t-1];n[t+1]=n[t]+yu.distanceTo(Su)}t.setAttribute("lineDistance",new Bi(n,1))}else{console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.")}return this}}class Tu extends Ai{constructor(t){super();this.isPointsMaterial=true;this.type="PointsMaterial";this.color=new Pi(16777215);this.map=null;this.alphaMap=null;this.size=1;this.sizeAttenuation=true;this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.alphaMap=t.alphaMap;this.size=t.size;this.sizeAttenuation=t.sizeAttenuation;this.fog=t.fog;return this}}const bu=new Gn;const wu=new Hn;const Au=new Un;const Ru=new fn;class qu extends di{constructor(t=new Yi,e=new Tu){super();this.isPoints=true;this.type="Points";this.geometry=t;this.material=e;this.updateMorphTargets()}copy(t,e){super.copy(t,e);this.material=t.material;this.geometry=t.geometry;return this}raycast(t,e){const n=this.geometry;const i=this.matrixWorld;const r=t.params.Points.threshold;const s=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();Au.copy(n.boundingSphere);Au.applyMatrix4(i);Au.radius+=r;if(t.ray.intersectsSphere(Au)===false)return;bu.copy(i).invert();wu.copy(t.ray).applyMatrix4(bu);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3);const o=a*a;const l=n.index;const c=n.attributes;const u=c.position;if(l!==null){const n=Math.max(0,s.start);const r=Math.min(l.count,s.start+s.count);for(let s=n,a=r;s<a;s++){const n=l.getX(s);Ru.fromBufferAttribute(u,n);Cu(Ru,n,o,i,t,e,this)}}else{const n=Math.max(0,s.start);const r=Math.min(u.count,s.start+s.count);for(let s=n,a=r;s<a;s++){Ru.fromBufferAttribute(u,s);Cu(Ru,s,o,i,t,e,this)}}}updateMorphTargets(){const t=this.geometry;const e=t.morphAttributes;const n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(t!==undefined){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0);this.morphTargetDictionary[n]=e}}}}}function Cu(t,e,n,i,r,s,a){const o=wu.distanceSqToPoint(t);if(o<n){const n=new fn;wu.closestPointToPoint(t,n);n.applyMatrix4(i);const l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}class Lu extends an{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l);this.isCanvasTexture=true;this.needsUpdate=true}}class Pu{constructor(){this.type="Curve";this.arcLengthDivisions=200}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.");return null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++){e.push(this.getPoint(n/t))}return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++){e.push(this.getPointAt(n/t))}return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate){return this.cacheArcLengths}this.needsUpdate=false;const e=[];let n,i=this.getPoint(0);let r=0;e.push(0);for(let s=1;s<=t;s++){n=this.getPoint(s/t);r+=n.distanceTo(i);e.push(r);i=n}this.cacheArcLengths=e;return e}updateArcLengths(){this.needsUpdate=true;this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;if(e){s=e}else{s=t*n[r-1]}let a=0,o=r-1,l;while(a<=o){i=Math.floor(a+(o-a)/2);l=n[i]-s;if(l<0){a=i+1}else if(l>0){o=i-1}else{o=i;break}}i=o;if(n[i]===s){return i/(r-1)}const c=n[i];const u=n[i+1];const h=u-c;const f=(s-c)/h;const d=(i+f)/(r-1);return d}getTangent(t,e){const n=1e-4;let i=t-n;let r=t+n;if(i<0)i=0;if(r>1)r=1;const s=this.getPoint(i);const a=this.getPoint(r);const o=e||(s.isVector2?new Fe:new fn);o.copy(a).sub(s).normalize();return o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new fn;const i=[];const r=[];const s=[];const a=new fn;const o=new Gn;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new fn)}r[0]=new fn;s[0]=new fn;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x);const u=Math.abs(i[0].y);const h=Math.abs(i[0].z);if(c<=l){l=c;n.set(1,0,0)}if(u<=l){l=u;n.set(0,1,0)}if(h<=l){n.set(0,0,1)}a.crossVectors(i[0],n).normalize();r[0].crossVectors(i[0],a);s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){r[e]=r[e-1].clone();s[e]=s[e-1].clone();a.crossVectors(i[e-1],i[e]);if(a.length()>Number.EPSILON){a.normalize();const t=Math.acos(Le(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(e===true){let e=Math.acos(Le(r[0].dot(r[t]),-1,1));e/=t;if(i[0].dot(a.crossVectors(r[0],r[t]))>0){e=-e}for(let n=1;n<=t;n++){r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n));s[n].crossVectors(i[n],r[n])}}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){this.arcLengthDivisions=t.arcLengthDivisions;return this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};t.arcLengthDivisions=this.arcLengthDivisions;t.type=this.type;return t}fromJSON(t){this.arcLengthDivisions=t.arcLengthDivisions;return this}}class Uu extends Pu{constructor(t=0,e=0,n=1,i=1,r=0,s=Math.PI*2,a=false,o=0){super();this.isEllipseCurve=true;this.type="EllipseCurve";this.aX=t;this.aY=e;this.xRadius=n;this.yRadius=i;this.aStartAngle=r;this.aEndAngle=s;this.aClockwise=a;this.aRotation=o}getPoint(t,e){const n=e||new Fe;const i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;while(r<0)r+=i;while(r>i)r-=i;if(r<Number.EPSILON){if(s){r=0}else{r=i}}if(this.aClockwise===true&&!s){if(r===i){r=-i}else{r=r-i}}const a=this.aStartAngle+t*r;let o=this.aX+this.xRadius*Math.cos(a);let l=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const t=Math.cos(this.aRotation);const e=Math.sin(this.aRotation);const n=o-this.aX;const i=l-this.aY;o=n*t-i*e+this.aX;l=n*e+i*t+this.aY}return n.set(o,l)}copy(t){super.copy(t);this.aX=t.aX;this.aY=t.aY;this.xRadius=t.xRadius;this.yRadius=t.yRadius;this.aStartAngle=t.aStartAngle;this.aEndAngle=t.aEndAngle;this.aClockwise=t.aClockwise;this.aRotation=t.aRotation;return this}toJSON(){const t=super.toJSON();t.aX=this.aX;t.aY=this.aY;t.xRadius=this.xRadius;t.yRadius=this.yRadius;t.aStartAngle=this.aStartAngle;t.aEndAngle=this.aEndAngle;t.aClockwise=this.aClockwise;t.aRotation=this.aRotation;return t}fromJSON(t){super.fromJSON(t);this.aX=t.aX;this.aY=t.aY;this.xRadius=t.xRadius;this.yRadius=t.yRadius;this.aStartAngle=t.aStartAngle;this.aEndAngle=t.aEndAngle;this.aClockwise=t.aClockwise;this.aRotation=t.aRotation;return this}}class Du extends Uu{constructor(t,e,n,i,r,s){super(t,e,n,n,i,r,s);this.isArcCurve=true;this.type="ArcCurve"}}function Iu(){let t=0,e=0,n=0,i=0;function r(r,s,a,o){t=r;e=a;n=-3*r+3*s-2*a-o;i=2*r-2*s+a+o}return{initCatmullRom:function(t,e,n,i,s){r(e,n,s*(n-t),s*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,s,a,o){let l=(e-t)/s-(n-t)/(s+a)+(n-e)/a;let c=(n-e)/a-(i-e)/(a+o)+(i-n)/o;l*=a;c*=a;r(e,n,l,c)},calc:function(r){const s=r*r;const a=s*r;return t+e*r+n*s+i*a}}}const Nu=new fn;const Ou=new Iu;const Fu=new Iu;const zu=new Iu;class Bu extends Pu{constructor(t=[],e=false,n="centripetal",i=.5){super();this.isCatmullRomCurve3=true;this.type="CatmullRomCurve3";this.points=t;this.closed=e;this.curveType=n;this.tension=i}getPoint(t,e=new fn){const n=e;const i=this.points;const r=i.length;const s=(r-(this.closed?0:1))*t;let a=Math.floor(s);let o=s-a;if(this.closed){a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r}else if(o===0&&a===r-1){a=r-2;o=1}let l,c;if(this.closed||a>0){l=i[(a-1)%r]}else{Nu.subVectors(i[0],i[1]).add(i[0]);l=Nu}const u=i[a%r];const h=i[(a+1)%r];if(this.closed||a+2<r){c=i[(a+2)%r]}else{Nu.subVectors(i[r-1],i[r-2]).add(i[r-1]);c=Nu}if(this.curveType==="centripetal"||this.curveType==="chordal"){const t=this.curveType==="chordal"?.5:.25;let e=Math.pow(l.distanceToSquared(u),t);let n=Math.pow(u.distanceToSquared(h),t);let i=Math.pow(h.distanceToSquared(c),t);if(n<1e-4)n=1;if(e<1e-4)e=n;if(i<1e-4)i=n;Ou.initNonuniformCatmullRom(l.x,u.x,h.x,c.x,e,n,i);Fu.initNonuniformCatmullRom(l.y,u.y,h.y,c.y,e,n,i);zu.initNonuniformCatmullRom(l.z,u.z,h.z,c.z,e,n,i)}else if(this.curveType==="catmullrom"){Ou.initCatmullRom(l.x,u.x,h.x,c.x,this.tension);Fu.initCatmullRom(l.y,u.y,h.y,c.y,this.tension);zu.initCatmullRom(l.z,u.z,h.z,c.z,this.tension)}n.set(Ou.calc(o),Fu.calc(o),zu.calc(o));return n}copy(t){super.copy(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}this.closed=t.closed;this.curveType=t.curveType;this.tension=t.tension;return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}t.closed=this.closed;t.curveType=this.curveType;t.tension=this.tension;return t}fromJSON(t){super.fromJSON(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new fn).fromArray(n))}this.closed=t.closed;this.curveType=t.curveType;this.tension=t.tension;return this}}function Hu(t,e,n,i,r){const s=(i-e)*.5;const a=(r-n)*.5;const o=t*t;const l=t*o;return(2*n-2*i+s+a)*l+(-3*n+3*i-2*s-a)*o+s*t+n}function Gu(t,e){const n=1-t;return n*n*e}function Vu(t,e){return 2*(1-t)*t*e}function ku(t,e){return t*t*e}function Wu(t,e,n,i){return Gu(t,e)+Vu(t,n)+ku(t,i)}function Xu(t,e){const n=1-t;return n*n*n*e}function ju(t,e){const n=1-t;return 3*n*n*t*e}function Yu(t,e){return 3*(1-t)*t*t*e}function Ju(t,e){return t*t*t*e}function Zu(t,e,n,i,r){return Xu(t,e)+ju(t,n)+Yu(t,i)+Ju(t,r)}class Ku extends Pu{constructor(t=new Fe,e=new Fe,n=new Fe,i=new Fe){super();this.isCubicBezierCurve=true;this.type="CubicBezierCurve";this.v0=t;this.v1=e;this.v2=n;this.v3=i}getPoint(t,e=new Fe){const n=e;const i=this.v0,r=this.v1,s=this.v2,a=this.v3;n.set(Zu(t,i.x,r.x,s.x,a.x),Zu(t,i.y,r.y,s.y,a.y));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);this.v3.copy(t.v3);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();t.v3=this.v3.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);this.v3.fromArray(t.v3);return this}}class Qu extends Pu{constructor(t=new fn,e=new fn,n=new fn,i=new fn){super();this.isCubicBezierCurve3=true;this.type="CubicBezierCurve3";this.v0=t;this.v1=e;this.v2=n;this.v3=i}getPoint(t,e=new fn){const n=e;const i=this.v0,r=this.v1,s=this.v2,a=this.v3;n.set(Zu(t,i.x,r.x,s.x,a.x),Zu(t,i.y,r.y,s.y,a.y),Zu(t,i.z,r.z,s.z,a.z));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);this.v3.copy(t.v3);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();t.v3=this.v3.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);this.v3.fromArray(t.v3);return this}}class $u extends Pu{constructor(t=new Fe,e=new Fe){super();this.isLineCurve=true;this.type="LineCurve";this.v1=t;this.v2=e}getPoint(t,e=new Fe){const n=e;if(t===1){n.copy(this.v2)}else{n.copy(this.v2).sub(this.v1);n.multiplyScalar(t).add(this.v1)}return n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Fe){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){super.copy(t);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class th extends Pu{constructor(t=new fn,e=new fn){super();this.isLineCurve3=true;this.type="LineCurve3";this.v1=t;this.v2=e}getPoint(t,e=new fn){const n=e;if(t===1){n.copy(this.v2)}else{n.copy(this.v2).sub(this.v1);n.multiplyScalar(t).add(this.v1)}return n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new fn){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){super.copy(t);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class eh extends Pu{constructor(t=new Fe,e=new Fe,n=new Fe){super();this.isQuadraticBezierCurve=true;this.type="QuadraticBezierCurve";this.v0=t;this.v1=e;this.v2=n}getPoint(t,e=new Fe){const n=e;const i=this.v0,r=this.v1,s=this.v2;n.set(Wu(t,i.x,r.x,s.x),Wu(t,i.y,r.y,s.y));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class nh extends Pu{constructor(t=new fn,e=new fn,n=new fn){super();this.isQuadraticBezierCurve3=true;this.type="QuadraticBezierCurve3";this.v0=t;this.v1=e;this.v2=n}getPoint(t,e=new fn){const n=e;const i=this.v0,r=this.v1,s=this.v2;n.set(Wu(t,i.x,r.x,s.x),Wu(t,i.y,r.y,s.y),Wu(t,i.z,r.z,s.z));return n}copy(t){super.copy(t);this.v0.copy(t.v0);this.v1.copy(t.v1);this.v2.copy(t.v2);return this}toJSON(){const t=super.toJSON();t.v0=this.v0.toArray();t.v1=this.v1.toArray();t.v2=this.v2.toArray();return t}fromJSON(t){super.fromJSON(t);this.v0.fromArray(t.v0);this.v1.fromArray(t.v1);this.v2.fromArray(t.v2);return this}}class ih extends Pu{constructor(t=[]){super();this.isSplineCurve=true;this.type="SplineCurve";this.points=t}getPoint(t,e=new Fe){const n=e;const i=this.points;const r=(i.length-1)*t;const s=Math.floor(r);const a=r-s;const o=i[s===0?s:s-1];const l=i[s];const c=i[s>i.length-2?i.length-1:s+1];const u=i[s>i.length-3?i.length-1:s+2];n.set(Hu(a,o.x,l.x,c.x,u.x),Hu(a,o.y,l.y,c.y,u.y));return n}copy(t){super.copy(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t);this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Fe).fromArray(n))}return this}}var rh=Object.freeze({__proto__:null,ArcCurve:Du,CatmullRomCurve3:Bu,CubicBezierCurve:Ku,CubicBezierCurve3:Qu,EllipseCurve:Uu,LineCurve:$u,LineCurve3:th,QuadraticBezierCurve:eh,QuadraticBezierCurve3:nh,SplineCurve:ih});class sh extends Pu{constructor(){super();this.type="CurvePath";this.curves=[];this.autoClose=false}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0);const e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){this.curves.push(new $u(e,t))}}getPoint(t,e){const n=t*this.getLength();const i=this.getCurveLengths();let r=0;while(r<i.length){if(i[r]>=n){const t=i[r]-n;const s=this.curves[r];const a=s.getLength();const o=a===0?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=true;this.cacheLengths=null;this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length){return this.cacheLengths}const t=[];let e=0;for(let n=0,i=this.curves.length;n<i;n++){e+=this.curves[n].getLength();t.push(e)}this.cacheLengths=t;return t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++){e.push(this.getPoint(n/t))}if(this.autoClose){e.push(e[0])}return e}getPoints(t=12){const e=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const s=r[i];const a=s.isEllipseCurve?t*2:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t;const o=s.getPoints(a);for(let t=0;t<o.length;t++){const i=o[t];if(n&&n.equals(i))continue;e.push(i);n=i}}if(this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])){e.push(e[0])}return e}copy(t){super.copy(t);this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}this.autoClose=t.autoClose;return this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose;t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t);this.autoClose=t.autoClose;this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new rh[n.type]).fromJSON(n))}return this}}class ah extends sh{constructor(t){super();this.type="Path";this.currentPoint=new Fe;if(t){this.setFromPoints(t)}}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++){this.lineTo(t[e].x,t[e].y)}return this}moveTo(t,e){this.currentPoint.set(t,e);return this}lineTo(t,e){const n=new $u(this.currentPoint.clone(),new Fe(t,e));this.curves.push(n);this.currentPoint.set(t,e);return this}quadraticCurveTo(t,e,n,i){const r=new eh(this.currentPoint.clone(),new Fe(t,e),new Fe(n,i));this.curves.push(r);this.currentPoint.set(n,i);return this}bezierCurveTo(t,e,n,i,r,s){const a=new Ku(this.currentPoint.clone(),new Fe(t,e),new Fe(n,i),new Fe(r,s));this.curves.push(a);this.currentPoint.set(r,s);return this}splineThru(t){const e=[this.currentPoint.clone()].concat(t);const n=new ih(e);this.curves.push(n);this.currentPoint.copy(t[t.length-1]);return this}arc(t,e,n,i,r,s){const a=this.currentPoint.x;const o=this.currentPoint.y;this.absarc(t+a,e+o,n,i,r,s);return this}absarc(t,e,n,i,r,s){this.absellipse(t,e,n,n,i,r,s);return this}ellipse(t,e,n,i,r,s,a,o){const l=this.currentPoint.x;const c=this.currentPoint.y;this.absellipse(t+l,e+c,n,i,r,s,a,o);return this}absellipse(t,e,n,i,r,s,a,o){const l=new Uu(t,e,n,i,r,s,a,o);if(this.curves.length>0){const t=l.getPoint(0);if(!t.equals(this.currentPoint)){this.lineTo(t.x,t.y)}}this.curves.push(l);const c=l.getPoint(1);this.currentPoint.copy(c);return this}copy(t){super.copy(t);this.currentPoint.copy(t.currentPoint);return this}toJSON(){const t=super.toJSON();t.currentPoint=this.currentPoint.toArray();return t}fromJSON(t){super.fromJSON(t);this.currentPoint.fromArray(t.currentPoint);return this}}class oh extends ah{constructor(t){super(t);this.uuid=Ce();this.type="Shape";this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,i=this.holes.length;n<i;n++){e[n]=this.holes[n].getPoints(t)}return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t);this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid;t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t);this.uuid=t.uuid;this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new ah).fromJSON(n))}return this}}const lh={triangulate:function(t,e,n=2){const i=e&&e.length;const r=i?e[0]*n:t.length;let s=ch(t,0,r,n,true);const a=[];if(!s||s.next===s.prev)return a;let o,l,c,u,h,f,d;if(i)s=gh(t,e,s,n);if(t.length>80*n){o=c=t[0];l=u=t[1];for(let e=n;e<r;e+=n){h=t[e];f=t[e+1];if(h<o)o=h;if(f<l)l=f;if(h>c)c=h;if(f>u)u=f}d=Math.max(c-o,u-l);d=d!==0?32767/d:0}hh(s,a,n,o,l,d,0);return a}};function ch(t,e,n,i,r){let s,a;if(r===zh(t,e,n,i)>0){for(s=e;s<n;s+=i)a=Nh(s,t[s],t[s+1],a)}else{for(s=n-i;s>=e;s-=i)a=Nh(s,t[s],t[s+1],a)}if(a&&Rh(a,a.next)){Oh(a);a=a.next}return a}function uh(t,e){if(!t)return t;if(!e)e=t;let n=t,i;do{i=false;if(!n.steiner&&(Rh(n,n.next)||Ah(n.prev,n,n.next)===0)){Oh(n);n=e=n.prev;if(n===n.next)break;i=true}else{n=n.next}}while(i||n!==e);return e}function hh(t,e,n,i,r,s,a){if(!t)return;if(!a&&s)yh(t,i,r,s);let o=t,l,c;while(t.prev!==t.next){l=t.prev;c=t.next;if(s?dh(t,i,r,s):fh(t)){e.push(l.i/n|0);e.push(t.i/n|0);e.push(c.i/n|0);Oh(t);t=c.next;o=c.next;continue}t=c;if(t===o){if(!a){hh(uh(t),e,n,i,r,s,1)}else if(a===1){t=ph(uh(t),e,n);hh(t,e,n,i,r,s,2)}else if(a===2){mh(t,e,n,i,r,s)}break}}}function fh(t){const e=t.prev,n=t,i=t.next;if(Ah(e,n,i)>=0)return false;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,c=i.y;const u=r<s?r<a?r:a:s<a?s:a,h=o<l?o<c?o:c:l<c?l:c,f=r>s?r>a?r:a:s>a?s:a,d=o>l?o>c?o:c:l>c?l:c;let p=i.next;while(p!==e){if(p.x>=u&&p.x<=f&&p.y>=h&&p.y<=d&&bh(r,o,s,l,a,c,p.x,p.y)&&Ah(p.prev,p,p.next)>=0)return false;p=p.next}return true}function dh(t,e,n,i){const r=t.prev,s=t,a=t.next;if(Ah(r,s,a)>=0)return false;const o=r.x,l=s.x,c=a.x,u=r.y,h=s.y,f=a.y;const d=o<l?o<c?o:c:l<c?l:c,p=u<h?u<f?u:f:h<f?h:f,m=o>l?o>c?o:c:l>c?l:c,g=u>h?u>f?u:f:h>f?h:f;const _=Eh(d,p,e,n,i),x=Eh(m,g,e,n,i);let v=t.prevZ,M=t.nextZ;while(v&&v.z>=_&&M&&M.z<=x){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==a&&bh(o,u,l,h,c,f,v.x,v.y)&&Ah(v.prev,v,v.next)>=0)return false;v=v.prevZ;if(M.x>=d&&M.x<=m&&M.y>=p&&M.y<=g&&M!==r&&M!==a&&bh(o,u,l,h,c,f,M.x,M.y)&&Ah(M.prev,M,M.next)>=0)return false;M=M.nextZ}while(v&&v.z>=_){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==a&&bh(o,u,l,h,c,f,v.x,v.y)&&Ah(v.prev,v,v.next)>=0)return false;v=v.prevZ}while(M&&M.z<=x){if(M.x>=d&&M.x<=m&&M.y>=p&&M.y<=g&&M!==r&&M!==a&&bh(o,u,l,h,c,f,M.x,M.y)&&Ah(M.prev,M,M.next)>=0)return false;M=M.nextZ}return true}function ph(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;if(!Rh(r,s)&&qh(r,i,i.next,s)&&Uh(r,s)&&Uh(s,r)){e.push(r.i/n|0);e.push(i.i/n|0);e.push(s.i/n|0);Oh(i);Oh(i.next);i=t=s}i=i.next}while(i!==t);return uh(i)}function mh(t,e,n,i,r,s){let a=t;do{let t=a.next.next;while(t!==a.prev){if(a.i!==t.i&&wh(a,t)){let o=Ih(a,t);a=uh(a,a.next);o=uh(o,o.next);hh(a,e,n,i,r,s,0);hh(o,e,n,i,r,s,0);return}t=t.next}a=a.next}while(a!==t)}function gh(t,e,n,i){const r=[];let s,a,o,l,c;for(s=0,a=e.length;s<a;s++){o=e[s]*i;l=s<a-1?e[s+1]*i:t.length;c=ch(t,o,l,i,false);if(c===c.next)c.steiner=true;r.push(Th(c))}r.sort(_h);for(s=0;s<r.length;s++){n=xh(r[s],n)}return n}function _h(t,e){return t.x-e.x}function xh(t,e){const n=vh(t,e);if(!n){return e}const i=Ih(n,t);uh(i,i.next);return uh(n,n.next)}function vh(t,e){let n=e,i=-Infinity,r;const s=t.x,a=t.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){const t=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=s&&t>i){i=t;r=n.x<n.next.x?n:n.next;if(t===s)return r}}n=n.next}while(n!==e);if(!r)return null;const o=r,l=r.x,c=r.y;let u=Infinity,h;n=r;do{if(s>=n.x&&n.x>=l&&s!==n.x&&bh(a<c?s:i,a,l,c,a<c?i:s,a,n.x,n.y)){h=Math.abs(a-n.y)/(s-n.x);if(Uh(n,t)&&(h<u||h===u&&(n.x>r.x||n.x===r.x&&Mh(r,n)))){r=n;u=h}}n=n.next}while(n!==o);return r}function Mh(t,e){return Ah(t.prev,t,e.prev)<0&&Ah(e.next,t,t.next)<0}function yh(t,e,n,i){let r=t;do{if(r.z===0)r.z=Eh(r.x,r.y,e,n,i);r.prevZ=r.prev;r.nextZ=r.next;r=r.next}while(r!==t);r.prevZ.nextZ=null;r.prevZ=null;Sh(r)}function Sh(t){let e,n,i,r,s,a,o,l,c=1;do{n=t;t=null;s=null;a=0;while(n){a++;i=n;o=0;for(e=0;e<c;e++){o++;i=i.nextZ;if(!i)break}l=c;while(o>0||l>0&&i){if(o!==0&&(l===0||!i||n.z<=i.z)){r=n;n=n.nextZ;o--}else{r=i;i=i.nextZ;l--}if(s)s.nextZ=r;else t=r;r.prevZ=s;s=r}n=i}s.nextZ=null;c*=2}while(a>1);return t}function Eh(t,e,n,i,r){t=(t-n)*r|0;e=(e-i)*r|0;t=(t|t<<8)&16711935;t=(t|t<<4)&252645135;t=(t|t<<2)&858993459;t=(t|t<<1)&1431655765;e=(e|e<<8)&16711935;e=(e|e<<4)&252645135;e=(e|e<<2)&858993459;e=(e|e<<1)&1431655765;return t|e<<1}function Th(t){let e=t,n=t;do{if(e.x<n.x||e.x===n.x&&e.y<n.y)n=e;e=e.next}while(e!==t);return n}function bh(t,e,n,i,r,s,a,o){return(r-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function wh(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Ph(t,e)&&(Uh(t,e)&&Uh(e,t)&&Dh(t,e)&&(Ah(t.prev,t,e.prev)||Ah(t,e.prev,e))||Rh(t,e)&&Ah(t.prev,t,t.next)>0&&Ah(e.prev,e,e.next)>0)}function Ah(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Rh(t,e){return t.x===e.x&&t.y===e.y}function qh(t,e,n,i){const r=Lh(Ah(t,e,n));const s=Lh(Ah(t,e,i));const a=Lh(Ah(n,i,t));const o=Lh(Ah(n,i,e));if(r!==s&&a!==o)return true;if(r===0&&Ch(t,n,e))return true;if(s===0&&Ch(t,i,e))return true;if(a===0&&Ch(n,t,i))return true;if(o===0&&Ch(n,e,i))return true;return false}function Ch(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Lh(t){return t>0?1:t<0?-1:0}function Ph(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&qh(n,n.next,t,e))return true;n=n.next}while(n!==t);return false}function Uh(t,e){return Ah(t.prev,t,t.next)<0?Ah(t,e,t.next)>=0&&Ah(t,t.prev,e)>=0:Ah(t,e,t.prev)<0||Ah(t,t.next,e)<0}function Dh(t,e){let n=t,i=false;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{if(n.y>s!==n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x)i=!i;n=n.next}while(n!==t);return i}function Ih(t,e){const n=new Fh(t.i,t.x,t.y),i=new Fh(e.i,e.x,e.y),r=t.next,s=e.prev;t.next=e;e.prev=t;n.next=r;r.prev=n;i.next=n;n.prev=i;s.next=i;i.prev=s;return i}function Nh(t,e,n,i){const r=new Fh(t,e,n);if(!i){r.prev=r;r.next=r}else{r.next=i.next;r.prev=i;i.next.prev=r;i.next=r}return r}function Oh(t){t.next.prev=t.prev;t.prev.next=t.next;if(t.prevZ)t.prevZ.nextZ=t.nextZ;if(t.nextZ)t.nextZ.prevZ=t.prevZ}function Fh(t,e,n){this.i=t;this.x=e;this.y=n;this.prev=null;this.next=null;this.z=0;this.prevZ=null;this.nextZ=null;this.steiner=false}function zh(t,e,n,i){let r=0;for(let s=e,a=n-i;s<n;s+=i){r+=(t[a]-t[s])*(t[s+1]+t[a+1]);a=s}return r}class Bh{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r<e;i=r++){n+=t[i].x*t[r].y-t[r].x*t[i].y}return n*.5}static isClockWise(t){return Bh.area(t)<0}static triangulateShape(t,e){const n=[];const i=[];const r=[];Hh(t);Gh(n,t);let s=t.length;e.forEach(Hh);for(let t=0;t<e.length;t++){i.push(s);s+=e[t].length;Gh(n,e[t])}const a=lh.triangulate(n,i);for(let t=0;t<a.length;t+=3){r.push(a.slice(t,t+3))}return r}}function Hh(t){const e=t.length;if(e>2&&t[e-1].equals(t[0])){t.pop()}}function Gh(t,e){for(let n=0;n<e.length;n++){t.push(e[n].x);t.push(e[n].y)}}class Vh extends Yi{constructor(t=new oh([new Fe(.5,.5),new Fe(-.5,.5),new Fe(-.5,-.5),new Fe(.5,-.5)]),e={}){super();this.type="ExtrudeGeometry";this.parameters={shapes:t,options:e};t=Array.isArray(t)?t:[t];const n=this;const i=[];const r=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];s(n)}this.setAttribute("position",new Bi(i,3));this.setAttribute("uv",new Bi(r,2));this.computeVertexNormals();function s(t){const s=[];const a=e.curveSegments!==undefined?e.curveSegments:12;const o=e.steps!==undefined?e.steps:1;const l=e.depth!==undefined?e.depth:1;let c=e.bevelEnabled!==undefined?e.bevelEnabled:true;let u=e.bevelThickness!==undefined?e.bevelThickness:.2;let h=e.bevelSize!==undefined?e.bevelSize:u-.1;let f=e.bevelOffset!==undefined?e.bevelOffset:0;let d=e.bevelSegments!==undefined?e.bevelSegments:3;const p=e.extrudePath;const m=e.UVGenerator!==undefined?e.UVGenerator:kh;let g,_=false;let x,v,M,y;if(p){g=p.getSpacedPoints(o);_=true;c=false;x=p.computeFrenetFrames(o,false);v=new fn;M=new fn;y=new fn}if(!c){d=0;u=0;h=0;f=0}const S=t.extractPoints(a);let E=S.shape;const T=S.holes;const b=!Bh.isClockWise(E);if(b){E=E.reverse();for(let t=0,e=T.length;t<e;t++){const e=T[t];if(Bh.isClockWise(e)){T[t]=e.reverse()}}}const w=Bh.triangulateShape(E,T);const A=E;for(let t=0,e=T.length;t<e;t++){const e=T[t];E=E.concat(e)}function R(t,e,n){if(!e)console.error("THREE.ExtrudeGeometry: vec does not exist");return t.clone().addScaledVector(e,n)}const q=E.length,C=w.length;function L(t,e,n){let i,r,s;const a=t.x-e.x,o=t.y-e.y;const l=n.x-t.x,c=n.y-t.y;const u=a*a+o*o;const h=a*c-o*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u);const f=Math.sqrt(l*l+c*c);const d=e.x-o/h;const p=e.y+a/h;const m=n.x-c/f;const g=n.y+l/f;const _=((m-d)*c-(g-p)*l)/(a*c-o*l);i=d+a*_-t.x;r=p+o*_-t.y;const x=i*i+r*r;if(x<=2){return new Fe(i,r)}else{s=Math.sqrt(x/2)}}else{let t=false;if(a>Number.EPSILON){if(l>Number.EPSILON){t=true}}else{if(a<-Number.EPSILON){if(l<-Number.EPSILON){t=true}}else{if(Math.sign(o)===Math.sign(c)){t=true}}}if(t){i=-o;r=a;s=Math.sqrt(u)}else{i=a;r=o;s=Math.sqrt(u/2)}}return new Fe(i/s,r/s)}const P=[];for(let t=0,e=A.length,n=e-1,i=t+1;t<e;t++,n++,i++){if(n===e)n=0;if(i===e)i=0;P[t]=L(A[t],A[n],A[i])}const U=[];let D,I=P.concat();for(let t=0,e=T.length;t<e;t++){const e=T[t];D=[];for(let t=0,n=e.length,i=n-1,r=t+1;t<n;t++,i++,r++){if(i===n)i=0;if(r===n)r=0;D[t]=L(e[t],e[i],e[r])}U.push(D);I=I.concat(D)}for(let t=0;t<d;t++){const e=t/d;const n=u*Math.cos(e*Math.PI/2);const i=h*Math.sin(e*Math.PI/2)+f;for(let t=0,e=A.length;t<e;t++){const e=R(A[t],P[t],i);B(e.x,e.y,-n)}for(let t=0,e=T.length;t<e;t++){const e=T[t];D=U[t];for(let t=0,r=e.length;t<r;t++){const r=R(e[t],D[t],i);B(r.x,r.y,-n)}}}const N=h+f;for(let t=0;t<q;t++){const e=c?R(E[t],I[t],N):E[t];if(!_){B(e.x,e.y,0)}else{M.copy(x.normals[0]).multiplyScalar(e.x);v.copy(x.binormals[0]).multiplyScalar(e.y);y.copy(g[0]).add(M).add(v);B(y.x,y.y,y.z)}}for(let t=1;t<=o;t++){for(let e=0;e<q;e++){const n=c?R(E[e],I[e],N):E[e];if(!_){B(n.x,n.y,l/o*t)}else{M.copy(x.normals[t]).multiplyScalar(n.x);v.copy(x.binormals[t]).multiplyScalar(n.y);y.copy(g[t]).add(M).add(v);B(y.x,y.y,y.z)}}}for(let t=d-1;t>=0;t--){const e=t/d;const n=u*Math.cos(e*Math.PI/2);const i=h*Math.sin(e*Math.PI/2)+f;for(let t=0,e=A.length;t<e;t++){const e=R(A[t],P[t],i);B(e.x,e.y,l+n)}for(let t=0,e=T.length;t<e;t++){const e=T[t];D=U[t];for(let t=0,r=e.length;t<r;t++){const r=R(e[t],D[t],i);if(!_){B(r.x,r.y,l+n)}else{B(r.x,r.y+g[o-1].y,g[o-1].x+n)}}}}O();F();function O(){const t=i.length/3;if(c){let t=0;let e=q*t;for(let t=0;t<C;t++){const n=w[t];H(n[2]+e,n[1]+e,n[0]+e)}t=o+d*2;e=q*t;for(let t=0;t<C;t++){const n=w[t];H(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<C;t++){const e=w[t];H(e[2],e[1],e[0])}for(let t=0;t<C;t++){const e=w[t];H(e[0]+q*o,e[1]+q*o,e[2]+q*o)}}n.addGroup(t,i.length/3-t,0)}function F(){const t=i.length/3;let e=0;z(A,e);e+=A.length;for(let t=0,n=T.length;t<n;t++){const n=T[t];z(n,e);e+=n.length}n.addGroup(t,i.length/3-t,1)}function z(t,e){let n=t.length;while(--n>=0){const i=n;let r=n-1;if(r<0)r=t.length-1;for(let t=0,n=o+d*2;t<n;t++){const n=q*t;const s=q*(t+1);const a=e+i+n,o=e+r+n,l=e+r+s,c=e+i+s;G(a,o,l,c)}}}function B(t,e,n){s.push(t);s.push(e);s.push(n)}function H(t,e,r){V(t);V(e);V(r);const s=i.length/3;const a=m.generateTopUV(n,i,s-3,s-2,s-1);k(a[0]);k(a[1]);k(a[2])}function G(t,e,r,s){V(t);V(e);V(s);V(e);V(r);V(s);const a=i.length/3;const o=m.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);k(o[0]);k(o[1]);k(o[3]);k(o[1]);k(o[2]);k(o[3])}function V(t){i.push(s[t*3+0]);i.push(s[t*3+1]);i.push(s[t*3+2])}function k(t){r.push(t.x);r.push(t.y)}}}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}toJSON(){const t=super.toJSON();const e=this.parameters.shapes;const n=this.parameters.options;return Wh(e,n,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}const i=t.options.extrudePath;if(i!==undefined){t.options.extrudePath=(new rh[i.type]).fromJSON(i)}return new Vh(n,t.options)}}const kh={generateTopUV:function(t,e,n,i,r){const s=e[n*3];const a=e[n*3+1];const o=e[i*3];const l=e[i*3+1];const c=e[r*3];const u=e[r*3+1];return[new Fe(s,a),new Fe(o,l),new Fe(c,u)]},generateSideWallUV:function(t,e,n,i,r,s){const a=e[n*3];const o=e[n*3+1];const l=e[n*3+2];const c=e[i*3];const u=e[i*3+1];const h=e[i*3+2];const f=e[r*3];const d=e[r*3+1];const p=e[r*3+2];const m=e[s*3];const g=e[s*3+1];const _=e[s*3+2];if(Math.abs(o-u)<Math.abs(a-c)){return[new Fe(a,1-l),new Fe(c,1-h),new Fe(f,1-p),new Fe(m,1-_)]}else{return[new Fe(o,1-l),new Fe(u,1-h),new Fe(d,1-p),new Fe(g,1-_)]}}};function Wh(t,e,n){n.shapes=[];if(Array.isArray(t)){for(let e=0,i=t.length;e<i;e++){const i=t[e];n.shapes.push(i.uuid)}}else{n.shapes.push(t.uuid)}n.options=Object.assign({},e);if(e.extrudePath!==undefined)n.options.extrudePath=e.extrudePath.toJSON();return n}class Xh extends Yi{constructor(t=1,e=32,n=16,i=0,r=Math.PI*2,s=0,a=Math.PI){super();this.type="SphereGeometry";this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:s,thetaLength:a};e=Math.max(3,Math.floor(e));n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const c=[];const u=new fn;const h=new fn;const f=[];const d=[];const p=[];const m=[];for(let f=0;f<=n;f++){const g=[];const _=f/n;let x=0;if(f===0&&s===0){x=.5/e}else if(f===n&&o===Math.PI){x=-.5/e}for(let n=0;n<=e;n++){const o=n/e;u.x=-t*Math.cos(i+o*r)*Math.sin(s+_*a);u.y=t*Math.cos(s+_*a);u.z=t*Math.sin(i+o*r)*Math.sin(s+_*a);d.push(u.x,u.y,u.z);h.copy(u).normalize();p.push(h.x,h.y,h.z);m.push(o+x,1-_);g.push(l++)}c.push(g)}for(let t=0;t<n;t++){for(let i=0;i<e;i++){const e=c[t][i+1];const r=c[t][i];const a=c[t+1][i];const l=c[t+1][i+1];if(t!==0||s>0)f.push(e,r,l);if(t!==n-1||o<Math.PI)f.push(r,a,l)}}this.setIndex(f);this.setAttribute("position",new Bi(d,3));this.setAttribute("normal",new Bi(p,3));this.setAttribute("uv",new Bi(m,2))}copy(t){super.copy(t);this.parameters=Object.assign({},t.parameters);return this}static fromJSON(t){return new Xh(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class jh extends Ai{constructor(t){super();this.isMeshLambertMaterial=true;this.type="MeshLambertMaterial";this.color=new Pi(16777215);this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new Pi(0);this.emissiveIntensity=1;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=me;this.normalScale=new Fe(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=V;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.flatShading=false;this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.lightMap=t.lightMap;this.lightMapIntensity=t.lightMapIntensity;this.aoMap=t.aoMap;this.aoMapIntensity=t.aoMapIntensity;this.emissive.copy(t.emissive);this.emissiveMap=t.emissiveMap;this.emissiveIntensity=t.emissiveIntensity;this.bumpMap=t.bumpMap;this.bumpScale=t.bumpScale;this.normalMap=t.normalMap;this.normalMapType=t.normalMapType;this.normalScale.copy(t.normalScale);this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;this.specularMap=t.specularMap;this.alphaMap=t.alphaMap;this.envMap=t.envMap;this.combine=t.combine;this.reflectivity=t.reflectivity;this.refractionRatio=t.refractionRatio;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;this.wireframeLinecap=t.wireframeLinecap;this.wireframeLinejoin=t.wireframeLinejoin;this.flatShading=t.flatShading;this.fog=t.fog;return this}}const Yh={enabled:false,files:{},add:function(t,e){if(this.enabled===false)return;this.files[t]=e},get:function(t){if(this.enabled===false)return;return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Jh{constructor(t,e,n){const i=this;let r=false;let s=0;let a=0;let o=undefined;const l=[];this.onStart=undefined;this.onLoad=t;this.onProgress=e;this.onError=n;this.itemStart=function(t){a++;if(r===false){if(i.onStart!==undefined){i.onStart(t,s,a)}}r=true};this.itemEnd=function(t){s++;if(i.onProgress!==undefined){i.onProgress(t,s,a)}if(s===a){r=false;if(i.onLoad!==undefined){i.onLoad()}}};this.itemError=function(t){if(i.onError!==undefined){i.onError(t)}};this.resolveURL=function(t){if(o){return o(t)}return t};this.setURLModifier=function(t){o=t;return this};this.addHandler=function(t,e){l.push(t,e);return this};this.removeHandler=function(t){const e=l.indexOf(t);if(e!==-1){l.splice(e,2)}return this};this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e];const i=l[e+1];if(n.global)n.lastIndex=0;if(n.test(t)){return i}}return null}}}const Zh=new Jh;class Kh{constructor(t){this.manager=t!==undefined?t:Zh;this.crossOrigin="anonymous";this.withCredentials=false;this.path="";this.resourcePath="";this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(i,r){n.load(t,i,e,r)}))}parse(){}setCrossOrigin(t){this.crossOrigin=t;return this}setWithCredentials(t){this.withCredentials=t;return this}setPath(t){this.path=t;return this}setResourcePath(t){this.resourcePath=t;return this}setRequestHeader(t){this.requestHeader=t;return this}}const Qh={};class $h extends Error{constructor(t,e){super(t);this.response=e}}class tf extends Kh{constructor(t){super(t)}load(t,e,n,i){if(t===undefined)t="";if(this.path!==undefined)t=this.path+t;t=this.manager.resolveURL(t);const r=Yh.get(t);if(r!==undefined){this.manager.itemStart(t);setTimeout((()=>{if(e)e(r);this.manager.itemEnd(t)}),0);return r}if(Qh[t]!==undefined){Qh[t].push({onLoad:e,onProgress:n,onError:i});return}Qh[t]=[];Qh[t].push({onLoad:e,onProgress:n,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});const a=this.mimeType;const o=this.responseType;fetch(s).then((e=>{if(e.status===200||e.status===0){if(e.status===0){console.warn("THREE.FileLoader: HTTP Status 0 received.")}if(typeof ReadableStream==="undefined"||e.body===undefined||e.body.getReader===undefined){return e}const n=Qh[t];const i=e.body.getReader();const r=e.headers.get("Content-Length")||e.headers.get("X-File-Size");const s=r?parseInt(r):0;const a=s!==0;let o=0;const l=new ReadableStream({start(t){e();function e(){i.read().then((({done:i,value:r})=>{if(i){t.close()}else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=n.length;t<e;t++){const e=n[t];if(e.onProgress)e.onProgress(i)}t.enqueue(r);e()}}))}}});return new Response(l)}else{throw new $h(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>{const e=new DOMParser;return e.parseFromString(t,a)}));case"json":return t.json();default:if(a===undefined){return t.text()}else{const e=/charset="?([^;"\s]*)"?/i;const n=e.exec(a);const i=n&&n[1]?n[1].toLowerCase():undefined;const r=new TextDecoder(i);return t.arrayBuffer().then((t=>r.decode(t)))}}})).then((e=>{Yh.add(t,e);const n=Qh[t];delete Qh[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];if(i.onLoad)i.onLoad(e)}})).catch((e=>{const n=Qh[t];if(n===undefined){this.manager.itemError(t);throw e}delete Qh[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];if(i.onError)i.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)}));this.manager.itemStart(t)}setResponseType(t){this.responseType=t;return this}setMimeType(t){this.mimeType=t;return this}}class ef extends di{constructor(t,e=1){super();this.isLight=true;this.type="Light";this.color=new Pi(t);this.intensity=e}dispose(){}copy(t,e){super.copy(t,e);this.color.copy(t.color);this.intensity=t.intensity;return this}toJSON(t){const e=super.toJSON(t);e.object.color=this.color.getHex();e.object.intensity=this.intensity;if(this.groundColor!==undefined)e.object.groundColor=this.groundColor.getHex();if(this.distance!==undefined)e.object.distance=this.distance;if(this.angle!==undefined)e.object.angle=this.angle;if(this.decay!==undefined)e.object.decay=this.decay;if(this.penumbra!==undefined)e.object.penumbra=this.penumbra;if(this.shadow!==undefined)e.object.shadow=this.shadow.toJSON();return e}}const nf=new Gn;const rf=new fn;const sf=new fn;class af{constructor(t){this.camera=t;this.bias=0;this.normalBias=0;this.radius=1;this.blurSamples=8;this.mapSize=new Fe(512,512);this.map=null;this.mapPass=null;this.matrix=new Gn;this.autoUpdate=true;this.needsUpdate=false;this._frustum=new Or;this._frameExtents=new Fe(1,1);this._viewportCount=1;this._viewports=[new on(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera;const n=this.matrix;rf.setFromMatrixPosition(t.matrixWorld);e.position.copy(rf);sf.setFromMatrixPosition(t.target.matrixWorld);e.lookAt(sf);e.updateMatrixWorld();nf.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse);this._frustum.setFromProjectionMatrix(nf);n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);n.multiply(nf)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){if(this.map){this.map.dispose()}if(this.mapPass){this.mapPass.dispose()}}copy(t){this.camera=t.camera.clone();this.bias=t.bias;this.radius=t.radius;this.mapSize.copy(t.mapSize);return this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};if(this.bias!==0)t.bias=this.bias;if(this.normalBias!==0)t.normalBias=this.normalBias;if(this.radius!==1)t.radius=this.radius;if(this.mapSize.x!==512||this.mapSize.y!==512)t.mapSize=this.mapSize.toArray();t.camera=this.camera.toJSON(false).object;delete t.camera.matrix;return t}}class of extends af{constructor(){super(new Ao(-5,5,5,-5,.5,500));this.isDirectionalLightShadow=true}}class lf extends ef{constructor(t,e){super(t,e);this.isDirectionalLight=true;this.type="DirectionalLight";this.position.copy(di.DEFAULT_UP);this.updateMatrix();this.target=new di;this.shadow=new of}dispose(){this.shadow.dispose()}copy(t){super.copy(t);this.target=t.target.clone();this.shadow=t.shadow.clone();return this}}class cf{constructor(t,e,n=0,i=Infinity){this.ray=new Hn(t,e);this.near=n;this.far=i;this.camera=null;this.layers=new $n;this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){if(e.isPerspectiveCamera){this.ray.origin.setFromMatrixPosition(e.matrixWorld);this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize();this.camera=e}else if(e.isOrthographicCamera){this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e);this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld);this.camera=e}else{console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}}intersectObject(t,e=true,n=[]){hf(t,this,n,e);n.sort(uf);return n}intersectObjects(t,e=true,n=[]){for(let i=0,r=t.length;i<r;i++){hf(t[i],this,n,e)}n.sort(uf);return n}}function uf(t,e){return t.distance-e.distance}function hf(t,e,n,i){if(t.layers.test(e.layers)){t.raycast(e,n)}if(i===true){const i=t.children;for(let t=0,r=i.length;t<r;t++){hf(i[t],e,n,true)}}}class ff{constructor(t=1,e=0,n=0){this.radius=t;this.phi=e;this.theta=n;return this}set(t,e,n){this.radius=t;this.phi=e;this.theta=n;return this}copy(t){this.radius=t.radius;this.phi=t.phi;this.theta=t.theta;return this}makeSafe(){const t=1e-6;this.phi=Math.max(t,Math.min(Math.PI-t,this.phi));return this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){this.radius=Math.sqrt(t*t+e*e+n*n);if(this.radius===0){this.theta=0;this.phi=0}else{this.theta=Math.atan2(t,n);this.phi=Math.acos(Le(e/this.radius,-1,1))}return this}clone(){return(new this.constructor).copy(this)}}class df extends Eu{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t];const n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1];const i=new Yi;i.setAttribute("position",new Bi(e,3));i.setAttribute("color",new Bi(n,3));const r=new pu({vertexColors:true,toneMapped:false});super(i,r);this.type="AxesHelper"}setColors(t,e,n){const i=new Pi;const r=this.geometry.attributes.color.array;i.set(t);i.toArray(r,0);i.toArray(r,3);i.set(e);i.toArray(r,6);i.toArray(r,9);i.set(n);i.toArray(r,12);i.toArray(r,15);this.geometry.attributes.color.needsUpdate=true;return this}dispose(){this.geometry.dispose();this.material.dispose()}}class pf{constructor(){this.type="ShapePath";this.color=new Pi;this.subPaths=[];this.currentPath=null}moveTo(t,e){this.currentPath=new ah;this.subPaths.push(this.currentPath);this.currentPath.moveTo(t,e);return this}lineTo(t,e){this.currentPath.lineTo(t,e);return this}quadraticCurveTo(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i);return this}bezierCurveTo(t,e,n,i,r,s){this.currentPath.bezierCurveTo(t,e,n,i,r,s);return this}splineThru(t){this.currentPath.splineThru(t);return this}toShapes(t){function e(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];const r=new oh;r.curves=i.curves;e.push(r)}return e}function n(t,e){const n=e.length;let i=false;for(let r=n-1,s=0;s<n;r=s++){let n=e[r];let a=e[s];let o=a.x-n.x;let l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0){n=e[s];o=-o;a=e[r];l=-l}if(t.y<n.y||t.y>a.y)continue;if(t.y===n.y){if(t.x===n.x)return true}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(e===0)return true;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return true}}return i}const i=Bh.isClockWise;const r=this.subPaths;if(r.length===0)return[];let s,a,o;const l=[];if(r.length===1){a=r[0];o=new oh;o.curves=a.curves;l.push(o);return l}let c=!i(r[0].getPoints());c=t?!c:c;const u=[];const h=[];let f=[];let d=0;let p;h[d]=undefined;f[d]=[];for(let e=0,n=r.length;e<n;e++){a=r[e];p=a.getPoints();s=i(p);s=t?!s:s;if(s){if(!c&&h[d])d++;h[d]={s:new oh,p:p};h[d].s.curves=a.curves;if(c)d++;f[d]=[]}else{f[d].push({h:a,p:p[0]})}}if(!h[0])return e(r);if(h.length>1){let t=false;let e=0;for(let t=0,e=h.length;t<e;t++){u[t]=[]}for(let i=0,r=h.length;i<r;i++){const r=f[i];for(let s=0;s<r.length;s++){const a=r[s];let o=true;for(let r=0;r<h.length;r++){if(n(a.p,h[r].p)){if(i!==r)e++;if(o){o=false;u[r].push(a)}else{t=true}}}if(o){u[i].push(a)}}}if(e>0&&t===false){f=u}}let m;for(let t=0,e=h.length;t<e;t++){o=h[t].s;l.push(o);m=f[t];for(let t=0,e=m.length;t<e;t++){o.holes.push(m[t].h)}}return l}}if(typeof __THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:e}}))}if(typeof window!=="undefined"){if(window.__THREE__){console.warn("WARNING: Multiple instances of Three.js being imported.")}else{window.__THREE__=e}}class mf extends Vh{constructor(t,e={}){const n=e.font;if(n===undefined){super()}else{const i=n.generateShapes(t,e.size);e.depth=e.height!==undefined?e.height:50;if(e.bevelThickness===undefined)e.bevelThickness=10;if(e.bevelSize===undefined)e.bevelSize=8;if(e.bevelEnabled===undefined)e.bevelEnabled=false;super(i,e)}this.type="TextGeometry"}}class gf extends Kh{constructor(t){super(t)}load(t,e,n,i){const r=this;const s=new tf(this.manager);s.setPath(this.path);s.setRequestHeader(this.requestHeader);s.setWithCredentials(this.withCredentials);s.load(t,(function(t){const n=r.parse(JSON.parse(t));if(e)e(n)}),n,i)}parse(t){return new _f(t)}}class _f{constructor(t){this.isFont=true;this.type="Font";this.data=t}generateShapes(t,e=100){const n=[];const i=xf(t,e,this.data);for(let t=0,e=i.length;t<e;t++){n.push(...i[t].toShapes())}return n}}function xf(t,e,n){const i=Array.from(t);const r=e/n.resolution;const s=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r;const a=[];let o=0,l=0;for(let t=0;t<i.length;t++){const e=i[t];if(e==="\n"){o=0;l-=s}else{const t=vf(e,r,o,l,n);o+=t.offsetX;a.push(t.path)}}return a}function vf(t,e,n,i,r){const s=r.glyphs[t]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");return}const a=new pf;let o,l,c,u,h,f,d,p;if(s.o){const t=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let r=0,s=t.length;r<s;){const s=t[r++];switch(s){case"m":o=t[r++]*e+n;l=t[r++]*e+i;a.moveTo(o,l);break;case"l":o=t[r++]*e+n;l=t[r++]*e+i;a.lineTo(o,l);break;case"q":c=t[r++]*e+n;u=t[r++]*e+i;h=t[r++]*e+n;f=t[r++]*e+i;a.quadraticCurveTo(h,f,c,u);break;case"b":c=t[r++]*e+n;u=t[r++]*e+i;h=t[r++]*e+n;f=t[r++]*e+i;d=t[r++]*e+n;p=t[r++]*e+i;a.bezierCurveTo(h,f,d,p,c,u);break}}}return{offsetX:s.ha*e,path:a}}var Mf={0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}};var yf="normal";var Sf=1189;var Ef=-100;var Tf="normal";var bf={yMin:-334,xMin:-111,yMax:1189,xMax:1672};var wf=1e3;var Af={postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"};var Rf=-334;var qf="Helvetiker";var Cf=1522;var Lf=50;var Pf={glyphs:Mf,cssFontWeight:yf,ascender:Sf,underlinePosition:Ef,cssFontStyle:Tf,boundingBox:bf,resolution:wf,original_font_information:Af,descender:Rf,familyName:qf,lineHeight:Cf,underlineThickness:Lf};function Uf(e){e.render2DSerieLarge=async function(n){const i=await import("./DragControls-d6250d18.js");e.mainDiv.selectAll("*").remove();e.canvas=e.mainDiv.insert("div").style("display","inline-block").append("canvas").node();e.canvas.width=e.settings.svgw;e.canvas.height=e.settings.svgh;n.chartDiv.style("margin","20px 20px");n.legendDiv=e.mainDiv.insert("div").style("display","inline-block").style("vertical-align","top");let r=Math.min(20*40/n.colorLegend.size,20);if(r<12)r=12;const s=(n.colorLegend.size+6)*r;n.legendG=n.legendDiv.append("svg").attr("width",e.settings.svgw/2).attr("height",s).append("g").attr("transform","translate(20, 0)");e.renderLegend(n,r);const a=e.settings.threeFOV;const o=.1;const l=1e3;const c=new br(a,1,o,l);const u=new du;c.position.set(0,0,1);c.lookAt(u.position);c.updateMatrix();const h=new Pi("rgb(255,255,255)");u.background=h;const f=new Yi;new Fe;const{vertices:d,colors:p}=v();f.setAttribute("position",new Bi(d,3));f.setAttribute("color",new Bi(p,3));const m=M(128);const g=new Tu({size:e.settings.threeSize,sizeAttenuation:true,transparent:true,opacity:e.settings.opacity,map:m,vertexColors:true});const _=new qu(f,g);u.add(_);const x=new hu({antialias:true,canvas:e.canvas,preserveDrawingBuffer:true});x.setPixelRatio(window.devicePixelRatio);new i.DragControls([_],c,x.domElement);document.addEventListener("mousewheel",(t=>{if(t.ctrlKey)c.position.z+=t.deltaY/500}));function v(){const i=[];const r=[];for(const s of n.data.samples){const a=e.getOpacity(s);if(a==0)continue;let o=(n.xAxisScale(s.x)-n.xScaleMin)/e.canvas.width;let l=(n.yAxisScale(s.y)-n.yScaleMax)/-e.canvas.height;let c=(n.zAxisScale(s.z)-n.zScaleMin)/e.settings.svgd;i.push(o-.5,l+.7,c);const u=new Pi(t(e.getColor(s,n)).toString());r.push(u.r,u.g,u.b)}return{vertices:i,colors:r}}function M(t){const e=document.createElement("canvas");e.width=t;e.height=t;const n=e.getContext("2d");n.clearRect(0,0,t,t);n.fillStyle="white";n.beginPath();n.arc(t/2,t/2,t/2,0,2*Math.PI);n.fill();const i=new Lu(e);return i}function y(){requestAnimationFrame(y);c.zoom=e.zoom;c.updateProjectionMatrix();x.render(u,c)}y()};e.render3DSerie=async function(n){const i=await import("./OrbitControls-45f56ed4.js");n.chartDiv.selectAll("*").remove();e.canvas=e.mainDiv.insert("div").style("display","inline-block").append("canvas").node();e.canvas.width=e.settings.svgw;e.canvas.height=e.settings.svgh;n.chartDiv.style("margin","20px 20px");n.legendDiv=e.mainDiv.insert("div").style("display","inline-block").style("vertical-align","top");n.legendG=n.legendDiv.append("svg").attr("width",e.settings.svgw/2).attr("height",e.settings.svgh).attr("width",e.settings.svgw).attr("height",e.settings.svgh).append("g").attr("transform","translate(20, 20)");e.renderLegend(n);const r=e.settings.fov;const s=.1;const a=1e3;const o=new br(r,1,s,a);const l=new du;const c=new i.OrbitControls(o,e.canvas);c.enableZoom=false;c.update();o.position.set(1.5,.5,2);o.lookAt(l.position);if(e.settings.showAxes){const t=new df(1);l.add(t);e.addLabels(l,n)}o.updateMatrix();const u=new Pi("rgb(255,255,255)");l.background=u;const h=new lf(u,2);h.position.set(.1,.1,2);l.add(h);const f=new Xh(.005,32);for(const i of n.data.samples){const r=e.getOpacity(i);if(r==0)continue;let s=n.xMax==n.xMin?0:Math.abs((i.x-n.xMin)/(n.xMax-n.xMin));let a=n.yMax==n.yMin?0:Math.abs((i.y-n.yMin)/(n.yMax-n.yMin));let o=n.zMax==n.zMin?0:Math.abs((i.z-n.zMin)/(n.zMax-n.zMin));const c=new Pi(t(e.getColor(i,n)).toString());const u=new jh({color:c});const h=new fr(f,u);l.add(h);h.position.set(s,a,o);l.add(h)}const d=new hu({antialias:true,canvas:e.canvas,preserveDrawingBuffer:true});d.setPixelRatio(window.devicePixelRatio);document.addEventListener("mousewheel",(t=>{c.enableZoom=t.ctrlKey}));function p(){requestAnimationFrame(p);c.update();d.render(l,o)}p()};e.addLabels=async function(t){const n=.7;let i=s(e.config.term.term.name);let r=new fr(i,new Di({color:new Pi(n,n/4,n/4)}));r.position.x=.01;r.position.y=-.03;t.add(r);i=s(e.config.term2.term.name);i.rotateZ(Math.PI/2);r=new fr(i,new Di({color:new Pi(n/4,n,n/4)}));r.position.x=-.03;r.position.y=.01;t.add(r);i=s(e.config.term0.term.name);i.rotateY(Math.PI/2);r=new fr(i,new Di({color:new Pi(n/4,n/4,n)}));r.position.z=.98;r.position.y=-.03;t.add(r);function s(t){const e=new gf;const n=e.parse(Pf);const i=new mf(t,{font:n,size:.02,height:.005,curveSegments:8,bevelEnabled:false});return i}}}var Df=Object.freeze({__proto__:null,setRenderersThree:Uf});export{we as E,Gn as M,Dr as P,hn as Q,cf as R,ff as S,i as T,Fe as V,fn as a,n as b,Df as c,Uf as s};