@crystaldesign/diva-web-planner-react 25.9.0-beta.9 → 25.9.0-rc.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 (1367) hide show
  1. package/build/esm/ArticleProperties-ee272d6c.js +183 -0
  2. package/build/esm/CatalogProperties-0b9457e5.js +541 -0
  3. package/build/esm/DecisionVizualizer-e05bc0fa.js +279 -0
  4. package/build/esm/OptionProperties-4d329d18.js +188 -0
  5. package/build/esm/OptionValueProperties-1a36b82d.js +151 -0
  6. package/build/esm/Planner2DGrid-9fb035ff.js +647 -0
  7. package/build/esm/Planner3DImage-faef04bc.js +955 -0
  8. package/build/esm/index-01679aa0.js +125 -0
  9. package/build/esm/index-03f35c14.js +163 -0
  10. package/build/esm/index-04d3d73d.js +69 -0
  11. package/build/esm/index-05e4eae2.js +178 -0
  12. package/build/esm/index-079c09a5.js +44 -0
  13. package/build/esm/index-0952785a.js +93 -0
  14. package/build/esm/index-0a1de1b9.js +103 -0
  15. package/build/esm/index-0b46aa51.js +76 -0
  16. package/build/esm/index-0b6e40d4.js +73 -0
  17. package/build/esm/index-0e3a20e2.js +207 -0
  18. package/build/esm/index-0e3b6b41.js +183 -0
  19. package/build/esm/index-12613513.js +32 -0
  20. package/build/esm/index-13418de2.js +68 -0
  21. package/build/esm/index-13b0e5e0.js +64 -0
  22. package/build/esm/index-16cea8f1.js +68 -0
  23. package/build/esm/index-1a3ab6be.js +32 -0
  24. package/build/esm/index-1b15ac66.js +32 -0
  25. package/build/esm/index-1c751c5f.js +141 -0
  26. package/build/esm/index-1cad1f93.js +105 -0
  27. package/build/esm/index-1d8ef880.js +181 -0
  28. package/build/esm/index-2175ce70.js +57 -0
  29. package/build/esm/index-220bdc3e.js +120 -0
  30. package/build/esm/index-23cb107a.js +81 -0
  31. package/build/esm/index-24438765.js +124 -0
  32. package/build/esm/index-24d8e0ca.js +128 -0
  33. package/build/esm/index-2627e6d7.js +117 -0
  34. package/build/esm/index-2664c0b5.js +95 -0
  35. package/build/esm/index-26aebe9f.js +32 -0
  36. package/build/esm/index-27e8ec1d.js +139 -0
  37. package/build/esm/index-29a53e55.js +94 -0
  38. package/build/esm/index-2c19b3f4.js +48 -0
  39. package/build/esm/index-2ccae45f.js +167 -0
  40. package/build/esm/index-2d8da945.js +32 -0
  41. package/build/esm/index-2dd28614.js +88 -0
  42. package/build/esm/index-2fbb7efc.js +44 -0
  43. package/build/esm/index-31db0e80.js +56 -0
  44. package/build/esm/index-32e52f0d.js +282 -0
  45. package/build/esm/index-3304dfe7.js +108 -0
  46. package/build/esm/index-35d113a1.js +40 -0
  47. package/build/esm/index-373273b2.js +99 -0
  48. package/build/esm/index-38e08486.js +87 -0
  49. package/build/esm/index-39c818ad.js +204 -0
  50. package/build/esm/index-3a238a3c.js +32 -0
  51. package/build/esm/index-3e7c037a.js +197 -0
  52. package/build/esm/index-3e8bf03c.js +32 -0
  53. package/build/esm/index-3e9b563e.js +36 -0
  54. package/build/esm/index-3ee321f4.js +105 -0
  55. package/build/esm/index-3fcd95a0.js +90 -0
  56. package/build/esm/index-3fd5d291.js +49 -0
  57. package/build/esm/index-407c77c8.js +87 -0
  58. package/build/esm/index-41b5b357.js +50 -0
  59. package/build/esm/index-42d775d3.js +48 -0
  60. package/build/esm/index-44c7ba38.js +58 -0
  61. package/build/esm/index-455f2725.js +125 -0
  62. package/build/esm/index-460a2d33.js +54 -0
  63. package/build/esm/index-461471b1.js +194 -0
  64. package/build/esm/index-4636c701.js +97 -0
  65. package/build/esm/index-49033906.js +99 -0
  66. package/build/esm/index-491160ca.js +102 -0
  67. package/build/esm/index-497d438a.js +47 -0
  68. package/build/esm/index-4b6fb704.js +46 -0
  69. package/build/esm/index-4ba394fb.js +30 -0
  70. package/build/esm/index-4c43ef5e.js +59 -0
  71. package/build/esm/index-4cb33ba2.js +140 -0
  72. package/build/esm/index-4e45ce76.js +32 -0
  73. package/build/esm/index-4ff56657.js +155 -0
  74. package/build/esm/index-5198321e.js +154 -0
  75. package/build/esm/index-537bb435.js +58 -0
  76. package/build/esm/index-5387e911.js +42 -0
  77. package/build/esm/index-53c375fd.js +40 -0
  78. package/build/esm/index-56af9bf6.js +153 -0
  79. package/build/esm/index-5773abf6.js +126 -0
  80. package/build/esm/index-58387646.js +43 -0
  81. package/build/esm/index-58ec8e0b.js +80 -0
  82. package/build/esm/index-59430be8.js +556 -0
  83. package/build/esm/index-59d583d3.js +123 -0
  84. package/build/esm/index-5a3c91c8.js +132 -0
  85. package/build/esm/index-5b3a9a81.js +58 -0
  86. package/build/esm/index-5b45677f.js +161 -0
  87. package/build/esm/index-5c7f568e.js +79 -0
  88. package/build/esm/index-5caac1b0.js +43 -0
  89. package/build/esm/index-5e9b93e0.js +184 -0
  90. package/build/esm/index-5f179563.js +41 -0
  91. package/build/esm/index-617a02b0.js +199 -0
  92. package/build/esm/index-61aefd6d.js +146 -0
  93. package/build/esm/index-61b6b02e.js +118 -0
  94. package/build/esm/index-62bbb883.js +103 -0
  95. package/build/esm/index-62d1664b.js +62 -0
  96. package/build/esm/index-6395ea79.js +56 -0
  97. package/build/esm/index-6414f7f2.js +67 -0
  98. package/build/esm/index-682383f2.js +66 -0
  99. package/build/esm/index-68738f07.js +143 -0
  100. package/build/esm/index-6a610a07.js +135 -0
  101. package/build/esm/index-6bf8686a.js +47 -0
  102. package/build/esm/index-6e313f76.js +96 -0
  103. package/build/esm/index-6f49cd0b.js +113 -0
  104. package/build/esm/index-6f97ec29.js +161 -0
  105. package/build/esm/index-6fafabe0.js +81 -0
  106. package/build/esm/index-707613bc.js +32 -0
  107. package/build/esm/index-708ae258.js +32 -0
  108. package/build/esm/index-708c7617.js +403 -0
  109. package/build/esm/index-7405ba6a.js +85 -0
  110. package/build/esm/index-779c413e.js +211 -0
  111. package/build/esm/index-78989836.js +96 -0
  112. package/build/esm/index-78ed3aa9.js +46 -0
  113. package/build/esm/index-798d68a4.js +168 -0
  114. package/build/esm/index-7a19ae2c.js +61 -0
  115. package/build/esm/index-7bf1e29e.js +95 -0
  116. package/build/esm/index-7c709924.js +123 -0
  117. package/build/esm/index-7ca33aff.js +66 -0
  118. package/build/esm/index-7dda49b6.js +44 -0
  119. package/build/esm/index-7f66d44c.js +103 -0
  120. package/build/esm/index-8037b2f7.js +161 -0
  121. package/build/esm/index-804b8291.js +49 -0
  122. package/build/esm/index-8059fd35.js +32 -0
  123. package/build/esm/index-82944be0.js +87 -0
  124. package/build/esm/index-832ca166.js +169 -0
  125. package/build/esm/index-85d79537.js +62 -0
  126. package/build/esm/index-8725b14f.js +164 -0
  127. package/build/esm/index-87ba3217.js +124 -0
  128. package/build/esm/index-88072857.js +54 -0
  129. package/build/esm/index-88d7e7ae.js +106 -0
  130. package/build/esm/index-88db02ea.js +137 -0
  131. package/build/esm/index-8998255e.js +82 -0
  132. package/build/esm/index-899ac63c.js +163 -0
  133. package/build/esm/index-8ad381db.js +40 -0
  134. package/build/esm/index-8c19880b.js +77 -0
  135. package/build/esm/index-8c7174d4.js +47 -0
  136. package/build/esm/index-8d5655d2.js +66 -0
  137. package/build/esm/index-8d6d26a2.js +65 -0
  138. package/build/esm/index-8e6a1d86.js +88 -0
  139. package/build/esm/index-8ffa96f3.js +139 -0
  140. package/build/esm/index-90ef53ba.js +43 -0
  141. package/build/esm/index-9150862c.js +73 -0
  142. package/build/esm/index-92636e7e.js +71 -0
  143. package/build/esm/index-96951e19.js +38 -0
  144. package/build/esm/index-9725001c.js +32 -0
  145. package/build/esm/index-995877a8.js +32 -0
  146. package/build/esm/index-9b83c24b.js +32 -0
  147. package/build/esm/index-9cf5046a.js +56 -0
  148. package/build/esm/index-9cff7a73.js +40 -0
  149. package/build/esm/index-9d3b01c5.js +295 -0
  150. package/build/esm/index-9db055a0.js +49 -0
  151. package/build/esm/index-a027e4d6.js +47 -0
  152. package/build/esm/index-a29fe3cc.js +50 -0
  153. package/build/esm/index-a448e181.js +28 -0
  154. package/build/esm/index-a61bf66a.js +72 -0
  155. package/build/esm/index-a977471f.js +154 -0
  156. package/build/esm/index-ab56eb05.js +92 -0
  157. package/build/esm/index-ac034357.js +136 -0
  158. package/build/esm/index-ac5f2159.js +32 -0
  159. package/build/esm/index-ad93e314.js +100 -0
  160. package/build/esm/index-b0057d01.js +90 -0
  161. package/build/esm/index-b1dcf5dc.js +46 -0
  162. package/build/esm/index-b255978e.js +32 -0
  163. package/build/esm/index-b2e2ce9d.js +49 -0
  164. package/build/esm/index-b3412fe0.js +200 -0
  165. package/build/esm/index-b400db02.js +41 -0
  166. package/build/esm/index-b4a509d8.js +201 -0
  167. package/build/esm/index-b6fd3503.js +51 -0
  168. package/build/esm/index-b6fd7955.js +98 -0
  169. package/build/esm/index-b852789e.js +286 -0
  170. package/build/esm/index-bace7177.js +51 -0
  171. package/build/esm/index-bbc6bd29.js +58 -0
  172. package/build/esm/index-bbf84c83.js +59 -0
  173. package/build/esm/index-bc7de908.js +52 -0
  174. package/build/esm/index-bc894b2a.js +57 -0
  175. package/build/esm/index-bdc59cef.js +274 -0
  176. package/build/esm/index-bf59b152.js +131 -0
  177. package/build/esm/index-c0510d75.js +269 -0
  178. package/build/esm/index-c0d1cf36.js +84 -0
  179. package/build/esm/index-c1da6810.js +32 -0
  180. package/build/esm/index-c20a3a3f.js +44 -0
  181. package/build/esm/index-c25c3e0d.js +44 -0
  182. package/build/esm/index-c3965789.js +79 -0
  183. package/build/esm/index-c41dafb0.js +32 -0
  184. package/build/esm/index-c62121af.js +32 -0
  185. package/build/esm/index-c6739c96.js +51 -0
  186. package/build/esm/index-c6744ca1.js +42 -0
  187. package/build/esm/index-c6db9a7a.js +268 -0
  188. package/build/esm/index-c7329cf6.js +73 -0
  189. package/build/esm/index-c7c91493.js +152 -0
  190. package/build/esm/index-c8f8c9b8.js +76 -0
  191. package/build/esm/index-c99b8e51.js +77 -0
  192. package/build/esm/index-ca126268.js +100 -0
  193. package/build/esm/index-ca3e530e.js +131 -0
  194. package/build/esm/index-ca6294fb.js +125 -0
  195. package/build/esm/index-ca7f3d9e.js +36 -0
  196. package/build/esm/index-ca90ca1d.js +65 -0
  197. package/build/esm/index-cab35b1b.js +64 -0
  198. package/build/esm/index-cada4fdd.js +50 -0
  199. package/build/esm/index-cae7645a.js +456 -0
  200. package/build/esm/index-cbb2283d.js +32 -0
  201. package/build/esm/index-cbb40f72.js +32 -0
  202. package/build/esm/index-cdda2daa.js +95 -0
  203. package/build/esm/index-cff5f93b.js +61 -0
  204. package/build/esm/index-d0155646.js +85 -0
  205. package/build/esm/index-d13b4fed.js +61 -0
  206. package/build/esm/index-d1ad8349.js +86 -0
  207. package/build/esm/index-d244983e.js +32 -0
  208. package/build/esm/index-d2824e87.js +117 -0
  209. package/build/esm/index-d317a1b8.js +143 -0
  210. package/build/esm/index-d58ac1e0.js +73 -0
  211. package/build/esm/index-d6fd9f0b.js +165 -0
  212. package/build/esm/index-d736221f.js +129 -0
  213. package/build/esm/index-d78a4c34.js +67 -0
  214. package/build/esm/index-d7b66e3c.js +86 -0
  215. package/build/esm/index-d7be8339.js +51 -0
  216. package/build/esm/index-d809398f.js +100 -0
  217. package/build/esm/index-d9563f51.js +51 -0
  218. package/build/esm/index-daa86bf4.js +68 -0
  219. package/build/esm/index-db251866.js +83 -0
  220. package/build/esm/index-dbf2adc1.js +107 -0
  221. package/build/esm/index-ddce3dd0.js +40 -0
  222. package/build/esm/index-dedd9490.js +138 -0
  223. package/build/esm/index-df8040ce.js +88 -0
  224. package/build/esm/index-e0c6b93d.js +12557 -0
  225. package/build/esm/index-e2ae7558.js +123 -0
  226. package/build/esm/index-e2af8614.js +182 -0
  227. package/build/esm/index-e39e842b.js +195 -0
  228. package/build/esm/index-e42b8933.js +107 -0
  229. package/build/esm/index-e48ed829.js +219 -0
  230. package/build/esm/index-e562f45d.js +146 -0
  231. package/build/esm/index-e96ec6f9.js +185 -0
  232. package/build/esm/index-eb99bd89.js +55 -0
  233. package/build/esm/index-ec0b066b.js +161 -0
  234. package/build/esm/index-ec16f3b3.js +142 -0
  235. package/build/esm/index-ec524bff.js +107 -0
  236. package/build/esm/index-efb65b32.js +128 -0
  237. package/build/esm/index-f04ce6da.js +80 -0
  238. package/build/esm/index-f765cc7c.js +147 -0
  239. package/build/esm/index-f8662a02.js +58 -0
  240. package/build/esm/index-f90a3b6a.js +157 -0
  241. package/build/esm/index-fa79d152.js +37 -0
  242. package/build/esm/index-fd302a2d.js +108 -0
  243. package/build/esm/index-fd859d6d.js +74 -0
  244. package/build/esm/index-fde833e1.js +159 -0
  245. package/build/esm/index-fe0982b5.js +180 -0
  246. package/build/esm/index-fff0113a.js +61 -0
  247. package/build/esm/index.js +1 -1
  248. package/build/esm/index.module-10abb965.js +13 -0
  249. package/build/esm/index.module-3d8f2891.js +12 -0
  250. package/build/esm/index.module-4b3422bc.js +18 -0
  251. package/build/esm/index.module-53c3e6b0.js +8 -0
  252. package/build/esm/index.module-72174292.js +26 -0
  253. package/build/esm/index.module-743bc8b7.js +18 -0
  254. package/build/esm/index.module-8f869cc4.js +21 -0
  255. package/build/esm/index.module-c9f41b62.js +7 -0
  256. package/build/esm/index.module-dff51b67.js +25 -0
  257. package/build/esm/index.module-e9a4adcf.js +13 -0
  258. package/build/esm/index.module-efedddda.js +9 -0
  259. package/build/esm/index.module-f4947c3c.js +17 -0
  260. package/build/esm/react-json-viewer-fa60bfe2.js +4 -0
  261. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/CreateAppointment/index.d.ts +5 -2
  262. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/CreateAppointment/index.d.ts.map +1 -1
  263. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Save/index.d.ts +3 -2
  264. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Save/index.d.ts.map +1 -1
  265. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/CreatignQrCode/index.d.ts +9 -0
  266. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/CreatignQrCode/index.d.ts.map +1 -0
  267. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/LoadingButton/index.d.ts +9 -0
  268. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/LoadingButton/index.d.ts.map +1 -0
  269. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/MultiToggleSwitch/index.d.ts +2 -1
  270. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/MultiToggleSwitch/index.d.ts.map +1 -1
  271. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/ShareViaEmail/index.d.ts +3 -2
  272. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/ShareViaEmail/index.d.ts.map +1 -1
  273. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/ShareViaSocialMedias/index.d.ts +3 -1
  274. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/ShareViaSocialMedias/index.d.ts.map +1 -1
  275. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/ShareViaUrl/index.d.ts +3 -1
  276. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/ShareViaUrl/index.d.ts.map +1 -1
  277. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/index.d.ts +3 -2
  278. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/Share/index.d.ts.map +1 -1
  279. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/index.d.ts +4 -3
  280. package/build/types/web-planner-react/src/components/GlobalElements/Checkout/index.d.ts.map +1 -1
  281. package/build/types/web-planner-react/src/components/Layout/standard/index.d.ts.map +1 -1
  282. package/build/types/web-planner-react/src/components/Layout/wysiwyg/Toolbar/ToolContainer/index.d.ts.map +1 -1
  283. package/build/types/web-planner-react/src/components/Product/ContentItemWrapper/index.d.ts.map +1 -1
  284. package/build/types/web-planner-react/src/components/Product/Product/catalog/Components/CatalogMakeup/LayoutSelection/index.d.ts.map +1 -1
  285. package/build/types/web-planner-react/src/components/Product/Product/catalog/Components/CatalogMakeup/OptionSelector/index.d.ts.map +1 -1
  286. package/build/types/web-planner-react/src/components/Product/Product/catalog/Components/GridOverview/index.d.ts +8 -0
  287. package/build/types/web-planner-react/src/components/Product/Product/catalog/Components/GridOverview/index.d.ts.map +1 -0
  288. package/build/types/web-planner-react/src/components/Product/Product/catalog/Components/PropertiesEditor/Properties/CatalogProperties.d.ts.map +1 -1
  289. package/build/types/web-planner-react/src/components/Product/Product/catalog/Sidebar/index.d.ts.map +1 -1
  290. package/build/types/web-planner-react/src/components/Product/Product/catalog/index.d.ts +1 -1
  291. package/build/types/web-planner-react/src/components/Product/Product/catalog/index.d.ts.map +1 -1
  292. package/build/types/web-planner-react/src/components/Product/ProductCenter/Planner3D/index.d.ts.map +1 -1
  293. package/build/types/web-planner-react/src/components/Product/ProductCenter/Planner3DImage/NavBar/standard/ArQrCodeIcon/index.d.ts.map +1 -1
  294. package/build/types/web-planner-react/src/components/Product/ProductCenter/PlannerRTV/index.d.ts.map +1 -1
  295. package/build/types/web-planner-react/src/components/Product/ProductHeader/Functions/standard/index.d.ts.map +1 -1
  296. package/build/types/web-planner-react/src/components/Settings/SettingsExpanderButtons/index.d.ts +7 -0
  297. package/build/types/web-planner-react/src/components/Settings/SettingsExpanderButtons/index.d.ts.map +1 -0
  298. package/build/types/web-planner-react/src/components/Settings/SettingsHeaderContainer/SettingsItemHeader/Header/index.d.ts +2 -1
  299. package/build/types/web-planner-react/src/components/Settings/SettingsHeaderContainer/SettingsItemHeader/Header/index.d.ts.map +1 -1
  300. package/build/types/web-planner-react/src/components/Settings/SettingsHeaderContainer/SettingsItemHeader/Header/standard/index.d.ts +1 -1
  301. package/build/types/web-planner-react/src/components/Settings/SettingsHeaderContainer/SettingsItemHeader/Header/standard/index.d.ts.map +1 -1
  302. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ComponentMap/index.d.ts.map +1 -1
  303. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/HorizontalGroup/index.d.ts +11 -0
  304. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/HorizontalGroup/index.d.ts.map +1 -0
  305. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/index.d.ts +12 -0
  306. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/index.d.ts.map +1 -0
  307. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/jungle/group/index.d.ts +14 -0
  308. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/jungle/group/index.d.ts.map +1 -0
  309. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/jungle/index.d.ts.map +1 -0
  310. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/standard/Group/index.d.ts +13 -0
  311. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/standard/Group/index.d.ts.map +1 -0
  312. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroup/standard/index.d.ts.map +1 -0
  313. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroupDropdown/index.d.ts +15 -0
  314. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/Groups/PaletteGroupDropdown/index.d.ts.map +1 -0
  315. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/ArticleOverviewWrapper/index.d.ts +7 -0
  316. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/ArticleOverviewWrapper/index.d.ts.map +1 -0
  317. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/Facelift/index.d.ts +11 -0
  318. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/Facelift/index.d.ts.map +1 -0
  319. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/PlannerOverview/addElement/index.d.ts +10 -0
  320. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/PlannerOverview/addElement/index.d.ts.map +1 -0
  321. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/PlannerOverview/index.d.ts +10 -0
  322. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Article/PlannerOverview/index.d.ts.map +1 -0
  323. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/HeaderAndOption/DropDownText/standard/index.d.ts.map +1 -1
  324. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/Default/MultiToggle/MultiToggleSwitch/index.d.ts +9 -0
  325. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/Default/MultiToggle/MultiToggleSwitch/index.d.ts.map +1 -0
  326. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/Default/MultiToggle/index.d.ts +13 -0
  327. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/Default/MultiToggle/index.d.ts.map +1 -0
  328. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/Default/Slider/index.d.ts +13 -0
  329. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/Default/Slider/index.d.ts.map +1 -0
  330. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/GalleryText/index.d.ts.map +1 -1
  331. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/GalleryText2/index.d.ts +7 -0
  332. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemPalette/Options/GalleryText2/index.d.ts.map +1 -0
  333. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/ItemWrapper/index.d.ts.map +1 -1
  334. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/index.d.ts.map +1 -1
  335. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/useGridVariables.d.ts +3 -0
  336. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/useGridVariables.d.ts.map +1 -0
  337. package/build/types/web-planner-react/src/components/Settings/SettingsSwiper/index.d.ts +7 -0
  338. package/build/types/web-planner-react/src/components/Settings/SettingsSwiper/index.d.ts.map +1 -0
  339. package/build/types/web-planner-react/src/components/Settings/index.d.ts.map +1 -1
  340. package/build/types/web-planner-react/src/components/TabGroup/TabGroupHorizontal/item/standard/index.d.ts.map +1 -1
  341. package/build/types/web-planner-react/src/components/TabGroup/index.d.ts.map +1 -1
  342. package/build/types/web-planner-react/src/model/DivaViewHandler.d.ts +8 -2
  343. package/build/types/web-planner-react/src/model/DivaViewHandler.d.ts.map +1 -1
  344. package/build/types/web-planner-react/src/model/Palette/PaletteViewHandler.d.ts +23 -5
  345. package/build/types/web-planner-react/src/model/Palette/PaletteViewHandler.d.ts.map +1 -1
  346. package/build/types/web-planner-react/src/model/Palette/Steps/Planner2Dot0Step/PlannerItems.d.ts +14 -0
  347. package/build/types/web-planner-react/src/model/Palette/Steps/Planner2Dot0Step/PlannerItems.d.ts.map +1 -0
  348. package/build/types/web-planner-react/src/model/Palette/Steps/PlannerStep/PlannerItems.d.ts +2 -0
  349. package/build/types/web-planner-react/src/model/Palette/Steps/PlannerStep/PlannerItems.d.ts.map +1 -1
  350. package/build/types/web-planner-react/src/model/Palette/VisitStepsHandler.d.ts.map +1 -1
  351. package/build/types/web-planner-react/src/model/Planner/Planner3DImageUI.d.ts.map +1 -1
  352. package/build/types/web-planner-react/src/model/Planner/ViewPlannerHandler.d.ts +5 -2
  353. package/build/types/web-planner-react/src/model/Planner/ViewPlannerHandler.d.ts.map +1 -1
  354. package/build/types/web-planner-react/src/model/Planner/Viewer/Planner3DImage.d.ts +1 -1
  355. package/build/types/web-planner-react/src/model/Planner/Viewer/Planner3DImage.d.ts.map +1 -1
  356. package/build/types/web-planner-react/src/model/States/UIState/ActionButtons/index.d.ts +3 -3
  357. package/build/types/web-planner-react/src/model/States/UIState/ActionButtons/index.d.ts.map +1 -1
  358. package/build/types/web-planner-react/src/model/States/UIState/Product/index.d.ts +1 -1
  359. package/build/types/web-planner-react/src/model/States/UIState/Product/index.d.ts.map +1 -1
  360. package/build/types/web-planner-react/src/model/States/UIState/Settings/index.d.ts +20 -1
  361. package/build/types/web-planner-react/src/model/States/UIState/Settings/index.d.ts.map +1 -1
  362. package/build/types/web-planner-react/src/model/States/UIState/index.d.ts +1 -0
  363. package/build/types/web-planner-react/src/model/States/UIState/index.d.ts.map +1 -1
  364. package/build/types/web-planner-react/src/model/TabGroup/ConfiguratorStructureHandler.d.ts.map +1 -1
  365. package/build/types/web-planner-react/src/model/plannerHelper.d.ts.map +1 -1
  366. package/build/types/web-planner-react/src/model/types.d.ts +27 -2
  367. package/build/types/web-planner-react/src/model/types.d.ts.map +1 -1
  368. package/build/umd/1001.diva-web-planner-react.umd.min.js +2 -0
  369. package/build/umd/1001.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  370. package/build/umd/1008.diva-web-planner-react.umd.min.js +2 -0
  371. package/build/umd/1008.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  372. package/build/umd/1037.diva-web-planner-react.umd.min.js +2 -0
  373. package/build/umd/1037.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  374. package/build/umd/1139.diva-web-planner-react.umd.min.js +2 -0
  375. package/build/umd/1139.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  376. package/build/umd/1280.diva-web-planner-react.umd.min.js +1 -1
  377. package/build/umd/1414.diva-web-planner-react.umd.min.js +1 -1
  378. package/build/umd/1451.diva-web-planner-react.umd.min.js +2 -0
  379. package/build/umd/1451.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  380. package/build/umd/1457.diva-web-planner-react.umd.min.js +2 -0
  381. package/build/umd/1457.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  382. package/build/umd/1462.diva-web-planner-react.umd.min.js +2 -0
  383. package/build/umd/1462.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  384. package/build/umd/1577.diva-web-planner-react.umd.min.js +2 -0
  385. package/build/umd/1577.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  386. package/build/umd/1581.diva-web-planner-react.umd.min.js +2 -0
  387. package/build/umd/1581.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  388. package/build/umd/163.diva-web-planner-react.umd.min.js +2 -0
  389. package/build/umd/163.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  390. package/build/umd/1633.diva-web-planner-react.umd.min.js +2 -0
  391. package/build/umd/1633.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  392. package/build/umd/1679.diva-web-planner-react.umd.min.js +2 -0
  393. package/build/umd/1679.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  394. package/build/umd/1680.diva-web-planner-react.umd.min.js +2 -0
  395. package/build/umd/1680.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  396. package/build/umd/1801.diva-web-planner-react.umd.min.js +2 -0
  397. package/build/umd/1801.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  398. package/build/umd/1849.diva-web-planner-react.umd.min.js +2 -0
  399. package/build/umd/1849.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  400. package/build/umd/1878.diva-web-planner-react.umd.min.js +2 -0
  401. package/build/umd/1878.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  402. package/build/umd/1880.diva-web-planner-react.umd.min.js +2 -0
  403. package/build/umd/1880.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  404. package/build/umd/1900.diva-web-planner-react.umd.min.js +2 -0
  405. package/build/umd/1900.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  406. package/build/umd/1912.diva-web-planner-react.umd.min.js +1 -1
  407. package/build/umd/1922.diva-web-planner-react.umd.min.js +1 -1
  408. package/build/umd/1932.diva-web-planner-react.umd.min.js +1 -1
  409. package/build/umd/1951.diva-web-planner-react.umd.min.js +2 -0
  410. package/build/umd/1951.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  411. package/build/umd/1989.diva-web-planner-react.umd.min.js +2 -0
  412. package/build/umd/1989.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  413. package/build/umd/2018.diva-web-planner-react.umd.min.js +1 -1
  414. package/build/umd/2027.diva-web-planner-react.umd.min.js +1 -1
  415. package/build/umd/2072.diva-web-planner-react.umd.min.js +1 -1
  416. package/build/umd/2093.diva-web-planner-react.umd.min.js +2 -0
  417. package/build/umd/2093.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  418. package/build/umd/2105.diva-web-planner-react.umd.min.js +2 -0
  419. package/build/umd/2105.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  420. package/build/umd/2147.diva-web-planner-react.umd.min.js +1 -1
  421. package/build/umd/2185.diva-web-planner-react.umd.min.js +1 -1
  422. package/build/umd/227.diva-web-planner-react.umd.min.js +2 -0
  423. package/build/umd/227.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  424. package/build/umd/2318.diva-web-planner-react.umd.min.js +2 -0
  425. package/build/umd/2318.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  426. package/build/umd/2333.diva-web-planner-react.umd.min.js +2 -0
  427. package/build/umd/2333.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  428. package/build/umd/2334.diva-web-planner-react.umd.min.js +1 -1
  429. package/build/umd/2408.diva-web-planner-react.umd.min.js +2 -0
  430. package/build/umd/2408.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  431. package/build/umd/243.diva-web-planner-react.umd.min.js +2 -0
  432. package/build/umd/243.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  433. package/build/umd/2452.diva-web-planner-react.umd.min.js +1 -1
  434. package/build/umd/2453.diva-web-planner-react.umd.min.js +2 -0
  435. package/build/umd/2453.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  436. package/build/umd/2529.diva-web-planner-react.umd.min.js +2 -0
  437. package/build/umd/2529.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  438. package/build/umd/2568.diva-web-planner-react.umd.min.js +1 -1
  439. package/build/umd/2585.diva-web-planner-react.umd.min.js +2 -0
  440. package/build/umd/2585.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  441. package/build/umd/2592.diva-web-planner-react.umd.min.js +2 -0
  442. package/build/umd/2592.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  443. package/build/umd/2595.diva-web-planner-react.umd.min.js +2 -0
  444. package/build/umd/2595.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  445. package/build/umd/2614.diva-web-planner-react.umd.min.js +2 -0
  446. package/build/umd/2614.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  447. package/build/umd/2654.diva-web-planner-react.umd.min.js +1 -1
  448. package/build/umd/2676.diva-web-planner-react.umd.min.js +2 -0
  449. package/build/umd/2676.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  450. package/build/umd/2692.diva-web-planner-react.umd.min.js +2 -0
  451. package/build/umd/2692.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  452. package/build/umd/2707.diva-web-planner-react.umd.min.js +2 -0
  453. package/build/umd/2707.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  454. package/build/umd/2735.diva-web-planner-react.umd.min.js +2 -0
  455. package/build/umd/2735.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  456. package/build/umd/2816.diva-web-planner-react.umd.min.js +2 -0
  457. package/build/umd/2816.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  458. package/build/umd/3001.diva-web-planner-react.umd.min.js +2 -0
  459. package/build/umd/3001.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  460. package/build/umd/3090.diva-web-planner-react.umd.min.js +1 -1
  461. package/build/umd/3168.diva-web-planner-react.umd.min.js +2 -0
  462. package/build/umd/3168.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  463. package/build/umd/326.diva-web-planner-react.umd.min.js +2 -0
  464. package/build/umd/326.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  465. package/build/umd/3275.diva-web-planner-react.umd.min.js +2 -0
  466. package/build/umd/3275.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  467. package/build/umd/3337.diva-web-planner-react.umd.min.js +2 -0
  468. package/build/umd/3337.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  469. package/build/umd/3411.diva-web-planner-react.umd.min.js +2 -0
  470. package/build/umd/3411.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  471. package/build/umd/3460.diva-web-planner-react.umd.min.js +1 -1
  472. package/build/umd/3513.diva-web-planner-react.umd.min.js +2 -0
  473. package/build/umd/3513.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  474. package/build/umd/3533.diva-web-planner-react.umd.min.js +1 -1
  475. package/build/umd/3538.diva-web-planner-react.umd.min.js +2 -0
  476. package/build/umd/3538.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  477. package/build/umd/357.diva-web-planner-react.umd.min.js +1 -1
  478. package/build/umd/3575.diva-web-planner-react.umd.min.js +2 -0
  479. package/build/umd/3575.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  480. package/build/umd/3596.diva-web-planner-react.umd.min.js +1 -1
  481. package/build/umd/3672.diva-web-planner-react.umd.min.js +2 -0
  482. package/build/umd/3672.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  483. package/build/umd/3695.diva-web-planner-react.umd.min.js +1 -1
  484. package/build/umd/3703.diva-web-planner-react.umd.min.js +1 -1
  485. package/build/umd/3721.diva-web-planner-react.umd.min.js +2 -0
  486. package/build/umd/3721.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  487. package/build/umd/3756.diva-web-planner-react.umd.min.js +1 -1
  488. package/build/umd/3812.diva-web-planner-react.umd.min.js +1 -1
  489. package/build/umd/3864.diva-web-planner-react.umd.min.js +2 -0
  490. package/build/umd/3864.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  491. package/build/umd/4001.diva-web-planner-react.umd.min.js +2 -0
  492. package/build/umd/4001.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  493. package/build/umd/4044.diva-web-planner-react.umd.min.js +2 -0
  494. package/build/umd/4044.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  495. package/build/umd/4050.diva-web-planner-react.umd.min.js +2 -0
  496. package/build/umd/4050.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  497. package/build/umd/4054.diva-web-planner-react.umd.min.js +2 -0
  498. package/build/umd/4054.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  499. package/build/umd/4060.diva-web-planner-react.umd.min.js +1 -1
  500. package/build/umd/4101.diva-web-planner-react.umd.min.js +2 -0
  501. package/build/umd/4101.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  502. package/build/umd/4144.diva-web-planner-react.umd.min.js +2 -0
  503. package/build/umd/4144.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  504. package/build/umd/4174.diva-web-planner-react.umd.min.js +2 -0
  505. package/build/umd/4174.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  506. package/build/umd/4228.diva-web-planner-react.umd.min.js +2 -0
  507. package/build/umd/4228.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  508. package/build/umd/4272.diva-web-planner-react.umd.min.js +2 -0
  509. package/build/umd/4272.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  510. package/build/umd/4300.diva-web-planner-react.umd.min.js +2 -0
  511. package/build/umd/4300.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  512. package/build/umd/4424.diva-web-planner-react.umd.min.js +2 -0
  513. package/build/umd/4424.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  514. package/build/umd/4472.diva-web-planner-react.umd.min.js +2 -0
  515. package/build/umd/4472.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  516. package/build/umd/4475.diva-web-planner-react.umd.min.js +2 -0
  517. package/build/umd/4475.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  518. package/build/umd/4516.diva-web-planner-react.umd.min.js +1 -1
  519. package/build/umd/4580.diva-web-planner-react.umd.min.js +1 -1
  520. package/build/umd/4581.diva-web-planner-react.umd.min.js +1 -1
  521. package/build/umd/4585.diva-web-planner-react.umd.min.js +1 -1
  522. package/build/umd/4649.diva-web-planner-react.umd.min.js +2 -0
  523. package/build/umd/4649.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  524. package/build/umd/4788.diva-web-planner-react.umd.min.js +2 -0
  525. package/build/umd/4788.diva-web-planner-react.umd.min.js.LICENSE.txt +7 -0
  526. package/build/umd/4827.diva-web-planner-react.umd.min.js +2 -0
  527. package/build/umd/4827.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  528. package/build/umd/4829.diva-web-planner-react.umd.min.js +1 -1
  529. package/build/umd/4873.diva-web-planner-react.umd.min.js +2 -0
  530. package/build/umd/4873.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  531. package/build/umd/49.diva-web-planner-react.umd.min.js +2 -0
  532. package/build/umd/49.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  533. package/build/umd/4903.diva-web-planner-react.umd.min.js +1 -1
  534. package/build/umd/4909.diva-web-planner-react.umd.min.js +2 -0
  535. package/build/umd/4909.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  536. package/build/umd/4959.diva-web-planner-react.umd.min.js +2 -0
  537. package/build/umd/4959.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  538. package/build/umd/497.diva-web-planner-react.umd.min.js +2 -0
  539. package/build/umd/497.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  540. package/build/umd/4980.diva-web-planner-react.umd.min.js +2 -0
  541. package/build/umd/4980.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  542. package/build/umd/5056.diva-web-planner-react.umd.min.js +2 -0
  543. package/build/umd/5056.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  544. package/build/umd/5106.diva-web-planner-react.umd.min.js +1 -1
  545. package/build/umd/5111.diva-web-planner-react.umd.min.js +1 -1
  546. package/build/umd/5115.diva-web-planner-react.umd.min.js +1 -1
  547. package/build/umd/5160.diva-web-planner-react.umd.min.js +2 -0
  548. package/build/umd/5160.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  549. package/build/umd/5178.diva-web-planner-react.umd.min.js +2 -0
  550. package/build/umd/5178.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  551. package/build/umd/5184.diva-web-planner-react.umd.min.js +2 -0
  552. package/build/umd/5184.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  553. package/build/umd/5322.diva-web-planner-react.umd.min.js +2 -0
  554. package/build/umd/5322.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  555. package/build/umd/5335.diva-web-planner-react.umd.min.js +2 -0
  556. package/build/umd/5335.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  557. package/build/umd/5340.diva-web-planner-react.umd.min.js +2 -0
  558. package/build/umd/5340.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  559. package/build/umd/5389.diva-web-planner-react.umd.min.js +2 -0
  560. package/build/umd/5389.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  561. package/build/umd/5391.diva-web-planner-react.umd.min.js +2 -0
  562. package/build/umd/5391.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  563. package/build/umd/5413.diva-web-planner-react.umd.min.js +2 -0
  564. package/build/umd/5413.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  565. package/build/umd/5414.diva-web-planner-react.umd.min.js +1 -1
  566. package/build/umd/5583.diva-web-planner-react.umd.min.js +2 -0
  567. package/build/umd/5583.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  568. package/build/umd/5649.diva-web-planner-react.umd.min.js +2 -0
  569. package/build/umd/5649.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  570. package/build/umd/5670.diva-web-planner-react.umd.min.js +2 -0
  571. package/build/umd/5670.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  572. package/build/umd/5745.diva-web-planner-react.umd.min.js +2 -0
  573. package/build/umd/5745.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  574. package/build/umd/5805.diva-web-planner-react.umd.min.js +2 -0
  575. package/build/umd/5805.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  576. package/build/umd/5814.diva-web-planner-react.umd.min.js +2 -0
  577. package/build/umd/5814.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  578. package/build/umd/5832.diva-web-planner-react.umd.min.js +2 -0
  579. package/build/umd/5832.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  580. package/build/umd/5946.diva-web-planner-react.umd.min.js +2 -0
  581. package/build/umd/5946.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  582. package/build/umd/5974.diva-web-planner-react.umd.min.js +2 -0
  583. package/build/umd/5974.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  584. package/build/umd/6108.diva-web-planner-react.umd.min.js +2 -0
  585. package/build/umd/6108.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  586. package/build/umd/6158.diva-web-planner-react.umd.min.js +1 -1
  587. package/build/umd/6167.diva-web-planner-react.umd.min.js +2 -0
  588. package/build/umd/6167.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  589. package/build/umd/6176.diva-web-planner-react.umd.min.js +2 -0
  590. package/build/umd/6176.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  591. package/build/umd/6212.diva-web-planner-react.umd.min.js +2 -0
  592. package/build/umd/6212.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  593. package/build/umd/6219.diva-web-planner-react.umd.min.js +2 -0
  594. package/build/umd/6219.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  595. package/build/umd/6253.diva-web-planner-react.umd.min.js +2 -0
  596. package/build/umd/6253.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  597. package/build/umd/6273.diva-web-planner-react.umd.min.js +2 -0
  598. package/build/umd/6273.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  599. package/build/umd/6335.diva-web-planner-react.umd.min.js +1 -1
  600. package/build/umd/6337.diva-web-planner-react.umd.min.js +2 -0
  601. package/build/umd/6337.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  602. package/build/umd/6345.diva-web-planner-react.umd.min.js +2 -0
  603. package/build/umd/6345.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  604. package/build/umd/6451.diva-web-planner-react.umd.min.js +2 -0
  605. package/build/umd/6451.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  606. package/build/umd/6456.diva-web-planner-react.umd.min.js +2 -0
  607. package/build/umd/6456.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  608. package/build/umd/6466.diva-web-planner-react.umd.min.js +2 -0
  609. package/build/umd/6466.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  610. package/build/umd/6599.diva-web-planner-react.umd.min.js +2 -0
  611. package/build/umd/6599.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  612. package/build/umd/6696.diva-web-planner-react.umd.min.js +2 -0
  613. package/build/umd/6696.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  614. package/build/umd/6854.diva-web-planner-react.umd.min.js +2 -0
  615. package/build/umd/6854.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  616. package/build/umd/6862.diva-web-planner-react.umd.min.js +2 -0
  617. package/build/umd/6862.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  618. package/build/umd/6871.diva-web-planner-react.umd.min.js +1 -1
  619. package/build/umd/6882.diva-web-planner-react.umd.min.js +2 -0
  620. package/build/umd/6882.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  621. package/build/umd/6886.diva-web-planner-react.umd.min.js +2 -0
  622. package/build/umd/6886.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  623. package/build/umd/6935.diva-web-planner-react.umd.min.js +2 -0
  624. package/build/umd/6935.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  625. package/build/umd/6945.diva-web-planner-react.umd.min.js +2 -0
  626. package/build/umd/6945.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  627. package/build/umd/6965.diva-web-planner-react.umd.min.js +2 -0
  628. package/build/umd/6965.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  629. package/build/umd/7052.diva-web-planner-react.umd.min.js +1 -1
  630. package/build/umd/7056.diva-web-planner-react.umd.min.js +2 -0
  631. package/build/umd/7056.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  632. package/build/umd/7069.diva-web-planner-react.umd.min.js +2 -0
  633. package/build/umd/7069.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  634. package/build/umd/7125.diva-web-planner-react.umd.min.js +2 -0
  635. package/build/umd/7125.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  636. package/build/umd/7259.diva-web-planner-react.umd.min.js +2 -0
  637. package/build/umd/7259.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  638. package/build/umd/7288.diva-web-planner-react.umd.min.js +1 -1
  639. package/build/umd/7328.diva-web-planner-react.umd.min.js +1 -1
  640. package/build/umd/7409.diva-web-planner-react.umd.min.js +1 -1
  641. package/build/umd/7419.diva-web-planner-react.umd.min.js +2 -0
  642. package/build/umd/7419.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  643. package/build/umd/7430.diva-web-planner-react.umd.min.js +2 -0
  644. package/build/umd/7430.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  645. package/build/umd/7442.diva-web-planner-react.umd.min.js +1 -1
  646. package/build/umd/7502.diva-web-planner-react.umd.min.js +2 -0
  647. package/build/umd/7502.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  648. package/build/umd/7557.diva-web-planner-react.umd.min.js +2 -0
  649. package/build/umd/7557.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  650. package/build/umd/7627.diva-web-planner-react.umd.min.js +2 -0
  651. package/build/umd/7627.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  652. package/build/umd/7677.diva-web-planner-react.umd.min.js +2 -0
  653. package/build/umd/7677.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  654. package/build/umd/7810.diva-web-planner-react.umd.min.js +1 -1
  655. package/build/umd/7853.diva-web-planner-react.umd.min.js +2 -0
  656. package/build/umd/7853.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  657. package/build/umd/7989.diva-web-planner-react.umd.min.js +2 -0
  658. package/build/umd/7989.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  659. package/build/umd/7993.diva-web-planner-react.umd.min.js +2 -0
  660. package/build/umd/7993.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  661. package/build/umd/8005.diva-web-planner-react.umd.min.js +2 -0
  662. package/build/umd/8005.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  663. package/build/umd/8063.diva-web-planner-react.umd.min.js +1 -1
  664. package/build/umd/8076.diva-web-planner-react.umd.min.js +2 -0
  665. package/build/umd/8076.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  666. package/build/umd/8117.diva-web-planner-react.umd.min.js +1 -1
  667. package/build/umd/8118.diva-web-planner-react.umd.min.js +2 -0
  668. package/build/umd/8118.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  669. package/build/umd/821.diva-web-planner-react.umd.min.js +1 -1
  670. package/build/umd/8278.diva-web-planner-react.umd.min.js +2 -0
  671. package/build/umd/8278.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  672. package/build/umd/8286.diva-web-planner-react.umd.min.js +2 -0
  673. package/build/umd/8286.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  674. package/build/umd/8287.diva-web-planner-react.umd.min.js +2 -0
  675. package/build/umd/8287.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  676. package/build/umd/8312.diva-web-planner-react.umd.min.js +2 -0
  677. package/build/umd/8312.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  678. package/build/umd/8317.diva-web-planner-react.umd.min.js +1 -1
  679. package/build/umd/8375.diva-web-planner-react.umd.min.js +2 -0
  680. package/build/umd/8375.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  681. package/build/umd/8391.diva-web-planner-react.umd.min.js +2 -0
  682. package/build/umd/8391.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  683. package/build/umd/8409.diva-web-planner-react.umd.min.js +2 -0
  684. package/build/umd/8409.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  685. package/build/umd/8425.diva-web-planner-react.umd.min.js +2 -0
  686. package/build/umd/8425.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  687. package/build/umd/8445.diva-web-planner-react.umd.min.js +1 -1
  688. package/build/umd/8466.diva-web-planner-react.umd.min.js +2 -0
  689. package/build/umd/8466.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  690. package/build/umd/8500.diva-web-planner-react.umd.min.js +2 -0
  691. package/build/umd/8500.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  692. package/build/umd/8523.diva-web-planner-react.umd.min.js +2 -0
  693. package/build/umd/8523.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  694. package/build/umd/858.diva-web-planner-react.umd.min.js +1 -1
  695. package/build/umd/8584.diva-web-planner-react.umd.min.js +1 -1
  696. package/build/umd/859.diva-web-planner-react.umd.min.js +1 -1
  697. package/build/umd/8641.diva-web-planner-react.umd.min.js +2 -0
  698. package/build/umd/8641.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  699. package/build/umd/8655.diva-web-planner-react.umd.min.js +2 -0
  700. package/build/umd/8655.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  701. package/build/umd/8659.diva-web-planner-react.umd.min.js +2 -0
  702. package/build/umd/8659.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  703. package/build/umd/8701.diva-web-planner-react.umd.min.js +1 -1
  704. package/build/umd/8703.diva-web-planner-react.umd.min.js +2 -0
  705. package/build/umd/8703.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  706. package/build/umd/8717.diva-web-planner-react.umd.min.js +1 -1
  707. package/build/umd/8742.diva-web-planner-react.umd.min.js +1 -1
  708. package/build/umd/8757.diva-web-planner-react.umd.min.js +1 -1
  709. package/build/umd/8774.diva-web-planner-react.umd.min.js +2 -0
  710. package/build/umd/8774.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  711. package/build/umd/8850.diva-web-planner-react.umd.min.js +1 -1
  712. package/build/umd/8886.diva-web-planner-react.umd.min.js +2 -0
  713. package/build/umd/8886.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  714. package/build/umd/8938.diva-web-planner-react.umd.min.js +1 -1
  715. package/build/umd/896.diva-web-planner-react.umd.min.js +1 -1
  716. package/build/umd/8971.diva-web-planner-react.umd.min.js +2 -0
  717. package/build/umd/8971.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  718. package/build/umd/9019.diva-web-planner-react.umd.min.js +2 -0
  719. package/build/umd/9019.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  720. package/build/umd/9053.diva-web-planner-react.umd.min.js +2 -0
  721. package/build/umd/9053.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  722. package/build/umd/9057.diva-web-planner-react.umd.min.js +2 -0
  723. package/build/umd/9057.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  724. package/build/umd/9098.diva-web-planner-react.umd.min.js +2 -0
  725. package/build/umd/9098.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  726. package/build/umd/9134.diva-web-planner-react.umd.min.js +2 -0
  727. package/build/umd/9134.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  728. package/build/umd/9214.diva-web-planner-react.umd.min.js +2 -0
  729. package/build/umd/9214.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  730. package/build/umd/9242.diva-web-planner-react.umd.min.js +2 -0
  731. package/build/umd/9242.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  732. package/build/umd/9290.diva-web-planner-react.umd.min.js +1 -1
  733. package/build/umd/9291.diva-web-planner-react.umd.min.js +1 -1
  734. package/build/umd/9360.diva-web-planner-react.umd.min.js +1 -1
  735. package/build/umd/9418.diva-web-planner-react.umd.min.js +2 -0
  736. package/build/umd/9418.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  737. package/build/umd/9442.diva-web-planner-react.umd.min.js +2 -0
  738. package/build/umd/9442.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  739. package/build/umd/9471.diva-web-planner-react.umd.min.js +2 -0
  740. package/build/umd/9471.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  741. package/build/umd/9556.diva-web-planner-react.umd.min.js +2 -0
  742. package/build/umd/9556.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  743. package/build/umd/9572.diva-web-planner-react.umd.min.js +2 -0
  744. package/build/umd/9572.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  745. package/build/umd/960.diva-web-planner-react.umd.min.js +1 -1
  746. package/build/umd/9604.diva-web-planner-react.umd.min.js +2 -0
  747. package/build/umd/9604.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  748. package/build/umd/9607.diva-web-planner-react.umd.min.js +1 -1
  749. package/build/umd/9631.diva-web-planner-react.umd.min.js +1 -1
  750. package/build/umd/9650.diva-web-planner-react.umd.min.js +2 -0
  751. package/build/umd/9650.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  752. package/build/umd/9658.diva-web-planner-react.umd.min.js +2 -0
  753. package/build/umd/9658.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  754. package/build/umd/9675.diva-web-planner-react.umd.min.js +2 -0
  755. package/build/umd/9675.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  756. package/build/umd/969.diva-web-planner-react.umd.min.js +2 -0
  757. package/build/umd/969.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  758. package/build/umd/9715.diva-web-planner-react.umd.min.js +1 -1
  759. package/build/umd/9725.diva-web-planner-react.umd.min.js +2 -0
  760. package/build/umd/9725.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  761. package/build/umd/9755.diva-web-planner-react.umd.min.js +2 -0
  762. package/build/umd/9755.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  763. package/build/umd/9806.diva-web-planner-react.umd.min.js +2 -0
  764. package/build/umd/9806.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  765. package/build/umd/9867.diva-web-planner-react.umd.min.js +2 -0
  766. package/build/umd/9867.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  767. package/build/umd/9874.diva-web-planner-react.umd.min.js +1 -1
  768. package/build/umd/9884.diva-web-planner-react.umd.min.js +2 -0
  769. package/build/umd/9884.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  770. package/build/umd/9924.diva-web-planner-react.umd.min.js +2 -0
  771. package/build/umd/9924.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  772. package/build/umd/9926.diva-web-planner-react.umd.min.js +2 -0
  773. package/build/umd/9926.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  774. package/build/umd/9929.diva-web-planner-react.umd.min.js +2 -0
  775. package/build/umd/9929.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  776. package/build/umd/9957.diva-web-planner-react.umd.min.js +2 -0
  777. package/build/umd/9957.diva-web-planner-react.umd.min.js.LICENSE.txt +1 -0
  778. package/build/umd/diva-web-planner-react.umd.min.js +1 -1
  779. package/build/umd/report.html +1 -1
  780. package/package.json +11 -10
  781. package/build/esm/ArticleProperties-714281b8.js +0 -183
  782. package/build/esm/CatalogProperties-af3eb440.js +0 -534
  783. package/build/esm/DecisionVizualizer-bae02da0.js +0 -279
  784. package/build/esm/IconHandler-ec4b75d3.js +0 -77
  785. package/build/esm/OptionProperties-1d2e76c9.js +0 -188
  786. package/build/esm/OptionValueProperties-df10d675.js +0 -151
  787. package/build/esm/Planner2DGrid-510ccdf7.js +0 -647
  788. package/build/esm/Planner3DImage-f6706285.js +0 -961
  789. package/build/esm/index-019a91a6.js +0 -100
  790. package/build/esm/index-021d59cc.js +0 -66
  791. package/build/esm/index-037b3ee4.js +0 -136
  792. package/build/esm/index-041f97bb.js +0 -106
  793. package/build/esm/index-055d7485.js +0 -36
  794. package/build/esm/index-05fbfb98.js +0 -195
  795. package/build/esm/index-066c3a2c.js +0 -143
  796. package/build/esm/index-072f8020.js +0 -141
  797. package/build/esm/index-07be5873.js +0 -85
  798. package/build/esm/index-092e3e46.js +0 -62
  799. package/build/esm/index-0a927916.js +0 -100
  800. package/build/esm/index-0b9eeb52.js +0 -116
  801. package/build/esm/index-0c32a976.js +0 -190
  802. package/build/esm/index-0d6d6da4.js +0 -82
  803. package/build/esm/index-0e601b05.js +0 -164
  804. package/build/esm/index-0f73098c.js +0 -117
  805. package/build/esm/index-0fd8ee1c.js +0 -32
  806. package/build/esm/index-11334c6e.js +0 -32
  807. package/build/esm/index-11ca794b.js +0 -130
  808. package/build/esm/index-126b7573.js +0 -61
  809. package/build/esm/index-12d0b1c8.js +0 -73
  810. package/build/esm/index-13aee063.js +0 -132
  811. package/build/esm/index-14a15b5c.js +0 -87
  812. package/build/esm/index-1725c3a0.js +0 -32
  813. package/build/esm/index-188bd4e9.js +0 -42
  814. package/build/esm/index-190d4432.js +0 -108
  815. package/build/esm/index-19aa1349.js +0 -289
  816. package/build/esm/index-19e39961.js +0 -93
  817. package/build/esm/index-1b13bfd2.js +0 -144
  818. package/build/esm/index-1dadda6c.js +0 -168
  819. package/build/esm/index-1e7f24da.js +0 -67
  820. package/build/esm/index-1f5ced7b.js +0 -32
  821. package/build/esm/index-24933b2c.js +0 -43
  822. package/build/esm/index-25b2c9e4.js +0 -32
  823. package/build/esm/index-26540ca9.js +0 -158
  824. package/build/esm/index-266e8657.js +0 -200
  825. package/build/esm/index-26ee7a3f.js +0 -32
  826. package/build/esm/index-27771e85.js +0 -44
  827. package/build/esm/index-27ef02f6.js +0 -88
  828. package/build/esm/index-281a5533.js +0 -79
  829. package/build/esm/index-2a18416e.js +0 -142
  830. package/build/esm/index-2a76ef42.js +0 -49
  831. package/build/esm/index-2a9cef60.js +0 -556
  832. package/build/esm/index-2b7ec702.js +0 -188
  833. package/build/esm/index-2d2bc62c.js +0 -161
  834. package/build/esm/index-2ea8e148.js +0 -67
  835. package/build/esm/index-30d61229.js +0 -76
  836. package/build/esm/index-3117a321.js +0 -37
  837. package/build/esm/index-335825cf.js +0 -117
  838. package/build/esm/index-34f8d1b6.js +0 -69
  839. package/build/esm/index-363ac662.js +0 -170
  840. package/build/esm/index-3690e140.js +0 -100
  841. package/build/esm/index-39c37698.js +0 -119
  842. package/build/esm/index-3ac31796.js +0 -123
  843. package/build/esm/index-3b86577d.js +0 -32
  844. package/build/esm/index-3c8d2101.js +0 -47
  845. package/build/esm/index-3d17b33c.js +0 -125
  846. package/build/esm/index-3e9fcba0.js +0 -56
  847. package/build/esm/index-42d73d6c.js +0 -50
  848. package/build/esm/index-44090686.js +0 -456
  849. package/build/esm/index-44b8279c.js +0 -32
  850. package/build/esm/index-45e7eccd.js +0 -44
  851. package/build/esm/index-460c0042.js +0 -71
  852. package/build/esm/index-47a214d6.js +0 -143
  853. package/build/esm/index-48de0976.js +0 -49
  854. package/build/esm/index-4b527171.js +0 -234
  855. package/build/esm/index-4b7abe2d.js +0 -80
  856. package/build/esm/index-4bfad54e.js +0 -123
  857. package/build/esm/index-4bfc2445.js +0 -102
  858. package/build/esm/index-4c9efef2.js +0 -56
  859. package/build/esm/index-4cade63d.js +0 -95
  860. package/build/esm/index-4deece2a.js +0 -68
  861. package/build/esm/index-4eceb0f7.js +0 -80
  862. package/build/esm/index-52afee2d.js +0 -85
  863. package/build/esm/index-5540708a.js +0 -77
  864. package/build/esm/index-56479dd9.js +0 -56
  865. package/build/esm/index-57cccc2e.js +0 -58
  866. package/build/esm/index-5acd90ec.js +0 -274
  867. package/build/esm/index-5be729c6.js +0 -120
  868. package/build/esm/index-5bfb421e.js +0 -56
  869. package/build/esm/index-5ca60a05.js +0 -73
  870. package/build/esm/index-5d52afbf.js +0 -77
  871. package/build/esm/index-606759e8.js +0 -123
  872. package/build/esm/index-61016a7d.js +0 -49
  873. package/build/esm/index-6168df84.js +0 -103
  874. package/build/esm/index-61a438cd.js +0 -87
  875. package/build/esm/index-625d13f8.js +0 -51
  876. package/build/esm/index-632668ac.js +0 -88
  877. package/build/esm/index-63c0fd44.js +0 -207
  878. package/build/esm/index-656a705e.js +0 -58
  879. package/build/esm/index-65c4e0dc.js +0 -96
  880. package/build/esm/index-666abd23.js +0 -124
  881. package/build/esm/index-66a6feb3.js +0 -54
  882. package/build/esm/index-677eb912.js +0 -138
  883. package/build/esm/index-67e743b8.js +0 -32
  884. package/build/esm/index-68711fc3.js +0 -46
  885. package/build/esm/index-68e2cb63.js +0 -71
  886. package/build/esm/index-6b3e9d84.js +0 -181
  887. package/build/esm/index-6c4e52ad.js +0 -159
  888. package/build/esm/index-6d1ef94a.js +0 -50
  889. package/build/esm/index-6eda5aba.js +0 -171
  890. package/build/esm/index-70683822.js +0 -274
  891. package/build/esm/index-706e96a8.js +0 -38
  892. package/build/esm/index-72f57066.js +0 -61
  893. package/build/esm/index-731c8b48.js +0 -161
  894. package/build/esm/index-73801daa.js +0 -127
  895. package/build/esm/index-745d199f.js +0 -51
  896. package/build/esm/index-74a0261e.js +0 -59
  897. package/build/esm/index-751468ea.js +0 -42
  898. package/build/esm/index-75671fbf.js +0 -92
  899. package/build/esm/index-7723c49f.js +0 -132
  900. package/build/esm/index-789d1845.js +0 -114
  901. package/build/esm/index-79d4b811.js +0 -55
  902. package/build/esm/index-7a0af9c9.js +0 -190
  903. package/build/esm/index-7aa8dc7e.js +0 -95
  904. package/build/esm/index-7b650ddf.js +0 -43
  905. package/build/esm/index-7d26ac27.js +0 -128
  906. package/build/esm/index-820be6cb.js +0 -50
  907. package/build/esm/index-8293f2ca.js +0 -103
  908. package/build/esm/index-829aef52.js +0 -46
  909. package/build/esm/index-82ad895e.js +0 -28
  910. package/build/esm/index-83f1a39c.js +0 -32
  911. package/build/esm/index-83f542a8.js +0 -65
  912. package/build/esm/index-841cdef4.js +0 -124
  913. package/build/esm/index-856acc1e.js +0 -32
  914. package/build/esm/index-87c75f68.js +0 -169
  915. package/build/esm/index-886c20cd.js +0 -107
  916. package/build/esm/index-8a6d3369.js +0 -44
  917. package/build/esm/index-8b2eec46.js +0 -47
  918. package/build/esm/index-8b9cd399.js +0 -32
  919. package/build/esm/index-8e43497d.js +0 -166
  920. package/build/esm/index-8fb6dd67.js +0 -64
  921. package/build/esm/index-8fd07189.js +0 -207
  922. package/build/esm/index-902517f9.js +0 -163
  923. package/build/esm/index-90e1ce14.js +0 -72
  924. package/build/esm/index-913173cb.js +0 -76
  925. package/build/esm/index-91bc02d2.js +0 -32
  926. package/build/esm/index-9243d3db.js +0 -57
  927. package/build/esm/index-92a0a6f8.js +0 -47
  928. package/build/esm/index-94ba821c.js +0 -68
  929. package/build/esm/index-94d62be3.js +0 -286
  930. package/build/esm/index-956e9871.js +0 -32
  931. package/build/esm/index-9596a4f6.js +0 -88
  932. package/build/esm/index-98dd3cf9.js +0 -36
  933. package/build/esm/index-991d2530.js +0 -46
  934. package/build/esm/index-99480838.js +0 -97
  935. package/build/esm/index-99b5035b.js +0 -66
  936. package/build/esm/index-99d24265.js +0 -56
  937. package/build/esm/index-99e1ef0a.js +0 -105
  938. package/build/esm/index-9b438bb8.js +0 -47
  939. package/build/esm/index-9cafb9b9.js +0 -135
  940. package/build/esm/index-9e7b2d4e.js +0 -40
  941. package/build/esm/index-9f3c4442.js +0 -43
  942. package/build/esm/index-a059954b.js +0 -51
  943. package/build/esm/index-a0f10b65.js +0 -99
  944. package/build/esm/index-a17e31b8.js +0 -58
  945. package/build/esm/index-a214bb37.js +0 -154
  946. package/build/esm/index-a568a36b.js +0 -153
  947. package/build/esm/index-a9bbb880.js +0 -153
  948. package/build/esm/index-ad2c4145.js +0 -32
  949. package/build/esm/index-ad73b0ee.js +0 -184
  950. package/build/esm/index-ad7b1874.js +0 -189
  951. package/build/esm/index-ae65ab47.js +0 -168
  952. package/build/esm/index-aea09632.js +0 -30
  953. package/build/esm/index-b0521e74.js +0 -40
  954. package/build/esm/index-b0827428.js +0 -131
  955. package/build/esm/index-b250f75d.js +0 -49
  956. package/build/esm/index-b381a4c3.js +0 -128
  957. package/build/esm/index-b4975443.js +0 -66
  958. package/build/esm/index-b52dd39e.js +0 -32
  959. package/build/esm/index-b53230fc.js +0 -57
  960. package/build/esm/index-b66d3f4f.js +0 -32
  961. package/build/esm/index-b713c89b.js +0 -163
  962. package/build/esm/index-b751c19a.js +0 -125
  963. package/build/esm/index-ba2ebee2.js +0 -11916
  964. package/build/esm/index-babe06e8.js +0 -105
  965. package/build/esm/index-badfc872.js +0 -109
  966. package/build/esm/index-bf8f0243.js +0 -52
  967. package/build/esm/index-bff77b46.js +0 -142
  968. package/build/esm/index-c06c835f.js +0 -52
  969. package/build/esm/index-c0ea4914.js +0 -141
  970. package/build/esm/index-c0f8925e.js +0 -62
  971. package/build/esm/index-c1fa0b1c.js +0 -61
  972. package/build/esm/index-c3e34816.js +0 -58
  973. package/build/esm/index-c3eda355.js +0 -54
  974. package/build/esm/index-c4158836.js +0 -48
  975. package/build/esm/index-c4339c72.js +0 -134
  976. package/build/esm/index-c4ff4e60.js +0 -73
  977. package/build/esm/index-c5267b61.js +0 -254
  978. package/build/esm/index-c5ca2deb.js +0 -32
  979. package/build/esm/index-c616b802.js +0 -64
  980. package/build/esm/index-c6510bde.js +0 -107
  981. package/build/esm/index-c65d54a7.js +0 -81
  982. package/build/esm/index-c726694a.js +0 -87
  983. package/build/esm/index-c9221d5c.js +0 -84
  984. package/build/esm/index-c98db15e.js +0 -43
  985. package/build/esm/index-cbf61707.js +0 -73
  986. package/build/esm/index-cdfb6403.js +0 -285
  987. package/build/esm/index-d09babbe.js +0 -48
  988. package/build/esm/index-d2837443.js +0 -139
  989. package/build/esm/index-d2ca7d02.js +0 -95
  990. package/build/esm/index-d3f760b9.js +0 -45
  991. package/build/esm/index-d75ea0d1.js +0 -83
  992. package/build/esm/index-d795ec37.js +0 -40
  993. package/build/esm/index-d7cc13b1.js +0 -74
  994. package/build/esm/index-d982e4d6.js +0 -32
  995. package/build/esm/index-db59b81d.js +0 -32
  996. package/build/esm/index-df1fbfeb.js +0 -161
  997. package/build/esm/index-df4c41ee.js +0 -60
  998. package/build/esm/index-e169c290.js +0 -51
  999. package/build/esm/index-e29cbe9b.js +0 -79
  1000. package/build/esm/index-e6bcc0f6.js +0 -32
  1001. package/build/esm/index-e6c792a8.js +0 -103
  1002. package/build/esm/index-e81a7d2d.js +0 -44
  1003. package/build/esm/index-eb001ee7.js +0 -41
  1004. package/build/esm/index-eb4f449e.js +0 -204
  1005. package/build/esm/index-ed63f2a4.js +0 -129
  1006. package/build/esm/index-ed7b163c.js +0 -32
  1007. package/build/esm/index-ef170c31.js +0 -68
  1008. package/build/esm/index-f3421b07.js +0 -180
  1009. package/build/esm/index-f5ad4df0.js +0 -137
  1010. package/build/esm/index-f5cb65cc.js +0 -42
  1011. package/build/esm/index-f6e73413.js +0 -89
  1012. package/build/esm/index-f9625ce1.js +0 -90
  1013. package/build/esm/index-fb531729.js +0 -147
  1014. package/build/esm/index-fbad2602.js +0 -61
  1015. package/build/esm/index-fc9b4fe1.js +0 -165
  1016. package/build/esm/index-fca3ae87.js +0 -114
  1017. package/build/esm/index-ff09b88f.js +0 -99
  1018. package/build/esm/index-ff617d5d.js +0 -118
  1019. package/build/esm/index.module-1994bf1d.js +0 -26
  1020. package/build/esm/index.module-34735199.js +0 -13
  1021. package/build/esm/index.module-39c31e35.js +0 -12
  1022. package/build/esm/index.module-58d28301.js +0 -21
  1023. package/build/esm/index.module-6f142235.js +0 -18
  1024. package/build/esm/index.module-745c5fde.js +0 -9
  1025. package/build/esm/index.module-7c01dc9e.js +0 -25
  1026. package/build/esm/index.module-88f98829.js +0 -17
  1027. package/build/esm/index.module-d11b8f72.js +0 -9
  1028. package/build/esm/index.module-dd133530.js +0 -13
  1029. package/build/esm/index.module-e5a3670c.js +0 -18
  1030. package/build/esm/index.module-f858c134.js +0 -8
  1031. package/build/esm/react-json-viewer-a1381b69.js +0 -4
  1032. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/index.d.ts +0 -12
  1033. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/index.d.ts.map +0 -1
  1034. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/jungle/group/index.d.ts +0 -14
  1035. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/jungle/group/index.d.ts.map +0 -1
  1036. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/jungle/index.d.ts.map +0 -1
  1037. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/standard/Group/index.d.ts +0 -13
  1038. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/standard/Group/index.d.ts.map +0 -1
  1039. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroup/standard/index.d.ts.map +0 -1
  1040. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroupDropdown/index.d.ts +0 -15
  1041. package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/PaletteGroupDropdown/index.d.ts.map +0 -1
  1042. package/build/umd/1019.diva-web-planner-react.umd.min.js +0 -2
  1043. package/build/umd/1019.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1044. package/build/umd/104.diva-web-planner-react.umd.min.js +0 -2
  1045. package/build/umd/104.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1046. package/build/umd/1087.diva-web-planner-react.umd.min.js +0 -2
  1047. package/build/umd/1087.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1048. package/build/umd/1123.diva-web-planner-react.umd.min.js +0 -2
  1049. package/build/umd/1123.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1050. package/build/umd/1167.diva-web-planner-react.umd.min.js +0 -2
  1051. package/build/umd/1167.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1052. package/build/umd/1200.diva-web-planner-react.umd.min.js +0 -2
  1053. package/build/umd/1200.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1054. package/build/umd/1386.diva-web-planner-react.umd.min.js +0 -2
  1055. package/build/umd/1386.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1056. package/build/umd/1500.diva-web-planner-react.umd.min.js +0 -2
  1057. package/build/umd/1500.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1058. package/build/umd/158.diva-web-planner-react.umd.min.js +0 -2
  1059. package/build/umd/158.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1060. package/build/umd/1636.diva-web-planner-react.umd.min.js +0 -2
  1061. package/build/umd/1636.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1062. package/build/umd/1876.diva-web-planner-react.umd.min.js +0 -2
  1063. package/build/umd/1876.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1064. package/build/umd/1988.diva-web-planner-react.umd.min.js +0 -2
  1065. package/build/umd/1988.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1066. package/build/umd/2039.diva-web-planner-react.umd.min.js +0 -2
  1067. package/build/umd/2039.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1068. package/build/umd/2059.diva-web-planner-react.umd.min.js +0 -2
  1069. package/build/umd/2059.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1070. package/build/umd/2199.diva-web-planner-react.umd.min.js +0 -2
  1071. package/build/umd/2199.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1072. package/build/umd/2249.diva-web-planner-react.umd.min.js +0 -2
  1073. package/build/umd/2249.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1074. package/build/umd/2295.diva-web-planner-react.umd.min.js +0 -2
  1075. package/build/umd/2295.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1076. package/build/umd/2326.diva-web-planner-react.umd.min.js +0 -2
  1077. package/build/umd/2326.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1078. package/build/umd/241.diva-web-planner-react.umd.min.js +0 -2
  1079. package/build/umd/241.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1080. package/build/umd/2456.diva-web-planner-react.umd.min.js +0 -2
  1081. package/build/umd/2456.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1082. package/build/umd/2471.diva-web-planner-react.umd.min.js +0 -2
  1083. package/build/umd/2471.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1084. package/build/umd/2491.diva-web-planner-react.umd.min.js +0 -2
  1085. package/build/umd/2491.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1086. package/build/umd/2521.diva-web-planner-react.umd.min.js +0 -2
  1087. package/build/umd/2521.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1088. package/build/umd/2565.diva-web-planner-react.umd.min.js +0 -2
  1089. package/build/umd/2565.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1090. package/build/umd/2749.diva-web-planner-react.umd.min.js +0 -2
  1091. package/build/umd/2749.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1092. package/build/umd/2795.diva-web-planner-react.umd.min.js +0 -2
  1093. package/build/umd/2795.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1094. package/build/umd/282.diva-web-planner-react.umd.min.js +0 -2
  1095. package/build/umd/282.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1096. package/build/umd/2833.diva-web-planner-react.umd.min.js +0 -2
  1097. package/build/umd/2833.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1098. package/build/umd/2873.diva-web-planner-react.umd.min.js +0 -2
  1099. package/build/umd/2873.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1100. package/build/umd/2890.diva-web-planner-react.umd.min.js +0 -2
  1101. package/build/umd/2890.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1102. package/build/umd/2914.diva-web-planner-react.umd.min.js +0 -2
  1103. package/build/umd/2914.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1104. package/build/umd/2936.diva-web-planner-react.umd.min.js +0 -2
  1105. package/build/umd/2936.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1106. package/build/umd/2979.diva-web-planner-react.umd.min.js +0 -2
  1107. package/build/umd/2979.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1108. package/build/umd/3302.diva-web-planner-react.umd.min.js +0 -2
  1109. package/build/umd/3302.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1110. package/build/umd/3349.diva-web-planner-react.umd.min.js +0 -2
  1111. package/build/umd/3349.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1112. package/build/umd/3410.diva-web-planner-react.umd.min.js +0 -2
  1113. package/build/umd/3410.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1114. package/build/umd/3481.diva-web-planner-react.umd.min.js +0 -2
  1115. package/build/umd/3481.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1116. package/build/umd/3483.diva-web-planner-react.umd.min.js +0 -2
  1117. package/build/umd/3483.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1118. package/build/umd/3492.diva-web-planner-react.umd.min.js +0 -2
  1119. package/build/umd/3492.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1120. package/build/umd/3493.diva-web-planner-react.umd.min.js +0 -2
  1121. package/build/umd/3493.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1122. package/build/umd/3614.diva-web-planner-react.umd.min.js +0 -2
  1123. package/build/umd/3614.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1124. package/build/umd/3769.diva-web-planner-react.umd.min.js +0 -2
  1125. package/build/umd/3769.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1126. package/build/umd/3842.diva-web-planner-react.umd.min.js +0 -2
  1127. package/build/umd/3842.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1128. package/build/umd/3927.diva-web-planner-react.umd.min.js +0 -2
  1129. package/build/umd/3927.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1130. package/build/umd/3928.diva-web-planner-react.umd.min.js +0 -2
  1131. package/build/umd/3928.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1132. package/build/umd/4002.diva-web-planner-react.umd.min.js +0 -2
  1133. package/build/umd/4002.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1134. package/build/umd/4036.diva-web-planner-react.umd.min.js +0 -2
  1135. package/build/umd/4036.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1136. package/build/umd/4254.diva-web-planner-react.umd.min.js +0 -2
  1137. package/build/umd/4254.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1138. package/build/umd/4260.diva-web-planner-react.umd.min.js +0 -2
  1139. package/build/umd/4260.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1140. package/build/umd/4276.diva-web-planner-react.umd.min.js +0 -2
  1141. package/build/umd/4276.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1142. package/build/umd/4304.diva-web-planner-react.umd.min.js +0 -2
  1143. package/build/umd/4304.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1144. package/build/umd/4326.diva-web-planner-react.umd.min.js +0 -2
  1145. package/build/umd/4326.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1146. package/build/umd/4375.diva-web-planner-react.umd.min.js +0 -2
  1147. package/build/umd/4375.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1148. package/build/umd/4404.diva-web-planner-react.umd.min.js +0 -2
  1149. package/build/umd/4404.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1150. package/build/umd/4412.diva-web-planner-react.umd.min.js +0 -2
  1151. package/build/umd/4412.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1152. package/build/umd/445.diva-web-planner-react.umd.min.js +0 -2
  1153. package/build/umd/445.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1154. package/build/umd/4661.diva-web-planner-react.umd.min.js +0 -2
  1155. package/build/umd/4661.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1156. package/build/umd/4665.diva-web-planner-react.umd.min.js +0 -2
  1157. package/build/umd/4665.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1158. package/build/umd/4677.diva-web-planner-react.umd.min.js +0 -2
  1159. package/build/umd/4677.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1160. package/build/umd/4683.diva-web-planner-react.umd.min.js +0 -2
  1161. package/build/umd/4683.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1162. package/build/umd/4686.diva-web-planner-react.umd.min.js +0 -2
  1163. package/build/umd/4686.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1164. package/build/umd/4819.diva-web-planner-react.umd.min.js +0 -2
  1165. package/build/umd/4819.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1166. package/build/umd/4844.diva-web-planner-react.umd.min.js +0 -2
  1167. package/build/umd/4844.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1168. package/build/umd/4851.diva-web-planner-react.umd.min.js +0 -2
  1169. package/build/umd/4851.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1170. package/build/umd/5083.diva-web-planner-react.umd.min.js +0 -2
  1171. package/build/umd/5083.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1172. package/build/umd/5217.diva-web-planner-react.umd.min.js +0 -2
  1173. package/build/umd/5217.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1174. package/build/umd/5294.diva-web-planner-react.umd.min.js +0 -2
  1175. package/build/umd/5294.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1176. package/build/umd/5296.diva-web-planner-react.umd.min.js +0 -2
  1177. package/build/umd/5296.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1178. package/build/umd/539.diva-web-planner-react.umd.min.js +0 -2
  1179. package/build/umd/539.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1180. package/build/umd/5415.diva-web-planner-react.umd.min.js +0 -2
  1181. package/build/umd/5415.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1182. package/build/umd/5417.diva-web-planner-react.umd.min.js +0 -2
  1183. package/build/umd/5417.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1184. package/build/umd/5472.diva-web-planner-react.umd.min.js +0 -2
  1185. package/build/umd/5472.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1186. package/build/umd/5512.diva-web-planner-react.umd.min.js +0 -2
  1187. package/build/umd/5512.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1188. package/build/umd/5544.diva-web-planner-react.umd.min.js +0 -2
  1189. package/build/umd/5544.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1190. package/build/umd/5552.diva-web-planner-react.umd.min.js +0 -2
  1191. package/build/umd/5552.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -7
  1192. package/build/umd/5697.diva-web-planner-react.umd.min.js +0 -2
  1193. package/build/umd/5697.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1194. package/build/umd/5771.diva-web-planner-react.umd.min.js +0 -2
  1195. package/build/umd/5771.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1196. package/build/umd/5813.diva-web-planner-react.umd.min.js +0 -2
  1197. package/build/umd/5813.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1198. package/build/umd/584.diva-web-planner-react.umd.min.js +0 -2
  1199. package/build/umd/584.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1200. package/build/umd/5859.diva-web-planner-react.umd.min.js +0 -2
  1201. package/build/umd/5859.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1202. package/build/umd/5880.diva-web-planner-react.umd.min.js +0 -2
  1203. package/build/umd/5880.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1204. package/build/umd/6051.diva-web-planner-react.umd.min.js +0 -2
  1205. package/build/umd/6051.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1206. package/build/umd/6057.diva-web-planner-react.umd.min.js +0 -2
  1207. package/build/umd/6057.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1208. package/build/umd/618.diva-web-planner-react.umd.min.js +0 -2
  1209. package/build/umd/618.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1210. package/build/umd/6201.diva-web-planner-react.umd.min.js +0 -2
  1211. package/build/umd/6201.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1212. package/build/umd/6235.diva-web-planner-react.umd.min.js +0 -2
  1213. package/build/umd/6235.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1214. package/build/umd/6279.diva-web-planner-react.umd.min.js +0 -2
  1215. package/build/umd/6279.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1216. package/build/umd/6349.diva-web-planner-react.umd.min.js +0 -2
  1217. package/build/umd/6349.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1218. package/build/umd/6541.diva-web-planner-react.umd.min.js +0 -2
  1219. package/build/umd/6541.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1220. package/build/umd/6547.diva-web-planner-react.umd.min.js +0 -2
  1221. package/build/umd/6547.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1222. package/build/umd/6606.diva-web-planner-react.umd.min.js +0 -2
  1223. package/build/umd/6606.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1224. package/build/umd/6809.diva-web-planner-react.umd.min.js +0 -2
  1225. package/build/umd/6809.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1226. package/build/umd/6874.diva-web-planner-react.umd.min.js +0 -2
  1227. package/build/umd/6874.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1228. package/build/umd/6878.diva-web-planner-react.umd.min.js +0 -2
  1229. package/build/umd/6878.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1230. package/build/umd/6888.diva-web-planner-react.umd.min.js +0 -2
  1231. package/build/umd/6888.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1232. package/build/umd/6900.diva-web-planner-react.umd.min.js +0 -2
  1233. package/build/umd/6900.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1234. package/build/umd/6985.diva-web-planner-react.umd.min.js +0 -2
  1235. package/build/umd/6985.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1236. package/build/umd/7055.diva-web-planner-react.umd.min.js +0 -2
  1237. package/build/umd/7055.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1238. package/build/umd/7086.diva-web-planner-react.umd.min.js +0 -2
  1239. package/build/umd/7086.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1240. package/build/umd/7226.diva-web-planner-react.umd.min.js +0 -2
  1241. package/build/umd/7226.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1242. package/build/umd/7241.diva-web-planner-react.umd.min.js +0 -2
  1243. package/build/umd/7241.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1244. package/build/umd/7334.diva-web-planner-react.umd.min.js +0 -2
  1245. package/build/umd/7334.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1246. package/build/umd/7353.diva-web-planner-react.umd.min.js +0 -2
  1247. package/build/umd/7353.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1248. package/build/umd/7456.diva-web-planner-react.umd.min.js +0 -2
  1249. package/build/umd/7456.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1250. package/build/umd/7544.diva-web-planner-react.umd.min.js +0 -2
  1251. package/build/umd/7544.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1252. package/build/umd/7591.diva-web-planner-react.umd.min.js +0 -2
  1253. package/build/umd/7591.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1254. package/build/umd/7593.diva-web-planner-react.umd.min.js +0 -2
  1255. package/build/umd/7593.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1256. package/build/umd/7604.diva-web-planner-react.umd.min.js +0 -2
  1257. package/build/umd/7604.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1258. package/build/umd/7674.diva-web-planner-react.umd.min.js +0 -2
  1259. package/build/umd/7674.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1260. package/build/umd/7715.diva-web-planner-react.umd.min.js +0 -2
  1261. package/build/umd/7715.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1262. package/build/umd/7732.diva-web-planner-react.umd.min.js +0 -2
  1263. package/build/umd/7732.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1264. package/build/umd/7737.diva-web-planner-react.umd.min.js +0 -2
  1265. package/build/umd/7737.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1266. package/build/umd/7795.diva-web-planner-react.umd.min.js +0 -2
  1267. package/build/umd/7795.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1268. package/build/umd/7809.diva-web-planner-react.umd.min.js +0 -2
  1269. package/build/umd/7809.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1270. package/build/umd/7833.diva-web-planner-react.umd.min.js +0 -2
  1271. package/build/umd/7833.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1272. package/build/umd/7857.diva-web-planner-react.umd.min.js +0 -2
  1273. package/build/umd/7857.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1274. package/build/umd/789.diva-web-planner-react.umd.min.js +0 -2
  1275. package/build/umd/789.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1276. package/build/umd/8044.diva-web-planner-react.umd.min.js +0 -2
  1277. package/build/umd/8044.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1278. package/build/umd/8105.diva-web-planner-react.umd.min.js +0 -2
  1279. package/build/umd/8105.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1280. package/build/umd/8188.diva-web-planner-react.umd.min.js +0 -2
  1281. package/build/umd/8188.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1282. package/build/umd/8209.diva-web-planner-react.umd.min.js +0 -2
  1283. package/build/umd/8209.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1284. package/build/umd/8268.diva-web-planner-react.umd.min.js +0 -2
  1285. package/build/umd/8268.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1286. package/build/umd/8339.diva-web-planner-react.umd.min.js +0 -2
  1287. package/build/umd/8339.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1288. package/build/umd/836.diva-web-planner-react.umd.min.js +0 -2
  1289. package/build/umd/836.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1290. package/build/umd/8412.diva-web-planner-react.umd.min.js +0 -2
  1291. package/build/umd/8412.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1292. package/build/umd/8442.diva-web-planner-react.umd.min.js +0 -2
  1293. package/build/umd/8442.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1294. package/build/umd/845.diva-web-planner-react.umd.min.js +0 -2
  1295. package/build/umd/845.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1296. package/build/umd/8507.diva-web-planner-react.umd.min.js +0 -2
  1297. package/build/umd/8507.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1298. package/build/umd/8579.diva-web-planner-react.umd.min.js +0 -2
  1299. package/build/umd/8579.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1300. package/build/umd/8606.diva-web-planner-react.umd.min.js +0 -2
  1301. package/build/umd/8606.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1302. package/build/umd/8666.diva-web-planner-react.umd.min.js +0 -2
  1303. package/build/umd/8666.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1304. package/build/umd/8711.diva-web-planner-react.umd.min.js +0 -2
  1305. package/build/umd/8711.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1306. package/build/umd/8722.diva-web-planner-react.umd.min.js +0 -2
  1307. package/build/umd/8722.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1308. package/build/umd/8726.diva-web-planner-react.umd.min.js +0 -2
  1309. package/build/umd/8726.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1310. package/build/umd/8731.diva-web-planner-react.umd.min.js +0 -2
  1311. package/build/umd/8731.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1312. package/build/umd/8810.diva-web-planner-react.umd.min.js +0 -2
  1313. package/build/umd/8810.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1314. package/build/umd/8820.diva-web-planner-react.umd.min.js +0 -2
  1315. package/build/umd/8820.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1316. package/build/umd/8833.diva-web-planner-react.umd.min.js +0 -2
  1317. package/build/umd/8833.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1318. package/build/umd/8858.diva-web-planner-react.umd.min.js +0 -2
  1319. package/build/umd/8858.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1320. package/build/umd/8867.diva-web-planner-react.umd.min.js +0 -2
  1321. package/build/umd/8867.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1322. package/build/umd/8878.diva-web-planner-react.umd.min.js +0 -2
  1323. package/build/umd/8878.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1324. package/build/umd/8932.diva-web-planner-react.umd.min.js +0 -2
  1325. package/build/umd/8932.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1326. package/build/umd/8933.diva-web-planner-react.umd.min.js +0 -2
  1327. package/build/umd/8933.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1328. package/build/umd/8957.diva-web-planner-react.umd.min.js +0 -2
  1329. package/build/umd/8957.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1330. package/build/umd/8962.diva-web-planner-react.umd.min.js +0 -2
  1331. package/build/umd/8962.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1332. package/build/umd/9142.diva-web-planner-react.umd.min.js +0 -2
  1333. package/build/umd/9142.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1334. package/build/umd/9181.diva-web-planner-react.umd.min.js +0 -2
  1335. package/build/umd/9181.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1336. package/build/umd/9240.diva-web-planner-react.umd.min.js +0 -2
  1337. package/build/umd/9240.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1338. package/build/umd/9269.diva-web-planner-react.umd.min.js +0 -2
  1339. package/build/umd/9269.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1340. package/build/umd/9271.diva-web-planner-react.umd.min.js +0 -2
  1341. package/build/umd/9271.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1342. package/build/umd/9321.diva-web-planner-react.umd.min.js +0 -2
  1343. package/build/umd/9321.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1344. package/build/umd/9374.diva-web-planner-react.umd.min.js +0 -2
  1345. package/build/umd/9374.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1346. package/build/umd/9426.diva-web-planner-react.umd.min.js +0 -2
  1347. package/build/umd/9426.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1348. package/build/umd/9435.diva-web-planner-react.umd.min.js +0 -2
  1349. package/build/umd/9435.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1350. package/build/umd/9506.diva-web-planner-react.umd.min.js +0 -2
  1351. package/build/umd/9506.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1352. package/build/umd/9532.diva-web-planner-react.umd.min.js +0 -2
  1353. package/build/umd/9532.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1354. package/build/umd/9589.diva-web-planner-react.umd.min.js +0 -2
  1355. package/build/umd/9589.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1356. package/build/umd/9610.diva-web-planner-react.umd.min.js +0 -2
  1357. package/build/umd/9610.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1358. package/build/umd/978.diva-web-planner-react.umd.min.js +0 -2
  1359. package/build/umd/978.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1360. package/build/umd/9827.diva-web-planner-react.umd.min.js +0 -2
  1361. package/build/umd/9827.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1362. package/build/umd/985.diva-web-planner-react.umd.min.js +0 -2
  1363. package/build/umd/985.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1364. package/build/umd/9921.diva-web-planner-react.umd.min.js +0 -2
  1365. package/build/umd/9921.diva-web-planner-react.umd.min.js.LICENSE.txt +0 -1
  1366. /package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/{PaletteGroup → Groups/PaletteGroup}/jungle/index.d.ts +0 -0
  1367. /package/build/types/web-planner-react/src/components/Settings/SettingsScroller/SettingsItem/{PaletteGroup → Groups/PaletteGroup}/standard/index.d.ts +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 5552.diva-web-planner-react.umd.min.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkCrystaldesignDivaWebPlannerReact=self.webpackChunkCrystaldesignDivaWebPlannerReact||[]).push([[5552],{82042:(e,t,n)=>{n.d(t,{CP7:()=>WebGLRenderer,FM8:()=>Vector2,Ilk:()=>Color,Kj0:()=>Mesh,Pa4:()=>Vector3,SUY:()=>Clock,USm:()=>Euler,YBo:()=>MeshLambertMaterial,_12:()=>PlaneGeometry,_fP:()=>Quaternion,a$l:()=>Float32BufferAttribute,cLu:()=>E,cPb:()=>PerspectiveCamera,dd2:()=>WebGLRenderTarget,dpR:()=>TextureLoader,iKG:()=>OrthographicCamera,iMs:()=>Raycaster,jFi:()=>a,jyz:()=>ShaderMaterial,rDY:()=>Kt,rpg:()=>d,u9r:()=>BufferGeometry,vBJ:()=>MeshBasicMaterial,xEZ:()=>Texture,xsS:()=>Scene});var i=n(25108);const r="163",a=0,s=100,o=301,l=302,c=303,h=304,u=306,d=1e3,p=1001,f=1002,m=1003,g=1005,_=1006,v=1007,x=1008,M=1009,y=1013,S=1014,T=1015,E=1016,b=1020,A=1023,R=1026,w=1027,C=33776,P=33777,L=33778,U=33779,D=36492,I=2300,N=2301,O=2302,F=2400,V=2401,B=2402,z="",G="srgb",H="srgb-linear",k="display-p3",W="display-p3-linear",X="linear",j="srgb",q="rec709",Y="p3",K=7680,Z=35044,J="300 es",Q=2e3,$=2001;class EventDispatcher{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,i=n.length;t<i;t++)n[t].call(this,e);e.target=null}}}const ee=["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 te=Math.PI/180,ne=180/Math.PI;function generateUUID(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(ee[255&e]+ee[e>>8&255]+ee[e>>16&255]+ee[e>>24&255]+"-"+ee[255&t]+ee[t>>8&255]+"-"+ee[t>>16&15|64]+ee[t>>24&255]+"-"+ee[63&n|128]+ee[n>>8&255]+"-"+ee[n>>16&255]+ee[n>>24&255]+ee[255&i]+ee[i>>8&255]+ee[i>>16&255]+ee[i>>24&255]).toLowerCase()}function clamp(e,t,n){return Math.max(t,Math.min(n,e))}function euclideanModulo(e,t){return(e%t+t)%t}function lerp(e,t,n){return(1-n)*e+n*t}function denormalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function normalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}class Vector2{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(e,t,n,i,r,a,s,o,l){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l)}set(e,t,n,i,r,a,s,o,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=t,c[4]=r,c[5]=o,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],_=i[1],v=i[4],x=i[7],M=i[2],y=i[5],S=i[8];return r[0]=a*f+s*_+o*M,r[3]=a*m+s*v+o*y,r[6]=a*g+s*x+o*S,r[1]=l*f+c*_+h*M,r[4]=l*m+c*v+h*y,r[7]=l*g+c*x+h*S,r[2]=u*f+d*_+p*M,r[5]=u*m+d*v+p*y,r[8]=u*g+d*x+p*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*a*c-t*s*l-n*r*c+n*s*o+i*r*l-i*a*o}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],h=c*a-s*l,u=s*o-c*r,d=l*r-a*o,p=t*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=h*f,e[1]=(i*l-c*n)*f,e[2]=(s*n-i*a)*f,e[3]=u*f,e[4]=(c*t-i*o)*f,e[5]=(i*r-s*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(a*t-n*r)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,s){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(ie.makeScale(e,t)),this}rotate(e){return this.premultiply(ie.makeRotation(-e)),this}translate(e,t){return this.premultiply(ie.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const ie=new Matrix3;function arrayNeedsUint32(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function createElementNS(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function createCanvasElement(){const e=createElementNS("canvas");return e.style.display="block",e}const re={};function warnOnce(e){e in re||(re[e]=!0,i.warn(e))}const ae=(new Matrix3).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),se=(new Matrix3).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),oe={[H]:{transfer:X,primaries:q,toReference:e=>e,fromReference:e=>e},[G]:{transfer:j,primaries:q,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[W]:{transfer:X,primaries:Y,toReference:e=>e.applyMatrix3(se),fromReference:e=>e.applyMatrix3(ae)},[k]:{transfer:j,primaries:Y,toReference:e=>e.convertSRGBToLinear().applyMatrix3(se),fromReference:e=>e.applyMatrix3(ae).convertLinearToSRGB()}},le=new Set([H,W]),ce={enabled:!0,_workingColorSpace:H,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!le.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const i=oe[t].toReference;return(0,oe[n].fromReference)(i(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return oe[e].primaries},getTransfer:function(e){return e===z?X:oe[e].transfer}};function SRGBToLinear(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function LinearToSRGB(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let he;let ue=0;class Source{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ue++}),this.uuid=generateUUID(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(serializeImage(i[t].image)):e.push(serializeImage(i[t]))}else e=serializeImage(i);n.url=e}return t||(e.images[this.uuid]=n),n}}function serializeImage(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?class ImageUtils{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===he&&(he=createElementNS("canvas")),he.width=e.width,he.height=e.height;const n=he.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=he}return t.width>2048||t.height>2048?(i.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=createElementNS("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;e<r.length;e++)r[e]=255*SRGBToLinear(r[e]/255);return n.putImageData(i,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*SRGBToLinear(t[e]/255)):t[e]=SRGBToLinear(t[e]);return{data:t,width:e.width,height:e.height}}return i.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(i.warn("THREE.Texture: Unable to serialize Texture."),{})}let de=0;class Texture extends EventDispatcher{constructor(e=Texture.DEFAULT_IMAGE,t=Texture.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,s=1023,o=1009,l=Texture.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:de++}),this.uuid=generateUUID(),this.name="",this.source=new Source(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}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(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case d:e.x=e.x-Math.floor(e.x);break;case p:e.x=e.x<0?0:1;break;case f:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case d:e.y=e.y-Math.floor(e.y);break;case p:e.y=e.y<0?0:1;break;case f:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Texture.DEFAULT_IMAGE=null,Texture.DEFAULT_MAPPING=300,Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(e=0,t=0,n=0,i=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const a=.01,s=.1,o=e.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-u)<a&&Math.abs(h-f)<a&&Math.abs(p-m)<a){if(Math.abs(c+u)<s&&Math.abs(h+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(d+1)/2,_=(g+1)/2,v=(c+u)/4,x=(h+f)/4,M=(p+m)/4;return e>o&&e>_?e<a?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(e),i=v/n,r=x/n):o>_?o<a?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=v/i,r=M/i):_<a?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(_),n=x/r,i=M/r),this.set(n,i,r,t),this}let _=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(_)<.001&&(_=1),this.x=(m-p)/_,this.y=(h-f)/_,this.z=(u-c)/_,this.w=Math.acos((l+d+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class RenderTarget extends EventDispatcher{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Vector4(0,0,e,t),this.scissorTest=!1,this.viewport=new Vector4(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:_,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const r=new Texture(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let e=0;e<a;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Source(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class WebGLRenderTarget extends RenderTarget{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class DataArrayTexture extends Texture{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=m,this.minFilter=m,this.wrapR=p,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Data3DTexture extends Texture{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=m,this.minFilter=m,this.wrapR=p,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Quaternion{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,s){let o=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const u=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(0===s)return e[t+0]=o,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===s)return e[t+0]=u,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(h!==f||o!==u||l!==d||c!==p){let e=1-s;const t=o*u+l*d+c*p+h*f,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const r=Math.sqrt(i),a=Math.atan2(r,t*n);e=Math.sin(e*a)/r,s=Math.sin(s*a)/r}const r=s*n;if(o=o*e+u*r,l=l*e+d*r,c=c*e+p*r,h=h*e+f*r,e===1-s){const e=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=e,l*=e,c*=e,h*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,r,a){const s=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[a],u=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+c*h+o*d-l*u,e[t+1]=o*p+c*u+l*h-s*d,e[t+2]=l*p+c*d+s*u-o*h,e[t+3]=c*p-s*h-o*u-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(r/2),u=o(a/2),d=l(n/2),p=l(r/2),f=l(a/2);switch(s){case"XYZ":this._x=d*h*u+c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u-d*p*f;break;case"YXZ":this._x=d*h*u+c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u+d*p*f;break;case"ZXY":this._x=d*h*u-c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u-d*p*f;break;case"ZYX":this._x=d*h*u-c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u+d*p*f;break;case"YZX":this._x=d*h*u+c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u-d*p*f;break;case"XZY":this._x=d*h*u-c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u+d*p*f;break;default:i.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],c=t[6],h=t[10],u=n+s+h;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-o)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>s&&n>h){const e=2*Math.sqrt(1+n-s-h);this._w=(c-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(s>h){const e=2*Math.sqrt(1+s-n-h);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+h-n-s);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+a*s+i*l-r*o,this._y=i*c+a*o+r*s-n*l,this._z=r*c+a*l+n*o-i*s,this._w=a*c-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,r=this._z,a=this._w;let s=a*e._w+n*e._x+i*e._y+r*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const o=1-s*s;if(o<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*r+t*this._z,this.normalize(),this}const l=Math.sqrt(o),c=Math.atan2(l,s),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=a*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(e=0,t=0,n=0){Vector3.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(fe.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(fe.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*n),c=2*(s*t-r*i),h=2*(r*n-a*t);return this.x=t+o*l+a*h-s*c,this.y=n+o*c+s*l-r*h,this.z=i+o*h+r*c-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return pe.copy(this).projectOnVector(e),this.sub(pe)}reflect(e){return this.sub(pe.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const pe=new Vector3,fe=new Quaternion;class Box3{constructor(e=new Vector3(1/0,1/0,1/0),t=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(ge.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(ge.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=ge.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===t&&void 0!==i&&!0!==e.isInstancedMesh)for(let t=0,n=i.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,ge):ge.fromBufferAttribute(i,t),ge.applyMatrix4(e.matrixWorld),this.expandByPoint(ge);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),_e.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),_e.copy(n.boundingBox)),_e.applyMatrix4(e.matrixWorld),this.union(_e)}const i=e.children;for(let e=0,n=i.length;e<n;e++)this.expandByObject(i[e],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ge),ge.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ee),be.subVectors(this.max,Ee),ve.subVectors(e.a,Ee),xe.subVectors(e.b,Ee),Me.subVectors(e.c,Ee),ye.subVectors(xe,ve),Se.subVectors(Me,xe),Te.subVectors(ve,Me);let t=[0,-ye.z,ye.y,0,-Se.z,Se.y,0,-Te.z,Te.y,ye.z,0,-ye.x,Se.z,0,-Se.x,Te.z,0,-Te.x,-ye.y,ye.x,0,-Se.y,Se.x,0,-Te.y,Te.x,0];return!!satForAxes(t,ve,xe,Me,be)&&(t=[1,0,0,0,1,0,0,0,1],!!satForAxes(t,ve,xe,Me,be)&&(Ae.crossVectors(ye,Se),t=[Ae.x,Ae.y,Ae.z],satForAxes(t,ve,xe,Me,be)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ge).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ge).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(me[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),me[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),me[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),me[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),me[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),me[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),me[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),me[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(me)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const me=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],ge=new Vector3,_e=new Box3,ve=new Vector3,xe=new Vector3,Me=new Vector3,ye=new Vector3,Se=new Vector3,Te=new Vector3,Ee=new Vector3,be=new Vector3,Ae=new Vector3,Re=new Vector3;function satForAxes(e,t,n,i,r){for(let a=0,s=e.length-3;a<=s;a+=3){Re.fromArray(e,a);const s=r.x*Math.abs(Re.x)+r.y*Math.abs(Re.y)+r.z*Math.abs(Re.z),o=t.dot(Re),l=n.dot(Re),c=i.dot(Re);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}const we=new Box3,Ce=new Vector3,Pe=new Vector3;class Sphere{constructor(e=new Vector3,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):we.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;t<r;t++)i=Math.max(i,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ce.subVectors(e,this.center);const t=Ce.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(Ce,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(Pe.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ce.copy(e.center).add(Pe)),this.expandByPoint(Ce.copy(e.center).sub(Pe))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Le=new Vector3,Ue=new Vector3,De=new Vector3,Ie=new Vector3,Ne=new Vector3,Oe=new Vector3,Fe=new Vector3;class Ray{constructor(e=new Vector3,t=new Vector3(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Le)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Le.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Le.copy(this.origin).addScaledVector(this.direction,t),Le.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ue.copy(e).add(t).multiplyScalar(.5),De.copy(t).sub(e).normalize(),Ie.copy(this.origin).sub(Ue);const r=.5*e.distanceTo(t),a=-this.direction.dot(De),s=Ie.dot(this.direction),o=-Ie.dot(De),l=Ie.lengthSq(),c=Math.abs(1-a*a);let h,u,d,p;if(c>0)if(h=a*o-s,u=a*s-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const e=1/c;h*=e,u*=e,d=h*(h+a*u+2*s)+u*(a*h+u+2*o)+l}else u=r,h=Math.max(0,-(a*u+s)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(a*u+s)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-a*r+s)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(a*r+s)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=a>0?-r:r,h=Math.max(0,-(a*u+s)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(Ue).addScaledVector(De,u),d}intersectSphere(e,t){Le.subVectors(e.center,this.origin);const n=Le.dot(this.direction),i=Le.dot(Le)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,a,s,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(e.min.x-u.x)*l,i=(e.max.x-u.x)*l):(n=(e.max.x-u.x)*l,i=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,a=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,a=(e.min.y-u.y)*c),n>a||r>i?null:((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),h>=0?(s=(e.min.z-u.z)*h,o=(e.max.z-u.z)*h):(s=(e.max.z-u.z)*h,o=(e.min.z-u.z)*h),n>o||s>i?null:((s>n||n!=n)&&(n=s),(o<i||i!=i)&&(i=o),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,Le)}intersectTriangle(e,t,n,i,r){Ne.subVectors(t,e),Oe.subVectors(n,e),Fe.crossVectors(Ne,Oe);let a,s=this.direction.dot(Fe);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}Ie.subVectors(this.origin,e);const o=a*this.direction.dot(Oe.crossVectors(Ie,Oe));if(o<0)return null;const l=a*this.direction.dot(Ne.cross(Ie));if(l<0)return null;if(o+l>s)return null;const c=-a*Ie.dot(Fe);return c<0?null:this.at(c/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(e,t,n,i,r,a,s,o,l,c,h,u,d,p,f,m){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l,c,h,u,d,p,f,m)}set(e,t,n,i,r,a,s,o,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Matrix4).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Ve.setFromMatrixColumn(e,0).length(),r=1/Ve.setFromMatrixColumn(e,1).length(),a=1/Ve.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){const e=a*c,n=a*h,i=s*c,r=s*h;t[0]=o*c,t[4]=-o*h,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*o}else if("YXZ"===e.order){const e=o*c,n=o*h,i=l*c,r=l*h;t[0]=e+r*s,t[4]=i*s-n,t[8]=a*l,t[1]=a*h,t[5]=a*c,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){const e=o*c,n=o*h,i=l*c,r=l*h;t[0]=e-r*s,t[4]=-a*h,t[8]=i+n*s,t[1]=n+i*s,t[5]=a*c,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){const e=a*c,n=a*h,i=s*c,r=s*h;t[0]=o*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=o*h,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){const e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=r-e*h,t[8]=i*h+n,t[1]=h,t[5]=a*c,t[9]=-s*c,t[2]=-l*c,t[6]=n*h+i,t[10]=e-r*h}else if("XZY"===e.order){const e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=-h,t[8]=l*c,t[1]=e*h+r,t[5]=a*c,t[9]=n*h-i,t[2]=i*h-n,t[6]=s*c,t[10]=r*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ze,e,Ge)}lookAt(e,t,n){const i=this.elements;return We.subVectors(e,t),0===We.lengthSq()&&(We.z=1),We.normalize(),He.crossVectors(n,We),0===He.lengthSq()&&(1===Math.abs(n.z)?We.x+=1e-4:We.z+=1e-4,We.normalize(),He.crossVectors(n,We)),He.normalize(),ke.crossVectors(We,He),i[0]=He.x,i[4]=ke.x,i[8]=We.x,i[1]=He.y,i[5]=ke.y,i[9]=We.y,i[2]=He.z,i[6]=ke.z,i[10]=We.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],_=n[3],v=n[7],x=n[11],M=n[15],y=i[0],S=i[4],T=i[8],E=i[12],b=i[1],A=i[5],R=i[9],w=i[13],C=i[2],P=i[6],L=i[10],U=i[14],D=i[3],I=i[7],N=i[11],O=i[15];return r[0]=a*y+s*b+o*C+l*D,r[4]=a*S+s*A+o*P+l*I,r[8]=a*T+s*R+o*L+l*N,r[12]=a*E+s*w+o*U+l*O,r[1]=c*y+h*b+u*C+d*D,r[5]=c*S+h*A+u*P+d*I,r[9]=c*T+h*R+u*L+d*N,r[13]=c*E+h*w+u*U+d*O,r[2]=p*y+f*b+m*C+g*D,r[6]=p*S+f*A+m*P+g*I,r[10]=p*T+f*R+m*L+g*N,r[14]=p*E+f*w+m*U+g*O,r[3]=_*y+v*b+x*C+M*D,r[7]=_*S+v*A+x*P+M*I,r[11]=_*T+v*R+x*L+M*N,r[15]=_*E+v*w+x*U+M*O,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*o*h-i*l*h-r*s*u+n*l*u+i*s*d-n*o*d)+e[7]*(+t*o*d-t*l*u+r*a*u-i*a*d+i*l*c-r*o*c)+e[11]*(+t*l*h-t*s*d-r*a*h+n*a*d+r*s*c-n*l*c)+e[15]*(-i*s*c-t*o*h+t*s*u+i*a*h-n*a*u+n*o*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],_=h*m*l-f*u*l+f*o*d-s*m*d-h*o*g+s*u*g,v=p*u*l-c*m*l-p*o*d+a*m*d+c*o*g-a*u*g,x=c*f*l-p*h*l+p*s*d-a*f*d-c*s*g+a*h*g,M=p*h*o-c*f*o-p*s*u+a*f*u+c*s*m-a*h*m,y=t*_+n*v+i*x+r*M;if(0===y)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/y;return e[0]=_*S,e[1]=(f*u*r-h*m*r-f*i*d+n*m*d+h*i*g-n*u*g)*S,e[2]=(s*m*r-f*o*r+f*i*l-n*m*l-s*i*g+n*o*g)*S,e[3]=(h*o*r-s*u*r-h*i*l+n*u*l+s*i*d-n*o*d)*S,e[4]=v*S,e[5]=(c*m*r-p*u*r+p*i*d-t*m*d-c*i*g+t*u*g)*S,e[6]=(p*o*r-a*m*r-p*i*l+t*m*l+a*i*g-t*o*g)*S,e[7]=(a*u*r-c*o*r+c*i*l-t*u*l-a*i*d+t*o*d)*S,e[8]=x*S,e[9]=(p*h*r-c*f*r-p*n*d+t*f*d+c*n*g-t*h*g)*S,e[10]=(a*f*r-p*s*r+p*n*l-t*f*l-a*n*g+t*s*g)*S,e[11]=(c*s*r-a*h*r-c*n*l+t*h*l+a*n*d-t*s*d)*S,e[12]=M*S,e[13]=(c*f*i-p*h*i+p*n*u-t*f*u-c*n*m+t*h*m)*S,e[14]=(p*s*i-a*f*i-p*n*o+t*f*o+a*n*m-t*s*m)*S,e[15]=(a*h*i-c*s*i+c*n*o-t*h*o-a*n*u+t*s*u)*S,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,s=e.y,o=e.z,l=r*a,c=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,c*s+n,c*o-i*a,0,l*o-i*s,c*o+i*a,r*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,c=a+a,h=s+s,u=r*l,d=r*c,p=r*h,f=a*c,m=a*h,g=s*h,_=o*l,v=o*c,x=o*h,M=n.x,y=n.y,S=n.z;return i[0]=(1-(f+g))*M,i[1]=(d+x)*M,i[2]=(p-v)*M,i[3]=0,i[4]=(d-x)*y,i[5]=(1-(u+g))*y,i[6]=(m+_)*y,i[7]=0,i[8]=(p+v)*S,i[9]=(m-_)*S,i[10]=(1-(u+f))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=Ve.set(i[0],i[1],i[2]).length();const a=Ve.set(i[4],i[5],i[6]).length(),s=Ve.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Be.copy(this);const o=1/r,l=1/a,c=1/s;return Be.elements[0]*=o,Be.elements[1]*=o,Be.elements[2]*=o,Be.elements[4]*=l,Be.elements[5]*=l,Be.elements[6]*=l,Be.elements[8]*=c,Be.elements[9]*=c,Be.elements[10]*=c,t.setFromRotationMatrix(Be),n.x=r,n.y=a,n.z=s,this}makePerspective(e,t,n,i,r,a,s=2e3){const o=this.elements,l=2*r/(t-e),c=2*r/(n-i),h=(t+e)/(t-e),u=(n+i)/(n-i);let d,p;if(s===Q)d=-(a+r)/(a-r),p=-2*a*r/(a-r);else{if(s!==$)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);d=-a/(a-r),p=-a*r/(a-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,i,r,a,s=2e3){const o=this.elements,l=1/(t-e),c=1/(n-i),h=1/(a-r),u=(t+e)*l,d=(n+i)*c;let p,f;if(s===Q)p=(a+r)*h,f=-2*h;else{if(s!==$)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);p=r*h,f=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=f,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Ve=new Vector3,Be=new Matrix4,ze=new Vector3(0,0,0),Ge=new Vector3(1,1,1),He=new Vector3,ke=new Vector3,We=new Vector3,Xe=new Matrix4,je=new Quaternion;class Euler{constructor(e=0,t=0,n=0,i=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,a=r[0],s=r[4],o=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(clamp(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-clamp(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(clamp(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-clamp(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-h,p),this._y=0);break;default:i.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Xe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Xe,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return je.setFromEuler(this),this.setFromQuaternion(je,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let qe=0;const Ye=new Vector3,Ke=new Quaternion,Ze=new Matrix4,Je=new Vector3,Qe=new Vector3,$e=new Vector3,et=new Quaternion,tt=new Vector3(1,0,0),nt=new Vector3(0,1,0),it=new Vector3(0,0,1),rt={type:"added"},at={type:"removed"},st={type:"childadded",child:null},ot={type:"childremoved",child:null};class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:qe++}),this.uuid=generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();const e=new Vector3,t=new Euler,n=new Quaternion,i=new Vector3(1,1,1);t._onChange((function onRotationChange(){n.setFromEuler(t,!1)})),n._onChange((function onQuaternionChange(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Matrix4},normalMatrix:{value:new Matrix3}}),this.matrix=new Matrix4,this.matrixWorld=new Matrix4,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Ke.setFromAxisAngle(e,t),this.quaternion.multiply(Ke),this}rotateOnWorldAxis(e,t){return Ke.setFromAxisAngle(e,t),this.quaternion.premultiply(Ke),this}rotateX(e){return this.rotateOnAxis(tt,e)}rotateY(e){return this.rotateOnAxis(nt,e)}rotateZ(e){return this.rotateOnAxis(it,e)}translateOnAxis(e,t){return Ye.copy(e).applyQuaternion(this.quaternion),this.position.add(Ye.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(tt,e)}translateY(e){return this.translateOnAxis(nt,e)}translateZ(e){return this.translateOnAxis(it,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ze.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Je.copy(e):Je.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Qe.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ze.lookAt(Qe,Je,this.up):Ze.lookAt(Je,Qe,this.up),this.quaternion.setFromRotationMatrix(Ze),i&&(Ze.extractRotation(i.matrixWorld),Ke.setFromRotationMatrix(Ze),this.quaternion.premultiply(Ke.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(i.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(rt),st.child=e,this.dispatchEvent(st),st.child=null):i.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(at),ot.child=e,this.dispatchEvent(ot),ot.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ze.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Ze.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ze),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(rt),st.child=e,this.dispatchEvent(st),st.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qe,e,$e),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qe,et,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++){const i=t[n];!0!==i.matrixWorldAutoUpdate&&!0!==e||i.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){const n=e[t];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};function serialize(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),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(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=serialize(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const i=n[t];serialize(e.shapes,i)}else serialize(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(serialize(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(serialize(e.materials,this.material[n]));i.material=t}else i.material=serialize(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];i.animations.push(serialize(e.animations,n))}}if(t){const t=extractFromCache(e.geometries),i=extractFromCache(e.materials),r=extractFromCache(e.textures),a=extractFromCache(e.images),s=extractFromCache(e.shapes),o=extractFromCache(e.skeletons),l=extractFromCache(e.animations),c=extractFromCache(e.nodes);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),o.length>0&&(n.skeletons=o),l.length>0&&(n.animations=l),c.length>0&&(n.nodes=c)}return n.object=i,n;function extractFromCache(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}Object3D.DEFAULT_UP=new Vector3(0,1,0),Object3D.DEFAULT_MATRIX_AUTO_UPDATE=!0,Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const lt=new Vector3,ct=new Vector3,ht=new Vector3,ut=new Vector3,dt=new Vector3,pt=new Vector3,ft=new Vector3,mt=new Vector3,gt=new Vector3,_t=new Vector3;class Triangle{constructor(e=new Vector3,t=new Vector3,n=new Vector3){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),lt.subVectors(e,t),i.cross(lt);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){lt.subVectors(i,t),ct.subVectors(n,t),ht.subVectors(e,t);const a=lt.dot(lt),s=lt.dot(ct),o=lt.dot(ht),l=ct.dot(ct),c=ct.dot(ht),h=a*l-s*s;if(0===h)return r.set(0,0,0),null;const u=1/h,d=(l*o-s*c)*u,p=(a*c-s*o)*u;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,ut)&&(ut.x>=0&&ut.y>=0&&ut.x+ut.y<=1)}static getInterpolation(e,t,n,i,r,a,s,o){return null===this.getBarycoord(e,t,n,i,ut)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,ut.x),o.addScaledVector(a,ut.y),o.addScaledVector(s,ut.z),o)}static isFrontFacing(e,t,n,i){return lt.subVectors(n,t),ct.subVectors(e,t),lt.cross(ct).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return lt.subVectors(this.c,this.b),ct.subVectors(this.a,this.b),.5*lt.cross(ct).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,s;dt.subVectors(i,n),pt.subVectors(r,n),mt.subVectors(e,n);const o=dt.dot(mt),l=pt.dot(mt);if(o<=0&&l<=0)return t.copy(n);gt.subVectors(e,i);const c=dt.dot(gt),h=pt.dot(gt);if(c>=0&&h<=c)return t.copy(i);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return a=o/(o-c),t.copy(n).addScaledVector(dt,a);_t.subVectors(e,r);const d=dt.dot(_t),p=pt.dot(_t);if(p>=0&&d<=p)return t.copy(r);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(n).addScaledVector(pt,s);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return ft.subVectors(r,i),s=(h-c)/(h-c+(d-p)),t.copy(i).addScaledVector(ft,s);const g=1/(m+f+u);return a=f*g,s=u*g,t.copy(n).addScaledVector(dt,a).addScaledVector(pt,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const vt={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},xt={h:0,s:0,l:0},Mt={h:0,s:0,l:0};function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class Color{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t="srgb"){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,ce.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=ce.workingColorSpace){return this.r=e,this.g=t,this.b=n,ce.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=ce.workingColorSpace){if(e=euclideanModulo(e,1),t=clamp(t,0,1),n=clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=hue2rgb(r,i,e+1/3),this.g=hue2rgb(r,i,e),this.b=hue2rgb(r,i,e-1/3)}return ce.toWorkingColorSpace(this,i),this}setStyle(e,t="srgb"){function handleAlpha(t){void 0!==t&&parseFloat(t)<1&&i.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=n[1],s=n[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return handleAlpha(r[4]),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,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return handleAlpha(r[4]),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,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return handleAlpha(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:i.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],a=r.length;if(3===a)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===a)return this.setHex(parseInt(r,16),t);i.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t="srgb"){const n=vt[e.toLowerCase()];return void 0!==n?this.setHex(n,t):i.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e="srgb"){return ce.fromWorkingColorSpace(yt.copy(this),e),65536*Math.round(clamp(255*yt.r,0,255))+256*Math.round(clamp(255*yt.g,0,255))+Math.round(clamp(255*yt.b,0,255))}getHexString(e="srgb"){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ce.workingColorSpace){ce.fromWorkingColorSpace(yt.copy(this),t);const n=yt.r,i=yt.g,r=yt.b,a=Math.max(n,i,r),s=Math.min(n,i,r);let o,l;const c=(s+a)/2;if(s===a)o=0,l=0;else{const e=a-s;switch(l=c<=.5?e/(a+s):e/(2-a-s),a){case n:o=(i-r)/e+(i<r?6:0);break;case i:o=(r-n)/e+2;break;case r:o=(n-i)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e,t=ce.workingColorSpace){return ce.fromWorkingColorSpace(yt.copy(this),t),e.r=yt.r,e.g=yt.g,e.b=yt.b,e}getStyle(e="srgb"){ce.fromWorkingColorSpace(yt.copy(this),e);const t=yt.r,n=yt.g,i=yt.b;return e!==G?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(e,t,n){return this.getHSL(xt),this.setHSL(xt.h+e,xt.s+t,xt.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(xt),e.getHSL(Mt);const n=lerp(xt.h,Mt.h,t),i=lerp(xt.s,Mt.s,t),r=lerp(xt.l,Mt.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const yt=new Color;Color.NAMES=vt;let St=0;class Material extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:St++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=s,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=K,this.stencilZFail=K,this.stencilZPass=K,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){i.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:i.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function extractFromCache(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==s&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==K&&(n.stencilFail=this.stencilFail),this.stencilZFail!==K&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==K&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=extractFromCache(e.textures),i=extractFromCache(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class MeshBasicMaterial extends Material{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(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.envMapRotation=new Euler,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Tt=new Vector3,Et=new Vector2;class BufferAttribute{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=Z,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=T,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return warnOnce("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)Et.fromBufferAttribute(this,t),Et.applyMatrix3(e),this.setXY(t,Et.x,Et.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Tt.fromBufferAttribute(this,t),Tt.applyMatrix3(e),this.setXYZ(t,Tt.x,Tt.y,Tt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Tt.fromBufferAttribute(this,t),Tt.applyMatrix4(e),this.setXYZ(t,Tt.x,Tt.y,Tt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Tt.fromBufferAttribute(this,t),Tt.applyNormalMatrix(e),this.setXYZ(t,Tt.x,Tt.y,Tt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Tt.fromBufferAttribute(this,t),Tt.transformDirection(e),this.setXYZ(t,Tt.x,Tt.y,Tt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=denormalize(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=normalize(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=denormalize(t,this.array)),t}setX(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=denormalize(t,this.array)),t}setY(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=denormalize(t,this.array)),t}setZ(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=denormalize(t,this.array)),t}setW(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),i=normalize(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),i=normalize(i,this.array),r=normalize(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Z&&(e.usage=this.usage),e}}class Uint16BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Uint32BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Float32BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Float32Array(e),t,n)}}let bt=0;const At=new Matrix4,Rt=new Object3D,wt=new Vector3,Ct=new Box3,Pt=new Box3,Lt=new Vector3;class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:bt++}),this.uuid=generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(arrayNeedsUint32(e)?Uint32BufferAttribute:Uint16BufferAttribute)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Matrix3).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return At.makeRotationFromQuaternion(e),this.applyMatrix4(At),this}rotateX(e){return At.makeRotationX(e),this.applyMatrix4(At),this}rotateY(e){return At.makeRotationY(e),this.applyMatrix4(At),this}rotateZ(e){return At.makeRotationZ(e),this.applyMatrix4(At),this}translate(e,t,n){return At.makeTranslation(e,t,n),this.applyMatrix4(At),this}scale(e,t,n){return At.makeScale(e,t,n),this.applyMatrix4(At),this}lookAt(e){return Rt.lookAt(e),Rt.updateMatrix(),this.applyMatrix4(Rt.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(wt).negate(),this.translate(wt.x,wt.y,wt.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Float32BufferAttribute(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return i.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Vector3(-1/0,-1/0,-1/0),new Vector3(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Ct.setFromBufferAttribute(n),this.morphTargetsRelative?(Lt.addVectors(this.boundingBox.min,Ct.min),this.boundingBox.expandByPoint(Lt),Lt.addVectors(this.boundingBox.max,Ct.max),this.boundingBox.expandByPoint(Lt)):(this.boundingBox.expandByPoint(Ct.min),this.boundingBox.expandByPoint(Ct.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&i.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sphere);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return i.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Vector3,1/0);if(e){const n=this.boundingSphere.center;if(Ct.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Pt.setFromBufferAttribute(n),this.morphTargetsRelative?(Lt.addVectors(Ct.min,Pt.min),Ct.expandByPoint(Lt),Lt.addVectors(Ct.max,Pt.max),Ct.expandByPoint(Lt)):(Ct.expandByPoint(Pt.min),Ct.expandByPoint(Pt.max))}Ct.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Lt.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Lt));if(t)for(let i=0,a=t.length;i<a;i++){const a=t[i],s=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Lt.fromBufferAttribute(a,t),s&&(wt.fromBufferAttribute(e,t),Lt.add(wt)),r=Math.max(r,n.distanceToSquared(Lt))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&i.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void i.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.position,r=t.normal,a=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new BufferAttribute(new Float32Array(4*n.count),4));const s=this.getAttribute("tangent"),o=[],l=[];for(let e=0;e<n.count;e++)o[e]=new Vector3,l[e]=new Vector3;const c=new Vector3,h=new Vector3,u=new Vector3,d=new Vector2,p=new Vector2,f=new Vector2,m=new Vector3,g=new Vector3;function handleTriangle(e,t,i){c.fromBufferAttribute(n,e),h.fromBufferAttribute(n,t),u.fromBufferAttribute(n,i),d.fromBufferAttribute(a,e),p.fromBufferAttribute(a,t),f.fromBufferAttribute(a,i),h.sub(c),u.sub(c),p.sub(d),f.sub(d);const r=1/(p.x*f.y-f.x*p.y);isFinite(r)&&(m.copy(h).multiplyScalar(f.y).addScaledVector(u,-p.y).multiplyScalar(r),g.copy(u).multiplyScalar(p.x).addScaledVector(h,-f.x).multiplyScalar(r),o[e].add(m),o[t].add(m),o[i].add(m),l[e].add(g),l[t].add(g),l[i].add(g))}let _=this.groups;0===_.length&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){const n=_[t],i=n.start;for(let t=i,r=i+n.count;t<r;t+=3)handleTriangle(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const v=new Vector3,x=new Vector3,M=new Vector3,y=new Vector3;function handleVertex(e){M.fromBufferAttribute(r,e),y.copy(M);const t=o[e];v.copy(t),v.sub(M.multiplyScalar(M.dot(t))).normalize(),x.crossVectors(y,t);const n=x.dot(l[e])<0?-1:1;s.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){const n=_[t],i=n.start;for(let t=i,r=i+n.count;t<r;t+=3)handleVertex(e.getX(t+0)),handleVertex(e.getX(t+1)),handleVertex(e.getX(t+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new BufferAttribute(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const i=new Vector3,r=new Vector3,a=new Vector3,s=new Vector3,o=new Vector3,l=new Vector3,c=new Vector3,h=new Vector3;if(e)for(let u=0,d=e.count;u<d;u+=3){const d=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);i.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),c.subVectors(a,r),h.subVectors(i,r),c.cross(h),s.fromBufferAttribute(n,d),o.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),s.add(c),o.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(p,o.x,o.y,o.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,r),h.subVectors(i,r),c.cross(h),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Lt.fromBufferAttribute(e,t),Lt.normalize(),e.setXYZ(t,Lt.x,Lt.y,Lt.z)}toNonIndexed(){function convertBufferAttribute(e,t){const n=e.array,i=e.itemSize,r=e.normalized,a=new n.constructor(t.length*i);let s=0,o=0;for(let r=0,l=t.length;r<l;r++){s=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*i;for(let e=0;e<i;e++)a[o++]=n[s++]}return new BufferAttribute(a,i,r)}if(null===this.index)return i.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new BufferGeometry,t=this.index.array,n=this.attributes;for(const i in n){const r=convertBufferAttribute(n[i],t);e.setAttribute(i,r)}const r=this.morphAttributes;for(const n in r){const i=[],a=r[n];for(let e=0,n=a.length;e<n;e++){const n=convertBufferAttribute(a[e],t);i.push(n)}e.morphAttributes[n]=i}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let t=0,n=a.length;t<n;t++){const n=a[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const i=n[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let r=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];a.push(i.toJSON(e.data))}a.length>0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const r=e.morphAttributes;for(const e in r){const n=[],i=r[e];for(let e=0,r=i.length;e<r;e++)n.push(i[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let e=0,t=a.length;e<t;e++){const t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Ut=new Matrix4,Dt=new Ray,It=new Sphere,Nt=new Vector3,Ot=new Vector3,Ft=new Vector3,Vt=new Vector3,Bt=new Vector3,zt=new Vector3,Gt=new Vector2,Ht=new Vector2,kt=new Vector2,Wt=new Vector3,Xt=new Vector3,jt=new Vector3,qt=new Vector3,Yt=new Vector3;class Mesh extends Object3D{constructor(e=new BufferGeometry,t=new MeshBasicMaterial){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const s=this.morphTargetInfluences;if(r&&s){zt.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=s[n],o=r[n];0!==i&&(Bt.fromBufferAttribute(o,e),a?zt.addScaledVector(Bt,i):zt.addScaledVector(Bt.sub(t),i))}t.add(zt)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),It.copy(n.boundingSphere),It.applyMatrix4(r),Dt.copy(e.ray).recast(e.near),!1===It.containsPoint(Dt.origin)){if(null===Dt.intersectSphere(It,Nt))return;if(Dt.origin.distanceToSquared(Nt)>(e.far-e.near)**2)return}Ut.copy(r).invert(),Dt.copy(e.ray).applyMatrix4(Ut),null!==n.boundingBox&&!1===Dt.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,Dt)}}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,h=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(a))for(let r=0,o=u.length;r<o;r++){const o=u[r],p=a[o.materialIndex];for(let r=Math.max(o.start,d.start),a=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));r<a;r+=3){i=checkGeometryIntersection(this,p,e,n,l,c,h,s.getX(r),s.getX(r+1),s.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,t.push(i))}}else{for(let r=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);r<o;r+=3){i=checkGeometryIntersection(this,a,e,n,l,c,h,s.getX(r),s.getX(r+1),s.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}else if(void 0!==o)if(Array.isArray(a))for(let r=0,s=u.length;r<s;r++){const s=u[r],p=a[s.materialIndex];for(let r=Math.max(s.start,d.start),a=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));r<a;r+=3){i=checkGeometryIntersection(this,p,e,n,l,c,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,t.push(i))}}else{for(let r=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);r<s;r+=3){i=checkGeometryIntersection(this,a,e,n,l,c,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}}}function checkGeometryIntersection(e,t,n,i,r,a,s,o,l,c){e.getVertexPosition(o,Ot),e.getVertexPosition(l,Ft),e.getVertexPosition(c,Vt);const h=function checkIntersection(e,t,n,i,r,a,s,o){let l;if(l=1===t.side?i.intersectTriangle(s,a,r,!0,o):i.intersectTriangle(r,a,s,0===t.side,o),null===l)return null;Yt.copy(o),Yt.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(Yt);return c<n.near||c>n.far?null:{distance:c,point:Yt.clone(),object:e}}(e,t,n,i,Ot,Ft,Vt,qt);if(h){r&&(Gt.fromBufferAttribute(r,o),Ht.fromBufferAttribute(r,l),kt.fromBufferAttribute(r,c),h.uv=Triangle.getInterpolation(qt,Ot,Ft,Vt,Gt,Ht,kt,new Vector2)),a&&(Gt.fromBufferAttribute(a,o),Ht.fromBufferAttribute(a,l),kt.fromBufferAttribute(a,c),h.uv1=Triangle.getInterpolation(qt,Ot,Ft,Vt,Gt,Ht,kt,new Vector2)),s&&(Wt.fromBufferAttribute(s,o),Xt.fromBufferAttribute(s,l),jt.fromBufferAttribute(s,c),h.normal=Triangle.getInterpolation(qt,Ot,Ft,Vt,Wt,Xt,jt,new Vector3),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const e={a:o,b:l,c,normal:new Vector3,materialIndex:0};Triangle.getNormal(Ot,Ft,Vt,e.normal),h.face=e}return h}class BoxGeometry extends BufferGeometry{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const o=[],l=[],c=[],h=[];let u=0,d=0;function buildPlane(e,t,n,i,r,a,p,f,m,g,_){const v=a/m,x=p/g,M=a/2,y=p/2,S=f/2,T=m+1,E=g+1;let b=0,A=0;const R=new Vector3;for(let a=0;a<E;a++){const s=a*x-y;for(let o=0;o<T;o++){const u=o*v-M;R[e]=u*i,R[t]=s*r,R[n]=S,l.push(R.x,R.y,R.z),R[e]=0,R[t]=0,R[n]=f>0?1:-1,c.push(R.x,R.y,R.z),h.push(o/m),h.push(1-a/g),b+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){const n=u+t+T*e,i=u+t+T*(e+1),r=u+(t+1)+T*(e+1),a=u+(t+1)+T*e;o.push(n,i,a),o.push(i,r,a),A+=6}s.addGroup(d,A,_),d+=A,u+=b}buildPlane("z","y","x",-1,-1,n,t,e,a,r,0),buildPlane("z","y","x",1,-1,n,t,-e,a,r,1),buildPlane("x","z","y",1,1,e,n,t,i,a,2),buildPlane("x","z","y",1,-1,e,n,-t,i,a,3),buildPlane("x","y","z",1,-1,e,t,n,i,r,4),buildPlane("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new Float32BufferAttribute(l,3)),this.setAttribute("normal",new Float32BufferAttribute(c,3)),this.setAttribute("uv",new Float32BufferAttribute(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function cloneUniforms(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const a=e[n][r];a&&(a.isColor||a.isMatrix3||a.isMatrix4||a.isVector2||a.isVector3||a.isVector4||a.isTexture||a.isQuaternion)?a.isRenderTargetTexture?(i.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=a.clone():Array.isArray(a)?t[n][r]=a.slice():t[n][r]=a}}return t}function mergeUniforms(e){const t={};for(let n=0;n<e.length;n++){const i=cloneUniforms(e[n]);for(const e in i)t[e]=i[e]}return t}function getUnlitUniformColorSpace(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:ce.workingColorSpace}const Kt={clone:cloneUniforms,merge:mergeUniforms};class ShaderMaterial extends Material{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cloneUniforms(e.uniforms),this.uniformsGroups=function cloneUniformsGroups(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=Q}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const Zt=new Vector3,Jt=new Vector2,Qt=new Vector2;class PerspectiveCamera extends Camera{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*ne*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*te*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*ne*Math.atan(Math.tan(.5*te*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Zt.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Zt.x,Zt.y).multiplyScalar(-e/Zt.z),Zt.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Zt.x,Zt.y).multiplyScalar(-e/Zt.z)}getViewSize(e,t){return this.getViewBounds(e,Jt,Qt),t.subVectors(Qt,Jt)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*te*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/s,i*=a.width/e,n*=a.height/s}const s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const $t=-90;class CubeCamera extends Object3D{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new PerspectiveCamera($t,1,e,t);i.layers=this.layers,this.add(i);const r=new PerspectiveCamera($t,1,e,t);r.layers=this.layers,this.add(r);const a=new PerspectiveCamera($t,1,e,t);a.layers=this.layers,this.add(a);const s=new PerspectiveCamera($t,1,e,t);s.layers=this.layers,this.add(s);const o=new PerspectiveCamera($t,1,e,t);o.layers=this.layers,this.add(o);const l=new PerspectiveCamera($t,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,s,o]=t;for(const e of t)this.remove(e);if(e===Q)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(e!==$)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,s,o,l,c]=this.children,h=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,s),e.setRenderTarget(n,3,i),e.render(t,o),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,i),e.render(t,c),e.setRenderTarget(h,u,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture{constructor(e,t,n,i,r,a,s,l,c,h){super(e=void 0!==e?e:[],t=void 0!==t?t:o,n,i,r,a,s,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new CubeTexture(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:_}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.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"},i=new BoxGeometry(5,5,5),r=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:a});r.uniforms.tEquirect.value=t;const s=new Mesh(i,r),o=t.minFilter;t.minFilter===x&&(t.minFilter=_);return new CubeCamera(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,i){const r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}const en=new Vector3,tn=new Vector3,nn=new Matrix3;class Plane{constructor(e=new Vector3(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=en.subVectors(n,t).cross(tn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(en),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||nn.getNormalMatrix(e),i=this.coplanarPoint(en).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const rn=new Sphere,an=new Vector3;class Frustum{constructor(e=new Plane,t=new Plane,n=new Plane,i=new Plane,r=new Plane,a=new Plane){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3){const n=this.planes,i=e.elements,r=i[0],a=i[1],s=i[2],o=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],_=i[13],v=i[14],x=i[15];if(n[0].setComponents(o-r,u-l,m-d,x-g).normalize(),n[1].setComponents(o+r,u+l,m+d,x+g).normalize(),n[2].setComponents(o+a,u+c,m+p,x+_).normalize(),n[3].setComponents(o-a,u-c,m-p,x-_).normalize(),n[4].setComponents(o-s,u-h,m-f,x-v).normalize(),t===Q)n[5].setComponents(o+s,u+h,m+f,x+v).normalize();else{if(t!==$)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(s,h,f,v).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),rn.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),rn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(rn)}intersectsSprite(e){return rn.center.set(0,0,0),rn.radius=.7071067811865476,rn.applyMatrix4(e.matrixWorld),this.intersectsSphere(rn)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)<i)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(an.x=i.normal.x>0?e.max.x:e.min.x,an.y=i.normal.y>0?e.max.y:e.min.y,an.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(an)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let e=null,t=!1,n=null,i=null;function onAnimationFrame(t,r){n(t,r),i=e.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(onAnimationFrame),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function WebGLAttributes(e){const t=new WeakMap;return{get:function get(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function remove(n){n.isInterleavedBufferAttribute&&(n=n.data);const i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function update(n,i){if(n.isGLBufferAttribute){const e=t.get(n);return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}n.isInterleavedBufferAttribute&&(n=n.data);const r=t.get(n);if(void 0===r)t.set(n,function createBuffer(t,n){const i=t.array,r=t.usage,a=i.byteLength,s=e.createBuffer();let o;if(e.bindBuffer(n,s),e.bufferData(n,i,r),t.onUploadCallback(),i instanceof Float32Array)o=e.FLOAT;else if(i instanceof Uint16Array)o=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(i instanceof Int16Array)o=e.SHORT;else if(i instanceof Uint32Array)o=e.UNSIGNED_INT;else if(i instanceof Int32Array)o=e.INT;else if(i instanceof Int8Array)o=e.BYTE;else if(i instanceof Uint8Array)o=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=e.UNSIGNED_BYTE}return{buffer:s,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:a}}(n,i));else if(r.version<n.version){if(r.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function updateBuffer(t,n,i){const r=n.array,a=n._updateRange,s=n.updateRanges;if(e.bindBuffer(i,t),-1===a.count&&0===s.length&&e.bufferSubData(i,0,r),0!==s.length){for(let t=0,n=s.length;t<n;t++){const n=s[t];e.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}-1!==a.count&&(e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r,a.offset,a.count),a.count=-1),n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}class PlaneGeometry extends BufferGeometry{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,s=Math.floor(n),o=Math.floor(i),l=s+1,c=o+1,h=e/s,u=t/o,d=[],p=[],f=[],m=[];for(let e=0;e<c;e++){const t=e*u-a;for(let n=0;n<l;n++){const i=n*h-r;p.push(i,-t,0),f.push(0,0,1),m.push(n/s),m.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<s;t++){const n=t+l*e,i=t+l*(e+1),r=t+1+l*(e+1),a=t+1+l*e;d.push(n,i,a),d.push(i,r,a)}this.setIndex(d),this.setAttribute("position",new Float32BufferAttribute(p,3)),this.setAttribute("normal",new Float32BufferAttribute(f,3)),this.setAttribute("uv",new Float32BufferAttribute(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)}}const sn={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"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",iridescence_fragment:"#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\treturn 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 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",bumpmap_pars_fragment:"#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 = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( 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",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#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",common:"#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};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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",cube_uv_reflection_fragment:"#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_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\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",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( 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}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#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, envMapRotation * 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",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\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",envmap_pars_fragment:"#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",envmap_pars_vertex:"#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",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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#ifdef 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, envMapRotation * 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\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#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",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#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",fog_pars_fragment:"#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",gradientmap_pars_fragment:"#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}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\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",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\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\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"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\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = 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_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\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\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, 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( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, 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}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\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, geometryPosition, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\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",lights_fragment_maps:"#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( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#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",map_particle_pars_fragment:"#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",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#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",morphnormal_vertex:"#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",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\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",morphtarget_vertex:"#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",normal_fragment_begin:"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#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\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,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\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 nonPerturbedNormal = normal;",normal_fragment_maps:"#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",normal_pars_fragment:"#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",normal_pars_vertex:"#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",normal_vertex:"#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",normalmap_pars_fragment:"#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 ) || defined( USE_ANISOTROPY ) )\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",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#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",clearcoat_pars_fragment:"#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",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#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\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n#endif",shadowmap_pars_vertex:"#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",shadowmap_vertex:"#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",shadowmask_pars_fragment:"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}",skinbase_vertex:"#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",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#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",skinnormal_vertex:"#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",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( 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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tfloat startCompression = 0.8 - 0.04;\n\tfloat desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min(color.r, min(color.g, color.b));\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max(color.r, max(color.g, color.b));\n\tif (peak < startCompression) return color;\n\tfloat d = 1. - startCompression;\n\tfloat newPeak = 1. - d * d / (peak + d - startCompression);\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);\n\treturn mix(color, newPeak * vec3(1, 1, 1), g);\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#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 transmitted = 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, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#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 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\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 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\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_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\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",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\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_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\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",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\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_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_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",worldpos_vertex:"#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_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"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}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"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}",backgroundCube_frag:"#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;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * 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 <colorspace_fragment>\n}",cube_vert:"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}",cube_frag:"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 <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\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 <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_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}",depth_frag:"#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 <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\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 <alphahash_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}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\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 <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_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}",distanceRGBA_frag:"#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 <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"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 <colorspace_fragment>\n}",linedashed_vert:"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 <morphinstance_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}",linedashed_frag:"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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\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 <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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}",meshbasic_frag:"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 <alphahash_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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 <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\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 <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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}",meshlambert_frag:"#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 <alphahash_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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 <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\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 <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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}",meshmatcap_frag:"#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 <alphahash_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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 <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#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 <batching_pars_vertex>\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 <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_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}",meshnormal_frag:"#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\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\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 ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\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 <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_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}",meshphong_frag:"#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 <alphahash_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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 <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\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 <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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}",meshphysical_frag:"#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\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\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 <alphahash_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\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 <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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}",meshtoon_frag:"#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 <alphahash_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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 <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"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 <morphinstance_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}",points_frag:"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 <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\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 <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_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}",shadow_frag:"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 <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"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}",sprite_frag:"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 <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},on={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new Matrix3},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(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 Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},ln={basic:{uniforms:mergeUniforms([on.common,on.specularmap,on.envmap,on.aomap,on.lightmap,on.fog]),vertexShader:sn.meshbasic_vert,fragmentShader:sn.meshbasic_frag},lambert:{uniforms:mergeUniforms([on.common,on.specularmap,on.envmap,on.aomap,on.lightmap,on.emissivemap,on.bumpmap,on.normalmap,on.displacementmap,on.fog,on.lights,{emissive:{value:new Color(0)}}]),vertexShader:sn.meshlambert_vert,fragmentShader:sn.meshlambert_frag},phong:{uniforms:mergeUniforms([on.common,on.specularmap,on.envmap,on.aomap,on.lightmap,on.emissivemap,on.bumpmap,on.normalmap,on.displacementmap,on.fog,on.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:sn.meshphong_vert,fragmentShader:sn.meshphong_frag},standard:{uniforms:mergeUniforms([on.common,on.envmap,on.aomap,on.lightmap,on.emissivemap,on.bumpmap,on.normalmap,on.displacementmap,on.roughnessmap,on.metalnessmap,on.fog,on.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:sn.meshphysical_vert,fragmentShader:sn.meshphysical_frag},toon:{uniforms:mergeUniforms([on.common,on.aomap,on.lightmap,on.emissivemap,on.bumpmap,on.normalmap,on.displacementmap,on.gradientmap,on.fog,on.lights,{emissive:{value:new Color(0)}}]),vertexShader:sn.meshtoon_vert,fragmentShader:sn.meshtoon_frag},matcap:{uniforms:mergeUniforms([on.common,on.bumpmap,on.normalmap,on.displacementmap,on.fog,{matcap:{value:null}}]),vertexShader:sn.meshmatcap_vert,fragmentShader:sn.meshmatcap_frag},points:{uniforms:mergeUniforms([on.points,on.fog]),vertexShader:sn.points_vert,fragmentShader:sn.points_frag},dashed:{uniforms:mergeUniforms([on.common,on.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:sn.linedashed_vert,fragmentShader:sn.linedashed_frag},depth:{uniforms:mergeUniforms([on.common,on.displacementmap]),vertexShader:sn.depth_vert,fragmentShader:sn.depth_frag},normal:{uniforms:mergeUniforms([on.common,on.bumpmap,on.normalmap,on.displacementmap,{opacity:{value:1}}]),vertexShader:sn.meshnormal_vert,fragmentShader:sn.meshnormal_frag},sprite:{uniforms:mergeUniforms([on.sprite,on.fog]),vertexShader:sn.sprite_vert,fragmentShader:sn.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:sn.background_vert,fragmentShader:sn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Matrix3}},vertexShader:sn.backgroundCube_vert,fragmentShader:sn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:sn.cube_vert,fragmentShader:sn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:sn.equirect_vert,fragmentShader:sn.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([on.common,on.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:sn.distanceRGBA_vert,fragmentShader:sn.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([on.lights,on.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:sn.shadow_vert,fragmentShader:sn.shadow_frag}};ln.physical={uniforms:mergeUniforms([ln.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:sn.meshphysical_vert,fragmentShader:sn.meshphysical_frag};const cn={r:0,b:0,g:0},hn=new Euler,un=new Matrix4;function WebGLBackground(e,t,n,i,r,a,s){const o=new Color(0);let l,c,h=!0===a?0:1,d=null,p=0,f=null;function setClear(t,n){t.getRGB(cn,getUnlitUniformColorSpace(e)),i.buffers.color.setClear(cn.r,cn.g,cn.b,n,s)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),h=t,setClear(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(e){h=e,setClear(o,h)},render:function render(a,m){let g=!1,_=!0===m.isScene?m.background:null;if(_&&_.isTexture){_=(m.backgroundBlurriness>0?n:t).get(_)}null===_?setClear(o,h):_&&_.isColor&&(setClear(_,1),g=!0);const v=e.xr.getEnvironmentBlendMode();"additive"===v?i.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===v&&i.buffers.color.setClear(0,0,0,0,s),(e.autoClear||g)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),_&&(_.isCubeTexture||_.mapping===u)?(void 0===c&&(c=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ln.backgroundCube.uniforms),vertexShader:ln.backgroundCube.vertexShader,fragmentShader:ln.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),hn.copy(m.backgroundRotation),hn.x*=-1,hn.y*=-1,hn.z*=-1,_.isCubeTexture&&!1===_.isRenderTargetTexture&&(hn.y*=-1,hn.z*=-1),c.material.uniforms.envMap.value=_,c.material.uniforms.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(un.makeRotationFromEuler(hn)),c.material.toneMapped=ce.getTransfer(_.colorSpace)!==j,d===_&&p===_.version&&f===e.toneMapping||(c.material.needsUpdate=!0,d=_,p=_.version,f=e.toneMapping),c.layers.enableAll(),a.unshift(c,c.geometry,c.material,0,0,null)):_&&_.isTexture&&(void 0===l&&(l=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ln.background.uniforms),vertexShader:ln.background.vertexShader,fragmentShader:ln.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=_,l.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,l.material.toneMapped=ce.getTransfer(_.colorSpace)!==j,!0===_.matrixAutoUpdate&&_.updateMatrix(),l.material.uniforms.uvTransform.value.copy(_.matrix),d===_&&p===_.version&&f===e.toneMapping||(l.material.needsUpdate=!0,d=_,p=_.version,f=e.toneMapping),l.layers.enableAll(),a.unshift(l,l.geometry,l.material,0,0,null))}}}function WebGLBindingStates(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=createBindingState(null);let a=r,s=!1;function bindVertexArrayObject(t){return e.bindVertexArray(t)}function deleteVertexArrayObject(t){return e.deleteVertexArray(t)}function createBindingState(e){const t=[],i=[],r=[];for(let e=0;e<n;e++)t[e]=0,i[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:r,object:e,attributes:{},index:null}}function initAttributes(){const e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function enableAttribute(e){enableAttributeAndDivisor(e,0)}function enableAttributeAndDivisor(t,n){const i=a.newAttributes,r=a.enabledAttributes,s=a.attributeDivisors;i[t]=1,0===r[t]&&(e.enableVertexAttribArray(t),r[t]=1),s[t]!==n&&(e.vertexAttribDivisor(t,n),s[t]=n)}function disableUnusedAttributes(){const t=a.newAttributes,n=a.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function vertexAttribPointer(t,n,i,r,a,s,o){!0===o?e.vertexAttribIPointer(t,n,i,a,s):e.vertexAttribPointer(t,n,i,r,a,s)}function reset(){resetDefaultState(),s=!0,a!==r&&(a=r,bindVertexArrayObject(a.object))}function resetDefaultState(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function setup(n,r,o,l,c){let h=!1;const u=function getBindingState(t,n,r){const a=!0===r.wireframe;let s=i[t.id];void 0===s&&(s={},i[t.id]=s);let o=s[n.id];void 0===o&&(o={},s[n.id]=o);let l=o[a];void 0===l&&(l=createBindingState(function createVertexArrayObject(){return e.createVertexArray()}()),o[a]=l);return l}(l,o,r);a!==u&&(a=u,bindVertexArrayObject(a.object)),h=function needsUpdate(e,t,n,i){const r=a.attributes,s=t.attributes;let o=0;const l=n.getAttributes();for(const t in l){if(l[t].location>=0){const n=r[t];let i=s[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;o++}}return a.attributesNum!==o||a.index!==i}(n,l,o,c),h&&function saveCache(e,t,n,i){const r={},s=t.attributes;let o=0;const l=n.getAttributes();for(const t in l){if(l[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[t]=i,o++}}a.attributes=r,a.attributesNum=o,a.index=i}(n,l,o,c),null!==c&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(h||s)&&(s=!1,function setupVertexAttributes(n,i,r,a){initAttributes();const s=a.attributes,o=r.getAttributes(),l=i.defaultAttributeValues;for(const i in o){const r=o[i];if(r.location>=0){let o=s[i];if(void 0===o&&("instanceMatrix"===i&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){const i=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement,d=h===e.INT||h===e.UNSIGNED_INT||o.gpuType===y;if(o.isInterleavedBufferAttribute){const t=o.data,l=t.stride,p=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)enableAttributeAndDivisor(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)enableAttribute(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)vertexAttribPointer(r.location+e,s/r.locationSize,h,i,l*u,(p+s/r.locationSize*e)*u,d)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)enableAttributeAndDivisor(r.location+e,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let e=0;e<r.locationSize;e++)enableAttribute(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)vertexAttribPointer(r.location+e,s/r.locationSize,h,i,s*u,s/r.locationSize*e*u,d)}}else if(void 0!==l){const t=l[i];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}disableUnusedAttributes()}(n,r,o,l),null!==c&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))},reset,resetDefaultState,dispose:function dispose(){reset();for(const e in i){const t=i[e];for(const e in t){const n=t[e];for(const e in n)deleteVertexArrayObject(n[e].object),delete n[e];delete t[e]}delete i[e]}},releaseStatesOfGeometry:function releaseStatesOfGeometry(e){if(void 0===i[e.id])return;const t=i[e.id];for(const e in t){const n=t[e];for(const e in n)deleteVertexArrayObject(n[e].object),delete n[e];delete t[e]}delete i[e.id]},releaseStatesOfProgram:function releaseStatesOfProgram(e){for(const t in i){const n=i[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)deleteVertexArrayObject(r[e].object),delete r[e];delete n[e.id]}},initAttributes,enableAttribute,disableUnusedAttributes}}function WebGLBufferRenderer(e,t,n){let i;this.setMode=function setMode(e){i=e},this.render=function render(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function renderInstances(t,r,a){0!==a&&(e.drawArraysInstanced(i,t,r,a),n.update(r,i,a))},this.renderMultiDraw=function renderMultiDraw(e,r,a){if(0===a)return;const s=t.get("WEBGL_multi_draw");if(null===s)for(let t=0;t<a;t++)this.render(e[t],r[t]);else{s.multiDrawArraysWEBGL(i,e,0,r,0,a);let t=0;for(let e=0;e<a;e++)t+=r[e];n.update(t,i,1)}}}function WebGLCapabilities(e,t,n){let r;function getMaxPrecision(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let a=void 0!==n.precision?n.precision:"highp";const s=getMaxPrecision(a);s!==a&&(i.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);const o=!0===n.logarithmicDepthBuffer,l=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),c=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function getMaxAnisotropy(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision,precision:a,logarithmicDepthBuffer:o,maxTextures:l,maxVertexTextures:c,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:c>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function WebGLClipping(e){const t=this;let n=null,i=0,r=!1,a=!1;const s=new Plane,o=new Matrix3,l={value:null,needsUpdate:!1};function projectPlanes(e,n,i,r){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==r||null===c){const t=i+4*a,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=i;t!==a;++t,n+=4)s.copy(e[t]).applyMatrix4(r,o),s.normal.toArray(c,n),c[n+3]=s.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==i||r;return r=t,i=e.length,n},this.beginShadows=function(){a=!0,projectPlanes(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=projectPlanes(e,t,0)},this.setState=function(s,o,c){const h=s.clippingPlanes,u=s.clipIntersection,d=s.clipShadows,p=e.get(s);if(!r||null===h||0===h.length||a&&!d)a?projectPlanes(null):function resetGlobalState(){l.value!==n&&(l.value=n,l.needsUpdate=i>0);t.numPlanes=i,t.numIntersection=0}();else{const e=a?0:i,t=4*e;let r=p.clippingState||null;l.value=r,r=projectPlanes(h,o,t,c);for(let e=0;e!==t;++e)r[e]=n[e];p.clippingState=r,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=e}}}function WebGLCubeMaps(e){let t=new WeakMap;function mapTextureMapping(e,t){return t===c?e.mapping=o:t===h&&(e.mapping=l),e}function onTextureDispose(e){const n=e.target;n.removeEventListener("dispose",onTextureDispose);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function get(n){if(n&&n.isTexture){const i=n.mapping;if(i===c||i===h){if(t.has(n)){return mapTextureMapping(t.get(n).texture,n.mapping)}{const i=n.image;if(i&&i.height>0){const r=new WebGLCubeRenderTarget(i.height);return r.fromEquirectangularTexture(e,n),t.set(n,r),n.addEventListener("dispose",onTextureDispose),mapTextureMapping(r.texture,n.mapping)}return null}}}return n},dispose:function dispose(){t=new WeakMap}}}class OrthographicCamera extends Camera{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-e,a=n+e,s=i+t,o=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const dn=[.125,.215,.35,.446,.526,.582],pn=20,fn=new OrthographicCamera,mn=new Color;let gn=null,_n=0,vn=0,xn=!1;const Mn=(1+Math.sqrt(5))/2,yn=1/Mn,Sn=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,Mn,yn),new Vector3(0,Mn,-yn),new Vector3(yn,0,Mn),new Vector3(-yn,0,Mn),new Vector3(Mn,yn,0),new Vector3(-Mn,yn,0)];class PMREMGenerator{constructor(e){this._renderer=e,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(e,t=0,n=.1,i=100){gn=this._renderer.getRenderTarget(),_n=this._renderer.getActiveCubeFace(),vn=this._renderer.getActiveMipmapLevel(),xn=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,n,i,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(gn,_n,vn),this._renderer.xr.enabled=xn,e.scissorTest=!1,_setViewport(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===o||e.mapping===l?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),gn=this._renderer.getRenderTarget(),_n=this._renderer.getActiveCubeFace(),vn=this._renderer.getActiveMipmapLevel(),xn=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:_,minFilter:_,generateMipmaps:!1,type:E,format:A,colorSpace:H,depthBuffer:!1},i=_createRenderTarget(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=_createRenderTarget(e,t,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function _createPlanes(e){const t=[],n=[],i=[];let r=e;const a=e-4+1+dn.length;for(let s=0;s<a;s++){const a=Math.pow(2,r);n.push(a);let o=1/a;s>e-4?o=dn[s-e+4-1]:0===s&&(o=0),i.push(o);const l=1/(a-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,_=new Float32Array(f*p*d),v=new Float32Array(m*p*d),x=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];_.set(i,f*p*e),v.set(u,m*p*e);const r=[e,e,e,e,e,e];x.set(r,g*p*e)}const M=new BufferGeometry;M.setAttribute("position",new BufferAttribute(_,f)),M.setAttribute("uv",new BufferAttribute(v,m)),M.setAttribute("faceIndex",new BufferAttribute(x,g)),t.push(M),r>4&&r--}return{lodPlanes:t,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function _getBlurShader(e,t,n){const i=new Float32Array(pn),r=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:pn,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:_getCommonVertexShader(),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:a,depthTest:!1,depthWrite:!1})}(i,e,t)}return i}_compileMaterial(e){const t=new Mesh(this._lodPlanes[0],e);this._renderer.compile(t,fn)}_sceneToCubeUV(e,t,n,i){const r=new PerspectiveCamera(90,1,t,n),a=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(mn),o.toneMapping=0,o.autoClear=!1;const h=new MeshBasicMaterial({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),u=new Mesh(new BoxGeometry,h);let d=!1;const p=e.background;p?p.isColor&&(h.color.copy(p),e.background=null,d=!0):(h.color.copy(mn),d=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(r.up.set(0,a[t],0),r.lookAt(s[t],0,0)):1===n?(r.up.set(0,0,a[t]),r.lookAt(0,s[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,s[t]));const l=this._cubeSize;_setViewport(i,n*l,t>2?l:0,l,l),o.setRenderTarget(i),d&&o.render(u,r),o.render(e,r)}u.geometry.dispose(),u.material.dispose(),o.toneMapping=c,o.autoClear=l,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===o||e.mapping===l;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new Mesh(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const s=this._cubeSize;_setViewport(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,fn)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),i=Sn[(t-1)%Sn.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,r,a,s,o){const l=this._renderer,c=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&i.error("blur direction must be either latitudinal or longitudinal!");const h=new Mesh(this._lodPlanes[r],c),u=c.uniforms,d=this._sizeLods[n]-1,p=isFinite(a)?Math.PI/(2*d):2*Math.PI/39,f=a/p,m=isFinite(a)?1+Math.floor(3*f):pn;m>pn&&i.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const g=[];let _=0;for(let e=0;e<pn;++e){const t=e/f,n=Math.exp(-t*t/2);g.push(n),0===e?_+=n:e<m&&(_+=2*n)}for(let e=0;e<g.length;e++)g[e]=g[e]/_;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=g,u.latitudinal.value="latitudinal"===s,o&&(u.poleAxis.value=o);const{_lodMax:v}=this;u.dTheta.value=p,u.mipInt.value=v-n;const x=this._sizeLods[r];_setViewport(t,3*x*(r>v-4?r-v+4:0),4*(this._cubeSize-x),3*x,2*x),l.setRenderTarget(t),l.render(h,fn)}}function _createRenderTarget(e,t,n){const i=new WebGLRenderTarget(e,t,n);return i.texture.mapping=u,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function _setViewport(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),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:a,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),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:a,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){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 WebGLCubeUVMaps(e){let t=new WeakMap,n=null;function onTextureDispose(e){const n=e.target;n.removeEventListener("dispose",onTextureDispose);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function get(i){if(i&&i.isTexture){const r=i.mapping,a=r===c||r===h,s=r===o||r===l;if(a||s){let r=t.get(i);const o=void 0!==r?r.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==o)return null===n&&(n=new PMREMGenerator(e)),r=a?n.fromEquirectangular(i,r):n.fromCubemap(i,r),r.texture.pmremVersion=i.pmremVersion,t.set(i,r),r.texture;if(void 0!==r)return r.texture;{const o=i.image;return a&&o&&o.height>0||s&&o&&function isCubeTextureComplete(e){let t=0;const n=6;for(let i=0;i<n;i++)void 0!==e[i]&&t++;return t===n}(o)?(null===n&&(n=new PMREMGenerator(e)),r=a?n.fromEquirectangular(i):n.fromCubemap(i),r.texture.pmremVersion=i.pmremVersion,t.set(i,r),i.addEventListener("dispose",onTextureDispose),r.texture):null}}}return i},dispose:function dispose(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function WebGLExtensions(e){const t={};function getExtension(n){if(void 0!==t[n])return t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==getExtension(e)},init:function(){getExtension("EXT_color_buffer_float"),getExtension("WEBGL_clip_cull_distance"),getExtension("OES_texture_float_linear"),getExtension("EXT_color_buffer_half_float"),getExtension("WEBGL_multisampled_render_to_texture"),getExtension("WEBGL_render_shared_exponent")},get:function(e){const t=getExtension(e);return null===t&&i.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function WebGLGeometries(e,t,n,i){const r={},a=new WeakMap;function onGeometryDispose(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);for(const e in s.morphAttributes){const n=s.morphAttributes[e];for(let e=0,i=n.length;e<i;e++)t.remove(n[e])}s.removeEventListener("dispose",onGeometryDispose),delete r[s.id];const o=a.get(s);o&&(t.remove(o),a.delete(s)),i.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function updateWireframeAttribute(e){const n=[],i=e.index,r=e.attributes.position;let s=0;if(null!==i){const e=i.array;s=i.version;for(let t=0,i=e.length;t<i;t+=3){const i=e[t+0],r=e[t+1],a=e[t+2];n.push(i,r,r,a,a,i)}}else{if(void 0===r)return;{const e=r.array;s=r.version;for(let t=0,i=e.length/3-1;t<i;t+=3){const e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}}const o=new(arrayNeedsUint32(n)?Uint32BufferAttribute:Uint16BufferAttribute)(n,1);o.version=s;const l=a.get(e);l&&t.remove(l),a.set(e,o)}return{get:function get(e,t){return!0===r[t.id]||(t.addEventListener("dispose",onGeometryDispose),r[t.id]=!0,n.memory.geometries++),t},update:function update(n){const i=n.attributes;for(const n in i)t.update(i[n],e.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++)t.update(i[n],e.ARRAY_BUFFER)}},getWireframeAttribute:function getWireframeAttribute(e){const t=a.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&updateWireframeAttribute(e)}else updateWireframeAttribute(e);return a.get(e)}}}function WebGLIndexedBufferRenderer(e,t,n){let i,r,a;this.setMode=function setMode(e){i=e},this.setIndex=function setIndex(e){r=e.type,a=e.bytesPerElement},this.render=function render(t,s){e.drawElements(i,s,r,t*a),n.update(s,i,1)},this.renderInstances=function renderInstances(t,s,o){0!==o&&(e.drawElementsInstanced(i,s,r,t*a,o),n.update(s,i,o))},this.renderMultiDraw=function renderMultiDraw(e,s,o){if(0===o)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<o;t++)this.render(e[t]/a,s[t]);else{l.multiDrawElementsWEBGL(i,s,0,r,e,0,o);let t=0;for(let e=0;e<o;e++)t+=s[e];n.update(t,i,1)}}}function WebGLInfo(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function reset(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function update(n,r,a){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=a*(n/3);break;case e.LINES:t.lines+=a*(n/2);break;case e.LINE_STRIP:t.lines+=a*(n-1);break;case e.LINE_LOOP:t.lines+=a*n;break;case e.POINTS:t.points+=a*n;break;default:i.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function WebGLMorphtargets(e,t,n){const i=new WeakMap,r=new Vector4;return{update:function update(a,s,o){const l=a.morphTargetInfluences,c=s.morphAttributes.position||s.morphAttributes.normal||s.morphAttributes.color,h=void 0!==c?c.length:0;let u=i.get(s);if(void 0===u||u.count!==h){void 0!==u&&u.texture.dispose();const e=void 0!==s.morphAttributes.position,n=void 0!==s.morphAttributes.normal,a=void 0!==s.morphAttributes.color,o=s.morphAttributes.position||[],l=s.morphAttributes.normal||[],c=s.morphAttributes.color||[];let d=0;!0===e&&(d=1),!0===n&&(d=2),!0===a&&(d=3);let p=s.attributes.position.count*d,f=1;p>t.maxTextureSize&&(f=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);const m=new Float32Array(p*f*4*h),g=new DataArrayTexture(m,p,f,h);g.type=T,g.needsUpdate=!0;const _=4*d;for(let t=0;t<h;t++){const i=o[t],s=l[t],h=c[t],u=p*f*4*t;for(let t=0;t<i.count;t++){const o=t*_;!0===e&&(r.fromBufferAttribute(i,t),m[u+o+0]=r.x,m[u+o+1]=r.y,m[u+o+2]=r.z,m[u+o+3]=0),!0===n&&(r.fromBufferAttribute(s,t),m[u+o+4]=r.x,m[u+o+5]=r.y,m[u+o+6]=r.z,m[u+o+7]=0),!0===a&&(r.fromBufferAttribute(h,t),m[u+o+8]=r.x,m[u+o+9]=r.y,m[u+o+10]=r.z,m[u+o+11]=4===h.itemSize?r.w:1)}}function disposeTexture(){g.dispose(),i.delete(s),s.removeEventListener("dispose",disposeTexture)}u={count:h,texture:g,size:new Vector2(p,f)},i.set(s,u),s.addEventListener("dispose",disposeTexture)}if(!0===a.isInstancedMesh&&null!==a.morphTexture)o.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let t=0;for(let e=0;e<l.length;e++)t+=l[e];const n=s.morphTargetsRelative?1:1-t;o.getUniforms().setValue(e,"morphTargetBaseInfluence",n),o.getUniforms().setValue(e,"morphTargetInfluences",l)}o.getUniforms().setValue(e,"morphTargetsTexture",u.texture,n),o.getUniforms().setValue(e,"morphTargetsTextureSize",u.size)}}}function WebGLObjects(e,t,n,i){let r=new WeakMap;function onInstancedMeshDispose(e){const t=e.target;t.removeEventListener("dispose",onInstancedMeshDispose),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function update(a){const s=i.render.frame,o=a.geometry,l=t.get(a,o);if(r.get(l)!==s&&(t.update(l),r.set(l,s)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",onInstancedMeshDispose)&&a.addEventListener("dispose",onInstancedMeshDispose),r.get(a)!==s&&(n.update(a.instanceMatrix,e.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,e.ARRAY_BUFFER),r.set(a,s))),a.isSkinnedMesh){const e=a.skeleton;r.get(e)!==s&&(e.update(),r.set(e,s))}return l},dispose:function dispose(){r=new WeakMap}}}class DepthTexture extends Texture{constructor(e,t,n,i,r,a,s,o,l,c){if((c=void 0!==c?c:R)!==R&&c!==w)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===R&&(n=S),void 0===n&&c===w&&(n=b),super(null,i,r,a,s,o,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==s?s:m,this.minFilter=void 0!==o?o:m,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}const Tn=new Texture,En=new DepthTexture(1,1);En.compareFunction=515;const bn=new DataArrayTexture,An=new Data3DTexture,Rn=new CubeTexture,wn=[],Cn=[],Pn=new Float32Array(16),Ln=new Float32Array(9),Un=new Float32Array(4);function flatten(e,t,n){const i=e[0];if(i<=0||i>0)return e;const r=t*n;let a=wn[r];if(void 0===a&&(a=new Float32Array(r),wn[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function arraysEqual(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function copyArray(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function allocTexUnits(e,t){let n=Cn[t];void 0===n&&(n=new Int32Array(t),Cn[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function setValueV1f(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function setValueV2f(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2fv(this.addr,t),copyArray(n,t)}}function setValueV3f(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(arraysEqual(n,t))return;e.uniform3fv(this.addr,t),copyArray(n,t)}}function setValueV4f(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4fv(this.addr,t),copyArray(n,t)}}function setValueM2(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(arraysEqual(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,i))return;Un.set(i),e.uniformMatrix2fv(this.addr,!1,Un),copyArray(n,i)}}function setValueM3(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(arraysEqual(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,i))return;Ln.set(i),e.uniformMatrix3fv(this.addr,!1,Ln),copyArray(n,i)}}function setValueM4(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(arraysEqual(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,i))return;Pn.set(i),e.uniformMatrix4fv(this.addr,!1,Pn),copyArray(n,i)}}function setValueV1i(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function setValueV2i(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2iv(this.addr,t),copyArray(n,t)}}function setValueV3i(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(arraysEqual(n,t))return;e.uniform3iv(this.addr,t),copyArray(n,t)}}function setValueV4i(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4iv(this.addr,t),copyArray(n,t)}}function setValueV1ui(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function setValueV2ui(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2uiv(this.addr,t),copyArray(n,t)}}function setValueV3ui(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(arraysEqual(n,t))return;e.uniform3uiv(this.addr,t),copyArray(n,t)}}function setValueV4ui(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4uiv(this.addr,t),copyArray(n,t)}}function setValueT1(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r);const a=this.type===e.SAMPLER_2D_SHADOW?En:Tn;n.setTexture2D(t||a,r)}function setValueT3D1(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||An,r)}function setValueT6(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(t||Rn,r)}function setValueT2DArray1(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||bn,r)}function setValueV1fArray(e,t){e.uniform1fv(this.addr,t)}function setValueV2fArray(e,t){const n=flatten(t,this.size,2);e.uniform2fv(this.addr,n)}function setValueV3fArray(e,t){const n=flatten(t,this.size,3);e.uniform3fv(this.addr,n)}function setValueV4fArray(e,t){const n=flatten(t,this.size,4);e.uniform4fv(this.addr,n)}function setValueM2Array(e,t){const n=flatten(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function setValueM3Array(e,t){const n=flatten(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function setValueM4Array(e,t){const n=flatten(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function setValueV1iArray(e,t){e.uniform1iv(this.addr,t)}function setValueV2iArray(e,t){e.uniform2iv(this.addr,t)}function setValueV3iArray(e,t){e.uniform3iv(this.addr,t)}function setValueV4iArray(e,t){e.uniform4iv(this.addr,t)}function setValueV1uiArray(e,t){e.uniform1uiv(this.addr,t)}function setValueV2uiArray(e,t){e.uniform2uiv(this.addr,t)}function setValueV3uiArray(e,t){e.uniform3uiv(this.addr,t)}function setValueV4uiArray(e,t){e.uniform4uiv(this.addr,t)}function setValueT1Array(e,t,n){const i=this.cache,r=t.length,a=allocTexUnits(n,r);arraysEqual(i,a)||(e.uniform1iv(this.addr,a),copyArray(i,a));for(let e=0;e!==r;++e)n.setTexture2D(t[e]||Tn,a[e])}function setValueT3DArray(e,t,n){const i=this.cache,r=t.length,a=allocTexUnits(n,r);arraysEqual(i,a)||(e.uniform1iv(this.addr,a),copyArray(i,a));for(let e=0;e!==r;++e)n.setTexture3D(t[e]||An,a[e])}function setValueT6Array(e,t,n){const i=this.cache,r=t.length,a=allocTexUnits(n,r);arraysEqual(i,a)||(e.uniform1iv(this.addr,a),copyArray(i,a));for(let e=0;e!==r;++e)n.setTextureCube(t[e]||Rn,a[e])}function setValueT2DArrayArray(e,t,n){const i=this.cache,r=t.length,a=allocTexUnits(n,r);arraysEqual(i,a)||(e.uniform1iv(this.addr,a),copyArray(i,a));for(let e=0;e!==r;++e)n.setTexture2DArray(t[e]||bn,a[e])}class SingleUniform{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function getSingularSetter(e){switch(e){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 36294:return setValueV2ui;case 36295:return setValueV3ui;case 36296:return setValueV4ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}(t.type)}}class PureArrayUniform{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function getPureArraySetter(e){switch(e){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 5125:return setValueV1uiArray;case 36294:return setValueV2uiArray;case 36295:return setValueV3uiArray;case 36296:return setValueV4uiArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35679:case 36299:case 36307:return setValueT3DArray;case 35680:case 36300:case 36308:case 36293:return setValueT6Array;case 36289:case 36303:case 36311:case 36292:return setValueT2DArrayArray}}(t.type)}}class StructuredUniform{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const a=i[r];a.setValue(e,t[a.id],n)}}}const Dn=/(\w+)(\])?(\[|\.)?/g;function addUniform(e,t){e.seq.push(t),e.map[t.id]=t}function parseUniform(e,t,n){const i=e.name,r=i.length;for(Dn.lastIndex=0;;){const a=Dn.exec(i),s=Dn.lastIndex;let o=a[1];const l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===r){addUniform(n,void 0===c?new SingleUniform(o,e,t):new PureArrayUniform(o,e,t));break}{let e=n.map[o];void 0===e&&(e=new StructuredUniform(o),addUniform(n,e)),n=e}}}class WebGLUniforms{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=e.getActiveUniform(t,i);parseUniform(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,i){const r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const a=t[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const r=e[i];r.id in t&&n.push(r)}return n}}function WebGLShader(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}let In=0;function getShaderErrors(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();if(i&&""===r)return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function handleSource(e,t){const n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=r;e<a;e++){const r=e+1;i.push(`${r===t?">":" "} ${r}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}return r}function getTexelEncodingFunction(e,t){const n=function getEncodingComponents(e){const t=ce.getPrimaries(ce.workingColorSpace),n=ce.getPrimaries(e);let r;switch(t===n?r="":t===Y&&n===q?r="LinearDisplayP3ToLinearSRGB":t===q&&n===Y&&(r="LinearSRGBToLinearDisplayP3"),e){case H:case W:return[r,"LinearTransferOETF"];case G:case k:return[r,"sRGBTransferOETF"];default:return i.warn("THREE.WebGLProgram: Unsupported color space:",e),[r,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function getToneMappingFunction(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:i.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function filterEmptyLine(e){return""!==e}function replaceLightNums(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function replaceClippingPlaneNums(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Nn=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(e){return e.replace(Nn,includeReplacer)}const On=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function includeReplacer(e,t){let n=sn[t];if(void 0===n){const e=On.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=sn[e],i.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return resolveIncludes(n)}const Fn=/#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 unrollLoops(e){return e.replace(Fn,loopReplacer)}function loopReplacer(e,t,n,i){let r="";for(let e=parseInt(t);e<parseInt(n);e++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function generatePrecision(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function WebGLProgram(e,t,n,r){const a=e.getContext(),s=n.defines;let c=n.vertexShader,h=n.fragmentShader;const d=function generateShadowMapTypeDefine(e){let t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),p=function generateEnvMapTypeDefine(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case o:case l:t="ENVMAP_TYPE_CUBE";break;case u:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),f=function generateEnvMapModeDefine(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===l&&(t="ENVMAP_MODE_REFRACTION");return t}(n),m=function generateEnvMapBlendingDefine(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),g=function generateCubeUVSize(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),_=function generateVertexExtensions(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(filterEmptyLine).join("\n")}(n),v=function generateDefines(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(s),x=a.createProgram();let M,y,S=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(M=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(filterEmptyLine).join("\n"),M.length>0&&(M+="\n"),y=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(filterEmptyLine).join("\n"),y.length>0&&(y+="\n")):(M=[generatePrecision(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",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 "+f:"",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.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",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.alphaHash?"#define USE_ALPHAHASH":"",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.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",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&&!1===n.flatShading?"#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&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#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(filterEmptyLine).join("\n"),y=[generatePrecision(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.envMap?"#define "+f:"",n.envMap?"#define "+m:"",g?"#define CUBEUV_TEXEL_WIDTH "+g.texelWidth:"",g?"#define CUBEUV_TEXEL_HEIGHT "+g.texelHeight:"",g?"#define CUBEUV_MAX_MIP "+g.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.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",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.alphaHash?"#define USE_ALPHAHASH":"",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&&!1===n.flatShading?"#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 "+d:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?sn.tonemapping_pars_fragment:"",0!==n.toneMapping?getToneMappingFunction("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",sn.colorspace_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),c=resolveIncludes(c),c=replaceLightNums(c,n),c=replaceClippingPlaneNums(c,n),h=resolveIncludes(h),h=replaceLightNums(h,n),h=replaceClippingPlaneNums(h,n),c=unrollLoops(c),h=unrollLoops(h),!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",M=[_,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+M,y=["#define varying in",n.glslVersion===J?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===J?"":"#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"+y);const T=S+M+c,E=S+y+h,b=WebGLShader(a,a.VERTEX_SHADER,T),A=WebGLShader(a,a.FRAGMENT_SHADER,E);function onFirstUse(t){if(e.debug.checkShaderErrors){const n=a.getProgramInfoLog(x).trim(),r=a.getShaderInfoLog(b).trim(),s=a.getShaderInfoLog(A).trim();let o=!0,l=!0;if(!1===a.getProgramParameter(x,a.LINK_STATUS))if(o=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(a,x,b,A);else{const e=getShaderErrors(a,b,"vertex"),r=getShaderErrors(a,A,"fragment");i.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(x,a.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+r)}else""!==n?i.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==s||(l=!1);l&&(t.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:M},fragmentShader:{log:s,prefix:y}})}a.deleteShader(b),a.deleteShader(A),R=new WebGLUniforms(a,x),w=function fetchAttributeLocations(e,t){const n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=e.getActiveAttrib(t,r),a=i.name;let s=1;i.type===e.FLOAT_MAT2&&(s=2),i.type===e.FLOAT_MAT3&&(s=3),i.type===e.FLOAT_MAT4&&(s=4),n[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:s}}return n}(a,x)}let R,w;a.attachShader(x,b),a.attachShader(x,A),void 0!==n.index0AttributeName?a.bindAttribLocation(x,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(x,0,"position"),a.linkProgram(x),this.getUniforms=function(){return void 0===R&&onFirstUse(this),R},this.getAttributes=function(){return void 0===w&&onFirstUse(this),w};let C=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===C&&(C=a.getProgramParameter(x,37297)),C},this.destroy=function(){r.releaseStatesOfProgram(this),a.deleteProgram(x),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=In++,this.cacheKey=t,this.usedTimes=1,this.program=x,this.vertexShader=b,this.fragmentShader=A,this}let Vn=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(r)&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new WebGLShaderStage(e),t.set(e,n)),n}}class WebGLShaderStage{constructor(e){this.id=Vn++,this.code=e,this.usedTimes=0}}function WebGLPrograms(e,t,n,r,a,s,o){const l=new Layers,c=new WebGLShaderCache,h=new Set,d=[],p=a.logarithmicDepthBuffer,f=a.vertexTextures;let m=a.precision;const g={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 getChannel(e){return h.add(e),0===e?"uv":`uv${e}`}return{getParameters:function getParameters(s,l,d,_,v){const x=_.fog,M=v.geometry,y=s.isMeshStandardMaterial?_.environment:null,S=(s.isMeshStandardMaterial?n:t).get(s.envMap||y),T=S&&S.mapping===u?S.image.height:null,E=g[s.type];null!==s.precision&&(m=a.getMaxPrecision(s.precision),m!==s.precision&&i.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",m,"instead."));const b=M.morphAttributes.position||M.morphAttributes.normal||M.morphAttributes.color,A=void 0!==b?b.length:0;let R,w,C,P,L=0;if(void 0!==M.morphAttributes.position&&(L=1),void 0!==M.morphAttributes.normal&&(L=2),void 0!==M.morphAttributes.color&&(L=3),E){const e=ln[E];R=e.vertexShader,w=e.fragmentShader}else R=s.vertexShader,w=s.fragmentShader,c.update(s),C=c.getVertexShaderID(s),P=c.getFragmentShaderID(s);const U=e.getRenderTarget(),D=!0===v.isInstancedMesh,I=!0===v.isBatchedMesh,N=!!s.map,O=!!s.matcap,F=!!S,V=!!s.aoMap,B=!!s.lightMap,z=!!s.bumpMap,G=!!s.normalMap,k=!!s.displacementMap,W=!!s.emissiveMap,X=!!s.metalnessMap,q=!!s.roughnessMap,Y=s.anisotropy>0,K=s.clearcoat>0,Z=s.iridescence>0,J=s.sheen>0,Q=s.transmission>0,$=Y&&!!s.anisotropyMap,ee=K&&!!s.clearcoatMap,te=K&&!!s.clearcoatNormalMap,ne=K&&!!s.clearcoatRoughnessMap,ie=Z&&!!s.iridescenceMap,re=Z&&!!s.iridescenceThicknessMap,ae=J&&!!s.sheenColorMap,se=J&&!!s.sheenRoughnessMap,oe=!!s.specularMap,le=!!s.specularColorMap,he=!!s.specularIntensityMap,ue=Q&&!!s.transmissionMap,de=Q&&!!s.thicknessMap,pe=!!s.gradientMap,fe=!!s.alphaMap,me=s.alphaTest>0,ge=!!s.alphaHash,_e=!!s.extensions;let ve=0;s.toneMapped&&(null!==U&&!0!==U.isXRRenderTarget||(ve=e.toneMapping));const xe={shaderID:E,shaderType:s.type,shaderName:s.name,vertexShader:R,fragmentShader:w,defines:s.defines,customVertexShaderID:C,customFragmentShaderID:P,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,batching:I,instancing:D,instancingColor:D&&null!==v.instanceColor,instancingMorph:D&&null!==v.morphTexture,supportsVertexTextures:f,outputColorSpace:null===U?e.outputColorSpace:!0===U.isXRRenderTarget?U.texture.colorSpace:H,alphaToCoverage:!!s.alphaToCoverage,map:N,matcap:O,envMap:F,envMapMode:F&&S.mapping,envMapCubeUVHeight:T,aoMap:V,lightMap:B,bumpMap:z,normalMap:G,displacementMap:f&&k,emissiveMap:W,normalMapObjectSpace:G&&1===s.normalMapType,normalMapTangentSpace:G&&0===s.normalMapType,metalnessMap:X,roughnessMap:q,anisotropy:Y,anisotropyMap:$,clearcoat:K,clearcoatMap:ee,clearcoatNormalMap:te,clearcoatRoughnessMap:ne,iridescence:Z,iridescenceMap:ie,iridescenceThicknessMap:re,sheen:J,sheenColorMap:ae,sheenRoughnessMap:se,specularMap:oe,specularColorMap:le,specularIntensityMap:he,transmission:Q,transmissionMap:ue,thicknessMap:de,gradientMap:pe,opaque:!1===s.transparent&&1===s.blending&&!1===s.alphaToCoverage,alphaMap:fe,alphaTest:me,alphaHash:ge,combine:s.combine,mapUv:N&&getChannel(s.map.channel),aoMapUv:V&&getChannel(s.aoMap.channel),lightMapUv:B&&getChannel(s.lightMap.channel),bumpMapUv:z&&getChannel(s.bumpMap.channel),normalMapUv:G&&getChannel(s.normalMap.channel),displacementMapUv:k&&getChannel(s.displacementMap.channel),emissiveMapUv:W&&getChannel(s.emissiveMap.channel),metalnessMapUv:X&&getChannel(s.metalnessMap.channel),roughnessMapUv:q&&getChannel(s.roughnessMap.channel),anisotropyMapUv:$&&getChannel(s.anisotropyMap.channel),clearcoatMapUv:ee&&getChannel(s.clearcoatMap.channel),clearcoatNormalMapUv:te&&getChannel(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ne&&getChannel(s.clearcoatRoughnessMap.channel),iridescenceMapUv:ie&&getChannel(s.iridescenceMap.channel),iridescenceThicknessMapUv:re&&getChannel(s.iridescenceThicknessMap.channel),sheenColorMapUv:ae&&getChannel(s.sheenColorMap.channel),sheenRoughnessMapUv:se&&getChannel(s.sheenRoughnessMap.channel),specularMapUv:oe&&getChannel(s.specularMap.channel),specularColorMapUv:le&&getChannel(s.specularColorMap.channel),specularIntensityMapUv:he&&getChannel(s.specularIntensityMap.channel),transmissionMapUv:ue&&getChannel(s.transmissionMap.channel),thicknessMapUv:de&&getChannel(s.thicknessMap.channel),alphaMapUv:fe&&getChannel(s.alphaMap.channel),vertexTangents:!!M.attributes.tangent&&(G||Y),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!M.attributes.color&&4===M.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!M.attributes.uv&&(N||fe),fog:!!x,useFog:!0===s.fog,fogExp2:!!x&&x.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:p,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==M.morphAttributes.position,morphNormals:void 0!==M.morphAttributes.normal,morphColors:void 0!==M.morphAttributes.color,morphTargetsCount:A,morphTextureStride:L,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numSpotLightMaps:l.spotLightMap.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numDirLightShadows:l.directionalShadowMap.length,numPointLightShadows:l.pointShadowMap.length,numSpotLightShadows:l.spotShadowMap.length,numSpotLightShadowsWithMaps:l.numSpotLightShadowsWithMaps,numLightProbes:l.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:ve,useLegacyLights:e._useLegacyLights,decodeVideoTexture:N&&!0===s.map.isVideoTexture&&ce.getTransfer(s.map.colorSpace)===j,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionClipCullDistance:_e&&!0===s.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_e&&!0===s.extensions.multiDraw&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return xe.vertexUv1s=h.has(1),xe.vertexUv2s=h.has(2),xe.vertexUv3s=h.has(3),h.clear(),xe},getProgramCacheKey:function getProgramCacheKey(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function getProgramCacheKeyParameters(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function getProgramCacheKeyBooleans(e,t){l.disableAll(),t.supportsVertexTextures&&l.enable(0);t.instancing&&l.enable(1);t.instancingColor&&l.enable(2);t.instancingMorph&&l.enable(3);t.matcap&&l.enable(4);t.envMap&&l.enable(5);t.normalMapObjectSpace&&l.enable(6);t.normalMapTangentSpace&&l.enable(7);t.clearcoat&&l.enable(8);t.iridescence&&l.enable(9);t.alphaTest&&l.enable(10);t.vertexColors&&l.enable(11);t.vertexAlphas&&l.enable(12);t.vertexUv1s&&l.enable(13);t.vertexUv2s&&l.enable(14);t.vertexUv3s&&l.enable(15);t.vertexTangents&&l.enable(16);t.anisotropy&&l.enable(17);t.alphaHash&&l.enable(18);t.batching&&l.enable(19);e.push(l.mask),l.disableAll(),t.fog&&l.enable(0);t.useFog&&l.enable(1);t.flatShading&&l.enable(2);t.logarithmicDepthBuffer&&l.enable(3);t.skinning&&l.enable(4);t.morphTargets&&l.enable(5);t.morphNormals&&l.enable(6);t.morphColors&&l.enable(7);t.premultipliedAlpha&&l.enable(8);t.shadowMapEnabled&&l.enable(9);t.useLegacyLights&&l.enable(10);t.doubleSided&&l.enable(11);t.flipSided&&l.enable(12);t.useDepthPacking&&l.enable(13);t.dithering&&l.enable(14);t.transmission&&l.enable(15);t.sheen&&l.enable(16);t.opaque&&l.enable(17);t.pointsUvs&&l.enable(18);t.decodeVideoTexture&&l.enable(19);t.alphaToCoverage&&l.enable(20);e.push(l.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function getUniforms(e){const t=g[e.type];let n;if(t){const e=ln[t];n=Kt.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function acquireProgram(t,n){let i;for(let e=0,t=d.length;e<t;e++){const t=d[e];if(t.cacheKey===n){i=t,++i.usedTimes;break}}return void 0===i&&(i=new WebGLProgram(e,n,t,s),d.push(i)),i},releaseProgram:function releaseProgram(e){if(0==--e.usedTimes){const t=d.indexOf(e);d[t]=d[d.length-1],d.pop(),e.destroy()}},releaseShaderCache:function releaseShaderCache(e){c.remove(e)},programs:d,dispose:function dispose(){c.dispose()}}}function WebGLProperties(){let e=new WeakMap;return{get:function get(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function remove(t){e.delete(t)},update:function update(t,n,i){e.get(t)[n]=i},dispose:function dispose(){e=new WeakMap}}}function painterSortStable(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function reversePainterSortStable(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function WebGLRenderList(){const e=[];let t=0;const n=[],i=[],r=[];function getNextRenderItem(n,i,r,a,s,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:a,renderOrder:n.renderOrder,z:s,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=o),t++,l}return{opaque:n,transmissive:i,transparent:r,init:function init(){t=0,n.length=0,i.length=0,r.length=0},push:function push(e,t,a,s,o,l){const c=getNextRenderItem(e,t,a,s,o,l);a.transmission>0?i.push(c):!0===a.transparent?r.push(c):n.push(c)},unshift:function unshift(e,t,a,s,o,l){const c=getNextRenderItem(e,t,a,s,o,l);a.transmission>0?i.unshift(c):!0===a.transparent?r.unshift(c):n.unshift(c)},finish:function finish(){for(let n=t,i=e.length;n<i;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function sort(e,t){n.length>1&&n.sort(e||painterSortStable),i.length>1&&i.sort(t||reversePainterSortStable),r.length>1&&r.sort(t||reversePainterSortStable)}}}function WebGLRenderLists(){let e=new WeakMap;return{get:function get(t,n){const i=e.get(t);let r;return void 0===i?(r=new WebGLRenderList,e.set(t,[r])):n>=i.length?(r=new WebGLRenderList,i.push(r)):r=i[n],r},dispose:function dispose(){e=new WeakMap}}}function UniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Vector3,color:new Color};break;case"SpotLight":n={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":n={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return e[t.id]=n,n}}}let Bn=0;function shadowCastingAndTexturingLightsFirst(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function WebGLLights(e){const t=new UniformsCache,n=function ShadowUniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let e=0;e<9;e++)i.probe.push(new Vector3);const r=new Vector3,a=new Matrix4,s=new Matrix4;return{setup:function setup(r,a){let s=0,o=0,l=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let c=0,h=0,u=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,x=0;r.sort(shadowCastingAndTexturingLightsFirst);const M=!0===a?Math.PI:1;for(let e=0,a=r.length;e<a;e++){const a=r[e],y=a.color,S=a.intensity,T=a.distance,E=a.shadow&&a.shadow.map?a.shadow.map.texture:null;if(a.isAmbientLight)s+=y.r*S*M,o+=y.g*S*M,l+=y.b*S*M;else if(a.isLightProbe){for(let e=0;e<9;e++)i.probe[e].addScaledVector(a.sh.coefficients[e],S);x++}else if(a.isDirectionalLight){const e=t.get(a);if(e.color.copy(a.color).multiplyScalar(a.intensity*M),a.castShadow){const e=a.shadow,t=n.get(a);t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,i.directionalShadow[c]=t,i.directionalShadowMap[c]=E,i.directionalShadowMatrix[c]=a.shadow.matrix,f++}i.directional[c]=e,c++}else if(a.isSpotLight){const e=t.get(a);e.position.setFromMatrixPosition(a.matrixWorld),e.color.copy(y).multiplyScalar(S*M),e.distance=T,e.coneCos=Math.cos(a.angle),e.penumbraCos=Math.cos(a.angle*(1-a.penumbra)),e.decay=a.decay,i.spot[u]=e;const r=a.shadow;if(a.map&&(i.spotLightMap[_]=a.map,_++,r.updateMatrices(a),a.castShadow&&v++),i.spotLightMatrix[u]=r.matrix,a.castShadow){const e=n.get(a);e.shadowBias=r.bias,e.shadowNormalBias=r.normalBias,e.shadowRadius=r.radius,e.shadowMapSize=r.mapSize,i.spotShadow[u]=e,i.spotShadowMap[u]=E,g++}u++}else if(a.isRectAreaLight){const e=t.get(a);e.color.copy(y).multiplyScalar(S),e.halfWidth.set(.5*a.width,0,0),e.halfHeight.set(0,.5*a.height,0),i.rectArea[d]=e,d++}else if(a.isPointLight){const e=t.get(a);if(e.color.copy(a.color).multiplyScalar(a.intensity*M),e.distance=a.distance,e.decay=a.decay,a.castShadow){const e=a.shadow,t=n.get(a);t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,i.pointShadow[h]=t,i.pointShadowMap[h]=E,i.pointShadowMatrix[h]=a.shadow.matrix,m++}i.point[h]=e,h++}else if(a.isHemisphereLight){const e=t.get(a);e.skyColor.copy(a.color).multiplyScalar(S*M),e.groundColor.copy(a.groundColor).multiplyScalar(S*M),i.hemi[p]=e,p++}}d>0&&(!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=on.LTC_FLOAT_1,i.rectAreaLTC2=on.LTC_FLOAT_2):(i.rectAreaLTC1=on.LTC_HALF_1,i.rectAreaLTC2=on.LTC_HALF_2)),i.ambient[0]=s,i.ambient[1]=o,i.ambient[2]=l;const y=i.hash;y.directionalLength===c&&y.pointLength===h&&y.spotLength===u&&y.rectAreaLength===d&&y.hemiLength===p&&y.numDirectionalShadows===f&&y.numPointShadows===m&&y.numSpotShadows===g&&y.numSpotMaps===_&&y.numLightProbes===x||(i.directional.length=c,i.spot.length=u,i.rectArea.length=d,i.point.length=h,i.hemi.length=p,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=m,i.spotLightMatrix.length=g+_-v,i.spotLightMap.length=_,i.numSpotLightShadowsWithMaps=v,i.numLightProbes=x,y.directionalLength=c,y.pointLength=h,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=p,y.numDirectionalShadows=f,y.numPointShadows=m,y.numSpotShadows=g,y.numSpotMaps=_,y.numLightProbes=x,i.version=Bn++)},setupView:function setupView(e,t){let n=0,o=0,l=0,c=0,h=0;const u=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){const d=e[t];if(d.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(d.matrixWorld),r.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(u),n++}else if(d.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(d.matrixWorld),r.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(u),l++}else if(d.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),s.identity(),a.copy(d.matrixWorld),a.premultiply(u),s.extractRotation(a),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(s),e.halfHeight.applyMatrix4(s),c++}else if(d.isPointLight){const e=i.point[o];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),o++}else if(d.isHemisphereLight){const e=i.hemi[h];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(u),h++}}},state:i}}function WebGLRenderState(e){const t=new WebGLLights(e),n=[],i=[];return{init:function init(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:t,transmissionRenderTarget:null},setupLights:function setupLights(e){t.setup(n,e)},setupLightsView:function setupLightsView(e){t.setupView(n,e)},pushLight:function pushLight(e){n.push(e)},pushShadow:function pushShadow(e){i.push(e)}}}function WebGLRenderStates(e){let t=new WeakMap;return{get:function get(n,i=0){const r=t.get(n);let a;return void 0===r?(a=new WebGLRenderState(e),t.set(n,[a])):i>=r.length?(a=new WebGLRenderState(e),r.push(a)):a=r[i],a},dispose:function dispose(){t=new WeakMap}}}class MeshDepthMaterial extends Material{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function WebGLShadowMap(e,t,n){let r=new Frustum;const s=new Vector2,o=new Vector2,l=new Vector4,c=new MeshDepthMaterial({depthPacking:3201}),h=new MeshDistanceMaterial,u={},d=n.maxTextureSize,p={0:1,1:0,2:2},f=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"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}"}),g=f.clone();g.defines.HORIZONTAL_PASS=1;const _=new BufferGeometry;_.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Mesh(_,f),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let M=this.type;function VSMPass(n,i){const r=t.update(v);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,g.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,g.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new WebGLRenderTarget(s.x,s.y)),f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,f,v,null),g.uniforms.shadow_pass.value=n.mapPass.texture,g.uniforms.resolution.value=n.mapSize,g.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,g,v,null)}function getDepthMaterial(t,n,i,r){let a=null;const s=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===i.isPointLight?h:c,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=a.uuid,t=n.uuid;let i=u[e];void 0===i&&(i={},u[e]=i);let r=i[t];void 0===r&&(r=a.clone(),i[t]=r,n.addEventListener("dispose",onMaterialDispose)),a=r}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=3===r?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:p[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial){e.properties.get(a).light=i}return a}function renderObject(n,i,a,s,o){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),l=n.material;if(Array.isArray(l)){const t=r.groups;for(let c=0,h=t.length;c<h;c++){const h=t[c],u=l[h.materialIndex];if(u&&u.visible){const t=getDepthMaterial(n,u,s,o);n.onBeforeShadow(e,n,i,a,r,t,h),e.renderBufferDirect(a,null,r,t,n,h),n.onAfterShadow(e,n,i,a,r,t,h)}}}else if(l.visible){const t=getDepthMaterial(n,l,s,o);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)renderObject(l[e],i,a,s,o)}function onMaterialDispose(e){e.target.removeEventListener("dispose",onMaterialDispose);for(const t in u){const n=u[t],i=e.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(t,n,c){if(!1===x.enabled)return;if(!1===x.autoUpdate&&!1===x.needsUpdate)return;if(0===t.length)return;const h=e.getRenderTarget(),u=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),f=e.state;f.setBlending(a),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);const g=3!==M&&3===this.type,_=3===M&&3!==this.type;for(let a=0,h=t.length;a<h;a++){const h=t[a],u=h.shadow;if(void 0===u){i.warn("THREE.WebGLShadowMap:",h,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;s.copy(u.mapSize);const p=u.getFrameExtents();if(s.multiply(p),o.copy(u.mapSize),(s.x>d||s.y>d)&&(s.x>d&&(o.x=Math.floor(d/p.x),s.x=o.x*p.x,u.mapSize.x=o.x),s.y>d&&(o.y=Math.floor(d/p.y),s.y=o.y*p.y,u.mapSize.y=o.y)),null===u.map||!0===g||!0===_){const e=3!==this.type?{minFilter:m,magFilter:m}:{};null!==u.map&&u.map.dispose(),u.map=new WebGLRenderTarget(s.x,s.y,e),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}e.setRenderTarget(u.map),e.clear();const v=u.getViewportCount();for(let e=0;e<v;e++){const t=u.getViewport(e);l.set(o.x*t.x,o.y*t.y,o.x*t.z,o.y*t.w),f.viewport(l),u.updateMatrices(h,e),r=u.getFrustum(),renderObject(n,c,u.camera,h,this.type)}!0!==u.isPointLightShadow&&3===this.type&&VSMPass(u,c),u.needsUpdate=!1}M=this.type,x.needsUpdate=!1,e.setRenderTarget(h,u,p)}}function WebGLState(e){const t=new function ColorBuffer(){let t=!1;const n=new Vector4;let i=null;const r=new Vector4(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,s,o){!0===o&&(t*=s,i*=s,a*=s),n.set(t,i,a,s),!1===r.equals(n)&&(e.clearColor(t,i,a,s),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},n=new function DepthBuffer(){let t=!1,n=null,i=null,r=null;return{setTest:function(t){t?enable(e.DEPTH_TEST):disable(e.DEPTH_TEST)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}},r=new function StencilBuffer(){let t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(n){t||(n?enable(e.STENCIL_TEST):disable(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,s){i===t&&r===n&&a===s||(e.stencilFunc(t,n,s),i=t,r=n,a=s)},setOp:function(t,n,i){s===t&&o===n&&l===i||(e.stencilOp(t,n,i),s=t,o=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null}}},o=new WeakMap,l=new WeakMap;let c={},h={},u=new WeakMap,d=[],p=null,f=!1,m=null,g=null,_=null,v=null,x=null,M=null,y=null,S=new Color(0,0,0),T=0,E=!1,b=null,A=null,R=null,w=null,C=null;const P=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let L=!1,U=0;const D=e.getParameter(e.VERSION);-1!==D.indexOf("WebGL")?(U=parseFloat(/^WebGL (\d)/.exec(D)[1]),L=U>=1):-1!==D.indexOf("OpenGL ES")&&(U=parseFloat(/^OpenGL ES (\d)/.exec(D)[1]),L=U>=2);let I=null,N={};const O=e.getParameter(e.SCISSOR_BOX),F=e.getParameter(e.VIEWPORT),V=(new Vector4).fromArray(O),B=(new Vector4).fromArray(F);function createTexture(t,n,i,r){const a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;s<i;s++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,r,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return s}const z={};function enable(t){!0!==c[t]&&(e.enable(t),c[t]=!0)}function disable(t){!1!==c[t]&&(e.disable(t),c[t]=!1)}z[e.TEXTURE_2D]=createTexture(e.TEXTURE_2D,e.TEXTURE_2D,1),z[e.TEXTURE_CUBE_MAP]=createTexture(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),z[e.TEXTURE_2D_ARRAY]=createTexture(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),z[e.TEXTURE_3D]=createTexture(e.TEXTURE_3D,e.TEXTURE_3D,1,1),t.setClear(0,0,0,1),n.setClear(1),r.setClear(0),enable(e.DEPTH_TEST),n.setFunc(3),setFlipSided(!1),setCullFace(1),enable(e.CULL_FACE),setBlending(a);const G={[s]:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};G[103]=e.MIN,G[104]=e.MAX;const H={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function setBlending(t,n,r,o,l,c,h,u,d,p){if(t!==a){if(!1===f&&(enable(e.BLEND),f=!0),5===t)l=l||n,c=c||r,h=h||o,n===g&&l===x||(e.blendEquationSeparate(G[n],G[l]),g=n,x=l),r===_&&o===v&&c===M&&h===y||(e.blendFuncSeparate(H[r],H[o],H[c],H[h]),_=r,v=o,M=c,y=h),!1!==u.equals(S)&&d===T||(e.blendColor(u.r,u.g,u.b,d),S.copy(u),T=d),m=t,E=!1;else if(t!==m||p!==E){if(g===s&&x===s||(e.blendEquation(e.FUNC_ADD),g=s,x=s),p)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:i.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:i.error("THREE.WebGLState: Invalid blending: ",t)}_=null,v=null,M=null,y=null,S.set(0,0,0),T=0,m=t,E=p}}else!0===f&&(disable(e.BLEND),f=!1)}function setFlipSided(t){b!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),b=t)}function setCullFace(t){0!==t?(enable(e.CULL_FACE),t!==A&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):disable(e.CULL_FACE),A=t}function setPolygonOffset(t,n,i){t?(enable(e.POLYGON_OFFSET_FILL),w===n&&C===i||(e.polygonOffset(n,i),w=n,C=i)):disable(e.POLYGON_OFFSET_FILL)}return{buffers:{color:t,depth:n,stencil:r},enable,disable,bindFramebuffer:function bindFramebuffer(t,n){return h[t]!==n&&(e.bindFramebuffer(t,n),h[t]=n,t===e.DRAW_FRAMEBUFFER&&(h[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(h[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function drawBuffers(t,n){let i=d,r=!1;if(t){i=u.get(n),void 0===i&&(i=[],u.set(n,i));const a=t.textures;if(i.length!==a.length||i[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)i[t]=e.COLOR_ATTACHMENT0+t;i.length=a.length,r=!0}}else i[0]!==e.BACK&&(i[0]=e.BACK,r=!0);r&&e.drawBuffers(i)},useProgram:function useProgram(t){return p!==t&&(e.useProgram(t),p=t,!0)},setBlending,setMaterial:function setMaterial(i,s){2===i.side?disable(e.CULL_FACE):enable(e.CULL_FACE);let o=1===i.side;s&&(o=!o),setFlipSided(o),1===i.blending&&!1===i.transparent?setBlending(a):setBlending(i.blending,i.blendEquation,i.blendSrc,i.blendDst,i.blendEquationAlpha,i.blendSrcAlpha,i.blendDstAlpha,i.blendColor,i.blendAlpha,i.premultipliedAlpha),n.setFunc(i.depthFunc),n.setTest(i.depthTest),n.setMask(i.depthWrite),t.setMask(i.colorWrite);const l=i.stencilWrite;r.setTest(l),l&&(r.setMask(i.stencilWriteMask),r.setFunc(i.stencilFunc,i.stencilRef,i.stencilFuncMask),r.setOp(i.stencilFail,i.stencilZFail,i.stencilZPass)),setPolygonOffset(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits),!0===i.alphaToCoverage?enable(e.SAMPLE_ALPHA_TO_COVERAGE):disable(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided,setCullFace,setLineWidth:function setLineWidth(t){t!==R&&(L&&e.lineWidth(t),R=t)},setPolygonOffset,setScissorTest:function setScissorTest(t){t?enable(e.SCISSOR_TEST):disable(e.SCISSOR_TEST)},activeTexture:function activeTexture(t){void 0===t&&(t=e.TEXTURE0+P-1),I!==t&&(e.activeTexture(t),I=t)},bindTexture:function bindTexture(t,n,i){void 0===i&&(i=null===I?e.TEXTURE0+P-1:I);let r=N[i];void 0===r&&(r={type:void 0,texture:void 0},N[i]=r),r.type===t&&r.texture===n||(I!==i&&(e.activeTexture(i),I=i),e.bindTexture(t,n||z[t]),r.type=t,r.texture=n)},unbindTexture:function unbindTexture(){const t=N[I];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function compressedTexImage2D(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},compressedTexImage3D:function compressedTexImage3D(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},texImage2D:function texImage2D(){try{e.texImage2D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},texImage3D:function texImage3D(){try{e.texImage3D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},updateUBOMapping:function updateUBOMapping(t,n){let i=l.get(n);void 0===i&&(i=new WeakMap,l.set(n,i));let r=i.get(t);void 0===r&&(r=e.getUniformBlockIndex(n,t.name),i.set(t,r))},uniformBlockBinding:function uniformBlockBinding(t,n){const i=l.get(n).get(t);o.get(n)!==i&&(e.uniformBlockBinding(n,i,t.__bindingPointIndex),o.set(n,i))},texStorage2D:function texStorage2D(){try{e.texStorage2D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},texStorage3D:function texStorage3D(){try{e.texStorage3D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},texSubImage2D:function texSubImage2D(){try{e.texSubImage2D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},texSubImage3D:function texSubImage3D(){try{e.texSubImage3D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function compressedTexSubImage2D(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function compressedTexSubImage3D(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){i.error("THREE.WebGLState:",e)}},scissor:function scissor(t){!1===V.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),V.copy(t))},viewport:function viewport(t){!1===B.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function reset(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),c={},I=null,N={},h={},u=new WeakMap,d=[],p=null,f=!1,m=null,g=null,_=null,v=null,x=null,M=null,y=null,S=new Color(0,0,0),T=0,E=!1,b=null,A=null,R=null,w=null,C=null,V.set(0,0,e.canvas.width,e.canvas.height),B.set(0,0,e.canvas.width,e.canvas.height),t.reset(),n.reset(),r.reset()}}}function WebGLTextures(e,t,n,r,a,s,o){const l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,c="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),h=new Vector2,u=new WeakMap;let y;const E=new WeakMap;let C=!1;try{C="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function createCanvas(e,t){return C?new OffscreenCanvas(e,t):createElementNS("canvas")}function resizeImage(e,t,n){let r=1;const a=getDimensions(e);if((a.width>n||a.height>n)&&(r=n/Math.max(a.width,a.height)),r<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(r*a.width),s=Math.floor(r*a.height);void 0===y&&(y=createCanvas(n,s));const o=t?createCanvas(n,s):y;o.width=n,o.height=s;return o.getContext("2d").drawImage(e,0,0,n,s),i.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+n+"x"+s+")."),o}return"data"in e&&i.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+")."),e}return e}function textureNeedsGenerateMipmaps(e){return e.generateMipmaps&&e.minFilter!==m&&e.minFilter!==_}function generateMipmap(t){e.generateMipmap(t)}function getInternalFormat(n,r,a,s,o=!1){if(null!==n){if(void 0!==e[n])return e[n];i.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=r;if(r===e.RED&&(a===e.FLOAT&&(l=e.R32F),a===e.HALF_FLOAT&&(l=e.R16F),a===e.UNSIGNED_BYTE&&(l=e.R8)),r===e.RED_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.R8UI),a===e.UNSIGNED_SHORT&&(l=e.R16UI),a===e.UNSIGNED_INT&&(l=e.R32UI),a===e.BYTE&&(l=e.R8I),a===e.SHORT&&(l=e.R16I),a===e.INT&&(l=e.R32I)),r===e.RG&&(a===e.FLOAT&&(l=e.RG32F),a===e.HALF_FLOAT&&(l=e.RG16F),a===e.UNSIGNED_BYTE&&(l=e.RG8)),r===e.RG_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.RG8UI),a===e.UNSIGNED_SHORT&&(l=e.RG16UI),a===e.UNSIGNED_INT&&(l=e.RG32UI),a===e.BYTE&&(l=e.RG8I),a===e.SHORT&&(l=e.RG16I),a===e.INT&&(l=e.RG32I)),r===e.RGB&&a===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),r===e.RGBA){const t=o?X:ce.getTransfer(s);a===e.FLOAT&&(l=e.RGBA32F),a===e.HALF_FLOAT&&(l=e.RGBA16F),a===e.UNSIGNED_BYTE&&(l=t===j?e.SRGB8_ALPHA8:e.RGBA8),a===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),a===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return l!==e.R16F&&l!==e.R32F&&l!==e.RG16F&&l!==e.RG32F&&l!==e.RGBA16F&&l!==e.RGBA32F||t.get("EXT_color_buffer_float"),l}function getMipLevels(e,t){return!0===textureNeedsGenerateMipmaps(e)||e.isFramebufferTexture&&e.minFilter!==m&&e.minFilter!==_?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function onTextureDispose(e){const t=e.target;t.removeEventListener("dispose",onTextureDispose),function deallocateTexture(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=E.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&deleteTexture(e),0===Object.keys(i).length&&E.delete(n)}r.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function onRenderTargetDispose(t){const n=t.target;n.removeEventListener("dispose",onRenderTargetDispose),function deallocateRenderTarget(t){const n=r.get(t);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let i=0;i<n.__webglFramebuffer[t].length;i++)e.deleteFramebuffer(n.__webglFramebuffer[t][i]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const i=t.textures;for(let t=0,n=i.length;t<n;t++){const n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}(n)}function deleteTexture(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete E.get(i)[n.__cacheKey],o.memory.textures--}let P=0;function setTexture2D(t,a){const s=r.get(t);if(t.isVideoTexture&&function updateVideoTexture(e){const t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&s.__version!==t.version){const e=t.image;if(null===e)i.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void uploadTexture(s,t,a);i.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+a)}const L={[d]:e.REPEAT,[p]:e.CLAMP_TO_EDGE,[f]:e.MIRRORED_REPEAT},U={[m]:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,[g]:e.NEAREST_MIPMAP_LINEAR,[_]:e.LINEAR,[v]:e.LINEAR_MIPMAP_NEAREST,[x]:e.LINEAR_MIPMAP_LINEAR},D={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function setTextureParameters(n,s){if(s.type!==T||!1!==t.has("OES_texture_float_linear")||s.magFilter!==_&&s.magFilter!==v&&s.magFilter!==g&&s.magFilter!==x&&s.minFilter!==_&&s.minFilter!==v&&s.minFilter!==g&&s.minFilter!==x||i.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,L[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,L[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,L[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,U[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,U[s.minFilter]),s.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,D[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(s.magFilter===m)return;if(s.minFilter!==g&&s.minFilter!==x)return;if(s.type===T&&!1===t.has("OES_texture_float_linear"))return;if(s.anisotropy>1||r.get(s).__currentAnisotropy){const i=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,a.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy}}}function initTexture(t,n){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",onTextureDispose));const r=n.source;let a=E.get(r);void 0===a&&(a={},E.set(r,a));const s=function getTextureCacheKey(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,i=!0),a[s].usedTimes++;const r=a[t.__cacheKey];void 0!==r&&(a[t.__cacheKey].usedTimes--,0===r.usedTimes&&deleteTexture(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return i}function uploadTexture(t,o,l){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);const h=initTexture(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+l);const d=r.get(u);if(u.version!==d.__version||!0===h){n.activeTexture(e.TEXTURE0+l);const t=ce.getPrimaries(ce.workingColorSpace),r=o.colorSpace===z?null:ce.getPrimaries(o.colorSpace),p=o.colorSpace===z||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=resizeImage(o.image,!1,a.maxTextureSize);f=verifyColorSpace(o,f);const m=s.convert(o.format,o.colorSpace),g=s.convert(o.type);let _,v=getInternalFormat(o.internalFormat,m,g,o.colorSpace,o.isVideoTexture);setTextureParameters(c,o);const x=o.mipmaps,M=!0!==o.isVideoTexture&&36196!==v,y=void 0===d.__version||!0===h,E=u.dataReady,R=getMipLevels(o,f);if(o.isDepthTexture)v=e.DEPTH_COMPONENT16,o.type===T?v=e.DEPTH_COMPONENT32F:o.type===S?v=e.DEPTH_COMPONENT24:o.type===b&&(v=e.DEPTH24_STENCIL8),y&&(M?n.texStorage2D(e.TEXTURE_2D,1,v,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,v,f.width,f.height,0,m,g,null));else if(o.isDataTexture)if(x.length>0){M&&y&&n.texStorage2D(e.TEXTURE_2D,R,v,x[0].width,x[0].height);for(let t=0,i=x.length;t<i;t++)_=x[t],M?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,_.width,_.height,m,g,_.data):n.texImage2D(e.TEXTURE_2D,t,v,_.width,_.height,0,m,g,_.data);o.generateMipmaps=!1}else M?(y&&n.texStorage2D(e.TEXTURE_2D,R,v,f.width,f.height),E&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,f.width,f.height,m,g,f.data)):n.texImage2D(e.TEXTURE_2D,0,v,f.width,f.height,0,m,g,f.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){M&&y&&n.texStorage3D(e.TEXTURE_2D_ARRAY,R,v,x[0].width,x[0].height,f.depth);for(let t=0,r=x.length;t<r;t++)_=x[t],o.format!==A?null!==m?M?E&&n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,_.width,_.height,f.depth,m,_.data,0,0):n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,v,_.width,_.height,f.depth,0,_.data,0,0):i.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M?E&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,_.width,_.height,f.depth,m,g,_.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,v,_.width,_.height,f.depth,0,m,g,_.data)}else{M&&y&&n.texStorage2D(e.TEXTURE_2D,R,v,x[0].width,x[0].height);for(let t=0,r=x.length;t<r;t++)_=x[t],o.format!==A?null!==m?M?E&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,_.width,_.height,m,_.data):n.compressedTexImage2D(e.TEXTURE_2D,t,v,_.width,_.height,0,_.data):i.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,_.width,_.height,m,g,_.data):n.texImage2D(e.TEXTURE_2D,t,v,_.width,_.height,0,m,g,_.data)}else if(o.isDataArrayTexture)M?(y&&n.texStorage3D(e.TEXTURE_2D_ARRAY,R,v,f.width,f.height,f.depth),E&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,m,g,f.data)):n.texImage3D(e.TEXTURE_2D_ARRAY,0,v,f.width,f.height,f.depth,0,m,g,f.data);else if(o.isData3DTexture)M?(y&&n.texStorage3D(e.TEXTURE_3D,R,v,f.width,f.height,f.depth),E&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,m,g,f.data)):n.texImage3D(e.TEXTURE_3D,0,v,f.width,f.height,f.depth,0,m,g,f.data);else if(o.isFramebufferTexture){if(y)if(M)n.texStorage2D(e.TEXTURE_2D,R,v,f.width,f.height);else{let t=f.width,i=f.height;for(let r=0;r<R;r++)n.texImage2D(e.TEXTURE_2D,r,v,t,i,0,m,g,null),t>>=1,i>>=1}}else if(x.length>0){if(M&&y){const t=getDimensions(x[0]);n.texStorage2D(e.TEXTURE_2D,R,v,t.width,t.height)}for(let t=0,i=x.length;t<i;t++)_=x[t],M?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,m,g,_):n.texImage2D(e.TEXTURE_2D,t,v,m,g,_);o.generateMipmaps=!1}else if(M){if(y){const t=getDimensions(f);n.texStorage2D(e.TEXTURE_2D,R,v,t.width,t.height)}E&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,m,g,f)}else n.texImage2D(e.TEXTURE_2D,0,v,m,g,f);textureNeedsGenerateMipmaps(o)&&generateMipmap(c),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function setupFrameBufferTexture(t,i,a,o,c,h){const u=s.convert(a.format,a.colorSpace),d=s.convert(a.type),p=getInternalFormat(a.internalFormat,u,d,a.colorSpace);if(!r.get(i).__hasExternalTextures){const t=Math.max(1,i.width>>h),r=Math.max(1,i.height>>h);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?n.texImage3D(c,h,p,t,r,i.depth,0,u,d,null):n.texImage2D(c,h,p,t,r,0,u,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),useMultisampledRTT(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,c,r.get(a).__webglTexture,0,getRenderTargetSamples(i)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,c,r.get(a).__webglTexture,h),n.bindFramebuffer(e.FRAMEBUFFER,null)}function setupRenderBufferStorage(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){let r=e.DEPTH_COMPONENT24;if(i||useMultisampledRTT(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===T?r=e.DEPTH_COMPONENT32F:t.type===S&&(r=e.DEPTH_COMPONENT24));const i=getRenderTargetSamples(n);useMultisampledRTT(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,r,n.width,n.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,i,r,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,r,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer){const r=getRenderTargetSamples(n);i&&!1===useMultisampledRTT(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,r,e.DEPTH24_STENCIL8,n.width,n.height):useMultisampledRTT(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,r,e.DEPTH24_STENCIL8,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=n.textures;for(let r=0;r<t.length;r++){const a=t[r],o=s.convert(a.format,a.colorSpace),c=s.convert(a.type),h=getInternalFormat(a.internalFormat,o,c,a.colorSpace),u=getRenderTargetSamples(n);i&&!1===useMultisampledRTT(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,h,n.width,n.height):useMultisampledRTT(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,h,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,h,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function setupDepthRenderbuffer(t){const i=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function setupDepthTexture(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),setTexture2D(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,s=getRenderTargetSamples(i);if(i.depthTexture.format===R)useMultisampledRTT(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==w)throw new Error("Unknown depthTexture format");useMultisampledRTT(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),setupRenderBufferStorage(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),setupRenderBufferStorage(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}function getRenderTargetSamples(e){return Math.min(a.maxSamples,e.samples)}function useMultisampledRTT(e){const n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function verifyColorSpace(e,t){const n=e.colorSpace,r=e.format,a=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==H&&n!==z&&(ce.getTransfer(n)===j?r===A&&a===M||i.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):i.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function getDimensions(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(h.width=e.naturalWidth||e.width,h.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(h.width=e.displayWidth,h.height=e.displayHeight):(h.width=e.width,h.height=e.height),h}this.allocateTextureUnit=function allocateTextureUnit(){const e=P;return e>=a.maxTextures&&i.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+a.maxTextures),P+=1,e},this.resetTextureUnits=function resetTextureUnits(){P=0},this.setTexture2D=setTexture2D,this.setTexture2DArray=function setTexture2DArray(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?uploadTexture(a,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function setTexture3D(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?uploadTexture(a,t,i):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function setTextureCube(t,o){const l=r.get(t);t.version>0&&l.__version!==t.version?function uploadCubeTexture(t,o,l){if(6!==o.image.length)return;const c=initTexture(t,o),h=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+l);const u=r.get(h);if(h.version!==u.__version||!0===c){n.activeTexture(e.TEXTURE0+l);const t=ce.getPrimaries(ce.workingColorSpace),r=o.colorSpace===z?null:ce.getPrimaries(o.colorSpace),d=o.colorSpace===z||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=o.isCompressedTexture||o.image[0].isCompressedTexture,f=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)m[e]=p||f?f?o.image[e].image:o.image[e]:resizeImage(o.image[e],!0,a.maxCubemapSize),m[e]=verifyColorSpace(o,m[e]);const g=m[0],_=s.convert(o.format,o.colorSpace),v=s.convert(o.type),x=getInternalFormat(o.internalFormat,_,v,o.colorSpace),M=!0!==o.isVideoTexture,y=void 0===u.__version||!0===c,S=h.dataReady;let T,E=getMipLevels(o,g);if(setTextureParameters(e.TEXTURE_CUBE_MAP,o),p){M&&y&&n.texStorage2D(e.TEXTURE_CUBE_MAP,E,x,g.width,g.height);for(let t=0;t<6;t++){T=m[t].mipmaps;for(let r=0;r<T.length;r++){const a=T[r];o.format!==A?null!==_?M?S&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,a.width,a.height,_,a.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,x,a.width,a.height,0,a.data):i.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):M?S&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,a.width,a.height,_,v,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,x,a.width,a.height,0,_,v,a.data)}}}else{if(T=o.mipmaps,M&&y){T.length>0&&E++;const t=getDimensions(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,E,x,t.width,t.height)}for(let t=0;t<6;t++)if(f){M?S&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,_,v,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,x,m[t].width,m[t].height,0,_,v,m[t].data);for(let i=0;i<T.length;i++){const r=T[i].image[t].image;M?S&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,r.width,r.height,_,v,r.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,x,r.width,r.height,0,_,v,r.data)}}else{M?S&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,_,v,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,x,_,v,m[t]);for(let i=0;i<T.length;i++){const r=T[i];M?S&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,_,v,r.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,x,_,v,r.image[t])}}}textureNeedsGenerateMipmaps(o)&&generateMipmap(e.TEXTURE_CUBE_MAP),u.__version=h.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(l,t,o):n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function rebindTextures(t,n,i){const a=r.get(t);void 0!==n&&setupFrameBufferTexture(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&setupDepthRenderbuffer(t)},this.setupRenderTarget=function setupRenderTarget(t){const i=t.texture,a=r.get(t),l=r.get(i);t.addEventListener("dispose",onRenderTargetDispose);const c=t.textures,h=!0===t.isWebGLCubeRenderTarget,u=c.length>1;if(u||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,o.memory.textures++),h){a.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){a.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)a.__webglFramebuffer[t][n]=e.createFramebuffer()}else a.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){a.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)a.__webglFramebuffer[t]=e.createFramebuffer()}else a.__webglFramebuffer=e.createFramebuffer();if(u)for(let t=0,n=c.length;t<n;t++){const n=r.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===useMultisampledRTT(t)){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,a.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){const i=c[n];a.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,a.__webglColorRenderbuffer[n]);const r=s.convert(i.format,i.colorSpace),o=s.convert(i.type),l=getInternalFormat(i.internalFormat,r,o,i.colorSpace,!0===t.isXRRenderTarget),h=getRenderTargetSamples(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,h,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,a.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(a.__webglDepthRenderbuffer=e.createRenderbuffer(),setupRenderBufferStorage(a.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(h){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),setTextureParameters(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)setupFrameBufferTexture(a.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else setupFrameBufferTexture(a.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);textureNeedsGenerateMipmaps(i)&&generateMipmap(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(u){for(let i=0,s=c.length;i<s;i++){const s=c[i],o=r.get(s);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),setTextureParameters(e.TEXTURE_2D,s),setupFrameBufferTexture(a.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+i,e.TEXTURE_2D,0),textureNeedsGenerateMipmaps(s)&&generateMipmap(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,l.__webglTexture),setTextureParameters(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)setupFrameBufferTexture(a.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else setupFrameBufferTexture(a.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);textureNeedsGenerateMipmaps(i)&&generateMipmap(r),n.unbindTexture()}t.depthBuffer&&setupDepthRenderbuffer(t)},this.updateRenderTargetMipmap=function updateRenderTargetMipmap(t){const i=t.textures;for(let a=0,s=i.length;a<s;a++){const s=i[a];if(textureNeedsGenerateMipmaps(s)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=r.get(s).__webglTexture;n.bindTexture(i,a),generateMipmap(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function updateMultisampleRenderTarget(t){if(t.samples>0&&!1===useMultisampledRTT(t)){const i=t.textures,a=t.width,s=t.height;let o=e.COLOR_BUFFER_BIT;const l=[],h=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){l.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&l.push(h);const p=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===p&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&!0!==u.__isTransmissionRenderTarget&&(o|=e.STENCIL_BUFFER_BIT)),d&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]),!0===p&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[h]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[h])),d){const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,s,0,0,a,s,o,e.NEAREST),c&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,l)}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);const a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=setupDepthRenderbuffer,this.setupFrameBufferTexture=setupFrameBufferTexture,this.useMultisampledRTT=useMultisampledRTT}function WebGLUtils(e,t){return{convert:function convert(n,i=""){let r;const a=ce.getTransfer(i);if(n===M)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return e.UNSIGNED_INT_5_9_9_9_REV;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(n===y)return e.INT;if(n===S)return e.UNSIGNED_INT;if(n===T)return e.FLOAT;if(n===E)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(n===A)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(n===R)return e.DEPTH_COMPONENT;if(n===w)return e.DEPTH_STENCIL;if(1028===n)return e.RED;if(1029===n)return e.RED_INTEGER;if(1030===n)return e.RG;if(1031===n)return e.RG_INTEGER;if(1033===n)return e.RGBA_INTEGER;if(n===C||n===P||n===L||n===U)if(a===j){if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===C)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===P)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===L)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===U)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=t.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===C)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===P)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===L)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===U)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(r=t.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return r=t.get("WEBGL_compressed_texture_etc1"),null!==r?r.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===n||37496===n){if(r=t.get("WEBGL_compressed_texture_etc"),null===r)return null;if(37492===n)return a===j?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(37496===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(r=t.get("WEBGL_compressed_texture_astc"),null===r)return null;if(37808===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return a===j?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===D||36494===n||36495===n){if(r=t.get("EXT_texture_compression_bptc"),null===r)return null;if(n===D)return a===j?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(r=t.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===D)return r.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===b?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class ArrayCamera extends PerspectiveCamera{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const zn={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null;const s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(const i of e.hand.values()){const e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position),o=.02,c=.005;l.inputState.pinching&&s>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==s&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(zn)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new Group;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const i=new Texture;e.properties.get(i).__webglTexture=t.texture,t.depthNear==n.depthNear&&t.depthFar==n.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(null!==this.texture){if(null===this.mesh){const e=t.cameras[0].viewport,n=new ShaderMaterial({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),n)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class WebXRManager extends EventDispatcher{constructor(e,t){super();const n=this;let r=null,a=1,s=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,p=null,f=null;const m=new WebXRDepthSensing,g=t.getContextAttributes();let _=null,v=null;const x=[],y=[],T=new Vector2;let E=null;const C=new PerspectiveCamera;C.layers.enable(1),C.viewport=new Vector4;const P=new PerspectiveCamera;P.layers.enable(2),P.viewport=new Vector4;const L=[C,P],U=new ArrayCamera;U.layers.enable(1),U.layers.enable(2);let D=null,I=null;function onSessionEvent(e){const t=y.indexOf(e.inputSource);if(-1===t)return;const n=x[t];void 0!==n&&(n.update(e.inputSource,e.frame,c||s),n.dispatchEvent({type:e.type,data:e.inputSource}))}function onSessionEnd(){r.removeEventListener("select",onSessionEvent),r.removeEventListener("selectstart",onSessionEvent),r.removeEventListener("selectend",onSessionEvent),r.removeEventListener("squeeze",onSessionEvent),r.removeEventListener("squeezestart",onSessionEvent),r.removeEventListener("squeezeend",onSessionEvent),r.removeEventListener("end",onSessionEnd),r.removeEventListener("inputsourceschange",onInputSourcesChange);for(let e=0;e<x.length;e++){const t=y[e];null!==t&&(y[e]=null,x[e].disconnect(t))}D=null,I=null,m.reset(),e.setRenderTarget(_),p=null,d=null,u=null,r=null,v=null,V.stop(),n.isPresenting=!1,e.setPixelRatio(E),e.setSize(T.width,T.height,!1),n.dispatchEvent({type:"sessionend"})}function onInputSourcesChange(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],i=y.indexOf(n);i>=0&&(y[i]=null,x[i].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let i=y.indexOf(n);if(-1===i){for(let e=0;e<x.length;e++){if(e>=y.length){y.push(n),i=e;break}if(null===y[e]){y[e]=n,i=e;break}}if(-1===i)break}const r=x[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new WebXRController,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new WebXRController,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new WebXRController,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){a=e,!0===n.isPresenting&&i.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&i.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||s},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return null!==d?d:p},this.getBinding=function(){return u},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(i){if(r=i,null!==r){if(_=e.getRenderTarget(),r.addEventListener("select",onSessionEvent),r.addEventListener("selectstart",onSessionEvent),r.addEventListener("selectend",onSessionEvent),r.addEventListener("squeeze",onSessionEvent),r.addEventListener("squeezestart",onSessionEvent),r.addEventListener("squeezeend",onSessionEvent),r.addEventListener("end",onSessionEnd),r.addEventListener("inputsourceschange",onInputSourcesChange),!0!==g.xrCompatible&&await t.makeXRCompatible(),E=e.getPixelRatio(),e.getSize(T),void 0===r.renderState.layers){const n={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:a};p=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),v=new WebGLRenderTarget(p.framebufferWidth,p.framebufferHeight,{format:A,type:M,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil})}else{let n=null,i=null,s=null;g.depth&&(s=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=g.stencil?w:R,i=g.stencil?b:S);const o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:a};u=new XRWebGLBinding(r,t),d=u.createProjectionLayer(o),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),v=new WebGLRenderTarget(d.textureWidth,d.textureHeight,{format:A,type:M,depthTexture:new DepthTexture(d.textureWidth,d.textureHeight,i,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0});e.properties.get(v).__ignoreDepthValues=d.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(l),c=null,s=await r.requestReferenceSpace(o),V.setContext(r),V.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const N=new Vector3,O=new Vector3;function updateCamera(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;null!==m.texture&&(e.near=m.depthNear,e.far=m.depthFar),U.near=P.near=C.near=e.near,U.far=P.far=C.far=e.far,D===U.near&&I===U.far||(r.updateRenderState({depthNear:U.near,depthFar:U.far}),D=U.near,I=U.far,C.near=D,C.far=I,P.near=D,P.far=I,C.updateProjectionMatrix(),P.updateProjectionMatrix(),e.updateProjectionMatrix());const t=e.parent,n=U.cameras;updateCamera(U,t);for(let e=0;e<n.length;e++)updateCamera(n[e],t);2===n.length?function setProjectionFromUnion(e,t,n){N.setFromMatrixPosition(t.matrixWorld),O.setFromMatrixPosition(n.matrixWorld);const i=N.distanceTo(O),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,s=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(a[8]+1)/a[0],d=s*h,p=s*u,f=i/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=s+f,_=o+f,v=d-m,x=p+(i-m),M=l*o/_*g,y=c*o/_*g;e.projectionMatrix.makePerspective(v,x,M,y,g,_),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(U,C,P):U.projectionMatrix.copy(C.projectionMatrix),function updateUserCamera(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*ne*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,U,t)},this.getCamera=function(){return U},this.getFoveation=function(){if(null!==d||null!==p)return l},this.setFoveation=function(e){l=e,null!==d&&(d.fixedFoveation=e),null!==p&&void 0!==p.fixedFoveation&&(p.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==m.texture};let F=null;const V=new WebGLAnimation;V.setAnimationLoop((function onAnimationFrame(t,i){if(h=i.getViewerPose(c||s),f=i,null!==h){const t=h.views;null!==p&&(e.setRenderTargetFramebuffer(v,p.framebuffer),e.setRenderTarget(v));let n=!1;t.length!==U.cameras.length&&(U.cameras.length=0,n=!0);for(let i=0;i<t.length;i++){const r=t[i];let a=null;if(null!==p)a=p.getViewport(r);else{const t=u.getViewSubImage(d,r);a=t.viewport,0===i&&(e.setRenderTargetTextures(v,t.colorTexture,d.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(v))}let s=L[i];void 0===s&&(s=new PerspectiveCamera,s.layers.enable(i),s.viewport=new Vector4,L[i]=s),s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(r.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(a.x,a.y,a.width,a.height),0===i&&(U.matrix.copy(s.matrix),U.matrix.decompose(U.position,U.quaternion,U.scale)),!0===n&&U.cameras.push(s)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=u.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&m.init(e,n,r.renderState)}}for(let e=0;e<x.length;e++){const t=y[e],n=x[e];null!==t&&void 0!==n&&n.update(t,i,c||s)}m.render(e,U),F&&F(t,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),f=null})),this.setAnimationLoop=function(e){F=e},this.dispose=function(){}}}const Gn=new Euler,Hn=new Matrix4;function WebGLMaterials(e,t){function refreshTransformUniform(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function refreshUniformsCommon(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map,refreshTransformUniform(i.map,n.mapTransform)),i.alphaMap&&(n.alphaMap.value=i.alphaMap,refreshTransformUniform(i.alphaMap,n.alphaMapTransform)),i.bumpMap&&(n.bumpMap.value=i.bumpMap,refreshTransformUniform(i.bumpMap,n.bumpMapTransform),n.bumpScale.value=i.bumpScale,1===i.side&&(n.bumpScale.value*=-1)),i.normalMap&&(n.normalMap.value=i.normalMap,refreshTransformUniform(i.normalMap,n.normalMapTransform),n.normalScale.value.copy(i.normalScale),1===i.side&&n.normalScale.value.negate()),i.displacementMap&&(n.displacementMap.value=i.displacementMap,refreshTransformUniform(i.displacementMap,n.displacementMapTransform),n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap,refreshTransformUniform(i.emissiveMap,n.emissiveMapTransform)),i.specularMap&&(n.specularMap.value=i.specularMap,refreshTransformUniform(i.specularMap,n.specularMapTransform)),i.alphaTest>0&&(n.alphaTest.value=i.alphaTest);const r=t.get(i),a=r.envMap,s=r.envMapRotation;if(a&&(n.envMap.value=a,Gn.copy(s),Gn.x*=-1,Gn.y*=-1,Gn.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(Gn.y*=-1,Gn.z*=-1),n.envMapRotation.value.setFromMatrix4(Hn.makeRotationFromEuler(Gn)),n.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,n.reflectivity.value=i.reflectivity,n.ior.value=i.ior,n.refractionRatio.value=i.refractionRatio),i.lightMap){n.lightMap.value=i.lightMap;const t=!0===e._useLegacyLights?Math.PI:1;n.lightMapIntensity.value=i.lightMapIntensity*t,refreshTransformUniform(i.lightMap,n.lightMapTransform)}i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity,refreshTransformUniform(i.aoMap,n.aoMapTransform))}return{refreshFogUniforms:function refreshFogUniforms(t,n){n.color.getRGB(t.fogColor.value,getUnlitUniformColorSpace(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function refreshMaterialUniforms(e,n,i,r,a){n.isMeshBasicMaterial||n.isMeshLambertMaterial?refreshUniformsCommon(e,n):n.isMeshToonMaterial?(refreshUniformsCommon(e,n),function refreshUniformsToon(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,n)):n.isMeshPhongMaterial?(refreshUniformsCommon(e,n),function refreshUniformsPhong(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,n)):n.isMeshStandardMaterial?(refreshUniformsCommon(e,n),function refreshUniformsStandard(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,refreshTransformUniform(t.metalnessMap,e.metalnessMapTransform));e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,refreshTransformUniform(t.roughnessMap,e.roughnessMapTransform));t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,n),n.isMeshPhysicalMaterial&&function refreshUniformsPhysical(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,refreshTransformUniform(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,refreshTransformUniform(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,refreshTransformUniform(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,refreshTransformUniform(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,refreshTransformUniform(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),1===t.side&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,refreshTransformUniform(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,refreshTransformUniform(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,refreshTransformUniform(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,refreshTransformUniform(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,refreshTransformUniform(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,refreshTransformUniform(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,refreshTransformUniform(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,n,a)):n.isMeshMatcapMaterial?(refreshUniformsCommon(e,n),function refreshUniformsMatcap(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,n)):n.isMeshDepthMaterial?refreshUniformsCommon(e,n):n.isMeshDistanceMaterial?(refreshUniformsCommon(e,n),function refreshUniformsDistance(e,n){const i=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(i.matrixWorld),e.nearDistance.value=i.shadow.camera.near,e.farDistance.value=i.shadow.camera.far}(e,n)):n.isMeshNormalMaterial?refreshUniformsCommon(e,n):n.isLineBasicMaterial?(!function refreshUniformsLine(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform))}(e,n),n.isLineDashedMaterial&&function refreshUniformsDash(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,n)):n.isPointsMaterial?function refreshUniformsPoints(e,t,n,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*i,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,n,i,r):n.isSpriteMaterial?function refreshUniformsSprites(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,n):n.isShadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(e,t,n,r){let a={},s={},o=[];const l=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function hasUniformChanged(e,t,n,i){const r=e.value,a=t+"_"+n;if(void 0===i[a])return i[a]="number"==typeof r||"boolean"==typeof r?r:r.clone(),!0;{const e=i[a];if("number"==typeof r||"boolean"==typeof r){if(e!==r)return i[a]=r,!0}else if(!1===e.equals(r))return e.copy(r),!0}return!1}function getUniformSize(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?i.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):i.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function onUniformsGroupsDispose(t){const n=t.target;n.removeEventListener("dispose",onUniformsGroupsDispose);const i=o.indexOf(n.__bindingPointIndex);o.splice(i,1),e.deleteBuffer(a[n.id]),delete a[n.id],delete s[n.id]}return{bind:function bind(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function update(n,c){let h=a[n.id];void 0===h&&(!function prepareUniformsGroup(e){const t=e.uniforms;let n=0;const i=16;for(let e=0,r=t.length;e<r;e++){const r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){const t=r[e],a=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=a.length;e<r;e++){const r=getUniformSize(a[e]),s=n%i;0!==s&&i-s<r.boundary&&(n+=i-s),t.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=r.storage}}}const r=n%i;r>0&&(n+=i-r);return e.__size=n,e.__cache={},this}(n),h=function createBuffer(t){const n=function allocateBindingPointIndex(){for(let e=0;e<l;e++)if(-1===o.indexOf(e))return o.push(e),e;return i.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),a=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,a,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),a[n.id]=h,n.addEventListener("dispose",onUniformsGroupsDispose));const u=c.program;r.updateUBOMapping(n,u);const d=t.render.frame;s[n.id]!==d&&(!function updateBufferData(t){const n=a[t.id],i=t.uniforms,r=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=i.length;t<n;t++){const n=Array.isArray(i[t])?i[t]:[i[t]];for(let i=0,a=n.length;i<a;i++){const a=n[i];if(!0===hasUniformChanged(a,t,i,r)){const t=a.__offset,n=Array.isArray(a.value)?a.value:[a.value];let i=0;for(let r=0;r<n.length;r++){const s=n[r],o=getUniformSize(s);"number"==typeof s||"boolean"==typeof s?(a.__data[0]=s,e.bufferSubData(e.UNIFORM_BUFFER,t+i,a.__data)):s.isMatrix3?(a.__data[0]=s.elements[0],a.__data[1]=s.elements[1],a.__data[2]=s.elements[2],a.__data[3]=0,a.__data[4]=s.elements[3],a.__data[5]=s.elements[4],a.__data[6]=s.elements[5],a.__data[7]=0,a.__data[8]=s.elements[6],a.__data[9]=s.elements[7],a.__data[10]=s.elements[8],a.__data[11]=0):(s.toArray(a.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,a.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),s[n.id]=d)},dispose:function dispose(){for(const t in a)e.deleteBuffer(a[t]);o=[],a={},s={}}}}class WebGLRenderer{constructor(e={}){const{canvas:t=createCanvasElement(),context:n=null,depth:r=!0,stencil:a=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1}=e;let d;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=s;const p=new Uint32Array(4),f=new Int32Array(4);let m=null,g=null;const _=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=G,this._useLegacyLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const y=this;let R=!1,w=0,C=0,P=null,L=-1,U=null;const D=new Vector4,I=new Vector4;let N=null;const O=new Color(0);let F=0,V=t.width,B=t.height,z=1,k=null,W=null;const X=new Vector4(0,0,V,B),j=new Vector4(0,0,V,B);let q=!1;const Y=new Frustum;let K=!1,Z=!1;const J=new Matrix4,Q=new Vector2,$=new Vector3,ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function getTargetPixelRatio(){return null===P?z:1}let te,ne,ie,re,ae,se,oe,le,ce,he,ue,de,pe,fe,me,ge,_e,ve,xe,Me,ye,Se,Te,Ee,be=n;function getContext(e,n){const i=t.getContext(e,n);return null!==i?i:null}try{const e={alpha:!0,depth:r,stencil:a,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r163"),t.addEventListener("webglcontextlost",onContextLost,!1),t.addEventListener("webglcontextrestored",onContextRestore,!1),t.addEventListener("webglcontextcreationerror",onContextCreationError,!1),null===be){const t="webgl2";if(be=getContext(t,e),null===be)throw getContext(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(e){throw i.error("THREE.WebGLRenderer: "+e.message),e}function initGLContext(){te=new WebGLExtensions(be),te.init(),ne=new WebGLCapabilities(be,te,e),Se=new WebGLUtils(be,te),ie=new WebGLState(be),re=new WebGLInfo(be),ae=new WebGLProperties,se=new WebGLTextures(be,te,ie,ae,ne,Se,re),oe=new WebGLCubeMaps(y),le=new WebGLCubeUVMaps(y),ce=new WebGLAttributes(be),Te=new WebGLBindingStates(be,ce),he=new WebGLGeometries(be,ce,re,Te),ue=new WebGLObjects(be,he,ce,re),xe=new WebGLMorphtargets(be,ne,se),ge=new WebGLClipping(ae),de=new WebGLPrograms(y,oe,le,te,ne,Te,ge),pe=new WebGLMaterials(y,ae),fe=new WebGLRenderLists,me=new WebGLRenderStates(te),ve=new WebGLBackground(y,oe,le,ie,ue,d,l),_e=new WebGLShadowMap(y,ue,ne),Ee=new WebGLUniformsGroups(be,re,ne,ie),Me=new WebGLBufferRenderer(be,te,re),ye=new WebGLIndexedBufferRenderer(be,te,re),re.programs=de.programs,y.capabilities=ne,y.extensions=te,y.properties=ae,y.renderLists=fe,y.shadowMap=_e,y.state=ie,y.info=re}initGLContext();const Ae=new WebXRManager(y,be);function onContextLost(e){e.preventDefault(),i.log("THREE.WebGLRenderer: Context Lost."),R=!0}function onContextRestore(){i.log("THREE.WebGLRenderer: Context Restored."),R=!1;const e=re.autoReset,t=_e.enabled,n=_e.autoUpdate,r=_e.needsUpdate,a=_e.type;initGLContext(),re.autoReset=e,_e.enabled=t,_e.autoUpdate=n,_e.needsUpdate=r,_e.type=a}function onContextCreationError(e){i.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function onMaterialDispose(e){const t=e.target;t.removeEventListener("dispose",onMaterialDispose),function deallocateMaterial(e){(function releaseMaterialProgramReferences(e){const t=ae.get(e).programs;void 0!==t&&(t.forEach((function(e){de.releaseProgram(e)})),e.isShaderMaterial&&de.releaseShaderCache(e))})(e),ae.remove(e)}(t)}function prepareMaterial(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,getProgram(e,t,n),e.side=0,e.needsUpdate=!0,getProgram(e,t,n),e.side=2):getProgram(e,t,n)}this.xr=Ae,this.getContext=function(){return be},this.getContextAttributes=function(){return be.getContextAttributes()},this.forceContextLoss=function(){const e=te.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=te.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return z},this.setPixelRatio=function(e){void 0!==e&&(z=e,this.setSize(V,B,!1))},this.getSize=function(e){return e.set(V,B)},this.setSize=function(e,n,r=!0){Ae.isPresenting?i.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(V=e,B=n,t.width=Math.floor(e*z),t.height=Math.floor(n*z),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(V*z,B*z).floor()},this.setDrawingBufferSize=function(e,n,i){V=e,B=n,z=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(D)},this.getViewport=function(e){return e.copy(X)},this.setViewport=function(e,t,n,i){e.isVector4?X.set(e.x,e.y,e.z,e.w):X.set(e,t,n,i),ie.viewport(D.copy(X).multiplyScalar(z).round())},this.getScissor=function(e){return e.copy(j)},this.setScissor=function(e,t,n,i){e.isVector4?j.set(e.x,e.y,e.z,e.w):j.set(e,t,n,i),ie.scissor(I.copy(j).multiplyScalar(z).round())},this.getScissorTest=function(){return q},this.setScissorTest=function(e){ie.setScissorTest(q=e)},this.setOpaqueSort=function(e){k=e},this.setTransparentSort=function(e){W=e},this.getClearColor=function(e){return e.copy(ve.getClearColor())},this.setClearColor=function(){ve.setClearColor.apply(ve,arguments)},this.getClearAlpha=function(){return ve.getClearAlpha()},this.setClearAlpha=function(){ve.setClearAlpha.apply(ve,arguments)},this.clear=function(e=!0,t=!0,n=!0){let i=0;if(e){let e=!1;if(null!==P){const t=P.texture.format;e=1033===t||1031===t||1029===t}if(e){const e=P.texture.type,t=e===M||e===S||1012===e||e===b||1017===e||1018===e,n=ve.getClearColor(),i=ve.getClearAlpha(),r=n.r,a=n.g,s=n.b;t?(p[0]=r,p[1]=a,p[2]=s,p[3]=i,be.clearBufferuiv(be.COLOR,0,p)):(f[0]=r,f[1]=a,f[2]=s,f[3]=i,be.clearBufferiv(be.COLOR,0,f))}else i|=be.COLOR_BUFFER_BIT}t&&(i|=be.DEPTH_BUFFER_BIT),n&&(i|=be.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),be.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",onContextLost,!1),t.removeEventListener("webglcontextrestored",onContextRestore,!1),t.removeEventListener("webglcontextcreationerror",onContextCreationError,!1),fe.dispose(),me.dispose(),ae.dispose(),oe.dispose(),le.dispose(),ue.dispose(),Te.dispose(),Ee.dispose(),de.dispose(),Ae.dispose(),Ae.removeEventListener("sessionstart",onXRSessionStart),Ae.removeEventListener("sessionend",onXRSessionEnd),we.stop()},this.renderBufferDirect=function(e,t,n,i,r,a){null===t&&(t=ee);const s=r.isMesh&&r.matrixWorld.determinant()<0,o=function setProgram(e,t,n,i,r){!0!==t.isScene&&(t=ee);se.resetTextureUnits();const a=t.fog,s=i.isMeshStandardMaterial?t.environment:null,o=null===P?y.outputColorSpace:!0===P.isXRRenderTarget?P.texture.colorSpace:H,l=(i.isMeshStandardMaterial?le:oe).get(i.envMap||s),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!n.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color;let f=0;i.toneMapped&&(null!==P&&!0!==P.isXRRenderTarget||(f=y.toneMapping));const m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=void 0!==m?m.length:0,v=ae.get(i),x=g.state.lights;if(!0===K&&(!0===Z||e!==U)){const t=e===U&&i.id===L;ge.setState(i,e,t)}let M=!1;i.version===v.__version?v.needsLights&&v.lightsStateVersion!==x.state.version||v.outputColorSpace!==o||r.isBatchedMesh&&!1===v.batching?M=!0:r.isBatchedMesh||!0!==v.batching?r.isInstancedMesh&&!1===v.instancing?M=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?M=!0:r.isSkinnedMesh||!0!==v.skinning?r.isInstancedMesh&&!0===v.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===v.instancingColor&&null!==r.instanceColor||r.isInstancedMesh&&!0===v.instancingMorph&&null===r.morphTexture||r.isInstancedMesh&&!1===v.instancingMorph&&null!==r.morphTexture||v.envMap!==l||!0===i.fog&&v.fog!==a?M=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===ge.numPlanes&&v.numIntersection===ge.numIntersection?(v.vertexAlphas!==c||v.vertexTangents!==h||v.morphTargets!==u||v.morphNormals!==d||v.morphColors!==p||v.toneMapping!==f||v.morphTargetsCount!==_)&&(M=!0):M=!0:M=!0:M=!0:M=!0:(M=!0,v.__version=i.version);let S=v.currentProgram;!0===M&&(S=getProgram(i,t,r));let T=!1,E=!1,b=!1;const A=S.getUniforms(),R=v.uniforms;ie.useProgram(S.program)&&(T=!0,E=!0,b=!0);i.id!==L&&(L=i.id,E=!0);if(T||U!==e){A.setValue(be,"projectionMatrix",e.projectionMatrix),A.setValue(be,"viewMatrix",e.matrixWorldInverse);const t=A.map.cameraPosition;void 0!==t&&t.setValue(be,$.setFromMatrixPosition(e.matrixWorld)),ne.logarithmicDepthBuffer&&A.setValue(be,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&A.setValue(be,"isOrthographic",!0===e.isOrthographicCamera),U!==e&&(U=e,E=!0,b=!0)}if(r.isSkinnedMesh){A.setOptional(be,r,"bindMatrix"),A.setOptional(be,r,"bindMatrixInverse");const e=r.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),A.setValue(be,"boneTexture",e.boneTexture,se))}r.isBatchedMesh&&(A.setOptional(be,r,"batchingTexture"),A.setValue(be,"batchingTexture",r._matricesTexture,se));const w=n.morphAttributes;void 0===w.position&&void 0===w.normal&&void 0===w.color||xe.update(r,n,S);(E||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,A.setValue(be,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);i.isMeshStandardMaterial&&null===i.envMap&&null!==t.environment&&(R.envMapIntensity.value=t.environmentIntensity);E&&(A.setValue(be,"toneMappingExposure",y.toneMappingExposure),v.needsLights&&function markUniformsLightsNeedsUpdate(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(R,b),a&&!0===i.fog&&pe.refreshFogUniforms(R,a),pe.refreshMaterialUniforms(R,i,z,B,g.state.transmissionRenderTarget),WebGLUniforms.upload(be,getUniformList(v),R,se));i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(WebGLUniforms.upload(be,getUniformList(v),R,se),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&A.setValue(be,"center",r.center);if(A.setValue(be,"modelViewMatrix",r.modelViewMatrix),A.setValue(be,"normalMatrix",r.normalMatrix),A.setValue(be,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const e=i.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];Ee.update(n,S),Ee.bind(n,S)}}return S}(e,t,n,i,r);ie.setMaterial(i,s);let l=n.index,c=1;if(!0===i.wireframe){if(l=he.getWireframeAttribute(n),void 0===l)return;c=2}const h=n.drawRange,u=n.attributes.position;let d=h.start*c,p=(h.start+h.count)*c;null!==a&&(d=Math.max(d,a.start*c),p=Math.min(p,(a.start+a.count)*c)),null!==l?(d=Math.max(d,0),p=Math.min(p,l.count)):null!=u&&(d=Math.max(d,0),p=Math.min(p,u.count));const f=p-d;if(f<0||f===1/0)return;let m;Te.setup(r,i,o,n,l);let _=Me;if(null!==l&&(m=ce.get(l),_=ye,_.setIndex(m)),r.isMesh)!0===i.wireframe?(ie.setLineWidth(i.wireframeLinewidth*getTargetPixelRatio()),_.setMode(be.LINES)):_.setMode(be.TRIANGLES);else if(r.isLine){let e=i.linewidth;void 0===e&&(e=1),ie.setLineWidth(e*getTargetPixelRatio()),r.isLineSegments?_.setMode(be.LINES):r.isLineLoop?_.setMode(be.LINE_LOOP):_.setMode(be.LINE_STRIP)}else r.isPoints?_.setMode(be.POINTS):r.isSprite&&_.setMode(be.TRIANGLES);if(r.isBatchedMesh)_.renderMultiDraw(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount);else if(r.isInstancedMesh)_.renderInstances(d,f,r.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);_.renderInstances(d,f,t)}else _.render(d,f)},this.compile=function(e,t,n=null){null===n&&(n=e),g=me.get(n),g.init(),v.push(g),n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(g.pushLight(e),e.castShadow&&g.pushShadow(e))})),e!==n&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(g.pushLight(e),e.castShadow&&g.pushShadow(e))})),g.setupLights(y._useLegacyLights);const i=new Set;return e.traverse((function(e){const t=e.material;if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++){const a=t[r];prepareMaterial(a,n,e),i.add(a)}else prepareMaterial(t,n,e),i.add(t)})),v.pop(),g=null,i},this.compileAsync=function(e,t,n=null){const i=this.compile(e,t,n);return new Promise((t=>{function checkMaterialsReady(){i.forEach((function(e){ae.get(e).currentProgram.isReady()&&i.delete(e)})),0!==i.size?setTimeout(checkMaterialsReady,10):t(e)}null!==te.get("KHR_parallel_shader_compile")?checkMaterialsReady():setTimeout(checkMaterialsReady,10)}))};let Re=null;function onXRSessionStart(){we.stop()}function onXRSessionEnd(){we.start()}const we=new WebGLAnimation;function projectObject(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)g.pushLight(e),e.castShadow&&g.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Y.intersectsSprite(e)){i&&$.setFromMatrixPosition(e.matrixWorld).applyMatrix4(J);const t=ue.update(e),r=e.material;r.visible&&m.push(e,t,r,n,$.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||Y.intersectsObject(e))){const t=ue.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),$.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),$.copy(t.boundingSphere.center)),$.applyMatrix4(e.matrixWorld).applyMatrix4(J)),Array.isArray(r)){const i=t.groups;for(let a=0,s=i.length;a<s;a++){const s=i[a],o=r[s.materialIndex];o&&o.visible&&m.push(e,t,o,n,$.z,s)}}else r.visible&&m.push(e,t,r,n,$.z,null)}const r=e.children;for(let e=0,a=r.length;e<a;e++)projectObject(r[e],t,n,i)}function renderScene(e,t,n,i){const r=e.opaque,s=e.transmissive,o=e.transparent;g.setupLightsView(n),!0===K&&ge.setGlobalState(y.clippingPlanes,n),s.length>0&&function renderTransmissionPass(e,t,n,i){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;if(null===g.state.transmissionRenderTarget){g.state.transmissionRenderTarget=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")||te.has("EXT_color_buffer_float")?E:M,minFilter:x,samples:4,stencilBuffer:a});ae.get(g.state.transmissionRenderTarget).__isTransmissionRenderTarget=!0}const r=g.state.transmissionRenderTarget;y.getDrawingBufferSize(Q),r.setSize(Q.x,Q.y);const s=y.getRenderTarget();y.setRenderTarget(r),y.getClearColor(O),F=y.getClearAlpha(),F<1&&y.setClearColor(16777215,.5);y.clear();const o=y.toneMapping;y.toneMapping=0,renderObjects(e,n,i),se.updateMultisampleRenderTarget(r),se.updateRenderTargetMipmap(r);let l=!1;for(let e=0,r=t.length;e<r;e++){const r=t[e],a=r.object,s=r.geometry,o=r.material,c=r.group;if(2===o.side&&a.layers.test(i.layers)){const e=o.side;o.side=1,o.needsUpdate=!0,renderObject(a,n,i,s,o,c),o.side=e,o.needsUpdate=!0,l=!0}}!0===l&&(se.updateMultisampleRenderTarget(r),se.updateRenderTargetMipmap(r));y.setRenderTarget(s),y.setClearColor(O,F),y.toneMapping=o}(r,s,t,n),i&&ie.viewport(D.copy(i)),r.length>0&&renderObjects(r,t,n),s.length>0&&renderObjects(s,t,n),o.length>0&&renderObjects(o,t,n),ie.buffers.depth.setTest(!0),ie.buffers.depth.setMask(!0),ie.buffers.color.setMask(!0),ie.setPolygonOffset(!1)}function renderObjects(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){const a=e[r],s=a.object,o=a.geometry,l=null===i?a.material:i,c=a.group;s.layers.test(n.layers)&&renderObject(s,t,n,o,l,c)}}function renderObject(e,t,n,i,r,a){e.onBeforeRender(y,t,n,i,r,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(y,t,n,i,e,a),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,a),r.side=0,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,a),r.side=2):y.renderBufferDirect(n,t,i,r,e,a),e.onAfterRender(y,t,n,i,r,a)}function getProgram(e,t,n){!0!==t.isScene&&(t=ee);const i=ae.get(e),r=g.state.lights,a=g.state.shadowsArray,s=r.state.version,o=de.getParameters(e,r.state,a,t,n),l=de.getProgramCacheKey(o);let c=i.programs;i.environment=e.isMeshStandardMaterial?t.environment:null,i.fog=t.fog,i.envMap=(e.isMeshStandardMaterial?le:oe).get(e.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===c&&(e.addEventListener("dispose",onMaterialDispose),c=new Map,i.programs=c);let h=c.get(l);if(void 0!==h){if(i.currentProgram===h&&i.lightsStateVersion===s)return updateCommonMaterialProperties(e,o),h}else o.uniforms=de.getUniforms(e),e.onBuild(n,o,y),e.onBeforeCompile(o,y),h=de.acquireProgram(o,l),c.set(l,h),i.uniforms=o.uniforms;const u=i.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(u.clippingPlanes=ge.uniform),updateCommonMaterialProperties(e,o),i.needsLights=function materialNeedsLights(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=s,i.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.ltc_1.value=r.state.rectAreaLTC1,u.ltc_2.value=r.state.rectAreaLTC2,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotLightMatrix.value=r.state.spotLightMatrix,u.spotLightMap.value=r.state.spotLightMap,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix),i.currentProgram=h,i.uniformsList=null,h}function getUniformList(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=WebGLUniforms.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function updateCommonMaterialProperties(e,t){const n=ae.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}we.setAnimationLoop((function onAnimationFrame(e){Re&&Re(e)})),"undefined"!=typeof self&&we.setContext(self),this.setAnimationLoop=function(e){Re=e,Ae.setAnimationLoop(e),null===e?we.stop():we.start()},Ae.addEventListener("sessionstart",onXRSessionStart),Ae.addEventListener("sessionend",onXRSessionEnd),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void i.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===R)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===Ae.enabled&&!0===Ae.isPresenting&&(!0===Ae.cameraAutoUpdate&&Ae.updateCamera(t),t=Ae.getCamera()),!0===e.isScene&&e.onBeforeRender(y,e,t,P),g=me.get(e,v.length),g.init(),v.push(g),J.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Y.setFromProjectionMatrix(J),Z=this.localClippingEnabled,K=ge.init(this.clippingPlanes,Z),m=fe.get(e,_.length),m.init(),_.push(m),projectObject(e,t,0,y.sortObjects),m.finish(),!0===y.sortObjects&&m.sort(k,W),this.info.render.frame++,!0===K&&ge.beginShadows();const n=g.state.shadowsArray;if(_e.render(n,e,t),!0===K&&ge.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1!==Ae.enabled&&!1!==Ae.isPresenting&&!1!==Ae.hasDepthSensing()||ve.render(m,e),g.setupLights(y._useLegacyLights),t.isArrayCamera){const n=t.cameras;for(let t=0,i=n.length;t<i;t++){const i=n[t];renderScene(m,e,i,i.viewport)}}else renderScene(m,e,t);null!==P&&(se.updateMultisampleRenderTarget(P),se.updateRenderTargetMipmap(P)),!0===e.isScene&&e.onAfterRender(y,e,t),Te.resetDefaultState(),L=-1,U=null,v.pop(),g=v.length>0?v[v.length-1]:null,_.pop(),m=_.length>0?_[_.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return C},this.getRenderTarget=function(){return P},this.setRenderTargetTextures=function(e,t,n){ae.get(e.texture).__webglTexture=t,ae.get(e.depthTexture).__webglTexture=n;const r=ae.get(e);r.__hasExternalTextures=!0,r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===te.has("WEBGL_multisampled_render_to_texture")&&(i.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const n=ae.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){P=e,w=t,C=n;let i=!0,r=null,a=!1,s=!1;if(e){const o=ae.get(e);void 0!==o.__useDefaultFramebuffer?(ie.bindFramebuffer(be.FRAMEBUFFER,null),i=!1):void 0===o.__webglFramebuffer?se.setupRenderTarget(e):o.__hasExternalTextures&&se.rebindTextures(e,ae.get(e.texture).__webglTexture,ae.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(s=!0);const c=ae.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],a=!0):r=e.samples>0&&!1===se.useMultisampledRTT(e)?ae.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,D.copy(e.viewport),I.copy(e.scissor),N=e.scissorTest}else D.copy(X).multiplyScalar(z).floor(),I.copy(j).multiplyScalar(z).floor(),N=q;if(ie.bindFramebuffer(be.FRAMEBUFFER,r)&&i&&ie.drawBuffers(e,r),ie.viewport(D),ie.scissor(I),ie.setScissorTest(N),a){const i=ae.get(e.texture);be.framebufferTexture2D(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,be.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(s){const i=ae.get(e.texture),r=t||0;be.framebufferTextureLayer(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}L=-1},this.readRenderTargetPixels=function(e,t,n,r,a,s,o){if(!e||!e.isWebGLRenderTarget)return void i.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=ae.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(l=l[o]),l){ie.bindFramebuffer(be.FRAMEBUFFER,l);try{const o=e.texture,l=o.format,c=o.type;if(l!==A&&Se.convert(l)!==be.getParameter(be.IMPLEMENTATION_COLOR_READ_FORMAT))return void i.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=c===E&&(te.has("EXT_color_buffer_half_float")||te.has("EXT_color_buffer_float"));if(c!==M&&Se.convert(c)!==be.getParameter(be.IMPLEMENTATION_COLOR_READ_TYPE)&&c!==T&&!h)return void i.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-a&&be.readPixels(t,n,r,a,Se.convert(l),Se.convert(c),s)}finally{const e=null!==P?ae.get(P).__webglFramebuffer:null;ie.bindFramebuffer(be.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const i=Math.pow(2,-n),r=Math.floor(t.image.width*i),a=Math.floor(t.image.height*i);se.setTexture2D(t,0),be.copyTexSubImage2D(be.TEXTURE_2D,n,0,0,e.x,e.y,r,a),ie.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i=0){const r=t.image.width,a=t.image.height,s=Se.convert(n.format),o=Se.convert(n.type);se.setTexture2D(n,0),be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,n.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,n.unpackAlignment),t.isDataTexture?be.texSubImage2D(be.TEXTURE_2D,i,e.x,e.y,r,a,s,o,t.image.data):t.isCompressedTexture?be.compressedTexSubImage2D(be.TEXTURE_2D,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,s,t.mipmaps[0].data):be.texSubImage2D(be.TEXTURE_2D,i,e.x,e.y,s,o,t.image),0===i&&n.generateMipmaps&&be.generateMipmap(be.TEXTURE_2D),ie.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,a=0){const s=Math.round(e.max.x-e.min.x),o=Math.round(e.max.y-e.min.y),l=e.max.z-e.min.z+1,c=Se.convert(r.format),h=Se.convert(r.type);let u;if(r.isData3DTexture)se.setTexture3D(r,0),u=be.TEXTURE_3D;else{if(!r.isDataArrayTexture&&!r.isCompressedArrayTexture)return void i.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");se.setTexture2DArray(r,0),u=be.TEXTURE_2D_ARRAY}be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,r.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,r.unpackAlignment);const d=be.getParameter(be.UNPACK_ROW_LENGTH),p=be.getParameter(be.UNPACK_IMAGE_HEIGHT),f=be.getParameter(be.UNPACK_SKIP_PIXELS),m=be.getParameter(be.UNPACK_SKIP_ROWS),g=be.getParameter(be.UNPACK_SKIP_IMAGES),_=n.isCompressedTexture?n.mipmaps[a]:n.image;be.pixelStorei(be.UNPACK_ROW_LENGTH,_.width),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,_.height),be.pixelStorei(be.UNPACK_SKIP_PIXELS,e.min.x),be.pixelStorei(be.UNPACK_SKIP_ROWS,e.min.y),be.pixelStorei(be.UNPACK_SKIP_IMAGES,e.min.z),n.isDataTexture||n.isData3DTexture?be.texSubImage3D(u,a,t.x,t.y,t.z,s,o,l,c,h,_.data):r.isCompressedArrayTexture?be.compressedTexSubImage3D(u,a,t.x,t.y,t.z,s,o,l,c,_.data):be.texSubImage3D(u,a,t.x,t.y,t.z,s,o,l,c,h,_),be.pixelStorei(be.UNPACK_ROW_LENGTH,d),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,p),be.pixelStorei(be.UNPACK_SKIP_PIXELS,f),be.pixelStorei(be.UNPACK_SKIP_ROWS,m),be.pixelStorei(be.UNPACK_SKIP_IMAGES,g),0===a&&r.generateMipmaps&&be.generateMipmap(u),ie.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?se.setTextureCube(e,0):e.isData3DTexture?se.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?se.setTexture2DArray(e,0):se.setTexture2D(e,0),ie.unbindTexture()},this.resetState=function(){w=0,C=0,P=null,ie.reset(),Te.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Q}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===k?"display-p3":"srgb",t.unpackColorSpace=ce.workingColorSpace===W?"display-p3":"srgb"}get useLegacyLights(){return i.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){i.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class MeshLambertMaterial extends Material{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function convertArray(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}class Interpolant{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{let a;n:{i:if(!(e<i)){for(let a=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=i,i=t[++n],e<i)break t}a=t.length;break n}if(e>=r)break e;{const s=t[1];e<s&&(n=2,r=s);for(let a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(i=r,r=t[--n-1],e>=r)break t}a=n,n=0}}for(;n<a;){const i=n+a>>>1;e<t[i]?a=i:n=i+1}if(i=t[n],r=t[n-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let e=0;e!==i;++e)t[e]=n[r+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class CubicInterpolant extends Interpolant{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:F,endingEnd:F}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,a=e+1,s=i[r],o=i[a];if(void 0===s)switch(this.getSettings_().endingStart){case V:r=e,s=2*t-n;break;case B:r=i.length-2,s=t+i[r]-i[r+1];break;default:r=e,s=n}if(void 0===o)switch(this.getSettings_().endingEnd){case V:a=e,o=2*n-t;break;case B:a=1,o=n+i[1]-i[0];break;default:a=e-1,o=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-n),this._offsetPrev=r*c,this._offsetNext=a*c}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(n-t)/(i-t),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,_=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let e=0;e!==s;++e)r[e]=g*a[c+e]+_*a[l+e]+v*a[o+e]+x*a[h+e];return r}}class LinearInterpolant extends Interpolant{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=(n-t)/(i-t),h=1-c;for(let e=0;e!==s;++e)r[e]=a[l+e]*h+a[o+e]*c;return r}}class DiscreteInterpolant extends Interpolant{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class KeyframeTrack{constructor(e,t,n,i){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=convertArray(t,this.TimeBufferType),this.values=convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:convertArray(e.times,Array),values:convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new LinearInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new CubicInterpolant(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case I:t=this.InterpolantFactoryMethodDiscrete;break;case N:t=this.InterpolantFactoryMethodLinear;break;case O:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return i.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return I;case this.InterpolantFactoryMethodLinear:return N;case this.InterpolantFactoryMethodSmooth:return O}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const e=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(i.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,a=n.length;0===a&&(i.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==a;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){i.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==s&&s>r){i.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,s),e=!1;break}s=r}if(void 0!==r&&isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){i.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===O,r=e.length-1;let a=1;for(let s=1;s<r;++s){let r=!1;const o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0]))if(i)r=!0;else{const e=s*n,i=e-n,a=e+n;for(let s=0;s!==n;++s){const n=t[e+s];if(n!==t[i+s]||n!==t[a+s]){r=!0;break}}}if(r){if(s!==a){e[a]=e[s];const i=s*n,r=a*n;for(let e=0;e!==n;++e)t[r+e]=t[i+e]}++a}}if(r>0){e[a]=e[r];for(let e=r*n,i=a*n,s=0;s!==n;++s)t[i+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=N;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=I,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(i-t);let l=e*s;for(let e=l+s;l!==e;l+=4)Quaternion.slerpFlat(r,0,a,l-s,a,l,o);return r}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.DefaultInterpolation=N,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=I,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";const kn={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class LoadingManager{constructor(e,t,n){const i=this;let r,a=!1,s=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===a&&void 0!==i.onStart&&i.onStart(e,s,o),a=!0},this.itemEnd=function(e){s++,void 0!==i.onProgress&&i.onProgress(e,s,o),s===o&&(a=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return r?r(e):e},this.setURLModifier=function(e){return r=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],i=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return i}return null}}}const Wn=new LoadingManager;class Loader{constructor(e){this.manager=void 0!==e?e:Wn,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(i,r){n.load(e,i,t,r)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Loader.DEFAULT_MATERIAL_NAME="__DEFAULT";Error;class ImageLoader extends Loader{constructor(e){super(e)}load(e,t,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=kn.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;const s=createElementNS("img");function onImageLoad(){removeEventListeners(),kn.add(e,this),t&&t(this),r.manager.itemEnd(e)}function onImageError(t){removeEventListeners(),i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}function removeEventListeners(){s.removeEventListener("load",onImageLoad,!1),s.removeEventListener("error",onImageError,!1)}return s.addEventListener("load",onImageLoad,!1),s.addEventListener("error",onImageError,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(e),s.src=e,s}}class TextureLoader extends Loader{constructor(e){super(e)}load(e,t,n,i){const r=new Texture,a=new ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)}),n,i),r}}class Clock{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function now(){return("undefined"==typeof performance?Date:performance).now()}const Xn="\\[\\]\\.:\\/",jn=new RegExp("[\\[\\]\\.:\\/]","g"),qn="[^\\[\\]\\.:\\/]",Yn="[^"+Xn.replace("\\.","")+"]",Kn=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",qn)+/(WCOD+)?/.source.replace("WCOD",Yn)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",qn)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",qn)+"$"),Zn=["material","materials","bones","map"];class PropertyBinding{constructor(e,t,n){this.path=t,this.parsedPath=n||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,n):new PropertyBinding(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(jn,"")}static parseTrackName(e){const t=Kn.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=n.nodeName.substring(i+1);-1!==Zn.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const searchNodeSubtree=function(e){for(let n=0;n<e.length;n++){const i=e[n];if(i.name===t||i.uuid===t)return i;const r=searchNodeSubtree(i.children);if(r)return r}return null},n=searchNodeSubtree(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let a=t.propertyIndex;if(e||(e=PropertyBinding.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void i.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void i.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void i.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void i.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void i.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void i.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void i.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void i.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const s=e[r];if(void 0===s){const n=t.nodeName;return void i.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(void 0!==a){if("morphTargetInfluences"===r){if(!e.geometry)return void i.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void i.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[a]&&(a=e.morphTargetDictionary[a])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}PropertyBinding.Composite=class Composite{constructor(e,t,n){const i=n||PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},PropertyBinding.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},PropertyBinding.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},PropertyBinding.prototype.GetterByBindingType=[PropertyBinding.prototype._getValue_direct,PropertyBinding.prototype._getValue_array,PropertyBinding.prototype._getValue_arrayElement,PropertyBinding.prototype._getValue_toArray],PropertyBinding.prototype.SetterByBindingTypeAndVersioning=[[PropertyBinding.prototype._setValue_direct,PropertyBinding.prototype._setValue_direct_setNeedsUpdate,PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_array,PropertyBinding.prototype._setValue_array_setNeedsUpdate,PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_arrayElement,PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_fromArray,PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1);const Jn=new Matrix4;class Raycaster{constructor(e,t,n=0,i=1/0){this.ray=new Ray(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Layers,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):i.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Jn.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Jn),this}intersectObject(e,t=!0,n=[]){return intersect(e,this,n,t),n.sort(ascSort),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)intersect(e[i],this,n,t);return n.sort(ascSort),n}}function ascSort(e,t){return e.distance-t.distance}function intersect(e,t,n,i){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===i){const i=e.children;for(let e=0,r=i.length;e<r;e++)intersect(i[e],t,n,!0)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:r}})),"undefined"!=typeof window&&(window.__THREE__?i.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=r)},92528:(e,t,n)=>{n.d(t,{x:()=>EffectComposer});var i=n(82042);const r={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};var a=n(48655),s=n(37982);class MaskPass extends s.w{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const i=e.getContext(),r=e.state;let a,s;r.buffers.color.setMask(!1),r.buffers.depth.setMask(!1),r.buffers.color.setLocked(!0),r.buffers.depth.setLocked(!0),this.inverse?(a=0,s=1):(a=1,s=0),r.buffers.stencil.setTest(!0),r.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),r.buffers.stencil.setFunc(i.ALWAYS,a,4294967295),r.buffers.stencil.setClear(s),r.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),r.buffers.color.setLocked(!1),r.buffers.depth.setLocked(!1),r.buffers.color.setMask(!0),r.buffers.depth.setMask(!0),r.buffers.stencil.setLocked(!1),r.buffers.stencil.setFunc(i.EQUAL,1,4294967295),r.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),r.buffers.stencil.setLocked(!0)}}class ClearMaskPass extends s.w{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class EffectComposer{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),void 0===t){const n=e.getSize(new i.FM8);this._width=n.width,this._height=n.height,(t=new i.dd2(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:i.cLu})).texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new a.T(r),this.copyPass.material.blending=i.jFi,this.clock=new i.SUY}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let t=0,i=this.passes.length;t<i;t++){const i=this.passes[t];if(!1!==i.enabled){if(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(t),i.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),i.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==MaskPass&&(i instanceof MaskPass?n=!0:i instanceof ClearMaskPass&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new i.FM8);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let e=0;e<this.passes.length;e++)this.passes[e].setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}},37982:(e,t,n)=>{n.d(t,{T:()=>FullScreenQuad,w:()=>Pass});var i=n(82042),r=n(25108);class Pass{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){r.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const a=new i.iKG(-1,1,1,-1,0,1);class FullscreenTriangleGeometry extends i.u9r{constructor(){super(),this.setAttribute("position",new i.a$l([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new i.a$l([0,2,0,0,2,0],2))}}const s=new FullscreenTriangleGeometry;class FullScreenQuad{constructor(e){this._mesh=new i.Kj0(s,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,a)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}},3259:(e,t,n)=>{n.d(t,{C:()=>RenderPass});var i=n(82042),r=n(37982);class RenderPass extends r.w{constructor(e,t,n=null,r=null,a=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=a,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new i.Ilk}render(e,t,n){const i=e.autoClear;let r,a;e.autoClear=!1,null!==this.overrideMaterial&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),null!==this.clearAlpha&&(r=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),null!==this.clearColor&&e.setClearColor(this._oldClearColor),null!==this.clearAlpha&&e.setClearAlpha(r),null!==this.overrideMaterial&&(this.scene.overrideMaterial=a),e.autoClear=i}}},48655:(e,t,n)=>{n.d(t,{T:()=>ShaderPass});var i=n(82042),r=n(37982);class ShaderPass extends r.w{constructor(e,t){super(),this.textureID=void 0!==t?t:"tDiffuse",e instanceof i.jyz?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=i.rDY.clone(e.uniforms),this.material=new i.jyz({name:void 0!==e.name?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new r.T(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}},27754:(e,t,n)=>{n.d(t,{F:()=>Vector2});n(25108);Math.PI,Math.PI;function clamp(e,t,n){return Math.max(t,Math.min(n,e))}class Vector2{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}}}]);