@uptimizr/dashboard 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +4 -4
  3. package/out/__next._full.txt +11 -11
  4. package/out/__next._head.txt +4 -4
  5. package/out/__next._index.txt +4 -4
  6. package/out/__next._tree.txt +2 -2
  7. package/out/_next/static/chunks/002cjeoit6-up.js +1 -0
  8. package/out/_next/static/chunks/02n1uiltexy3w.js +1 -0
  9. package/out/_next/static/chunks/03ab2khhe8-x5.js +1 -0
  10. package/out/_next/static/chunks/04_yytpc2paxy.js +1 -0
  11. package/out/_next/static/chunks/06qot1qvlsqaz.js +1 -0
  12. package/out/_next/static/chunks/07eeopuufsqp-.js +1501 -0
  13. package/out/_next/static/chunks/08a5xek662n8n.js +1 -0
  14. package/out/_next/static/chunks/08wuc9--s8zn_.js +1 -0
  15. package/out/_next/static/chunks/0927l-ygd5c8d.js +1 -0
  16. package/out/_next/static/chunks/09510356f0lad.js +1 -0
  17. package/out/_next/static/chunks/0_eu72k69lxj7.js +1 -0
  18. package/out/_next/static/chunks/0beajlqy8p8b5.js +1 -0
  19. package/out/_next/static/chunks/0c83pe1mpx456.js +1 -0
  20. package/out/_next/static/chunks/0echnagbkyx79.js +1198 -0
  21. package/out/_next/static/chunks/0eh1ml86u8dh7.js +1 -0
  22. package/out/_next/static/chunks/0fh-9h9ylxskr.js +674 -0
  23. package/out/_next/static/chunks/0fzmc1up21g1i.js +1 -0
  24. package/out/_next/static/chunks/0g_v2zswo4l6f.js +1 -0
  25. package/out/_next/static/chunks/0grlb9lo8e502.js +1 -0
  26. package/out/_next/static/chunks/0h22pg-0xrxnm.js +1 -0
  27. package/out/_next/static/chunks/0j6p1pmc14t96.js +1 -0
  28. package/out/_next/static/chunks/0j_6dx-sttgsy.js +1 -0
  29. package/out/_next/static/chunks/0j__xaq_8_di1.js +1 -0
  30. package/out/_next/static/chunks/0kfd-cvj5fvtz.js +1 -0
  31. package/out/_next/static/chunks/0o_mp98xzqfyf.js +1 -0
  32. package/out/_next/static/chunks/0otsec99kdkt7.js +213 -0
  33. package/out/_next/static/chunks/0ql-s-tsmel_u.js +151 -0
  34. package/out/_next/static/chunks/0r47gs_e93cka.js +1 -0
  35. package/out/_next/static/chunks/0sqys6o2pbe1q.js +1328 -0
  36. package/out/_next/static/chunks/0titqrn1qmcsv.js +1 -0
  37. package/out/_next/static/chunks/0tnlbw78tgaxp.js +4 -0
  38. package/out/_next/static/chunks/0tw4dyl-cp-hd.js +1 -0
  39. package/out/_next/static/chunks/0vbce-8omgurc.js +1 -0
  40. package/out/_next/static/chunks/0vfsg5byzep_0.js +1 -0
  41. package/out/_next/static/chunks/{0gv7mblzv3dl3.js → 0w8_1yjvol1f0.js} +20 -20
  42. package/out/_next/static/chunks/0xh144a5fz58h.js +1 -0
  43. package/out/_next/static/chunks/0xjltg_pph0c8.js +1 -0
  44. package/out/_next/static/chunks/0yeqgh0dnas8d.js +1 -0
  45. package/out/_next/static/chunks/101-7e_7up7rk.js +1 -0
  46. package/out/_next/static/chunks/128e51hj_04r0.js +1 -0
  47. package/out/_next/static/chunks/{10fnxpln_5xfd.js → 12kv810lohbsx.js} +2 -2
  48. package/out/_next/static/chunks/137xbvd4nd41j.js +3 -0
  49. package/out/_next/static/chunks/14bws-suyy5zu.js +1 -0
  50. package/out/_next/static/chunks/14ggsmqwej_tt.js +1656 -0
  51. package/out/_next/static/chunks/17genz6pkmty_.js +1 -0
  52. package/out/_next/static/chunks/17xd8hnazzr0g.js +1454 -0
  53. package/out/_next/static/chunks/18dczy9ylt2s_.js +1 -0
  54. package/out/_next/static/chunks/18xs_kvsaolb0.js +1 -0
  55. package/out/_next/static/chunks/19016f8-ry0z6.js +1 -0
  56. package/out/_next/static/chunks/1_6oejyxj39li.js +1 -0
  57. package/out/_next/static/chunks/1_aon8nz9p1fr.js +1 -0
  58. package/out/_next/static/chunks/1_qzlkuxukhpq.js +779 -0
  59. package/out/_next/static/chunks/1akaj5rhgitn3.js +1 -0
  60. package/out/_next/static/chunks/1bvl1ws7b_3gn.js +1 -0
  61. package/out/_next/static/chunks/1cdbk6kxyr1c9.js +1 -0
  62. package/out/_next/static/chunks/1fbjkk55uu4_g.js +1 -0
  63. package/out/_next/static/chunks/1furcfsgrw_3g.js +1 -0
  64. package/out/_next/static/chunks/1g0-f1g3gn_rs.js +1 -0
  65. package/out/_next/static/chunks/1g7emwu85bifo.js +557 -0
  66. package/out/_next/static/chunks/{37vzwr3ciejf1.js → 1gs-5722l4u59.js} +1 -1
  67. package/out/_next/static/chunks/1gt4kh0_xmigy.js +1 -0
  68. package/out/_next/static/chunks/1h8xzuuhhglu9.js +1 -0
  69. package/out/_next/static/chunks/1hatz-jlztrn0.js +1 -0
  70. package/out/_next/static/chunks/1iioifo7i0t0_.js +1 -0
  71. package/out/_next/static/chunks/{0impkpmxx3ttp.js → 1iiz7jqgj20z0.js} +1 -1
  72. package/out/_next/static/chunks/1kujmd5n0j9nk.js +1 -0
  73. package/out/_next/static/chunks/{2kazjq29jeamx.js → 1ltux4lwz7muf.js} +160 -372
  74. package/out/_next/static/chunks/1m_buecgcq67j.js +740 -0
  75. package/out/_next/static/chunks/1n9sy0yt5d2vq.js +1 -0
  76. package/out/_next/static/chunks/1p1gz6dseck--.js +1 -0
  77. package/out/_next/static/chunks/1p1xtsfwvpuqo.js +1 -0
  78. package/out/_next/static/chunks/1p8f6okk2ewbz.js +1 -0
  79. package/out/_next/static/chunks/1qg_etglhvp9h.js +740 -0
  80. package/out/_next/static/chunks/1th_t5ujeqlkf.js +1 -0
  81. package/out/_next/static/chunks/1thr-mdzbu96v.js +1 -0
  82. package/out/_next/static/chunks/1tta1a064979p.js +1 -0
  83. package/out/_next/static/chunks/1u_riwm0nfww7.js +1 -0
  84. package/out/_next/static/chunks/1ua15kzid0_8p.js +2560 -0
  85. package/out/_next/static/chunks/1uu-rt_8p1edp.js +2712 -0
  86. package/out/_next/static/chunks/1uu93wuxigx4k.js +1 -0
  87. package/out/_next/static/chunks/{1flb8adpj6_2o.js → 1xpwp4m1tqugp.js} +1 -1
  88. package/out/_next/static/chunks/1ynju1jqfrcv0.js +1 -0
  89. package/out/_next/static/chunks/1zfojlgb15okk.js +1 -0
  90. package/out/_next/static/chunks/1zj8x5wbgnzz-.js +1 -0
  91. package/out/_next/static/chunks/1zl6t15gh34nn.js +1 -0
  92. package/out/_next/static/chunks/{1thjncpj7u6pq.js → 223vrr_4sfhsj.js} +1 -1
  93. package/out/_next/static/chunks/22cr2b04btguf.js +1 -0
  94. package/out/_next/static/chunks/242xhzxxetctz.js +1 -0
  95. package/out/_next/static/chunks/24essz5mmvx-6.js +1 -0
  96. package/out/_next/static/chunks/256k1jw1m--l7.js +146 -0
  97. package/out/_next/static/chunks/259obyrpxcv6r.js +1 -0
  98. package/out/_next/static/chunks/26v9yqicofqba.js +1 -0
  99. package/out/_next/static/chunks/290d93hmm_e8b.js +1 -0
  100. package/out/_next/static/chunks/2_2fk7iddrs43.js +1 -0
  101. package/out/_next/static/chunks/{00k_j_r7bv_eb.js → 2bjlls8-qe05r.js} +9 -9
  102. package/out/_next/static/chunks/2ckd7f1wbfod-.js +1 -0
  103. package/out/_next/static/chunks/{163fa70v4mgxj.js → 2d6hru4qo23tt.js} +1 -1
  104. package/out/_next/static/chunks/2ejvntxtvf5o9.js +1 -0
  105. package/out/_next/static/chunks/2f7_3tzf7xhps.js +1 -0
  106. package/out/_next/static/chunks/2gxd_o1g89_bv.js +1 -0
  107. package/out/_next/static/chunks/2hd2txb4-m9k1.js +1 -0
  108. package/out/_next/static/chunks/2hpxou_cnp4f_.js +1 -0
  109. package/out/_next/static/chunks/2izioctrfc0s5.js +1 -0
  110. package/out/_next/static/chunks/2jhnk4h4n0udv.js +1 -0
  111. package/out/_next/static/chunks/2jpkhkk9zi8-f.js +1 -0
  112. package/out/_next/static/chunks/2kpet_l1kq2sx.js +1 -0
  113. package/out/_next/static/chunks/2mdbvf1b5h00_.css +3 -0
  114. package/out/_next/static/chunks/2nck5w4c7leb7.js +1 -0
  115. package/out/_next/static/chunks/2our10fwtj87e.js +1 -0
  116. package/out/_next/static/chunks/2qq3uzsbiicw3.js +1194 -0
  117. package/out/_next/static/chunks/2qqqpu0ahfdda.js +1 -0
  118. package/out/_next/static/chunks/2u-f7mmxvk8wj.js +1 -0
  119. package/out/_next/static/chunks/2ue1wo4ryk87z.js +1 -0
  120. package/out/_next/static/chunks/2uk-vwlxe9-xr.js +1 -0
  121. package/out/_next/static/chunks/2ur5-lxdvv1jm.js +1 -0
  122. package/out/_next/static/chunks/2veqsohwfhfqc.js +1 -0
  123. package/out/_next/static/chunks/2vqlv9wnewhu9.js +1 -0
  124. package/out/_next/static/chunks/{1zvc1tv--w8nn.js → 2wzshintp5lf8.js} +1 -1
  125. package/out/_next/static/chunks/2x-00glogc485.js +1 -0
  126. package/out/_next/static/chunks/2yfxy0f5fqs4o.js +1 -0
  127. package/out/_next/static/chunks/2z88mt3ixktu3.js +1 -0
  128. package/out/_next/static/chunks/2z_jn9ud28fk7.js +1 -0
  129. package/out/_next/static/chunks/3-eswqjobiqk1.js +1 -0
  130. package/out/_next/static/chunks/30-tbi7pys6fp.js +4 -0
  131. package/out/_next/static/chunks/30c-nsedy_ce0.js +1 -0
  132. package/out/_next/static/chunks/31u5lbu1vxznh.js +1 -0
  133. package/out/_next/static/chunks/{2feca0xcipcyt.js → 32ahba5ezp467.js} +156 -156
  134. package/out/_next/static/chunks/337hn35kts7ud.js +1 -0
  135. package/out/_next/static/chunks/33dgpebv-tf73.js +1 -0
  136. package/out/_next/static/chunks/36jkdhq6kb-cf.js +1 -0
  137. package/out/_next/static/chunks/37epa8fz59vba.js +1166 -0
  138. package/out/_next/static/chunks/3833xfnz0a-ub.js +1 -0
  139. package/out/_next/static/chunks/38awrh_qxn22k.js +1 -0
  140. package/out/_next/static/chunks/{0wrm9jr-9bw0e.js → 38x3c1ra5slhe.js} +383 -913
  141. package/out/_next/static/chunks/39idqlqlcp5b9.js +1 -0
  142. package/out/_next/static/chunks/{2a3spdq-m8drh.js → 3_gku1pwluoo0.js} +1 -1
  143. package/out/_next/static/chunks/3_mu-4rdjajna.js +1450 -0
  144. package/out/_next/static/chunks/3coacc4-g-g5c.js +1 -0
  145. package/out/_next/static/chunks/3e00fzdfkclzq.js +1 -0
  146. package/out/_next/static/chunks/3e8fmlq0k5wkg.js +1 -0
  147. package/out/_next/static/chunks/3e9tzyrt4_98z.js +1 -0
  148. package/out/_next/static/chunks/3edelqkq92pil.js +1 -0
  149. package/out/_next/static/chunks/3figbil1t4ssj.js +593 -0
  150. package/out/_next/static/chunks/3gimb3z_mteou.js +1 -0
  151. package/out/_next/static/chunks/{2p2vv6cc9i-3q.js → 3idaz_s77e-j_.js} +9 -9
  152. package/out/_next/static/chunks/3j-4wuhs5weba.js +1 -0
  153. package/out/_next/static/chunks/3jjfnwvybayy7.js +1 -0
  154. package/out/_next/static/chunks/3jwm5dfk_78gc.js +1 -0
  155. package/out/_next/static/chunks/3k9d4ylc3li2t.js +1352 -0
  156. package/out/_next/static/chunks/3l3_0ack3gy4k.js +1 -0
  157. package/out/_next/static/chunks/3lwhs5ja7tun3.js +1 -0
  158. package/out/_next/static/chunks/3m6nmp2dca6un.js +1342 -0
  159. package/out/_next/static/chunks/3mbnfpufs2-7e.js +7 -0
  160. package/out/_next/static/chunks/3mcd08gmt038z.js +1 -0
  161. package/out/_next/static/chunks/3mt5th7b1i_u9.js +1 -0
  162. package/out/_next/static/chunks/3ne77mjdz2y7o.js +1 -0
  163. package/out/_next/static/chunks/3puhrqtujktyv.js +1 -0
  164. package/out/_next/static/chunks/3rdifucupcgkg.js +1 -0
  165. package/out/_next/static/chunks/3riekaxl3uxfb.js +1195 -0
  166. package/out/_next/static/chunks/3sdoskq_buttj.js +1 -0
  167. package/out/_next/static/chunks/3tg-ma9tv9xu4.js +1 -0
  168. package/out/_next/static/chunks/3tm-pqpmq_ppw.js +1 -0
  169. package/out/_next/static/chunks/3w9go565cjhq3.js +1636 -0
  170. package/out/_next/static/chunks/3wi9gzq2mtr_q.js +8 -0
  171. package/out/_next/static/chunks/3xagd_2_9zft2.js +1 -0
  172. package/out/_next/static/chunks/3xsq_anpad-fb.js +1 -0
  173. package/out/_next/static/chunks/3ycv2qq7vpbua.js +1 -0
  174. package/out/_next/static/chunks/3z84au-mitjjw.js +1 -0
  175. package/out/_next/static/chunks/4030dhur2h70-.js +1 -0
  176. package/out/_next/static/chunks/40ffffml4h_3r.js +4 -0
  177. package/out/_next/static/chunks/{3-shckrcpvbxu.js → 41wt50z9tx9cx.js} +108 -711
  178. package/out/_next/static/chunks/431slrqh0wa0g.js +1 -0
  179. package/out/_next/static/chunks/43s_lbd1i2krj.js +1 -0
  180. package/out/_next/static/chunks/{0-2y-_oomza2l.js → 44nxswtahaq4w.js} +18 -18
  181. package/out/_next/static/chunks/45bwefvdpztfs.js +1 -0
  182. package/out/_next/static/chunks/{turbopack-0sgd6pfbe1fy6.js → turbopack-19105pdhzxp1x.js} +1 -1
  183. package/out/_not-found/__next._full.txt +9 -9
  184. package/out/_not-found/__next._head.txt +4 -4
  185. package/out/_not-found/__next._index.txt +4 -4
  186. package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
  187. package/out/_not-found/__next._not-found.txt +3 -3
  188. package/out/_not-found/__next._tree.txt +2 -2
  189. package/out/_not-found.html +1 -1
  190. package/out/_not-found.txt +9 -9
  191. package/out/index.html +1 -1
  192. package/out/index.txt +11 -11
  193. package/package.json +5 -4
  194. package/out/_next/static/chunks/068j6934u8j16.js +0 -1
  195. package/out/_next/static/chunks/09e4adtr6w0xe.js +0 -1
  196. package/out/_next/static/chunks/0_rf76jneiwal.js +0 -176
  197. package/out/_next/static/chunks/0aznt7717miff.js +0 -1
  198. package/out/_next/static/chunks/0cu-q5q3a7uf3.js +0 -1
  199. package/out/_next/static/chunks/0fskcfh9vbhtv.js +0 -1
  200. package/out/_next/static/chunks/0gg-ii7i6d_p6.js +0 -1
  201. package/out/_next/static/chunks/0tx1j_ghpz7rc.css +0 -3
  202. package/out/_next/static/chunks/0ufbyo1x3qkmo.js +0 -1
  203. package/out/_next/static/chunks/0wwcfw8i3j_zx.js +0 -1
  204. package/out/_next/static/chunks/0wwkrsvxwi57d.js +0 -1
  205. package/out/_next/static/chunks/0ys9-ozuluawt.js +0 -1
  206. package/out/_next/static/chunks/1-61zh4waha61.js +0 -1
  207. package/out/_next/static/chunks/10r_824wzt8hj.js +0 -1
  208. package/out/_next/static/chunks/123xxske5c9na.js +0 -1
  209. package/out/_next/static/chunks/13isnf0--pmx1.js +0 -1
  210. package/out/_next/static/chunks/157d9euci08yu.js +0 -1
  211. package/out/_next/static/chunks/18u58lorfahxi.js +0 -4
  212. package/out/_next/static/chunks/1_aahautsz2v_.js +0 -1
  213. package/out/_next/static/chunks/1o1d0p-v1z8ty.js +0 -1
  214. package/out/_next/static/chunks/1vdjn0pkoyypn.js +0 -1
  215. package/out/_next/static/chunks/1yehxf-fmeicg.js +0 -1
  216. package/out/_next/static/chunks/1zx2q-r32thv1.js +0 -4
  217. package/out/_next/static/chunks/2-sjjedfr0kfq.js +0 -1
  218. package/out/_next/static/chunks/25b9x-li-tvk2.js +0 -1
  219. package/out/_next/static/chunks/2aelw3far6rii.js +0 -1
  220. package/out/_next/static/chunks/2aor7m-wbis85.js +0 -1
  221. package/out/_next/static/chunks/2clzipqap01hp.js +0 -1
  222. package/out/_next/static/chunks/2fh-_9b6tqhvb.js +0 -1
  223. package/out/_next/static/chunks/2g5gecypj0rqe.js +0 -1
  224. package/out/_next/static/chunks/2szdcpl41-kzv.js +0 -1
  225. package/out/_next/static/chunks/2u6shh3oeycm-.js +0 -1
  226. package/out/_next/static/chunks/2unhhuv0arlcv.js +0 -1
  227. package/out/_next/static/chunks/2z5eqx5do5std.js +0 -1
  228. package/out/_next/static/chunks/310uz81hnnzsu.js +0 -1
  229. package/out/_next/static/chunks/3aqbf_wkg2sih.js +0 -3
  230. package/out/_next/static/chunks/3i3gbhccmhu7j.js +0 -210
  231. package/out/_next/static/chunks/3mqy-84_ul3t2.js +0 -1
  232. package/out/_next/static/chunks/3nz-dh9d7cehk.js +0 -1
  233. package/out/_next/static/chunks/3pufs8g4ui943.js +0 -1
  234. package/out/_next/static/chunks/3t06schbtqonl.js +0 -1
  235. package/out/_next/static/chunks/3v3-7fio3nw_t.js +0 -1
  236. package/out/_next/static/chunks/3v5ha25nxo43j.js +0 -1
  237. package/out/_next/static/chunks/3zskk1hxu3-_o.js +0 -1
  238. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_buildManifest.js +0 -0
  239. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_clientMiddlewareManifest.js +0 -0
  240. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24574,e=>{"use strict";class t{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=t._Counter++}}t._Counter=0,e.s(["DataBuffer",0,t])},18064,30419,29485,e=>{"use strict";e.s(["IsWrapper",0,function(e){return void 0===e.getPipelineContext}],18064),e.s(["WebGLShaderProcessor",0,class{constructor(){this.shaderLanguage=0}postProcessor(e,t,r,i,s){return s.drawBuffersExtensionDisabled&&(e=e.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g,"")),e}}],30419);let t=/(flat\s)?\s*varying\s*.*/;e.s(["WebGL2ShaderProcessor",0,class{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,r){return t.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,r){let i=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),r){let r=-1!==e.search(/layout *\(location *= *0\) *out/g),s=-1!==t.indexOf("#define DUAL_SOURCE_BLENDING");s&&(e="#extension GL_EXT_blend_func_extended : require\n"+e),e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(i||r?"":s?"layout(location = 0, index = 0) out vec4 glFragColor;\nlayout(location = 0, index = 1) out vec4 glFragColor2;\n":"layout(location = 0) out vec4 glFragColor;\n")+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e="invariant gl_Position;\n"+e),-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e}}],29485)},20483,e=>{"use strict";var t=e.i(24574);class r extends t.DataBuffer{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}e.s(["WebGLDataBuffer",0,r])},68179,e=>{"use strict";function t(e){let t=r(e),s=i(e);return t-e>e-s?s:t}function r(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}function i(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)-(e>>1)}e.s(["FloorPOT",0,i,"GetExponentOfTwo",0,function(e,s,a=2){let n;switch(a){case 1:n=i(e);break;case 2:n=t(e);break;default:n=r(e)}return Math.min(n,s)},"IsExponentOfTwo",0,function(e){let t=1;do t*=2;while(t<e)return t===e},"Mix",0,function(e,t,r){return e*(1-r)+t*r},"NearestPOT",0,t])},71379,40462,79814,e=>{"use strict";var t,r,i,s,a,n,_,l,h=e.i(99904),u=e.i(8881),o=e.i(76535),c=e.i(18064),g=e.i(13379),f=e.i(64545),d=e.i(30419),E=e.i(29485),T=e.i(20483),R=e.i(68179);class p{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&!(e=t.createTexture()))throw Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(let e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){return this._MSAARenderBuffers?.[e]??null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}e.s(["WebGLHardwareTexture",0,p],40462);var A=e.i(84201),x=e.i(75017),S=e.i(28799);function b(e){return 13===e||14===e||15===e||16===e||17===e||18===e||19===e}function m(e){return 13===e||17===e||18===e||19===e}e.s(["HasStencilAspect",0,m,"IsDepthTexture",0,b],79814);var B=e.i(41520),C=e.i(75405);class P{}class L extends o.AbstractEngine{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return h.Effect.ShadersRepository}static set ShadersRepository(e){h.Effect.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,r,i){let s;if(r=r||{},super(t??r.antialias,r,i),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=[],this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=[],this._currentInstanceLocations=[],this._currentInstanceBuffers=[],this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=[],this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;if(e.getContext){if(s=e,void 0===r.preserveDrawingBuffer&&(r.preserveDrawingBuffer=!1),void 0===r.xrCompatible&&(r.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const e=navigator.userAgent;for(const t of L.ExceptionList){const i=t.key,s=t.targets;if(new RegExp(i).test(e)){if(t.capture&&t.captureConstraint){const r=t.capture,i=t.captureConstraint,s=new RegExp(r).exec(e);if(s&&s.length>0&&parseInt(s[s.length-1])>=i)continue}for(const e of s)switch(e){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":r.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{(0,u.deleteStateObject)(this._gl)}:(this._onContextLost=e=>{e.preventDefault(),this._contextWasLost=!0,(0,u.deleteStateObject)(this._gl),g.Logger.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},s.addEventListener("webglcontextrestored",this._onContextRestored,!1),r.powerPreference=r.powerPreference||"high-performance"),s.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(r.xrCompatible=!1),!r.disableWebGL2Support)try{this._gl=s.getContext("webgl2",r)||s.getContext("experimental-webgl2",r),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch(e){}if(!this._gl){if(!s)throw Error("The provided canvas is null or undefined.");try{this._gl=s.getContext("webgl",r)||s.getContext("experimental-webgl",r)}catch(e){throw Error("WebGL not supported",{cause:e})}}if(!this._gl)throw Error("WebGL not supported")}else{this._gl=e,s=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const t=this._gl.getContextAttributes();t&&(r.stencil=t.stencil)}this._sharedInit(s),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),void 0!==r.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=r.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let e=0;e<this._caps.maxVertexAttribs;e++)this._currentBufferPointers[e]=new P;this._shaderProcessor=this.webGLVersion>1?new E.WebGL2ShaderProcessor:new d.WebGLShaderProcessor;const a=`Babylon.js v${L.Version}`;g.Logger.Log(a+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",a);const n=(0,u.getStateObject)(this._gl);n.validateShaderPrograms=this.validateShaderPrograms,n.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}areAllEffectsReady(){for(let e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),shaderFloatPrecision:0,parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),blendFloat:null!==this._gl.getExtension("EXT_float_blend"),supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:1!==this._webGLVersion,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1,supportReadWriteStorageTextures:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);let e=this._gl.getExtension("WEBGL_debug_renderer_info");null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);let t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,this._alphaState=new B.AlphaState(this._caps.blendParametersPerTarget),t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=null!==this._maxMSAASamplesOverride?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{let e=this._gl.getExtension("WEBGL_draw_buffers");if(null!==e){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=e.drawBuffersWEBGL.bind(e),this._caps.maxDrawBuffers=this._gl.getParameter(e.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let t=0;t<16;t++)this._gl["COLOR_ATTACHMENT"+t+"_WEBGL"]=e["COLOR_ATTACHMENT"+t+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{let e=this._gl.getExtension("WEBGL_depth_texture");null!=e&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=e.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{let e=this._gl.getExtension("OES_vertex_array_object");null!=e&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=e.createVertexArrayOES.bind(e),this._gl.bindVertexArray=e.bindVertexArrayOES.bind(e),this._gl.deleteVertexArray=e.deleteVertexArrayOES.bind(e))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{let e=this._gl.getExtension("ANGLE_instanced_arrays");null!=e?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=e.drawArraysInstancedANGLE.bind(e),this._gl.drawElementsInstanced=e.drawElementsInstancedANGLE.bind(e),this._gl.vertexAttribDivisor=e.vertexAttribDivisorANGLE.bind(e)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(e&&t&&(this._caps.highPrecisionShaderSupported=0!==e.precision&&0!==t.precision,this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision)),!this._shouldUseHighPrecisionShader){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);e&&t&&(this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{let e=this._gl.getExtension("EXT_blend_minmax");null!=e&&(this._caps.blendMinMax=!0,this._gl.MAX=e.MAX_EXT,this._gl.MIN=e.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{let e=this._gl.getExtension("EXT_sRGB");null!=e&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:e.SRGB_EXT,SRGB8:e.SRGB_ALPHA_EXT,SRGB8_ALPHA8:e.SRGB_ALPHA_EXT})}if(this._creationOptions){let e=this._creationOptions.forceSRGBBufferSupportState;void 0!==e&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&e)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let e=0;e<this._maxSimultaneousTextures;e++)this._nextFreeTextureSlots.push(e);"Mali-G72"===this._glRenderer&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){this._features={forceBitmapOverHTMLImageElement:"u"<typeof HTMLImageElement,supportRenderAndCopyToLodForFloatTextures:1!==this._webGLVersion,supportDepthStencilTexture:1!==this._webGLVersion,supportShadowSamplers:1!==this._webGLVersion,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:1!==this._webGLVersion,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:1!==this._webGLVersion,basisNeedsPOT:1===this._webGLVersion,support3DTextures:1!==this._webGLVersion,needTypeSuffixInShaderConstants:1!==this._webGLVersion,supportMSAA:1!==this._webGLVersion,supportSSAO2:1!==this._webGLVersion,supportIBLShadows:1!==this._webGLVersion,supportExtendedTextureFormats:1!==this._webGLVersion,supportSwitchCaseInShader:1!==this._webGLVersion,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);let e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){let e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,r,i=!1,s=0){let a=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=a;let n=0;if(t&&e){let t=!0;if(this._currentRenderTarget){let r=this._currentRenderTarget.texture?.format;if(8===r||9===r||10===r||11===r){let r=this._currentRenderTarget.texture?.type;7===r||5===r?(L._TempClearColorUint32[0]=255*e.r,L._TempClearColorUint32[1]=255*e.g,L._TempClearColorUint32[2]=255*e.b,L._TempClearColorUint32[3]=255*e.a,this._gl.clearBufferuiv(this._gl.COLOR,0,L._TempClearColorUint32)):(L._TempClearColorInt32[0]=255*e.r,L._TempClearColorInt32[1]=255*e.g,L._TempClearColorInt32[2]=255*e.b,L._TempClearColorInt32[3]=255*e.a,this._gl.clearBufferiv(this._gl.COLOR,0,L._TempClearColorInt32)),t=!1}}t&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),n|=this._gl.COLOR_BUFFER_BIT)}r&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),n|=this._gl.DEPTH_BUFFER_BIT),i&&(this._gl.clearStencil(s),n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)}_viewport(e,t,r,i){(e!==this._viewportCached.x||t!==this._viewportCached.y||r!==this._viewportCached.z||i!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=r,this._viewportCached.w=i,this._gl.viewport(e,t,r,i))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,r,i,s,a=0,n=0){this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(e._framebuffer);let _=this._gl;e.isMulti||(e.is2DArray||e.is3D?(_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,a,n),e._currentLOD=a):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,a):e._currentLOD!==a&&(_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,a),e._currentLOD=a));let l=e._depthStencilTexture;if(l){e.is3D&&(e.texture.width!==l.width||e.texture.height!==l.height||e.texture.depth!==l.depth)&&g.Logger.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");let r=e._depthStencilTextureWithStencil?_.DEPTH_STENCIL_ATTACHMENT:_.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?_.framebufferTextureLayer(_.FRAMEBUFFER,r,l._hardwareTexture?.underlyingResource,a,n):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,l._hardwareTexture?.underlyingResource,a):_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_2D,l._hardwareTexture?.underlyingResource,a)}e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._MSAAFramebuffer),this._cachedViewport&&!s?this.setViewport(this._cachedViewport,r,i):(!r&&(r=e.width,a&&(r/=Math.pow(2,a))),!i&&(i=e.height,a&&(i/=Math.pow(2,a))),this._viewport(0,0,r,i)),this.wipeCaches()}setStateCullFaceType(e,t){let r=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==r||t)&&(this._depthCullingState.cullFace=r)}setState(e,t=0,r,i=!1,s,a,n=0){(this._depthCullingState.cull!==e||r)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(s,r),this.setZOffset(t),this.setZOffsetUnits(n);let _=i?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==_||r)&&(this._depthCullingState.frontFace=_),this._stencilStateComposer.stencilMaterial=a}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return null===this._currentFramebuffer}generateMipmaps(e){let t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,r){this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),r&&(e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._framebuffer),r()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){let t=this._gl;if(!e._MSAAFramebuffer||e.isMulti)return;let r=e.resolveMSAAColors?t.COLOR_BUFFER_BIT:0;r|=e._generateDepthBuffer&&e.resolveMSAADepth?t.DEPTH_BUFFER_BIT:0,r|=e._generateStencilBuffer&&e.resolveMSAAStencil?t.STENCIL_BUFFER_BIT:0,t.bindFramebuffer(t.READ_FRAMEBUFFER,e._MSAAFramebuffer),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,e._framebuffer),t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,r,t.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,r){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create vertex buffer");let i=new T.WebGLDataBuffer(r);return this.bindArrayBuffer(i),"number"!=typeof e?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),i.capacity=4*e.length):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),i.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),i.capacity=e),this._resetVertexBufferBinding(),i.references=1,i}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,r){let i=this._gl.createBuffer(),s=new T.WebGLDataBuffer(i);if(!i)throw Error("Unable to create index buffer");this.bindIndexBuffer(s);let a=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,a,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),s.references=1,s.is32Bits=4===a.BYTES_PER_ELEMENT,s}_normalizeIndexData(e){if(2===e.BYTES_PER_ELEMENT)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;else for(let t=0;t<e.length;t++)if(e[t]>=65535)return new Uint32Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,r){let i=e.program,s=this._gl.getUniformBlockIndex(i,t);this._gl.uniformBlockBinding(i,s,r)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,r,i,s,a,n){let _=this._currentBufferPointers[t];if(!_)return;let l=!1;_.active?(_.buffer!==e&&(_.buffer=e,l=!0),_.size!==r&&(_.size=r,l=!0),_.type!==i&&(_.type=i,l=!0),_.normalized!==s&&(_.normalized=s,l=!0),_.stride!==a&&(_.stride=a,l=!0),_.offset!==n&&(_.offset=n,l=!0)):(l=!0,_.active=!0,_.index=t,_.size=r,_.type=i,_.normalized=s,_.stride=a,_.offset=n,_.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),i===this._gl.UNSIGNED_INT||i===this._gl.INT?this._gl.vertexAttribIPointer(t,r,i,a,n):this._gl.vertexAttribPointer(t,r,i,s,a,n))}_bindIndexBufferWithCache(e){null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,r){let i=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let s=0;s<i.length;s++){let a=t.getAttributeLocation(s);if(a>=0){let t=i[s],n=null;if(r&&(n=r[t]),n||(n=e[t]),!n)continue;this._gl.enableVertexAttribArray(a),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[a]=!0);let _=n.getBuffer();_&&(this._vertexAttribPointer(_,a,n.getSize(),n.type,n.normalized,n.byteStride,n.byteOffset),n.getIsInstanced()&&(this._gl.vertexAttribDivisor(a,n.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(a),this._currentInstanceBuffers.push(_))))}}}recordVertexArrayObject(e,t,r,i){let s=this._gl.createVertexArray();if(!s)throw Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(s),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,r,i),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),s}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,r,i,s){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==s){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=s;let t=s.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let a=0;for(let n=0;n<t;n++)if(n<r.length){let t=s.getAttributeLocation(n);t>=0&&(this._gl.enableVertexAttribArray(t),this._vertexAttribArraysEnabled[t]=!0,this._vertexAttribPointer(e,t,r[n],this._gl.FLOAT,!1,i,a)),a+=4*r[n]}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,r,i){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==r)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r,this._bindVertexBuffersAttributes(e,r,i)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,r=this._currentInstanceLocations.length;t<r;t++){let r=this._currentInstanceBuffers[t];e!=r&&r.references&&(e=r,this.bindArrayBuffer(r));let i=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(i,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){this._gl.deleteVertexArray(e)}_releaseBuffer(e){return e.references--,0===e.references&&(this._deleteBuffer(e),!0)}_deleteBuffer(e){this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,r){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),void 0!==r[0].index)this.bindInstancesBuffer(e,r,!0);else for(let t=0;t<4;t++){let i=r[t];this._vertexAttribArraysEnabled[i]||(this._gl.enableVertexAttribArray(i),this._vertexAttribArraysEnabled[i]=!0),this._vertexAttribPointer(e,i,4,this._gl.FLOAT,!1,64,16*t),this._gl.vertexAttribDivisor(i,1),this._currentInstanceLocations.push(i),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,r=!0){this.bindArrayBuffer(e);let i=0;if(r)for(let e=0;e<t.length;e++)i+=4*t[e].attributeSize;for(let r=0;r<t.length;r++){let s=t[r];void 0===s.index&&(s.index=this._currentEffect.getAttributeLocationByName(s.attributeName)),s.index<0||(this._vertexAttribArraysEnabled[s.index]||(this._gl.enableVertexAttribArray(s.index),this._vertexAttribArraysEnabled[s.index]=!0),this._vertexAttribPointer(e,s.index,s.attributeSize,s.attributeType||this._gl.FLOAT,s.normalized||!1,i,s.offset),this._gl.vertexAttribDivisor(s.index,void 0===s.divisor?1:s.divisor),this._currentInstanceLocations.push(s.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){if(!this._currentEffect)return;let t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){let t,r=!1;for(;-1!==(t=this._currentInstanceLocations.indexOf(e));)this._currentInstanceLocations.splice(t,1),this._currentInstanceBuffers.splice(t,1),r=!0;r&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,r,i){this.drawElementsType(+!e,t,r,i)}drawPointClouds(e,t,r){this.drawArraysType(2,e,t,r)}drawUnIndexed(e,t,r,i){this.drawArraysType(+!e,t,r,i)}drawElementsType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e),a=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,n=this._uintIndicesCurrentlySet?4:2;i?this._gl.drawElementsInstanced(s,r,a,t*n,i):this._gl.drawElements(s,r,a,t*n)}drawArraysType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e);i?this._gl.drawArraysInstanced(s,t,r,i):this._gl.drawArrays(s,t,r)}_drawMode(e){switch(e){case 0:default:return this._gl.TRIANGLES;case 2:case 3:return this._gl.POINTS;case 1:case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN}}_releaseEffect(e){this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];let t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){e&&e.program&&(e.program.__SPECTOR_rebuildProgram=null,(0,S.resetCachedPipeline)(e),this._gl&&(this._currentProgram===e.program&&this._setProgram(null),this._gl.deleteProgram(e.program)))}_getGlobalDefines(e){return(0,x._GetGlobalDefines)(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,r,i,s,a,n,_,l,o=0,c){let g="string"==typeof e?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,f="string"==typeof e?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,d=this._getGlobalDefines(),E=void 0!==t.attributes,T=s??t.defines??"";d&&(T+=d);let R=g+"+"+f+"@"+T;if(this._compiledEffects[R]){let e=this._compiledEffects[R];return n&&e.isReady()&&n(e),e._refCount++,e}this._gl&&(0,u.getStateObject)(this._gl);let p=new h.Effect(e,t,E?this:r,i,this,s,a,n,_,l,R,t.shaderLanguage??o,t.extraInitializationsAsync??c);return this._compiledEffects[R]=p,p}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,r,i,s=null){let a=(0,u.getStateObject)(this._gl);return a._contextWasLost=this._contextWasLost,a.validateShaderPrograms=this.validateShaderPrograms,(0,u.createRawShaderProgram)(e,t,r,i||this._gl,s)}createShaderProgram(e,t,r,i,s,a=null){let n=(0,u.getStateObject)(this._gl);return n._contextWasLost=this._contextWasLost,n.validateShaderPrograms=this.validateShaderPrograms,(0,u.createShaderProgram)(e,t,r,i,s||this._gl,a)}inlineShaderCode(e){return e}createPipelineContext(e){this._gl&&((0,u.getStateObject)(this._gl).parallelShaderCompile=this._caps.parallelShaderCompile);let t=(0,u.createPipelineContext)(this._gl,e);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return(0,u._finalizePipelineContext)(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,r,i,s,a,n,_,l,h,o){let c=(0,u.getStateObject)(this._gl);return c._contextWasLost=this._contextWasLost,c.validateShaderPrograms=this.validateShaderPrograms,c._createShaderProgramInjection=this._createShaderProgram.bind(this),c.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),c.createShaderProgramInjection=this.createShaderProgram.bind(this),c.loadFileInjection=this._loadFile.bind(this),(0,u._preparePipelineContext)(e,t,r,i,s,a,n,_,l,h,o)}_createShaderProgram(e,t,r,i,s=null){return(0,u._createShaderProgram)(e,t,r,i,s)}_isRenderingStateCompiled(e){return!this._isDisposed&&(0,u._isRenderingStateCompiled)(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){(0,u._executeWhenRenderingStateIsCompiled)(e,t)}getUniforms(e,t){let r=[];for(let i=0;i<t.length;i++)r.push(this._gl.getUniformLocation(e.program,t[i]));return r}getAttributes(e,t){let r=[];for(let i=0;i<t.length;i++)try{r.push(this._gl.getAttribLocation(e.program,t[i]))}catch(e){r.push(-1)}return r}enableEffect(e){(e=null!==e&&(0,c.IsWrapper)(e)?e.effect:e)&&e!==this._currentEffect&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){return!!e&&(this._gl.uniform1i(e,t),!0)}setInt2(e,t,r){return!!e&&(this._gl.uniform2i(e,t,r),!0)}setInt3(e,t,r,i){return!!e&&(this._gl.uniform3i(e,t,r,i),!0)}setInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4i(e,t,r,i,s),!0)}setIntArray(e,t){return!!e&&(this._gl.uniform1iv(e,t),!0)}setIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){return!!e&&(this._gl.uniform1ui(e,t),!0)}setUInt2(e,t,r){return!!e&&(this._gl.uniform2ui(e,t,r),!0)}setUInt3(e,t,r,i){return!!e&&(this._gl.uniform3ui(e,t,r,i),!0)}setUInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4ui(e,t,r,i,s),!0)}setUIntArray(e,t){return!!e&&(this._gl.uniform1uiv(e,t),!0)}setUIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){return!!e&&!(t.length<1)&&(this._gl.uniform1fv(e,t),!0)}setArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){return!!e&&(this._gl.uniformMatrix4fv(e,!1,t),!0)}setMatrix3x3(e,t){return!!e&&(this._gl.uniformMatrix3fv(e,!1,t),!0)}setMatrix2x2(e,t){return!!e&&(this._gl.uniformMatrix2fv(e,!1,t),!0)}setFloat(e,t){return!!e&&(this._gl.uniform1f(e,t),!0)}setFloat2(e,t,r){return!!e&&(this._gl.uniform2f(e,t,r),!0)}setFloat3(e,t,r,i){return!!e&&(this._gl.uniform3f(e,t,r,i),!0)}setFloat4(e,t,r,i,s){return!!e&&(this._gl.uniform4f(e,t,r,i,s),!0)}applyStates(){if(this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;let e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){(!this.preventCacheWipeBetweenFrames||e)&&(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){let r=this._gl,i=r.NEAREST,s=r.NEAREST,a=!1;switch(e){case 11:i=r.LINEAR,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 3:i=r.LINEAR,a=!0,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 8:a=!0,i=r.NEAREST,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 4:i=r.NEAREST,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 5:i=r.NEAREST,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 6:a=!0,i=r.NEAREST,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 7:i=r.NEAREST,s=r.LINEAR;break;case 1:i=r.NEAREST,s=r.NEAREST;break;case 9:i=r.LINEAR,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 10:a=!0,i=r.LINEAR,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 2:i=r.LINEAR,s=r.LINEAR;break;case 12:i=r.LINEAR,s=r.NEAREST}return{min:s,mag:i,hasMipMaps:a}}_createTexture(){let e=this._gl.createTexture();if(!e)throw Error("Unable to create texture");return e}_createHardwareTexture(){return new p(this._createTexture(),this._gl)}_createInternalTexture(e,t,r=!0,i=0){let s,a,n=!1,_=0,l=3,h=5,u=!1,o=1,c=!1,f=0,d=!1;void 0!==t&&"object"==typeof t?(s=!!t.generateMipMaps,n=!!t.createMipMaps,_=void 0===t.type?0:t.type,l=void 0===t.samplingMode?3:t.samplingMode,h=void 0===t.format?5:t.format,u=void 0!==t.useSRGBBuffer&&t.useSRGBBuffer,o=t.samples??1,a=t.label,c=!!t.createMSAATexture,f=t.comparisonFunction||0,d=!!t.isCube):s=!!t,u&&(u=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(1!==_||this._caps.textureFloatLinearFiltering)&&(2!==_||this._caps.textureHalfFloatLinearFiltering)||(l=1),1!==_||this._caps.textureFloat||(_=0,g.Logger.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));let E=b(h),T=m(h),R=this._gl,p=new A.InternalTexture(this,i),x=e.width||e,S=e.height||e,B=e.depth||0,C=e.layers||0,P=this._getSamplingParameters(l,(s||n)&&!E),L=0!==C?R.TEXTURE_2D_ARRAY:0!==B?R.TEXTURE_3D:d?R.TEXTURE_CUBE_MAP:R.TEXTURE_2D,M=E?this._getInternalFormatFromDepthTextureFormat(h,!0,T):this._getRGBABufferInternalSizedFormat(_,h,u),G=E?T?R.DEPTH_STENCIL:R.DEPTH_COMPONENT:this._getInternalFormat(h),I=E?this._getWebGLTextureTypeFromDepthTextureFormat(h):this._getWebGLTextureType(_);if(this._bindTextureDirectly(L,p),0!==C)p.is2DArray=!0,R.texImage3D(L,0,M,x,S,C,0,G,I,null);else if(0!==B)p.is3D=!0,R.texImage3D(L,0,M,x,S,B,0,G,I,null);else if(d){p.isCube=!0;for(let e=0;e<6;e++)R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,M,x,S,0,G,I,null)}else R.texImage2D(L,0,M,x,S,0,G,I,null);if(R.texParameteri(L,R.TEXTURE_MAG_FILTER,P.mag),R.texParameteri(L,R.TEXTURE_MIN_FILTER,P.min),R.texParameteri(L,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(L,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),E&&this.webGLVersion>1&&(0===f?(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,515),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.NONE)):(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,f),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.COMPARE_REF_TO_TEXTURE))),(s||n)&&this._gl.generateMipmap(L),this._bindTextureDirectly(L,null),p._useSRGBBuffer=u,p.baseWidth=x,p.baseHeight=S,p.width=x,p.height=S,p.depth=C||B,p.isReady=!0,p.samples=o,p.generateMipMaps=s,p.samplingMode=l,p.type=_,p.format=h,p.label=a,p.comparisonFunction=f,this._internalTexturesCache.push(p),c){let e;if(!(e=b(p.format)?this._setupFramebufferDepthAttachments(m(p.format),19!==p.format,p.width,p.height,o,p.format,!0):this._createRenderBuffer(p.width,p.height,o,-1,this._getRGBABufferInternalSizedFormat(p.type,p.format,p._useSRGBBuffer),-1)))throw Error("Unable to create render buffer");p._autoMSAAManagement=!0;let t=p._hardwareTexture;t||(t=p._hardwareTexture=this._createHardwareTexture()),t.addMSAARenderBuffer(e)}return p}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,r,i,s=3,a=null,n=null,_=null,l=null,h=null,u=null,o,c,g,f){return this._createTextureBase(e,t,r,i,s,a,n,(...e)=>this._prepareWebGLTexture(...e,h),(e,t,r,s,a,n)=>{let _=this._gl,l=r.width===e&&r.height===t;a._creationFlags=g??0;let h=this._getTexImageParametersForCreateTexture(a.format,a._useSRGBBuffer);if(l)return _.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),!1;let u=this._caps.maxTextureSize;if(r.width>u||r.height>u||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!!this._workingCanvas&&!!this._workingContext&&(this._workingCanvas.width=e,this._workingCanvas.height=t,this._workingContext.drawImage(r,0,0,r.width,r.height,0,0,e,t),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,this._workingCanvas),a.width=e,a.height=t,!1);{let e=new A.InternalTexture(this,2);this._bindTextureDirectly(_.TEXTURE_2D,e,!0),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),this._rescaleTexture(e,a,i,h.format,()=>{this._releaseTexture(e),this._bindTextureDirectly(_.TEXTURE_2D,a,!0),n()})}return!0},_,l,h,u,o,c,f)}_getTexImageParametersForCreateTexture(e,t){let r,i;return 1===this.webGLVersion?i=r=this._getInternalFormat(e,t):(r=this._getInternalFormat(e,!1),i=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:i,format:r,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,r,i,s){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,+!!e),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,r=!1){let i=this._getTextureTarget(t),s=this._getSamplingParameters(e,t.useMipMaps||r);this._setTextureParameterInteger(i,this._gl.TEXTURE_MAG_FILTER,s.mag,t),this._setTextureParameterInteger(i,this._gl.TEXTURE_MIN_FILTER,s.min),r&&s.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(i)),this._bindTextureDirectly(i,null),t.samplingMode=e}updateTextureDimensions(e,t,r,i=1){}updateTextureWrappingMode(e,t,r=null,i=null){let s=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==r&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r),e),e._cachedWrapV=r),(e.is2DArray||e.is3D)&&null!==i&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(i),e),e._cachedWrapR=i),this._bindTextureDirectly(s,null)}_uploadCompressedDataToTextureDirectly(e,t,r,i,s,a=0,n=0){let _=this._gl,l=_.TEXTURE_2D;if(e.isCube&&(l=_.TEXTURE_CUBE_MAP_POSITIVE_X+a),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=_.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=_.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 37809:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;break;case 37810:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;break;case 37811:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;break;case 37812:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;break;case 37813:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;break;case 37814:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;break;case 37815:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;break;case 37816:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;break;case 37817:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;break;case 37818:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;break;case 37819:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;break;case 37820:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;break;case 37821:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;break;case 33776:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1}if(e.generateMipMaps){let a=e._hardwareTexture;a.memoryAllocated||(_.texStorage2D(e.isCube?_.TEXTURE_CUBE_MAP:_.TEXTURE_2D,Math.floor(Math.log2(Math.max(r,i)))+1,t,e.width,e.height),a.memoryAllocated=!0),this._gl.compressedTexSubImage2D(l,n,0,0,r,i,t,s)}else this._gl.compressedTexImage2D(l,n,t,r,i,0,s)}_uploadDataToTextureDirectly(e,t,r=0,i=0,s,a=!1){let n=this._gl,_=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),h=void 0===s?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(s,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let u=n.TEXTURE_2D;e.isCube&&(u=n.TEXTURE_CUBE_MAP_POSITIVE_X+r);let o=Math.round(Math.log(e.width)*Math.LOG2E),c=Math.round(Math.log(e.height)*Math.LOG2E),g=a?e.width:Math.pow(2,Math.max(o-i,0)),f=a?e.height:Math.pow(2,Math.max(c-i,0));n.texImage2D(u,i,h,g,f,0,l,_,t)}updateTextureData(e,t,r,i,s,a,n=0,_=0,l=!1){let h=this._gl,u=this._getWebGLTextureType(e.type),o=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let c=h.TEXTURE_2D,g=h.TEXTURE_2D;e.isCube&&(g=h.TEXTURE_CUBE_MAP_POSITIVE_X+n,c=h.TEXTURE_CUBE_MAP),this._bindTextureDirectly(c,e,!0),h.texSubImage2D(g,_,r,i,s,a,o,u,t),l&&this._gl.generateMipmap(g),this._bindTextureDirectly(c,null)}_uploadArrayBufferViewToTexture(e,t,r=0,i=0){let s=this._gl,a=e.isCube?s.TEXTURE_CUBE_MAP:s.TEXTURE_2D;this._bindTextureDirectly(a,e,!0),this._uploadDataToTextureDirectly(e,t,r,i),this._bindTextureDirectly(a,null,!0)}_prepareWebGLTextureContinuation(e,t,r,i,s){let a=this._gl;if(!a)return;let n=this._getSamplingParameters(s,!r);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,n.mag),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,n.min),r||i||a.generateMipmap(a.TEXTURE_2D),this._bindTextureDirectly(a.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,r,i,s,a,n,_,l,h){let u=this.getCaps().maxTextureSize,o=Math.min(u,this.needPOTTextures?(0,R.GetExponentOfTwo)(i.width,u):i.width),c=Math.min(u,this.needPOTTextures?(0,R.GetExponentOfTwo)(i.height,u):i.height),g=this._gl;if(g){if(!e._hardwareTexture){r&&r.removePendingData(e);return}this._bindTextureDirectly(g.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===s||!!s),e.baseWidth=i.width,e.baseHeight=i.height,e.width=o,e.height=c,e.isReady=!0,e.type=-1!==e.type?e.type:0,e.format=-1!==e.format?e.format:h??(".jpg"!==t||e._useSRGBBuffer?5:4),_(o,c,i,t,e,()=>{this._prepareWebGLTextureContinuation(e,r,a,n,l)})||this._prepareWebGLTextureContinuation(e,r,a,n,l)}}_getInternalFormatFromDepthTextureFormat(e,t,r){let i=this._gl;if(!t)return i.STENCIL_INDEX8;let s=r?i.DEPTH_STENCIL:i.DEPTH_COMPONENT;return this.webGLVersion>1?15===e?s=i.DEPTH_COMPONENT16:16===e?s=i.DEPTH_COMPONENT24:17===e||13===e?s=r?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24:14===e?s=i.DEPTH_COMPONENT32F:18===e&&(s=r?i.DEPTH32F_STENCIL8:i.DEPTH_COMPONENT32F):s=i.DEPTH_COMPONENT16,s}_getWebGLTextureTypeFromDepthTextureFormat(e){let t=this._gl,r=t.UNSIGNED_INT;return 15===e?r=t.UNSIGNED_SHORT:17===e||13===e?r=t.UNSIGNED_INT_24_8:14===e?r=t.FLOAT:18===e?r=t.FLOAT_32_UNSIGNED_INT_24_8_REV:19===e&&(r=t.UNSIGNED_BYTE),r}_setupFramebufferDepthAttachments(e,t,r,i,s=1,a,n=!1){let _=this._gl;a=a??(e?13:14);let l=this._getInternalFormatFromDepthTextureFormat(a,t,e);return e&&t?this._createRenderBuffer(r,i,s,_.DEPTH_STENCIL,l,n?-1:_.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(r,i,s,l,l,n?-1:_.DEPTH_ATTACHMENT):e?this._createRenderBuffer(r,i,s,l,l,n?-1:_.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,r,i,s,a,n=!0){let _=this._gl.createRenderbuffer();return this._updateRenderBuffer(_,e,t,r,i,s,a,n)}_updateRenderBuffer(e,t,r,i,s,a,n,_=!0){let l=this._gl;return l.bindRenderbuffer(l.RENDERBUFFER,e),i>1&&l.renderbufferStorageMultisample?l.renderbufferStorageMultisample(l.RENDERBUFFER,i,a,t,r):l.renderbufferStorage(l.RENDERBUFFER,s,t,r),-1!==n&&l.framebufferRenderbuffer(l.FRAMEBUFFER,n,l.RENDERBUFFER,e),_&&l.bindRenderbuffer(l.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();let t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e?.release()}_setProgram(e){this._currentProgram!==e&&((0,u._setProgram)(e,this._gl),this._currentProgram=e)}bindSamplers(e){let t=e.getPipelineContext();this._setProgram(t.program);let r=e.getSamplers();for(let t=0;t<r.length;t++){let i=e.getUniform(r[t]);i&&(this._boundUniforms[t]=i)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,r=!1,i=!1){let s=!1,a=t&&t._associatedChannel>-1;if(r&&a&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||i){if(this._activateCurrentTexture(),t&&t.isMultiview)throw g.Logger.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else r&&(s=!0,this._activateCurrentTexture());return a&&!r&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),s}_bindTexture(e,t,r){if(void 0===e)return;t&&(t._associatedChannel=e),this._activeChannel=e;let i=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(i,t)}unbindAllTextures(){for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,r,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,r))}_bindSamplerUniformToChannel(e,t){let r=this._boundUniforms[e];r&&r._currentState!==t&&(this._gl.uniform1i(r,t),r._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:break;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,r=!1,i=!1,s=""){let a;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;let r=t.getInternalTexture();r&&(r._associatedChannel=e),t.update()}else if(4===t.delayLoadState)return t.delayLoad(),!1;a=i?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!r&&a&&(a._associatedChannel=e);let n=!0;this._boundTexturesCache[e]===a&&(r||this._bindSamplerUniformToChannel(a._associatedChannel,e),n=!1),this._activeChannel=e;let _=this._getTextureTarget(a);if(n&&this._bindTextureDirectly(_,a,r),a&&!a.isMultiview){if(a.isCube&&a._cachedCoordinatesMode!==t.coordinatesMode){a._cachedCoordinatesMode=t.coordinatesMode;let e=+(3!==t.coordinatesMode&&5!==t.coordinatesMode);t.wrapU=e,t.wrapV=e}a._cachedWrapU!==t.wrapU&&(a._cachedWrapU=t.wrapU,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),a)),a._cachedWrapV!==t.wrapV&&(a._cachedWrapV=t.wrapV,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),a)),a.is3D&&a._cachedWrapR!==t.wrapR&&(a._cachedWrapR=t.wrapR,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),a)),this._setAnisotropicLevel(_,a,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,r,i){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===r.length||(this._textureUnits=new Int32Array(r.length));for(let t=0;t<r.length;t++){let i=r[t].getInternalTexture();i?(this._textureUnits[t]=e+t,i._associatedChannel=e+t):this._textureUnits[t]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let e=0;e<r.length;e++)this._setTexture(this._textureUnits[e],r[e],!0)}}_setAnisotropicLevel(e,t,r){let i=this._caps.textureAnisotropicFilterExtension;11!==t.samplingMode&&3!==t.samplingMode&&2!==t.samplingMode&&(r=1),i&&t._cachedAnisotropicFilteringLevel!==r&&(this._setTextureParameterFloat(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=r)}_setTextureParameterFloat(e,t,r,i){this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameterf(e,t,r)}_setTextureParameterInteger(e,t,r,i){i&&this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameteri(e,t,r)}unbindAllAttributes(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e);return}for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)!(e>=this._caps.maxVertexAttribs)&&this._vertexAttribArraysEnabled[e]&&this.disableAttributeByIndex(e)}releaseEffects(){this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){(0,f.IsWindowObjectExist)()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),(0,u.deleteStateObject)(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){let t=this._gl;for(;t.getError()!==t.NO_ERROR;);let r=!0,i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);let s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0);let a=t.checkFramebufferStatus(t.FRAMEBUFFER);if((r=(r=r&&a===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),r=r&&t.getError()===t.NO_ERROR),r){t.bindFramebuffer(t.FRAMEBUFFER,null);let e=t.RGBA,i=t.UNSIGNED_BYTE,s=new Uint8Array(4);t.readPixels(0,0,1,1,e,i,s),r=r&&t.getError()===t.NO_ERROR}for(t.deleteTexture(i),t.deleteFramebuffer(s),t.bindFramebuffer(t.FRAMEBUFFER,null);!r&&t.getError()!==t.NO_ERROR;);return r}_getWebGLTextureType(e){if(1===this._webGLVersion){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:break;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:break;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:r=this._gl.ALPHA;break;case 1:r=this._gl.LUMINANCE;break;case 2:r=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:r=this._gl.RED;break;case 7:case 33324:case 36761:r=this._gl.RG;break;case 4:case 32852:case 36762:r=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA}if(this._webGLVersion>1)switch(e){case 8:r=this._gl.RED_INTEGER;break;case 9:r=this._gl.RG_INTEGER;break;case 10:r=this._gl.RGB_INTEGER;break;case 11:r=this._gl.RGBA_INTEGER}return r}_getRGBABufferInternalSizedFormat(e,t,r=!1){if(1===this._webGLVersion){if(void 0!==t)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return r?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return r?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:default:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI}}return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,r,i,s=!0,a=!0,n=null){let _=s?this._gl.RGBA:this._gl.RGB,l=r*i*(s?4:3);if(n){if(n.length<l)return g.Logger.Error(`Data buffer is too small to store the read pixels (${n.length} should be more than ${l})`),Promise.resolve(n)}else n=new Uint8Array(l);return a&&this.flushFramebuffer(),this._gl.readPixels(e,t,r,i,_,this._gl.UNSIGNED_BYTE,n),Promise.resolve(n)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(null!==this._HasMajorPerformanceCaveat)return!this._HasMajorPerformanceCaveat;if(null===this._IsSupported)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=null!=t&&!!globalThis.WebGLRenderingContext}catch(e){this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(null===this._HasMajorPerformanceCaveat)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch(e){this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}L._TempClearColorUint32=new Uint32Array(4),L._TempClearColorInt32=new Int32Array(4),L.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}],L._ConcatenateShader=x._ConcatenateShader,L._IsSupported=null,L._HasMajorPerformanceCaveat=null,(t=L.prototype).startTimeQuery??(t.startTimeQuery=(0,C._MissingSideEffect)("ThinEngine","startTimeQuery")),(r=L.prototype).endTimeQuery??(r.endTimeQuery=(0,C._MissingSideEffect)("ThinEngine","endTimeQuery")),(i=L.prototype).createUniformBuffer??(i.createUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","createUniformBuffer")),(s=L.prototype).createDynamicUniformBuffer??(s.createDynamicUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","createDynamicUniformBuffer")),(a=L.prototype).updateUniformBuffer??(a.updateUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","updateUniformBuffer")),(n=L.prototype).bindUniformBuffer??(n.bindUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","bindUniformBuffer")),(_=L.prototype).bindUniformBufferBase??(_.bindUniformBufferBase=(0,C._MissingSideEffect)("ThinEngine","bindUniformBufferBase")),(l=L.prototype).bindUniformBlock??(l.bindUniformBlock=(0,C._MissingSideEffect)("ThinEngine","bindUniformBlock")),e.s(["ThinEngine",0,L],71379)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12423,t=>{"use strict";class e{static GetShadersRepository(t=0){return 0===t?e.ShadersRepository:e.ShadersRepositoryWGSL}static GetShadersStore(t=0){return 0===t?e.ShadersStore:e.ShadersStoreWGSL}static GetIncludesShadersStore(t=0){return 0===t?e.IncludesShadersStore:e.IncludesShadersStoreWGSL}}e.ShadersRepository="src/Shaders/",e.ShadersStore={},e.IncludesShadersStore={},e.ShadersRepositoryWGSL="src/ShadersWGSL/",e.ShadersStoreWGSL={},e.IncludesShadersStoreWGSL={},t.s(["ShaderStore",0,e])},21222,t=>{"use strict";var e=t.i(96265);class i{}i.POINTERDOWN=1,i.POINTERUP=2,i.POINTERMOVE=4,i.POINTERWHEEL=8,i.POINTERPICK=16,i.POINTERTAP=32,i.POINTERDOUBLETAP=64;class r{constructor(t,e){this.type=t,this.event=e}}t.s(["PointerEventTypes",0,i,"PointerInfo",0,class extends r{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(t,e,i,r=null){super(t,e),this._pickInfo=i,this._inputManager=r}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}},"PointerInfoPre",0,class extends r{constructor(t,i,r,s){super(t,i),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new e.Vector2(r,s)}}])},36365,t=>{"use strict";class e{}e.KEYDOWN=1,e.KEYUP=2;class i{constructor(t,e){this.type=t,this.event=e}}t.s(["KeyboardEventTypes",0,e,"KeyboardInfo",0,i,"KeyboardInfoPre",0,class extends i{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(t){this.skipOnKeyboardObservable=t}constructor(t,e){super(t,e),this.type=t,this.event=e,this.skipOnKeyboardObservable=!1}}])},76696,t=>{"use strict";var e,i;(i=e||(e={}))[i.PointerMove=0]="PointerMove",i[i.PointerDown=1]="PointerDown",i[i.PointerUp=2]="PointerUp";class r{}r.DOM_DELTA_PIXEL=0,r.DOM_DELTA_LINE=1,r.DOM_DELTA_PAGE=2,t.s(["EventConstants",0,r])},1773,t=>{"use strict";t.s(["useOpenGLOrientationForUV",()=>!1])},54361,t=>{"use strict";class e{constructor(t,e){this.width=t,this.height=e}toString(){return`{W: ${this.width}, H: ${this.height}}`}getClassName(){return"Size"}getHashCode(){let t=0|this.width;return 397*t^this.height}copyFrom(t){this.width=t.width,this.height=t.height}copyFromFloats(t,e){return this.width=t,this.height=e,this}set(t,e){return this.copyFromFloats(t,e)}multiplyByFloats(t,i){return new e(this.width*t,this.height*i)}clone(){return new e(this.width,this.height)}equals(t){return!!t&&this.width===t.width&&this.height===t.height}get surface(){return this.width*this.height}static Zero(){return new e(0,0)}add(t){return new e(this.width+t.width,this.height+t.height)}subtract(t){return new e(this.width-t.width,this.height-t.height)}scale(t){return new e(this.width*t,this.height*t)}static Lerp(t,i,r){return new e(t.width+(i.width-t.width)*r,t.height+(i.height-t.height)*r)}}t.s(["Size",0,e])},25348,t=>{"use strict";class e{constructor(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r}toGlobal(t,i){return new e(this.x*t,this.y*i,this.width*t,this.height*i)}toGlobalToRef(t,e,i){return i.x=this.x*t,i.y=this.y*e,i.width=this.width*t,i.height=this.height*e,this}clone(){return new e(this.x,this.y,this.width,this.height)}}t.s(["Viewport",0,e])},70247,t=>{"use strict";var e,i,r,s,o=t.i(96265);(e=r||(r={}))[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE";class a{}a.X=new o.Vector3(1,0,0),a.Y=new o.Vector3(0,1,0),a.Z=new o.Vector3(0,0,1),(i=s||(s={}))[i.X=0]="X",i[i.Y=1]="Y",i[i.Z=2]="Z",t.s(["Axis",0,a,"Coordinate",0,s,"Space",0,r])},44939,t=>{"use strict";var e=t.i(23240);t.s(["DrawWrapper",0,class{static GetEffect(t){return void 0===t.getPipelineContext?t.effect:t}constructor(t,e=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=t.createDrawContext(),e&&(this.materialContext=t.createMaterialContext())}setEffect(t,e,i=!0){this.effect=t,void 0!==e&&(this.defines=e),i&&this.drawContext?.reset()}dispose(t=!1){if(this.effect){let i=this.effect;t?i.dispose():e.TimingTools.SetImmediate(()=>{i.getEngine().onEndFrameObservable.addOnce(()=>{i.dispose()})}),this.effect=null}this.drawContext?.dispose()}}])},49007,t=>{"use strict";t.s(["IntersectionInfo",0,class{constructor(t,e,i){this.bu=t,this.bv=e,this.distance=i,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}])},75991,t=>{"use strict";var e,i,r=t.i(46703),s=t.i(96265),o=t.i(89030);(e=i||(i={}))[e.CW=0]="CW",e[e.CCW=1]="CCW";class a{constructor(t){this._radians=t,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return 180*this._radians/Math.PI}radians(){return this._radians}static BetweenTwoPoints(t,e){let i=e.subtract(t);return new a(Math.atan2(i.y,i.x))}static BetweenTwoVectors(t,e){let i=t.lengthSquared()*e.lengthSquared();if(0===i)return new a(Math.PI/2);i=Math.sqrt(i);let s=t.dot(e)/i;return new a(Math.acos(s=(0,r.Clamp)(s,-1,1)))}static FromRadians(t){return new a(t)}static FromDegrees(t){return new a(t*Math.PI/180)}}class n{constructor(t,e,i){this.startPoint=t,this.midPoint=e,this.endPoint=i;const r=Math.pow(e.x,2)+Math.pow(e.y,2),o=(Math.pow(t.x,2)+Math.pow(t.y,2)-r)/2,n=(r-Math.pow(i.x,2)-Math.pow(i.y,2))/2,h=(t.x-e.x)*(e.y-i.y)-(e.x-i.x)*(t.y-e.y);this.centerPoint=new s.Vector2((o*(e.y-i.y)-n*(t.y-e.y))/h,((t.x-e.x)*n-(e.x-i.x)*o)/h),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=a.BetweenTwoPoints(this.centerPoint,this.startPoint);const c=this.startAngle.degrees();let l=a.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),u=a.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();l-c>180&&(l-=360),l-c<-180&&(l+=360),u-l>180&&(u-=360),u-l<-180&&(u+=360),this.orientation=l-c<0?0:1,this.angle=a.FromDegrees(0===this.orientation?c-u:u-c)}}class h{constructor(t,e){this._points=[],this._length=0,this.closed=!1,this._points.push(new s.Vector2(t,e))}addLineTo(t,e){if(this.closed)return this;let i=new s.Vector2(t,e),r=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(r).length(),this}addArcTo(t,e,i,r,o=36){if(this.closed)return this;let a=new n(this._points[this._points.length-1],new s.Vector2(t,e),new s.Vector2(i,r)),h=a.angle.radians()/o;0===a.orientation&&(h*=-1);let c=a.startAngle.radians()+h;for(let t=0;t<o;t++){let t=Math.cos(c)*a.radius+a.centerPoint.x,e=Math.sin(c)*a.radius+a.centerPoint.y;this.addLineTo(t,e),c+=h}return this}addQuadraticCurveTo(t,e,i,r,s=36){if(this.closed)return this;let o=(t,e,i,r)=>(1-t)*(1-t)*e+2*t*(1-t)*i+t*t*r,a=this._points[this._points.length-1];for(let n=0;n<=s;n++){let h=n/s,c=o(h,a.x,t,i),l=o(h,a.y,e,r);this.addLineTo(c,l)}return this}addBezierCurveTo(t,e,i,r,s,o,a=36){if(this.closed)return this;let n=(t,e,i,r,s)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*i+3*t*t*(1-t)*r+t*t*t*s,h=this._points[this._points.length-1];for(let c=0;c<=a;c++){let l=c/a,u=n(l,h.x,t,i,s),d=n(l,h.y,e,r,o);this.addLineTo(u,d)}return this}isPointInside(t){let e=!1,i=this._points.length;for(let r=i-1,s=0;s<i;r=s++){let i=this._points[r],o=this._points[s],a=o.x-i.x,n=o.y-i.y;if(Math.abs(n)>Number.EPSILON){if(n<0&&(i=this._points[s],a=-a,o=this._points[r],n=-n),t.y<i.y||t.y>o.y)continue;if(t.y===i.y&&t.x===i.x)return!0;{let r=n*(t.x-i.x)-a*(t.y-i.y);if(0===r)return!0;if(r<0)continue;e=!e}}else{if(t.y!==i.y)continue;if(o.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=o.x)return!0}}return e}close(){return this.closed=!0,this}length(){let t=this._length;if(this.closed){let e=this._points[this._points.length-1];t+=this._points[0].subtract(e).length()}return t}area(){let t=this._points.length,e=0;for(let i=t-1,r=0;r<t;i=r++)e+=this._points[i].x*this._points[r].y-this._points[r].x*this._points[i].y;return .5*e}getPoints(){return this._points}getPointAtLengthPosition(t){if(t<0||t>1)return s.Vector2.Zero();let e=t*this.length(),i=0;for(let t=0;t<this._points.length;t++){let r=(t+1)%this._points.length,o=this._points[t],a=this._points[r].subtract(o),n=a.length()+i;if(e>=i&&e<=n){let t=a.normalize(),r=e-i;return new s.Vector2(o.x+t.x*r,o.y+t.y*r)}i=n}return s.Vector2.Zero()}static StartingAt(t,e){return new h(t,e)}}class c{constructor(t,e=null,i,r=!1){this.path=t,this._curve=[],this._distances=[],this._tangents=[],this._normals=[],this._binormals=[],this._pointAtData={id:0,point:s.Vector3.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:s.Matrix.Identity()};for(let e=0;e<t.length;e++)this._curve[e]=t[e].clone();this._raw=i||!1,this._alignTangentsWithPath=r,this._compute(e,r)}getCurve(){return this._curve}getPoints(){return this._curve}length(){return this._distances[this._distances.length-1]}getTangents(){return this._tangents}getNormals(){return this._normals}getBinormals(){return this._binormals}getDistances(){return this._distances}getPointAt(t){return this._updatePointAtData(t).point}getTangentAt(t,e=!1){return this._updatePointAtData(t,e),e?s.Vector3.TransformCoordinates(s.Vector3.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(t,e=!1){return this._updatePointAtData(t,e),e?s.Vector3.TransformCoordinates(s.Vector3.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(t,e=!1){return this._updatePointAtData(t,e),e?s.Vector3.TransformCoordinates(s.Vector3.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(t){return this.length()*t}getPreviousPointIndexAt(t){return this._updatePointAtData(t),this._pointAtData.previousPointArrayIndex}getSubPositionAt(t){return this._updatePointAtData(t),this._pointAtData.subPosition}getClosestPositionTo(t){let e=Number.MAX_VALUE,i=0;for(let r=0;r<this._curve.length-1;r++){let o=this._curve[r+0],a=this._curve[r+1].subtract(o).normalize(),n=this._distances[r+1]-this._distances[r+0],h=Math.min(Math.max(s.Vector3.Dot(a,t.subtract(o).normalize()),0)*s.Vector3.Distance(o,t)/n,1),c=s.Vector3.Distance(o.add(a.scale(h*n)),t);c<e&&(e=c,i=(this._distances[r+0]+n*h)/this.length())}return i}slice(t=0,e=1){if(t<0&&(t=1- -1*t%1),e<0&&(e=1- -1*e%1),t>e){let i=t;t=e,e=i}let i=this.getCurve(),r=this.getPointAt(t),s=this.getPreviousPointIndexAt(t),o=this.getPointAt(e),a=this.getPreviousPointIndexAt(e)+1,n=[];return 0!==t&&(s++,n.push(r)),n.push(...i.slice(s,a)),(1!==e||1===t)&&n.push(o),new c(n,this.getNormalAt(t),this._raw,this._alignTangentsWithPath)}update(t,e=null,i=!1){for(let e=0;e<t.length;e++)this._curve[e].x=t[e].x,this._curve[e].y=t[e].y,this._curve[e].z=t[e].z;return this._compute(e,i),this}_compute(t,e=!1){let i,r,o,a,n,h=this._curve.length;if(h<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[h-1]=this._curve[h-1].subtract(this._curve[h-2]),this._raw||this._tangents[h-1].normalize();let c=this._tangents[0],l=this._normalVector(c,t);this._normals[0]=l,this._raw||this._normals[0].normalize(),this._binormals[0]=s.Vector3.Cross(c,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(let t=1;t<h;t++)i=this._getLastNonNullVector(t),t<h-1&&(r=this._getFirstNonNullVector(t),this._tangents[t]=e?r:i.add(r),this._tangents[t].normalize()),this._distances[t]=this._distances[t-1]+this._curve[t].subtract(this._curve[t-1]).length(),o=this._tangents[t],n=this._binormals[t-1],this._normals[t]=s.Vector3.Cross(n,o),this._raw||(0===this._normals[t].length()?(a=this._normals[t-1],this._normals[t]=a.clone()):this._normals[t].normalize()),this._binormals[t]=s.Vector3.Cross(o,this._normals[t]),this._raw||this._binormals[t].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(t){let e=1,i=this._curve[t+e].subtract(this._curve[t]);for(;0===i.length()&&t+e+1<this._curve.length;)e++,i=this._curve[t+e].subtract(this._curve[t]);return i}_getLastNonNullVector(t){let e=1,i=this._curve[t].subtract(this._curve[t-e]);for(;0===i.length()&&t>e+1;)e++,i=this._curve[t].subtract(this._curve[t-e]);return i}_normalVector(t,e){let i,a=t.length();if(0===a&&(a=1),null==e){let e;e=(0,r.WithinEpsilon)(Math.abs(t.y)/a,1,o.Epsilon)?(0,r.WithinEpsilon)(Math.abs(t.x)/a,1,o.Epsilon)?(0,r.WithinEpsilon)(Math.abs(t.z)/a,1,o.Epsilon)?s.Vector3.Zero():new s.Vector3(0,0,1):new s.Vector3(1,0,0):new s.Vector3(0,-1,0),i=s.Vector3.Cross(t,e)}else i=s.Vector3.Cross(t,e),s.Vector3.CrossToRef(i,t,i);return i.normalize(),i}_updatePointAtData(t,e=!1){let i;if(this._pointAtData.id===t)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=t;let r=this.getPoints();if(t<=0)return this._setPointAtData(0,0,r[0],0,e);if(t>=1)return this._setPointAtData(1,1,r[r.length-1],r.length-1,e);let o=r[0],a=0,n=t*this.length();for(let h=1;h<r.length;h++){i=r[h];let c=s.Vector3.Distance(o,i);if((a+=c)===n)return this._setPointAtData(t,1,i,h,e);if(a>n){let r=(a-n)/c,s=o.subtract(i),l=i.add(s.scaleInPlace(r));return this._setPointAtData(t,1-r,l,h-1,e)}o=i}return this._pointAtData}_setPointAtData(t,e,i,r,s){return this._pointAtData.point=i,this._pointAtData.position=t,this._pointAtData.subPosition=e,this._pointAtData.previousPointArrayIndex=r,this._pointAtData.interpolateReady=s,s&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=s.Matrix.Identity();let t=this._pointAtData.previousPointArrayIndex;if(t!==this._tangents.length-1){let e=t+1,i=this._tangents[t].clone(),r=this._normals[t].clone(),o=this._binormals[t].clone(),a=this._tangents[e].clone(),n=this._normals[e].clone(),h=this._binormals[e].clone(),c=s.Quaternion.RotationQuaternionFromAxis(r,o,i),l=s.Quaternion.RotationQuaternionFromAxis(n,h,a);s.Quaternion.Slerp(c,l,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class l{static CreateQuadraticBezier(t,e,i,r){r=r>2?r:3;let o=[],a=(t,e,i,r)=>(1-t)*(1-t)*e+2*t*(1-t)*i+t*t*r;for(let n=0;n<=r;n++)o.push(new s.Vector3(a(n/r,t.x,e.x,i.x),a(n/r,t.y,e.y,i.y),a(n/r,t.z,e.z,i.z)));return new l(o)}static CreateCubicBezier(t,e,i,r,o){o=o>3?o:4;let a=[],n=(t,e,i,r,s)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*i+3*t*t*(1-t)*r+t*t*t*s;for(let h=0;h<=o;h++)a.push(new s.Vector3(n(h/o,t.x,e.x,i.x,r.x),n(h/o,t.y,e.y,i.y,r.y),n(h/o,t.z,e.z,i.z,r.z)));return new l(a)}static CreateHermiteSpline(t,e,i,r,o){let a=[],n=1/o;for(let h=0;h<=o;h++)a.push(s.Vector3.Hermite(t,e,i,r,h*n));return new l(a)}static CreateCatmullRomSpline(t,e,i){let r=[],o=1/e,a=0;if(i){let i=t.length;for(let n=0;n<i;n++){a=0;for(let h=0;h<e;h++)r.push(s.Vector3.CatmullRom(t[n%i],t[(n+1)%i],t[(n+2)%i],t[(n+3)%i],a)),a+=o}r.push(r[0])}else{let i=[];i.push(t[0].clone()),i.push(...t),i.push(t[t.length-1].clone());let n=0;for(;n<i.length-3;n++){a=0;for(let t=0;t<e;t++)r.push(s.Vector3.CatmullRom(i[n],i[n+1],i[n+2],i[n+3],a)),a+=o}n--,r.push(s.Vector3.CatmullRom(i[n],i[n+1],i[n+2],i[n+3],a))}return new l(r)}static ArcThru3Points(t,e,i,r=32,o=!1,a=!1){let n=[],h=e.subtract(t),c=i.subtract(e),u=t.subtract(i),d=s.Vector3.Cross(h,c),p=d.length();if(p<1e-8)return new l(n);let _=h.lengthSquared(),m=c.lengthSquared(),g=u.lengthSquared(),f=d.lengthSquared(),y=.5*h.length()*c.length()*u.length()/p,x=s.Vector3.Dot(h,u),P=s.Vector3.Dot(h,c),M=s.Vector3.Dot(c,u),R=t.scale(-.5*m*x/f).add(e.scale(-.5*g*P/f)).add(i.scale(-.5*_*M/f)),A=t.subtract(R).normalize(),C=s.Vector3.Cross(d,A).normalize();if(a){let e=2*Math.PI/r;for(let t=0;t<=2*Math.PI;t+=e)n.push(R.add(A.scale(y*Math.cos(t)).add(C.scale(y*Math.sin(t)))));n.push(t)}else{let e,s=1/r,a=0;do e=R.add(A.scale(y*Math.cos(a)).add(C.scale(y*Math.sin(a)))),n.push(e),a+=s;while(!e.equalsWithEpsilon(i,y*s*1.1))n.push(i),o&&n.push(t)}return new l(n)}constructor(t){this._length=0,this._points=t,this._length=this._computeLength(t)}getPoints(){return this._points}length(){return this._length}continue(t){let e=this._points[this._points.length-1],i=this._points.slice(),r=t.getPoints();for(let t=1;t<r.length;t++)i.push(r[t].subtract(r[0]).add(e));return new l(i)}_computeLength(t){let e=0;for(let i=1;i<t.length;i++)e+=t[i].subtract(t[i-1]).length();return e}}t.s(["Angle",0,a,"Arc2",0,n,"BezierCurve",0,class{static Interpolate(t,e,i,r,s){if(0===t)return 0;let o=1-3*r+3*e,a=3*r-6*e,n=3*e,h=t;for(let e=0;e<5;e++){let e=h*h,i=e*h*o+a*e+n*h,r=1/(3*o*e+2*a*h+n);h-=(i-t)*r,h=Math.min(1,Math.max(0,h))}return 3*Math.pow(1-h,2)*h*i+3*(1-h)*Math.pow(h,2)*s+Math.pow(h,3)}},"Curve3",0,l,"Orientation",0,i,"Path2",0,h,"Path3D",0,c])},58302,16074,63764,95190,t=>{"use strict";var e=t.i(10272),i=t.i(37143),r=t.i(59576),s=t.i(96265),o=t.i(89030),a=t.i(70247);class n{constructor(t,e,i){this._cameraPosition=e,this._behavior=i,this.activeInput=!1,this.speed=1,this.zoomSpeed=1,this.panSpeed=1,this.rotationXSpeed=1,this.rotationYSpeed=1,this._zoomSpeedMultiplier=1,this._panSpeedMultiplier=1,this.zoomInertia=.9,this.panInertia=.9,this.rotationInertia=.9,this.zoomAccumulatedPixels=0,this.panAccumulatedPixels=new s.Vector3,this.rotationAccumulatedPixels=new s.Vector3,this.zoomDeltaCurrentFrame=0,this.panDeltaCurrentFrame=s.Vector3.Zero(),this.rotationDeltaCurrentFrame=s.Vector3.Zero(),this._zoomVelocity=0,this._panVelocity=new s.Vector3,this.referenceFrameRate=60,this._rotationVelocity=new s.Vector3,this._prevFrameTimeMs=0,this._scene=t}computeCurrentFrameDeltas(){let t=this._scene.getEngine().getDeltaTime(),e=this._getEffectiveDeltaMs(t);if(0===this._zoomVelocity&&0===this.zoomAccumulatedPixels&&0===this._panVelocity.x&&0===this._panVelocity.y&&0===this._panVelocity.z&&0===this.panAccumulatedPixels.x&&0===this.panAccumulatedPixels.y&&0===this.panAccumulatedPixels.z&&0===this._rotationVelocity.x&&0===this._rotationVelocity.y&&0===this._rotationVelocity.z&&0===this.rotationAccumulatedPixels.x&&0===this.rotationAccumulatedPixels.y&&0===this.rotationAccumulatedPixels.z&&!this.activeInput){this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,t>0&&(this._prevFrameTimeMs=t);return}this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,(this.panAccumulatedPixels.lengthSquared()>0||this.rotationAccumulatedPixels.lengthSquared()>0||0!==this.zoomAccumulatedPixels)&&this._behavior?.isInterpolating&&this._behavior.stopAllAnimations(),this._panVelocity.copyFromFloats(this._calculateCurrentVelocity(this._panVelocity.x,this.panAccumulatedPixels.x,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.y,this.panAccumulatedPixels.y,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.z,this.panAccumulatedPixels.z,this.panInertia)),this._panVelocity.scaleToRef(this.speed*this.panSpeed*this._panSpeedMultiplier*e,this.panDeltaCurrentFrame),this._rotationVelocity.copyFromFloats(this._calculateCurrentVelocity(this._rotationVelocity.x,this.rotationAccumulatedPixels.x,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.y,this.rotationAccumulatedPixels.y,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.z,this.rotationAccumulatedPixels.z,this.rotationInertia)),this.rotationDeltaCurrentFrame.copyFromFloats(this._rotationVelocity.x*this.speed*this.rotationXSpeed*e,this._rotationVelocity.y*this.speed*this.rotationYSpeed*e,0),this._zoomVelocity=this._calculateCurrentVelocity(this._zoomVelocity,this.zoomAccumulatedPixels,this.zoomInertia),this.zoomDeltaCurrentFrame=this._zoomVelocity*(this.speed*this.zoomSpeed*this._zoomSpeedMultiplier)*e,t>0&&(this._prevFrameTimeMs=t),this.zoomAccumulatedPixels=0,this.panAccumulatedPixels.setAll(0),this.rotationAccumulatedPixels.setAll(0),this.activeInput=!1}resetRotationVelocity(){this._rotationVelocity.setAll(0),this.rotationAccumulatedPixels.setAll(0)}resetPanVelocity(){this._panVelocity.setAll(0),this.panAccumulatedPixels.setAll(0)}resetZoomVelocity(){this._zoomVelocity=0,this.zoomAccumulatedPixels=0}get isInterpolating(){return!!this._behavior?.isInterpolating}getFrameIndependentDecay(t){let e=this._scene.getEngine().getDeltaTime();return Math.pow(t,this._getEffectiveDeltaMs(e)/(1e3/this.referenceFrameRate))}getFrameIndependentInputScale(t){let e=1-t;return e<=0?1:(1-this.getFrameIndependentDecay(t))/e}_getEffectiveDeltaMs(t){return t>0?t:this._prevFrameTimeMs>0?this._prevFrameTimeMs:1e3/this.referenceFrameRate}_calculateCurrentVelocity(t,e,i){let r=t,s=this._scene.getEngine().getDeltaTime(),o=this._getEffectiveDeltaMs(s);if(0===o)return r;let a=this.getFrameIndependentDecay(i);if(r*=a,0!==e||this.activeInput){let t=1-i;r+=e/o*(t>0?(1-a)/t:1)}else 1e-6>Math.abs(r)&&(r=0);return r}}t.s(["CameraMovement",0,n],16074);class h{constructor(t,e){this.inputMap=[],this.handlers=t,this._createDefaultEntries=e,this.resetInputMap()}resolveInteraction(t,e){for(let i of this.inputMap)if(i.source===t&&this._entryMatches(i,e))return i;return null}resetInputMap(){this.inputMap=this._createDefaultEntries?.()??[]}getEntry(t,e,i){let r=this.inputMap;for(let s=0;s<r.length;s++){let o=r[s];if(o.source===t&&o.interaction===e&&this._entryConditionsMatch(o,i))return o}}getEntries(t,e,i){let r=[],s=this.inputMap;for(let o=0;o<s.length;o++){let a=s[o];a.source===t&&a.interaction===e&&this._entryConditionsMatch(a,i)&&r.push(a)}return r}addEntry(t){let e=this._entrySpecificity(t),i=this.inputMap.length;for(let t=0;t<this.inputMap.length;t++)if(this._entrySpecificity(this.inputMap[t])<e){i=t;break}this.inputMap.splice(i,0,t)}setInteraction(t,e,i){let r=this.resolveInteraction(t,e);return r&&this._entryCoversAllConditionsOf(r,e)?r.interaction=i:this.addEntry({source:t,...e??{},interaction:i}),!0}_entryCoversAllConditionsOf(t,e){if(!e)return!0;for(let i of Object.keys(e)){let r=e[i];if(void 0!==r){if("modifiers"===i){let e=t.modifiers??{};for(let t of Object.keys(r))if(void 0!==r[t]&&void 0===e[t])return!1}else if(void 0===t[i])return!1}}return!0}setInteractions(t,e,i){let r=0,s=this.inputMap;for(let o=0;o<s.length;o++){let a=s[o];a.source===t&&this._entryMatches(a,e)&&(a.interaction=i,r++)}return r}_entryMatches(t,e){switch(t.source){case"pointer":if(void 0!==t.button&&t.button!==e?.button)return!1;return this._matchModifiers(t.modifiers,e?.modifiers);case"wheel":return this._matchModifiers(t.modifiers,e?.modifiers);case"touch":if(void 0!==t.touchCount&&t.touchCount!==e?.touchCount)return!1;return!0;case"keyboard":if(void 0!==t.key&&(Array.isArray(t.key)?-1===t.key.indexOf(e?.key??-1):t.key!==e?.key))return!1;return this._matchModifiers(t.modifiers,e?.modifiers)}}_entryConditionsMatch(t,e){if(!e)return!0;switch(t.source){case"pointer":if("button"in e&&t.button!==e.button)return!1;return!("modifiers"in e)||this._entryModifiersMatch(t.modifiers,e.modifiers);case"wheel":return!("modifiers"in e)||this._entryModifiersMatch(t.modifiers,e.modifiers);case"touch":return!("touchCount"in e)||t.touchCount===e.touchCount;case"keyboard":if("key"in e){if(void 0===t.key)return void 0===e.key;if(void 0===e.key||(Array.isArray(t.key)?-1===t.key.indexOf(e.key):t.key!==e.key))return!1}return!("modifiers"in e)||this._entryModifiersMatch(t.modifiers,e.modifiers)}}_entrySpecificity(t){let e=0;return"button"in t&&void 0!==t.button&&e++,"key"in t&&void 0!==t.key&&e++,"touchCount"in t&&void 0!==t.touchCount&&e++,"modifiers"in t&&t.modifiers&&e++,e}_matchModifiers(t,e){return!t||(void 0===t.ctrl||t.ctrl===(e?.ctrl??!1))&&(void 0===t.shift||t.shift===(e?.shift??!1))&&(void 0===t.alt||t.alt===(e?.alt??!1))}_entryModifiersMatch(t,e){return e?void 0===e.ctrl&&void 0===e.shift&&void 0===e.alt?!t||void 0===t.ctrl&&void 0===t.shift&&void 0===t.alt:(void 0===e.ctrl||t?.ctrl===e.ctrl)&&(void 0===e.shift||t?.shift===e.shift)&&(void 0===e.alt||t?.alt===e.alt):!t}}t.s(["InputMapper",0,h],63764);class c extends n{constructor(t,e,i){super(t,e,i),this.input=new h({translate:(t,e,i)=>{this.panAccumulatedPixels.x+=t,this.panAccumulatedPixels.y+=e,this.panAccumulatedPixels.z+=i},rotate:(t,e)=>{this.rotationAccumulatedPixels.x+=t,this.rotationAccumulatedPixels.y+=e}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",interaction:"rotate"},{source:"keyboard",interaction:"translate"},{source:"keyboard",interaction:"rotate"},{source:"touch",interaction:"rotate"},{source:"touch",interaction:"translate"}]}}let l=s.Matrix.Zero(),u=s.Quaternion.Identity();class d extends r.Camera{get inertia(){return this._targetInertia}set inertia(t){this._targetInertia=t,this.movement&&(this.movement.panInertia=t,this.movement.rotationInertia=t)}constructor(t,e,i,r=!0){super(t,e,i,r),this.cameraDirection=new s.Vector3(0,0,0),this.cameraRotation=new s.Vector2(0,0),this._targetInertia=.9,this.updateUpVectorFromRotation=!1,this.speed=2,this.noRotationConstraint=!1,this.invertRotation=!1,this.inverseRotationSpeed=.2,this._panningEpsilon=o.Epsilon,this._rotationEpsilon=o.Epsilon,this.lockedTarget=null,this._currentTarget=s.Vector3.Zero(),this._initialFocalDistance=1,this._viewMatrix=s.Matrix.Zero(),this._cameraTransformMatrix=s.Matrix.Zero(),this._cameraRotationMatrix=s.Matrix.Zero(),this._transformedReferencePoint=s.Vector3.Zero(),this._deferredPositionUpdate=new s.Vector3,this._deferredRotationQuaternionUpdate=new s.Quaternion,this._deferredRotationUpdate=new s.Vector3,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=s.Vector3.Forward(this.getScene().useRightHandedSystem),this.rotation=new s.Vector3(0,this.getScene().useRightHandedSystem?Math.PI:0,0),this.movement=new c(this.getScene(),this.position),this.movement.panInertia=this.inertia,this.movement.rotationInertia=this.inertia}getFrontPosition(t){this.getWorldMatrix();let e=s.TmpVectors.Vector3[0],i=s.TmpVectors.Vector3[1];return i.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(i,e),e.scaleInPlace(t),this.globalPosition.add(e)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){let t=this.lockedTarget;t.computeWorldMatrix().getTranslationToRef(t.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return!!super._restoreStateValues()&&(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&this._storedRotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0)}_initCache(){super._initCache(),this._cache.lockedTarget=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new s.Quaternion(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(t){t||super._updateCache();let e=this._getLockedTargetPosition();e?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(e):this._cache.lockedTarget=e.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;let t=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(t):!t)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){let t=this.getEngine();return this.speed*Math.sqrt(t.getDeltaTime()/(100*t.getFps()))}setTarget(t){this.upVector.normalize(),this._initialFocalDistance=t.subtract(this.position).length(),this.position.z===t.z&&(this.position.z+=o.Epsilon),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?s.Matrix.LookAtRHToRef(this.position,t,s.Vector3.UpReadOnly,l):s.Matrix.LookAtLHToRef(this.position,t,s.Vector3.UpReadOnly,l),l.invert();let e=this.rotationQuaternion||u;s.Quaternion.FromRotationMatrixToRef(l,e),e.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(s.TmpVectors.Matrix[0]),s.Vector3.TransformNormalToRef(this.cameraDirection,s.TmpVectors.Matrix[0],s.TmpVectors.Vector3[0]),this._deferredPositionUpdate.addInPlace(s.TmpVectors.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){let t=this.movement,e=0!==this.cameraDirection.x||0!==this.cameraDirection.y||0!==this.cameraDirection.z,i=0!==this.cameraRotation.x||0!==this.cameraRotation.y;t.panAccumulatedPixels.addInPlace(this.cameraDirection),t.rotationAccumulatedPixels.x+=this.cameraRotation.x,t.rotationAccumulatedPixels.y+=this.cameraRotation.y,t.computeCurrentFrameDeltas(),this.cameraDirection.copyFrom(t.panDeltaCurrentFrame),this.cameraRotation.set(t.rotationDeltaCurrentFrame.x,t.rotationDeltaCurrentFrame.y);let r=this.speed*this._panningEpsilon;!e&&Math.abs(this.cameraDirection.x)<r&&Math.abs(this.cameraDirection.y)<r&&Math.abs(this.cameraDirection.z)<r&&(this.cameraDirection.setAll(0),t.resetPanVelocity());let o=this.speed*this._rotationEpsilon;!i&&Math.abs(this.cameraRotation.x)<o&&Math.abs(this.cameraRotation.y)<o&&(this.cameraRotation.set(0,0),t.resetRotationVelocity());let a=this.invertRotation?-this.inverseRotationSpeed:1,n=this._decideIfNeedsToMove(),h=!!(this.cameraRotation.x||this.cameraRotation.y);this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),n&&this._updatePosition(),h&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*a,this._deferredRotationUpdate.y+=this.cameraRotation.y*a,!this.noRotationConstraint&&(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(s.Quaternion.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),this.cameraDirection.setAll(0),this.cameraRotation.set(0,0),super._checkInputs()}_updateCameraRotationMatrix(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):s.Matrix.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){return s.Vector3.TransformNormalToRef(s.Vector3.UpReadOnly,this._cameraRotationMatrix,this.upVector),this}_getViewMatrix(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!==this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),s.Vector3.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?a.Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(s.Quaternion.FromEulerVectorToRef(this.rotation,u),a.Axis.Y.rotateByQuaternionToRef(u,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(t,e,i){if(this.getScene().useRightHandedSystem?s.Matrix.LookAtRHToRef(t,e,i,this._viewMatrix):s.Matrix.LookAtLHToRef(t,e,i,this._viewMatrix),this.parent){let t=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(t,this._viewMatrix),this._viewMatrix.invert(),this._markSyncedWithParent()}}createRigCamera(t,e){if(this.cameraRigMode!==r.Camera.RIG_MODE_NONE){let e=new d(t,this.position.clone(),this.getScene());return e.isRigCamera=!0,e.rigParent=this,this.cameraRigMode===r.Camera.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new s.Quaternion),e._cameraRigParams={},e.rotationQuaternion=new s.Quaternion),e.mode=this.mode,e.orthoLeft=this.orthoLeft,e.orthoRight=this.orthoRight,e.orthoTop=this.orthoTop,e.orthoBottom=this.orthoBottom,e}return null}_updateRigCameras(){let t=this._rigCameras[0],e=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case r.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case r.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case r.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case r.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case r.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:{let i=this.cameraRigMode===r.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,s=this.cameraRigMode===r.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*i,t),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*s,e);break}case r.Camera.RIG_MODE_VR:t.rotationQuaternion&&e.rotationQuaternion&&this.rotationQuaternion?(t.rotationQuaternion.copyFrom(this.rotationQuaternion),e.rotationQuaternion.copyFrom(this.rotationQuaternion)):(t.rotation.copyFrom(this.rotation),e.rotation.copyFrom(this.rotation)),t.position.copyFrom(this.position),e.position.copyFrom(this.position)}super._updateRigCameras()}_getRigCamPositionAndTarget(t,e){this.getTarget().subtractToRef(this.position,d._TargetFocalPoint),d._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);let i=d._TargetFocalPoint.addInPlace(this.position);s.Matrix.TranslationToRef(-i.x,-i.y,-i.z,d._TargetTransformMatrix),d._TargetTransformMatrix.multiplyToRef(s.Matrix.RotationAxis(e.upVector,t),d._RigCamTransformMatrix),s.Matrix.TranslationToRef(i.x,i.y,i.z,d._TargetTransformMatrix),d._RigCamTransformMatrix.multiplyToRef(d._TargetTransformMatrix,d._RigCamTransformMatrix),s.Vector3.TransformCoordinatesToRef(this.position,d._RigCamTransformMatrix,e.position),e.setTarget(i)}getClassName(){return"TargetCamera"}}d._RigCamTransformMatrix=new s.Matrix,d._TargetTransformMatrix=new s.Matrix,d._TargetFocalPoint=new s.Vector3,(0,e.__decorate)([(0,i.serialize)()],d.prototype,"updateUpVectorFromRotation",void 0),(0,e.__decorate)([(0,i.serializeAsVector3)()],d.prototype,"rotation",void 0),(0,e.__decorate)([(0,i.serialize)()],d.prototype,"speed",void 0),(0,e.__decorate)([(0,i.serializeAsMeshReference)("lockedTargetId")],d.prototype,"lockedTarget",void 0),t.s(["TargetCamera",0,d],58302);var p=t.i(13379),_=t.i(80871),m={};t.s(["CameraInputTypes",0,m,"CameraInputsManager",0,class{constructor(t){this.attachedToElement=!1,this.attached={},this.camera=t,this.checkInputs=()=>{}}add(t){let e=t.getSimpleName();this.attached[e]?p.Logger.Warn("camera input of type "+e+" already exists on camera"):(this.attached[e]=t,t.camera=this.camera,t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t))),this.attachedToElement&&t.attachControl(this.noPreventDefault))}remove(t){for(let e in this.attached){let i=this.attached[e];if(i===t){i.detachControl(),i.camera=null,delete this.attached[e],this.rebuildInputCheck();return}}}removeByType(t){for(let e in this.attached){let i=this.attached[e];i.getClassName()===t&&(i.detachControl(),i.camera=null,delete this.attached[e],this.rebuildInputCheck())}}_addCheckInputs(t){let e=this.checkInputs;return()=>{e(),t()}}attachInput(t){this.attachedToElement&&t.attachControl(this.noPreventDefault)}attachElement(t=!1){if(!this.attachedToElement)for(let e in t=!r.Camera.ForceAttachControlToAlwaysPreventDefault&&t,this.attachedToElement=!0,this.noPreventDefault=t,this.attached)this.attached[e].attachControl(t)}detachElement(t=!1){for(let e in this.attached)this.attached[e].detachControl(),t&&(this.attached[e].camera=null);this.attachedToElement=!1}rebuildInputCheck(){for(let t in this.checkInputs=()=>{},this.attached){let e=this.attached[t];e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(t){let e={};for(let t in this.attached){let i=this.attached[t],r=_.SerializationHelper.Serialize(i);e[i.getClassName()]=r}t.inputsmgr=e}parse(t){let e=t.inputsmgr;if(e)for(let t in this.clear(),e){let i=m[t];if(i){let r=e[t],s=_.SerializationHelper.Parse(()=>new i,r,null);this.add(s)}}else for(let e in this.attached){let i=m[this.attached[e].getClassName()];if(i){let r=_.SerializationHelper.Parse(()=>new i,t,null);this.remove(this.attached[e]),this.add(r)}}}}],95190)},42829,t=>{t.v(e=>Promise.all(["static/chunks/3l1dr_qm_x5kp.js"].map(e=>t.l(e))).then(()=>e(47786)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24543,e=>{"use strict";var t=e.i(29212),n=e.i(94179);e.i(82665);var i=e.i(20880);let a="__other_sp__",o="__other_mesh__";function l(e){return`${e[0]}|${e[1]}|${e[2]}`}function s(e,t){return t<=1?0:1.4-e/(t-1)*2.8}var r=e.i(56054),u=e.i(62238),d=e.i(59683),m=e.i(37660),h=e.i(93425),c=e.i(42279);let g="__all__",b={maxStandpoints:6,maxMeshes:10,maxRibbons:70};function f(e,t){return`${e}|${t}`}function p({label:e,value:n,onChange:i,allLabel:a,options:o}){return(0,t.jsxs)("label",{className:"flex items-center gap-1.5 rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg backdrop-blur",children:[(0,t.jsx)("span",{className:"font-medium text-fg-muted",children:e}),(0,t.jsxs)("select",{className:"max-w-[12rem] bg-transparent text-white outline-none",value:n,onChange:e=>i(e.target.value),children:[(0,t.jsx)("option",{value:g,children:a}),o.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))]})]})}function w({active:e,onClick:n,children:i,disabled:a=!1,title:o}){return(0,t.jsx)("button",{type:"button",onClick:n,disabled:a,title:o,className:`rounded px-2 py-0.5 font-medium transition ${a?"cursor-not-allowed text-fg-muted/40":e?"bg-amber text-ink":"text-fg-muted hover:text-fg"}`,children:i})}function x({standpoints:e,proxyMeshes:i,selectedKey:a,onSelect:o}){let l=(0,n.useRef)(null),s=(0,n.useMemo)(()=>e.filter(e=>e.origin),[e]),r=(0,n.useMemo)(()=>{let e=1/0,t=-1/0,n=1/0,a=-1/0,o=(i,o)=>{e=Math.min(e,i),t=Math.max(t,i),n=Math.min(n,o),a=Math.max(a,o)};for(let e of i)o(e.aabb[0],e.aabb[2]),o(e.aabb[3],e.aabb[5]);for(let e of s)o(e.origin[0],e.origin[2]);return Number.isFinite(e)?(t-e<.001&&(e-=1,t+=1),a-n<.001&&(n-=1,a+=1),{minX:e,maxX:t,minZ:n,maxZ:a}):{minX:-1,maxX:1,minZ:-1,maxZ:1}},[i,s]),u=(0,n.useMemo)(()=>{let e=Math.min(134/(r.maxX-r.minX),94/(r.maxZ-r.minZ));return(t,n)=>[8+(t-r.minX)*e,8+(n-r.minZ)*e]},[r]),d=(0,n.useMemo)(()=>s.reduce((e,t)=>Math.max(e,t.count),1),[s]);return(0,n.useEffect)(()=>{let e=l.current,t=e?.getContext("2d");if(!t)return;let n=window.devicePixelRatio||1;for(let a of(e.width=150*n,e.height=110*n,t.setTransform(n,0,0,n,0,0),t.clearRect(0,0,150,110),t.fillStyle="rgba(8,10,14,0.85)",t.fillRect(0,0,150,110),t.strokeStyle="rgba(120,140,170,0.35)",t.lineWidth=1,i)){let[e,n]=u(a.aabb[0],a.aabb[2]),[i,o]=u(a.aabb[3],a.aabb[5]);t.strokeRect(Math.min(e,i),Math.min(n,o),Math.abs(i-e),Math.abs(o-n))}for(let e of s){let[n,i]=u(e.origin[0],e.origin[2]),o=2+e.count/d*4,l=e.key===a;t.beginPath(),t.arc(n,i,o,0,2*Math.PI),t.fillStyle=l?"rgba(242,115,242,1)":"rgba(242,115,242,0.55)",t.fill(),l&&(t.beginPath(),t.arc(n,i,o+2.5,0,2*Math.PI),t.strokeStyle="rgba(255,255,255,0.9)",t.lineWidth=1.5,t.stroke())}},[i,s,u,d,a]),(0,t.jsxs)("div",{className:"absolute right-3 top-3 rounded-md border border-edge bg-ink/80 p-1 backdrop-blur",children:[(0,t.jsx)("div",{className:"px-1 pb-0.5 text-[10px] font-medium text-fg-muted",children:"Standpoints (top view)"}),(0,t.jsx)("canvas",{ref:l,className:"h-27.5 w-37.5 cursor-pointer rounded",onClick:e=>{let t=l.current;if(!t||0===s.length)return;let n=t.getBoundingClientRect(),i=(e.clientX-n.left)/n.width*150,a=(e.clientY-n.top)/n.height*110,r=null,d=1/0;for(let e of s){let[t,n]=u(e.origin[0],e.origin[2]),o=(t-i)**2+(n-a)**2;o<d&&(d=o,r=e)}r&&d<=196&&o(r.key)}})]})}e.s(["FlowSankey3D",0,function({links:v,gridSize:k,proxyMeshes:M=[],maxLinks:z=80,baseUrl:$,apiKey:y,flowQuery:I,hasFirstPerson:j=!1}){let _=(0,n.useRef)(null),C=(0,n.useRef)(null),[S,B]=(0,n.useState)("loading"),[A,P]=(0,n.useState)(null),[L,E]=(0,n.useState)(g),[N,R]=(0,n.useState)(g),[O,T]=(0,n.useState)(g),[Z,F]=(0,n.useState)("aggregate"),[V,W]=(0,n.useState)(null),[X,D]=(0,n.useState)("all"),[H,K]=(0,n.useState)(v),U=!!($&&I),q=(0,n.useMemo)(()=>I?JSON.stringify(I):"",[I]),G=(0,n.useRef)(!1);(0,n.useEffect)(()=>{!G.current&&j&&(D("first-person"),G.current=!0)},[j]),(0,n.useEffect)(()=>{j&&"viewer"===X&&D("first-person")},[j,X]),(0,n.useEffect)(()=>{U||K(v)},[v,U]),(0,n.useEffect)(()=>{if(!$||!I)return;let e=!1,t=new i.CollectorApi($,y??""),n="all"===X?void 0:X;return t.flowHeatmap({...I,bins:k,limit:400,groupByOrigin:!0,cameraMode:n}).then(t=>{e||K(t)}).catch(()=>{e||K([])}),()=>{e=!0}},[$,y,q,X,k]);let J=(0,n.useMemo)(()=>{let e=new Map;for(let t of H){if(!t.originVoxel)continue;let n=l(t.originVoxel),i=t.origin,a=e.get(n);a?(a.count+=t.count,i&&(a.ox+=i[0]*t.count,a.oy+=i[1]*t.count,a.oz+=i[2]*t.count,a.wsum+=t.count)):e.set(n,{key:n,voxel:t.originVoxel,count:t.count,ox:i?i[0]*t.count:0,oy:i?i[1]*t.count:0,oz:i?i[2]*t.count:0,wsum:i?t.count:0})}return[...e.values()].map(e=>({key:e.key,voxel:e.voxel,count:e.count,origin:e.wsum>0?[e.ox/e.wsum,e.oy/e.wsum,e.oz/e.wsum]:void 0})).sort((e,t)=>t.count-e.count)},[H]),Y=J.length>0,Q=(0,n.useMemo)(()=>O===g?null:J.find(e=>e.key===O)??null,[J,O]),ee=(0,n.useMemo)(()=>(function(e,t,n,i){let r=e.filter(e=>e.originVoxel);if(0===r.length)return{standpoints:[],gazes:[],meshes:[],ribbons:[],maxCount:1};let u=t.slice(0,Math.max(1,i.maxStandpoints)),d=new Set(u.map(e=>e.key)),m=e=>{let t=e.originVoxel?l(e.originVoxel):a;return d.has(t)?t:a},h=new Map;for(let e of r)h.set(e.mesh,(h.get(e.mesh)??0)+e.count);let c=new Set([...h.entries()].sort((e,t)=>t[1]-e[1]).slice(0,Math.max(1,i.maxMeshes)).map(([e])=>e)),g=e=>c.has(e)?e:o,b=new Map;for(let e of r){let t=m(e),n=g(e.mesh),i=`${t}|${e.azimuth_bin}|${e.elevation_bin}|${n}`,a=b.get(i);a?a.count+=e.count:b.set(i,{standpointId:t,gazeId:`${t}|${e.azimuth_bin}|${e.elevation_bin}`,meshId:n,azimuthBin:e.azimuth_bin,elevationBin:e.elevation_bin,count:e.count})}let f=[...b.values()].sort((e,t)=>t.count-e.count),p=f.slice(0,Math.max(1,i.maxRibbons)),w=f.slice(Math.max(1,i.maxRibbons));if(w.length>0){let e=new Map(p.map(e=>[`${e.standpointId}|${e.azimuthBin}|${e.elevationBin}|${o}`,e]));for(let t of w){let n=`${t.standpointId}|${t.azimuthBin}|${t.elevationBin}|${o}`,i=e.get(n);if(i)i.count+=t.count;else{let i={standpointId:t.standpointId,gazeId:t.gazeId,meshId:o,azimuthBin:t.azimuthBin,elevationBin:t.elevationBin,count:t.count};e.set(n,i),p.push(i)}}}let x=new Set(p.map(e=>e.standpointId)),v=new Set(p.map(e=>e.meshId)),k=[...u.filter(e=>x.has(e.key)).map(e=>e.key),...x.has(a)?[a]:[]],M=k.map((e,t)=>{let n=u.find(t=>t.key===e),i=p.filter(t=>t.standpointId===e).reduce((e,t)=>e+t.count,0);return{id:e,kind:"standpoint",pos:[-2.6,s(t,k.length),0],count:i,label:n?`[${n.voxel[0]}, ${n.voxel[1]}, ${n.voxel[2]}]`:"Other standpoints",isOther:e===a}}),z=new Map(M.map(e=>[e.id,e.pos[1]])),$=new Map;for(let e of p)$.set(e.meshId,($.get(e.meshId)??0)+e.count);let y=[...v].sort((e,t)=>($.get(t)??0)-($.get(e)??0));y.sort((e,t)=>(e===o)-(t===o));let I=y.map((e,t)=>({id:e,kind:"mesh",pos:[2.6,s(t,y.length),0],count:$.get(e)??0,label:e===o?"Other meshes":e,isOther:e===o})),j=new Map;for(let e of p){let t=j.get(e.gazeId);t?t.count+=e.count:j.set(e.gazeId,{az:e.azimuthBin,el:e.elevationBin,sp:e.standpointId,count:e.count})}let _=[...j.entries()].map(([e,t])=>{let i=z.get(t.sp)??0,a=(t.az+.5)/n-.5;return{id:e,kind:"gaze",pos:[0,i+((t.el+.5)/n-.5)*.85,1.6*a],count:t.count,label:`(${t.az}, ${t.el})`,isOther:!1}}),C=p.reduce((e,t)=>Math.max(e,t.count),1);return{standpoints:M,gazes:_,meshes:I,ribbons:p,maxCount:C}})(H,J,k,b),[H,J,k]),et="twostage"===Z&&Y;(0,n.useEffect)(()=>{"twostage"!==Z||Y||F("aggregate")},[Z,Y]);let en=(0,n.useMemo)(()=>{if(O!==g&&Y)return H.filter(e=>e.originVoxel&&l(e.originVoxel)===O);if(!Y)return H;let e=new Map;for(let t of H){let n=`${t.azimuth_bin}|${t.elevation_bin}|${t.mesh}`,i=e.get(n);i?i.count+=t.count:e.set(n,{azimuth_bin:t.azimuth_bin,elevation_bin:t.elevation_bin,mesh:t.mesh,count:t.count})}return[...e.values()]},[H,O,Y]),ei=(0,n.useMemo)(()=>[...en].sort((e,t)=>t.count-e.count).slice(0,Math.max(1,z)),[en,z]),ea=(0,n.useMemo)(()=>{let e=new Map;for(let t of ei)e.set(t.mesh,(e.get(t.mesh)??0)+t.count);return[...e.entries()].sort((e,t)=>t[1]-e[1])},[ei]),eo=(0,n.useMemo)(()=>{let e=new Map;for(let t of ei){let n=f(t.azimuth_bin,t.elevation_bin),i=e.get(n);i?i.count+=t.count:e.set(n,{azimuthBin:t.azimuth_bin,elevationBin:t.elevation_bin,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count)},[ei]);(0,n.useEffect)(()=>{!et&&L!==g&&(ea.some(([e])=>e===L)||E(g))},[et,L,ea]),(0,n.useEffect)(()=>{!et&&N!==g&&(eo.some(e=>f(e.azimuthBin,e.elevationBin)===N)||R(g))},[et,N,eo]),(0,n.useEffect)(()=>{!et&&O!==g&&(J.some(e=>e.key===O)||T(g))},[et,O,J]),(0,n.useEffect)(()=>{E(g),R(g),T(g)},[Z]);let el=(0,n.useMemo)(()=>et?ee.ribbons.filter(e=>{let t=O===g||e.standpointId===O,n=N===g||f(e.azimuthBin,e.elevationBin)===N,i=L===g||e.meshId===L;return t&&n&&i}).length:ei.filter(e=>{let t=N===g||f(e.azimuth_bin,e.elevation_bin)===N,n=L===g||e.mesh===L;return t&&n}).length,[et,ee,ei,L,N,O]),es=et?ee.ribbons.length:ei.length,er=(0,n.useMemo)(()=>et?ee.standpoints.map(e=>({value:e.id,label:`${e.label} \xb7 ${e.count}`})):J.slice(0,24).map(e=>({value:e.key,label:`[${e.voxel[0]}, ${e.voxel[1]}, ${e.voxel[2]}] \xb7 ${e.count}`})),[et,ee,J]),eu=(0,n.useMemo)(()=>{if(et){let e=new Map;for(let t of ee.ribbons){let n=f(t.azimuthBin,t.elevationBin),i=e.get(n);i?i.count+=t.count:e.set(n,{az:t.azimuthBin,el:t.elevationBin,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count).map(e=>({value:f(e.az,e.el),label:`(${e.az}, ${e.el}) \xb7 ${e.count}`}))}return eo.map(e=>({value:f(e.azimuthBin,e.elevationBin),label:`(${e.azimuthBin}, ${e.elevationBin}) \xb7 ${e.count}`}))},[et,ee,eo]),ed=(0,n.useMemo)(()=>et?ee.meshes.map(e=>({value:e.id,label:`${e.label} \xb7 ${e.count}`})):ea.map(([e,t])=>({value:e,label:`${e} \xb7 ${t}`})),[et,ee,ea]);return(0,n.useEffect)(()=>{let t=_.current;if(!t||et)return;if(0===ei.length)return void B("empty");let n=!1,i=null;return B("loading"),P(null),(async()=>{try{let[{Engine:a},{Scene:o},{ArcRotateCamera:l},{HemisphericLight:s},{Vector3:m,Color3:h,Color4:c},{MeshBuilder:b},{StandardMaterial:p}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(96664)]);if(n)return;let w=new a(t,!0,{preserveDrawingBuffer:!1}),x=new o(w);x.clearColor=new c(.04,.05,.07,1);let v=new Map;for(let e of M)v.set(e.name,function(e){let t=e.aabb;return[(t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2]}(e));let z=new Map,$=ea.map(([e])=>e).filter(e=>!v.has(e));for(let e=0;e<$.length;e++){let t=$[e],n=function(e){let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Math.abs(t)}(t),i=e/Math.max(1,$.length)*Math.PI*2+n%100/100*.35;z.set(t,[2.2*Math.cos(i),-.35+(n%7-3)*.06,2.2*Math.sin(i)])}for(let[e,t]of v.entries())z.set(e,t);let y=0,I=0,j=0,_=0;for(let e of z.values())y+=e[0],I+=e[1],j+=e[2],_++;let S=new m(y/Math.max(1,_),I/Math.max(1,_),j/Math.max(1,_)),A=1.8;for(let e of z.values()){let t=e[0]-S.x,n=e[1]-S.y,i=e[2]-S.z;A=Math.max(A,Math.sqrt(t*t+n*n+i*i))}let P=.75*A+1,E=Math.max(1,A/1.8),R=ei.reduce((e,t)=>Math.max(e,t.count),1),O=new p("flow-source-node",x);O.disableLighting=!0,O.emissiveColor=new h(.45,.75,1);let T=new p("flow-target-node",x);T.disableLighting=!0,T.emissiveColor=new h(1,.82,.42);let Z=new Set,F=new Set,V=e=>{let t=N===g||f(e.azimuth_bin,e.elevation_bin)===N,n=L===g||e.mesh===L;return t&&n},X=new Set,D=new Set;for(let e of ei)V(e)&&(X.add(f(e.azimuth_bin,e.elevation_bin)),D.add(e.mesh));for(let e of ei){let t=`${e.azimuth_bin}|${e.elevation_bin}`,n=z.get(e.mesh);if(!n)continue;let i=V(e),a=(e.azimuth_bin+.5)/k*Math.PI*2-Math.PI,o=(e.elevation_bin+.5)/k*Math.PI-Math.PI/2,l=Math.cos(o),s=l*Math.cos(a),u=Math.sin(o),d=l*Math.sin(a),c=new m(S.x+s*P,S.y+u*P,S.z+d*P),f=new m(n[0],n[1],n[2]);if(!Z.has(t)){let e=b.CreateSphere(`flow-src-${t}`,{diameter:.12*E,segments:6},x);e.position=c;let n=O.clone(`flow-src-mat-${t}`);n.alpha=X.has(t)||L===g&&N===g?1:.22,e.material=n,e.isPickable=!1,Z.add(t)}if(!F.has(e.mesh)){let t=b.CreateSphere(`flow-target-${e.mesh}`,{diameter:.2*E,segments:7},x);t.position=f;let n=T.clone(`flow-target-mat-${e.mesh}`);n.alpha=D.has(e.mesh)||L===g&&N===g?1:.22,t.material=n,t.isPickable=!0,t.metadata={hoverLabel:e.mesh},F.add(e.mesh)}let w=c.add(f).scale(.5),v=w.subtract(S),M=Math.sqrt(v.x*v.x+v.y*v.y+v.z*v.z),$=M>1e-6?v.x/M:0,y=M>1e-6?v.y/M:1,I=M>1e-6?v.z/M:0,j=(.35+e.count/R*.75)*E,_=new m(w.x+$*j,w.y+y*j+.12*E,w.z+I*j),C=[];for(let e=0;e<=18;e++){let t=e/18,n=1-t;C.push(new m(n*n*c.x+2*n*t*_.x+t*t*f.x,n*n*c.y+2*n*t*_.y+t*t*f.y,n*n*c.z+2*n*t*_.z+t*t*f.z))}let B=e.count/R,[A,W,H]=(0,r.heatRgb)(B),K=b.CreateTube(`flow-link-${e.mesh}-${t}`,{path:C,radius:(i?1:.4)*(.012+.04*B)*E,tessellation:8,cap:0,sideOrientation:0},x),U=new p(`flow-link-mat-${e.mesh}-${t}`,x);U.disableLighting=!0,U.emissiveColor=new h(A,W,H),U.alpha=i?.35+.65*B:.08,K.material=U,K.isPickable=!0,K.metadata={hoverLabel:e.mesh}}let H=new l("flow-cam",Math.PI/4,Math.PI/3,3.4*A,S,x);H.attachControl(t,!0),(0,u.disableWheelZoom)(H),C.current=H,new s("flow-light",new m(.3,1,.2),x);let K=b.CreateSphere("flow-source-dome",{diameter:2*P,segments:20},x);K.position=S;let U=new p("flow-source-dome-mat",x);U.wireframe=!0,U.disableLighting=!0,U.emissiveColor=new h(.16,.2,.28),U.alpha=.35,K.material=U,K.isPickable=!1;let q=Q?.origin;if(q){let e=new m(q[0],q[1],q[2]),t=b.CreateSphere("flow-standpoint",{diameter:.26*E,segments:10},x);t.position=e;let n=new p("flow-standpoint-mat",x);n.disableLighting=!0,n.emissiveColor=new h(.95,.45,.95),t.material=n,t.isPickable=!1;let i=b.CreateLines("flow-standpoint-stem",{points:[e,new m(e.x,S.y,e.z)]},x);i.color=new h(.95,.45,.95),i.isPickable=!1}w.runRenderLoop(()=>x.render());let G=()=>w.resize();window.addEventListener("resize",G);let J=(0,d.attachMeshHover)(x,t,W);B("ready"),i=()=>{window.removeEventListener("resize",G),J(),W(null),C.current=null,x.dispose(),w.dispose()}}catch(e){if(n)return;B("error"),P(e instanceof Error?e.message:"Failed to render flow links.")}})(),()=>{n=!0,i?.()}},[ei,k,M,L,N,Q,et]),(0,n.useEffect)(()=>{let t=_.current;if(!t||!et)return;if(0===ee.ribbons.length)return void B("empty");let n=!1,i=null;return B("loading"),P(null),(async()=>{try{let[{Engine:a},{Scene:o},{ArcRotateCamera:l},{HemisphericLight:s},{Vector3:m,Color3:h,Color4:c},{MeshBuilder:b},{StandardMaterial:p}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(96664)]);if(n)return;let w=new a(t,!0,{preserveDrawingBuffer:!1}),x=new o(w);x.clearColor=new c(.04,.05,.07,1);let v=e=>{let t=O===g||e.standpointId===O,n=N===g||f(e.azimuthBin,e.elevationBin)===N,i=L===g||e.meshId===L;return t&&n&&i},k=O!==g||N!==g||L!==g,M=new Set;for(let e of ee.ribbons)v(e)&&(M.add(e.standpointId),M.add(e.gazeId),M.add(e.meshId));let z={standpoint:[.95,.45,.95],gaze:[.45,.75,1],mesh:[1,.82,.42]},$={standpoint:.26,gaze:.13,mesh:.22},y=[...ee.standpoints,...ee.gazes,...ee.meshes],I=new Map(y.map(e=>[e.id,e.pos])),j=new Map(y.map(e=>[e.id,e.label]));for(let e of y){let t=b.CreateSphere(`ts-node-${e.kind}-${e.id}`,{diameter:$[e.kind],segments:8},x);t.position=new m(e.pos[0],e.pos[1],e.pos[2]);let n=new p(`ts-node-mat-${e.kind}-${e.id}`,x);n.disableLighting=!0;let[i,a,o]=z[e.kind];n.emissiveColor=new h(i,a,o),n.alpha=!k||M.has(e.id)?1:.2,t.material=n,t.isPickable=!0,t.metadata={hoverLabel:e.label}}let _=(e,t,n)=>{let i=e[0],a=e[1],o=e[2],l=t[0],s=t[1],r=t[2],u=[(i+l)/2,(a+s)/2+n,(o+r)/2],d=[];for(let e=0;e<=12;e++){let t=e/12,n=1-t;d.push(new m(n*n*i+2*n*t*u[0]+t*t*l,n*n*a+2*n*t*u[1]+t*t*s,n*n*o+2*n*t*u[2]+t*t*r))}return d};for(let e of ee.ribbons){let t=I.get(e.standpointId),n=I.get(e.gazeId),i=I.get(e.meshId);if(!t||!n||!i)continue;let a=e.count/ee.maxCount,o=.18+.5*a,l=[..._(t,n,o),..._(n,i,o).slice(1)],s=v(e),[u,d,m]=(0,r.heatRgb)(a),c=b.CreateTube(`ts-link-${e.standpointId}-${e.gazeId}-${e.meshId}`,{path:l,radius:(s?1:.4)*(.012+.04*a),tessellation:8,cap:0,sideOrientation:0},x),g=new p(`ts-link-mat-${e.standpointId}-${e.gazeId}-${e.meshId}`,x);g.disableLighting=!0,g.emissiveColor=new h(u,d,m),g.alpha=s?.35+.65*a:k?.06:.18,c.material=g,c.isPickable=!0,c.metadata={hoverLabel:j.get(e.meshId)??e.meshId}}let S=new l("ts-cam",Math.PI/2,Math.PI/2.4,8.5,m.Zero(),x);S.attachControl(t,!0),(0,u.disableWheelZoom)(S),C.current=S,new s("ts-light",new m(.3,1,.2),x),w.runRenderLoop(()=>x.render());let A=()=>w.resize();window.addEventListener("resize",A);let P=(0,d.attachMeshHover)(x,t,W);B("ready"),i=()=>{window.removeEventListener("resize",A),P(),W(null),C.current=null,x.dispose(),w.dispose()}}catch(e){if(n)return;B("error"),P(e instanceof Error?e.message:"Failed to render flow links.")}})(),()=>{n=!0,i?.()}},[et,ee,O,N,L]),(0,t.jsx)(h.Panel,{title:"Flow Sankey (3D)",subtitle:"Direction-bin → mesh links (aggregate), or standpoint → gaze → mesh (two-stage)",help:(0,t.jsxs)(t.Fragment,{children:["Each ",(0,t.jsx)("strong",{children:"source"})," is a camera ",(0,t.jsx)("em",{children:"gaze-direction bin"})," — a cell on the sphere of where viewers were looking (grouped by azimuth/elevation). Each"," ",(0,t.jsx)("strong",{children:"target"})," is a ",(0,t.jsx)("em",{children:"mesh that was clicked"}),". A ribbon's thickness is how many clicks on that mesh happened while viewers looked from that direction, so you can see which viewpoints drive interaction with which objects. When the scene reports"," ",(0,t.jsx)("em",{children:"standpoints"}),'(where the viewer stood, §7.8), pick one to gate the flow to clicks made from that vantage — a pin marks it in the scene. "All standpoints" is the aggregate view. Switch to ',(0,t.jsx)("strong",{children:"Two-stage"})," for a three-column"," ",(0,t.jsx)("em",{children:"standpoint → gaze sector → mesh"}),'flow with a birdview minimap; the busiest standpoints/meshes are kept and the tail folds into an "Other" node.']}),children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:_,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),V?(0,t.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-[16rem] truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:V.x+12,top:V.y+12},children:V.label}):null,"ready"===S?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex flex-wrap gap-2",children:[Y?(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(w,{active:!et,onClick:()=>F("aggregate"),children:"Aggregate"}),(0,t.jsx)(w,{active:et,onClick:()=>F("twostage"),children:"Two-stage"})]}):null,U?(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(w,{active:"first-person"===X,onClick:()=>D("first-person"),children:"Walk"}),(0,t.jsx)(w,{active:"viewer"===X,onClick:()=>D("viewer"),disabled:j,title:j?"Orbit (viewer) flow isn't available for walkable scenes":void 0,children:"Orbit"}),(0,t.jsx)(w,{active:"all"===X,onClick:()=>D("all"),children:"All"})]}):null,Y?(0,t.jsx)(p,{label:"Standpoint",value:O,onChange:T,allLabel:"All standpoints",options:er}):null,(0,t.jsx)(p,{label:et?"Gaze":"Source",value:N,onChange:R,allLabel:et?"All gaze sectors":"All sources",options:eu}),(0,t.jsx)(p,{label:"Mesh",value:L,onChange:E,allLabel:"All meshes",options:ed})]}),et?(0,t.jsx)(x,{standpoints:J,proxyMeshes:M,selectedKey:O,onSelect:e=>T(t=>t===e?g:e)}):null,(0,t.jsxs)("div",{className:"pointer-events-none absolute bottom-3 right-3 flex max-w-[20rem] flex-col items-end gap-2",children:[U&&!j?(0,t.jsxs)("div",{className:"rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg-muted backdrop-blur",children:["Orbit-dominated scene — viewer ",(0,t.jsx)("em",{children:"position"})," adds little here. Use the"," ",(0,t.jsx)("strong",{children:"View dome"})," (§7.5) above for where viewers looked."]}):null,(0,t.jsxs)("div",{className:"rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg backdrop-blur",children:["Active links: ",el,"/",es]})]}),(0,t.jsx)(c.ZoomButtons,{onZoom:e=>C.current&&(0,u.stepZoom)(C.current,e)}),(0,t.jsx)(m.HeatLegend,{title:"Flow volume",lowLabel:"fewer links",highLabel:"dominant links",note:et?"Three columns: standpoint → gaze sector → mesh. Top standpoints/meshes are kept; the tail folds into an “Other” node. Pick a standpoint (or click the minimap), gaze sector, or mesh to emphasize matching ribbons.":"Each arc aggregates clicks from one camera-direction bin to a mesh. Pick a source or mesh to emphasize matching links and dim the rest."})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===S?"Rendering…":"empty"===S?"No aggregate flow links in range.":"error"===S?A??"Flow view unavailable.":null})]})})}],24543)},36471,e=>{e.n(e.i(24543))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12423,e=>{"use strict";class t{static GetShadersRepository(e=0){return 0===e?t.ShadersRepository:t.ShadersRepositoryWGSL}static GetShadersStore(e=0){return 0===e?t.ShadersStore:t.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return 0===e?t.IncludesShadersStore:t.IncludesShadersStoreWGSL}}t.ShadersRepository="src/Shaders/",t.ShadersStore={},t.IncludesShadersStore={},t.ShadersRepositoryWGSL="src/ShadersWGSL/",t.ShadersStoreWGSL={},t.IncludesShadersStoreWGSL={},e.s(["ShaderStore",0,t])},14960,e=>{"use strict";var t=e.i(68179),i=e.i(71379),s=e.i(84201);let a=!1;a=!0,i.ThinEngine.prototype.createDynamicTexture=function(e,i,a,r){let h=new s.InternalTexture(this,4);return h.baseWidth=e,h.baseHeight=i,a&&(e=this.needPOTTextures?(0,t.GetExponentOfTwo)(e,this._caps.maxTextureSize):e,i=this.needPOTTextures?(0,t.GetExponentOfTwo)(i,this._caps.maxTextureSize):i),h.width=e,h.height=i,h.isReady=!1,h.generateMipMaps=a,h.samplingMode=r,this.updateTextureSamplingMode(r,h),this._internalTexturesCache.push(h),h},i.ThinEngine.prototype.updateDynamicTexture=function(e,t,i,s=!1,a,r=!1,h=!1){if(!e)return;let n=this._gl,c=n.TEXTURE_2D,o=this._bindTextureDirectly(c,e,!0,r);this._unpackFlipY(void 0===i?e.invertY:i),s&&n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);let l=this._getWebGLTextureType(e.type),d=this._getInternalFormat(a||e.format),u=this._getRGBABufferInternalSizedFormat(e.type,d);n.texImage2D(c,0,u,d,l,t),e.generateMipMaps&&n.generateMipmap(c),o||this._bindTextureDirectly(c,null),s&&n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),a&&(e.format=a),e._dynamicTextureSource=t,e._premulAlpha=s,e.invertY=i||!1,e.isReady=!0},e.s([],55976),e.i(55976);var r=e.i(13379),h=e.i(58720);class n extends h.Texture{constructor(e,t,i,s=!1,a=3,r=5,n){const c=!i||i._isScene;super(null,c?i:i?.scene,c?!s:i,n,a,void 0,void 0,void 0,void 0,r),this.name=e,this.wrapU=h.Texture.CLAMP_ADDRESSMODE,this.wrapV=h.Texture.CLAMP_ADDRESSMODE,this._generateMipMaps=s;const o=this._getEngine();if(!o)return;t.getContext?(this._canvas=t,this._ownCanvas=!1,this._texture=o.createDynamicTexture(this._canvas.width,this._canvas.height,s,a)):(this._canvas=o.createCanvas(1,1),this._ownCanvas=!0,t.width||0===t.width?this._texture=o.createDynamicTexture(t.width,t.height,s,a):this._texture=o.createDynamicTexture(t,t,s,a));const l=this.getSize();this._canvas.width!==l.width&&(this._canvas.width=l.width),this._canvas.height!==l.height&&(this._canvas.height=l.height),this._context=this._canvas.getContext("2d")}getClassName(){return"DynamicTexture"}get canRescale(){return!0}_recreate(e){this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._getEngine().createDynamicTexture(e.width,e.height,this._generateMipMaps,this.samplingMode)}scale(e){let t=this.getSize();t.width*=e,t.height*=e,this._recreate(t)}scaleTo(e,t){let i=this.getSize();i.width=e,i.height=t,this._recreate(i)}getContext(){return this._context}clear(e){let t=this.getSize();e&&(this._context.fillStyle=e),this._context.clearRect(0,0,t.width,t.height)}update(e,t=!1,i=!1){this._texture&&this._getEngine().updateDynamicTexture(this._texture,this._canvas,void 0===e||e,t,this._format||void 0,void 0,i)}drawText(e,t,i,s,a,r,h,n=!0){let c=this.getSize();if(r&&(this._context.fillStyle=r,this._context.fillRect(0,0,c.width,c.height)),this._context.font=s,null==t){let i=this._context.measureText(e);t=(c.width-i.width)/2}if(null==i){let e=parseInt(s.replace(/\D/g,""));i=c.height/2+e/3.65}this._context.fillStyle=a||"",this._context.fillText(e,t,i),n&&this.update(h)}dispose(){super.dispose(),this._ownCanvas&&this._canvas?.remove?.(),this._canvas=null,this._context=null}clone(){let e=this.getScene();if(!e)return this;let t=this.getSize(),i=new n(this.name,t,e,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i}serialize(){let e=this.getScene();e&&!e.isReady()&&r.Logger.Warn("The scene must be ready before serializing the dynamic texture");let t=super.serialize();return n._IsCanvasElement(this._canvas)&&(t.base64String=this._canvas.toDataURL()),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t}static _IsCanvasElement(e){return void 0!==e.toDataURL}_rebuild(){this.update()}}e.s(["DynamicTexture",0,n],72412),e.i(72412),e.s(["DynamicTexture",0,n],14960)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21222,e=>{"use strict";var t=e.i(96265);class i{}i.POINTERDOWN=1,i.POINTERUP=2,i.POINTERMOVE=4,i.POINTERWHEEL=8,i.POINTERPICK=16,i.POINTERTAP=32,i.POINTERDOUBLETAP=64;class s{constructor(e,t){this.type=e,this.event=t}}e.s(["PointerEventTypes",0,i,"PointerInfo",0,class extends s{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,i,s=null){super(e,t),this._pickInfo=i,this._inputManager=s}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}},"PointerInfoPre",0,class extends s{constructor(e,i,s,r){super(e,i),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new t.Vector2(s,r)}}])},36365,e=>{"use strict";class t{}t.KEYDOWN=1,t.KEYUP=2;class i{constructor(e,t){this.type=e,this.event=t}}e.s(["KeyboardEventTypes",0,t,"KeyboardInfo",0,i,"KeyboardInfoPre",0,class extends i{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}])},76696,e=>{"use strict";var t,i;(i=t||(t={}))[i.PointerMove=0]="PointerMove",i[i.PointerDown=1]="PointerDown",i[i.PointerUp=2]="PointerUp";class s{}s.DOM_DELTA_PIXEL=0,s.DOM_DELTA_LINE=1,s.DOM_DELTA_PAGE=2,e.s(["EventConstants",0,s])},1773,e=>{"use strict";e.s(["useOpenGLOrientationForUV",()=>!1])},25348,e=>{"use strict";class t{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,i){return new t(this.x*e,this.y*i,this.width*e,this.height*i)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new t(this.x,this.y,this.width,this.height)}}e.s(["Viewport",0,t])},44939,e=>{"use strict";var t=e.i(23240);e.s(["DrawWrapper",0,class{static GetEffect(e){return void 0===e.getPipelineContext?e.effect:e}constructor(e,t=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,i=!0){this.effect=e,void 0!==t&&(this.defines=t),i&&this.drawContext?.reset()}dispose(e=!1){if(this.effect){let i=this.effect;e?i.dispose():t.TimingTools.SetImmediate(()=>{i.getEngine().onEndFrameObservable.addOnce(()=>{i.dispose()})}),this.effect=null}this.drawContext?.dispose()}}])},58720,e=>{"use strict";var t=e.i(10272),i=e.i(37143),s=e.i(99267),r=e.i(96265),a=e.i(52153),n=e.i(77052),o=e.i(75405),h=e.i(23240),l=e.i(98105),c=e.i(65002),d=e.i(49311);function u(e,t,i=!1){let s=t.width,r=t.height;if(e instanceof Float32Array){let t=e.byteLength/e.BYTES_PER_ELEMENT,i=new Uint8Array(t);for(;--t>=0;){let s=e[t];s<0?s=0:s>1&&(s=1),i[t]=255*s}e=i}let a=document.createElement("canvas");a.width=s,a.height=r;let n=a.getContext("2d");if(!n)return null;let o=n.createImageData(s,r);if(o.data.set(e),n.putImageData(o,0,0),i){let e=document.createElement("canvas");e.width=s,e.height=r;let t=e.getContext("2d");return t?(t.translate(0,r),t.scale(1,-1),t.drawImage(a,0,0),e.toDataURL("image/png")):null}return a.toDataURL("image/png")}async function f(e,t=0,i=0){let s=e.getInternalTexture();if(!s)return null;let r=await e.readPixels(t,i);return r?u(r,e.getSize(),s.invertY):null}var p=e.i(1773),_=e.i(80871);class m extends a.BaseTexture{static _CreateVideoTexture(e,t,i,s=!1,r=!1,a=m.TRILINEAR_SAMPLINGMODE,n={},h,l=5){throw(0,o._WarnImport)("VideoTexture")}get noMipmap(){return this._noMipmap}get mimeType(){return this._mimeType}set isBlocking(e){this._isBlocking=e}get isBlocking(){return this._isBlocking}get invertY(){return this._invertY}constructor(e,t,i,r,a=m.TRILINEAR_SAMPLINGMODE,n=null,o=null,l=null,c=!1,d,u,f,_,x){let g;super(t),this.url=null,this.uOffset=0,this.vOffset=0,this.uScale=1,this.vScale=1,this.uAng=0,this.vAng=0,this.wAng=0,this.uRotationCenter=.5,this.vRotationCenter=.5,this.wRotationCenter=.5,this.homogeneousRotationInUVTransform=!1,this.inspectableCustomProperties=null,this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedIdentity3x2=!0,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new s.Observable,this._isBlocking=!0,this.name=e||"",this.url=e;let v=!1,R=null,T=!0;"object"==typeof i&&null!==i?(g=i.noMipmap??!1,r=i.invertY??!p.useOpenGLOrientationForUV,a=i.samplingMode??m.TRILINEAR_SAMPLINGMODE,n=i.onLoad??null,o=i.onError??null,l=i.buffer??null,c=i.deleteBuffer??!1,d=i.format,u=i.mimeType,f=i.loaderOptions,_=i.creationFlags,v=i.useSRGBBuffer??!1,R=i.internalTexture??null,T=i.gammaSpace??T,x=i.forcedExtension??x):g=!!i,this._gammaSpace=T,this._noMipmap=g,this._invertY=void 0===r?!p.useOpenGLOrientationForUV:r,this._initialSamplingMode=a,this._buffer=l,this._deleteBuffer=c,this._mimeType=u,this._loaderOptions=f,this._creationFlags=_,this._useSRGBBuffer=v,this._forcedExtension=x,void 0!==d&&(this._format=d);const M=this.getScene(),S=this._getEngine();if(!S)return;S.onBeforeTextureInitObservable.notifyObservers(this);const E=()=>{this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),null!==this._texture._cachedWrapU&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),null!==this._texture._cachedWrapV&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),null!==this._texture._cachedWrapR&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),n&&n(),!this.isBlocking&&M&&M.resetCachedMaterial()},b=(e,t)=>{this._loadingError=!0,this._errorObject={message:e,exception:t},o&&o(e,t),m.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!R){this._delayedOnLoad=E,this._delayedOnError=b;return}if(this._texture=R??this._getFromCache(this.url,g,a,this._invertY,v,this.isCube),this._texture)if(this._texture.isReady)h.TimingTools.SetImmediate(()=>E());else{const e=this._texture.onLoadedObservable.add(E);this._texture.onErrorObservable.add(t=>{b(t.message,t.exception),this._texture?.onLoadedObservable.remove(e)})}else if(M&&M.useDelayedTextureLoading)this.delayLoadState=4,this._delayedOnLoad=E,this._delayedOnError=b;else{try{this._texture=S.createTexture(this.url,g,this._invertY,M,a,E,b,this._buffer,void 0,this._format,this._forcedExtension,u,f,_,v)}catch(e){throw b("error loading",e),e}c&&(this._buffer=null)}}updateURL(e,t=null,i,s){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1,e=>e.hasTexture(this))),(!this.name||this.name.startsWith("data:"))&&(this.name=e),this.url=e,this._buffer=t,this._forcedExtension=s,this.delayLoadState=4;let r=this._delayedOnLoad,a=()=>{r?r():this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),i&&i()};this._delayedOnLoad=a,this.delayLoad()}delayLoad(){if(4!==this.delayLoadState)return;let e=this.getScene();if(!e)return;let t=this.url;!t&&(this.name.indexOf("://")>0||this.name.startsWith("data:"))&&(t=this.name),this.delayLoadState=1,this._texture=this._getFromCache(t,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer,this.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?h.TimingTools.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(t,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null}_prepareRowForTextureGeneration(e,t,i,s){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,i-=this.wRotationCenter,r.Vector3.TransformCoordinatesFromFloatsToRef(e,t,i,this._rowGenerationMatrix,s),s.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,s.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,s.z+=this.wRotationCenter}getTextureMatrix(e=1){if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,this._cachedTextureMatrix&&this._rowGenerationMatrix||(this._cachedTextureMatrix=r.Matrix.Zero(),this._rowGenerationMatrix=new r.Matrix,this._t0=r.Vector3.Zero(),this._t1=r.Vector3.Zero(),this._t2=r.Vector3.Zero()),r.Matrix.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(r.Matrix.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,r.TmpVectors.Matrix[0]),r.Matrix.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,r.TmpVectors.Matrix[1]),r.Matrix.ScalingToRef(this._cachedUScale,this._cachedVScale,0,r.TmpVectors.Matrix[2]),r.Matrix.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,r.TmpVectors.Matrix[3]),r.TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(r.TmpVectors.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(r.TmpVectors.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(r.TmpVectors.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),r.Matrix.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));let t=this.getScene();if(!t)return this._cachedTextureMatrix;let i=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&i!==this._cachedIdentity3x2&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedTextureMatrix}getReflectionTextureMatrix(){let e=this.getScene();if(!e)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode){if(this.coordinatesMode!==m.PROJECTION_MODE)return this._cachedReflectionTextureMatrix;else if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=r.Matrix.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=r.Matrix.Zero());let t=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case m.PLANAR_MODE:r.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break;case m.PROJECTION_MODE:{r.Matrix.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);let t=e.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=t.updateFlag,t.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:r.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix)}return t&&e.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedReflectionTextureMatrix}clone(){let e={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return _.SerializationHelper.Clone(()=>new m(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){let e=this.name;!m.SerializeBuffers&&this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");let t=super.serialize(m._SerializeInternalTextureUniqueId);if(!t)return null;if(m.SerializeBuffers||m.ForceSerializeBuffers)if("string"==typeof this._buffer&&this._buffer.startsWith("data:"))t.base64String=this._buffer,t.name=t.name.replace("data:","");else if(this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array){let e=this.mimeType||"image/png";t.base64String=`data:${e};base64,${(0,d.EncodeArrayBufferToBase64)(this._buffer)}`}else(m.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(t.base64String=!this._engine||this._engine._features.supportSyncTextureRead?function(e,t=0,i=0){let s=e.getInternalTexture();if(!s)return null;let r=e._readPixelsSync(t,i);return r?u(r,e.getSize(),s.invertY):null}(this):f(this));return t.invertY=this._invertY,t.samplingMode=this.samplingMode,t._creationFlags=this._creationFlags,t._useSRGBBuffer=this._useSRGBBuffer,m._SerializeInternalTextureUniqueId&&(t.internalTextureUniqueId=this._texture?.uniqueId),t.internalTextureLabel=this._texture?.label,t.noMipmap=this._noMipmap,this.name=e,t}getClassName(){return"Texture"}dispose(){super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(e,t,i){let s;if(e.customType){let s=l.InstantiationTools.Instantiate(e.customType).Parse(e,t,i);return e.samplingMode&&s.updateSamplingMode&&s._samplingMode&&s._samplingMode!==e.samplingMode&&s.updateSamplingMode(e.samplingMode),s}if(e.isCube&&!e.isRenderTarget)return m._CubeTextureParser(e,t,i);let r=void 0!==e.internalTextureUniqueId;if(!e.name&&!e.isRenderTarget&&!r)return null;if(r){for(let i of t.getEngine().getLoadedTexturesCache())if(i.uniqueId===e.internalTextureUniqueId){s=i;break}}let a=t=>{if(t&&t._texture&&(t._texture._cachedWrapU=null,t._texture._cachedWrapV=null,t._texture._cachedWrapR=null),e.samplingMode){let i=e.samplingMode;t&&t.samplingMode!==i&&t.updateSamplingMode(i)}if(t&&e.animations)for(let i=0;i<e.animations.length;i++){let s=e.animations[i],r=(0,n.GetClass)("BABYLON.Animation");r&&t.animations.push(r.Parse(s))}t&&t._texture&&(r&&!s&&t._texture._setUniqueId(e.internalTextureUniqueId),t._texture.label=e.internalTextureLabel)};return _.SerializationHelper.Parse(()=>{let r=!0;if(e.noMipmap&&(r=!1),e.mirrorPlane){let i=m._CreateMirror(e.name,e.renderTargetSize,t,r);return i._waitingRenderList=e.renderList,i.mirrorPlane=c.Plane.FromArray(e.mirrorPlane),a(i),i}if(e.isRenderTarget&&!e.base64String){let i=null;if(e.isCube){if(t.reflectionProbes)for(let i=0;i<t.reflectionProbes.length;i++){let s=t.reflectionProbes[i];if(s.name===e.name)return s.cubeTexture}}else(i=m._CreateRenderTargetTexture(e.name,e.renderTargetSize,t,r,e._creationFlags??0))._waitingRenderList=e.renderList;return a(i),i}if(e.isVideo){let s=m._CreateVideoTexture(i+(e.url||e.name),i+(e.src||e.url),t,r,e.invertY,e.samplingMode,e.settings||{});return a(s),s}{let n;if("string"==typeof e.base64String&&e.base64String&&!s){let i={buffer:e.base64String,noMipmap:!r,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)}},s=e.base64String,o=s.startsWith("data:")?s.substring(5):s;(n=m.CreateFromBase64String("",o,t,i)).name=e.name}else{let o;o=e.name&&(e.name.indexOf("://")>0||e.name.startsWith("data:"))?e.name:i+e.name,e.url&&(e.url.startsWith("data:")||m.UseSerializedUrlIfAny)&&(o=e.url),n=new m(o,t,{noMipmap:!r,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)},internalTexture:s})}return n}},e,t)}static CreateFromBase64String(e,t,i,s,r,a=m.TRILINEAR_SAMPLINGMODE,n=null,o=null,h=5,l,c){return new m("data:"+t,i,s,r,a,n,o,e,!1,h,void 0,void 0,l,c)}static LoadFromDataString(e,t,i,s=!1,r,a=!0,n=m.TRILINEAR_SAMPLINGMODE,o=null,h=null,l=5,c,d){return"data:"!==e.substring(0,5)&&(e="data:"+e),new m(e,i,r,a,n,o,h,t,s,l,void 0,void 0,c,d)}}m.SerializeBuffers=!0,m.ForceSerializeBuffers=!1,m.OnTextureLoadErrorObservable=new s.Observable,m._SerializeInternalTextureUniqueId=!1,m._CubeTextureParser=(e,t,i)=>{throw(0,o._WarnImport)("CubeTexture")},m._CreateMirror=(e,t,i,s)=>{throw(0,o._WarnImport)("MirrorTexture")},m._CreateRenderTargetTexture=(e,t,i,s,r)=>{throw(0,o._WarnImport)("RenderTargetTexture")},m.NEAREST_SAMPLINGMODE=1,m.NEAREST_NEAREST_MIPLINEAR=8,m.BILINEAR_SAMPLINGMODE=2,m.LINEAR_LINEAR_MIPNEAREST=11,m.TRILINEAR_SAMPLINGMODE=3,m.LINEAR_LINEAR_MIPLINEAR=3,m.NEAREST_NEAREST_MIPNEAREST=4,m.NEAREST_LINEAR_MIPNEAREST=5,m.NEAREST_LINEAR_MIPLINEAR=6,m.NEAREST_LINEAR=7,m.NEAREST_NEAREST=1,m.LINEAR_NEAREST_MIPNEAREST=9,m.LINEAR_NEAREST_MIPLINEAR=10,m.LINEAR_LINEAR=2,m.LINEAR_NEAREST=12,m.EXPLICIT_MODE=0,m.SPHERICAL_MODE=1,m.PLANAR_MODE=2,m.CUBIC_MODE=3,m.PROJECTION_MODE=4,m.SKYBOX_MODE=5,m.INVCUBIC_MODE=6,m.EQUIRECTANGULAR_MODE=7,m.FIXED_EQUIRECTANGULAR_MODE=8,m.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,m.CLAMP_ADDRESSMODE=0,m.WRAP_ADDRESSMODE=1,m.MIRROR_ADDRESSMODE=2,m.UseSerializedUrlIfAny=!1,(0,t.__decorate)([(0,i.serialize)()],m.prototype,"url",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uOffset",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vOffset",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uScale",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vScale",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uAng",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vAng",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"wAng",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"wRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"homogeneousRotationInUVTransform",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"isBlocking",null),e.s(["Texture",0,m],58720)},20461,e=>{"use strict";var t=e.i(96265),i=e.i(46703),s=e.i(14953),r=e.i(89030),a=e.i(70653);class n{constructor(e,t,i,s){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=i,this.worldAxisForFileY=s}}class o{static _NearestPow2Floor(e){return e<=1?1:1<<Math.floor(Math.log2(e))}static ConvertCubeMapTextureToSphericalPolynomial(e){let t,i;if(!e.isCube)return null;e.getScene()?.getEngine().flushFramebuffer();let s=e.getSize().width,r=e._sphericalPolynomialTargetSize,a=r>0?this._NearestPow2Floor(r):0,n=!e.noMipmap&&e._texture?.generateMipMaps===!0,o=a>0&&a<s&&n,h=o?Math.max(0,Math.round(Math.log2(s/a))):0,l=o?Math.max(1,Math.floor(s/Math.pow(2,h))):s,c=e.readPixels(0,h,void 0,!1),d=e.readPixels(1,h,void 0,!1);e.isRenderTarget?(t=e.readPixels(3,h,void 0,!1),i=e.readPixels(2,h,void 0,!1)):(t=e.readPixels(2,h,void 0,!1),i=e.readPixels(3,h,void 0,!1));let u=e.readPixels(4,h,void 0,!1),f=e.readPixels(5,h,void 0,!1),p=e.gammaSpace,_=a>0&&a<s&&!o;return new Promise(e=>{Promise.all([d,c,t,i,u,f]).then(([t,i,r,n,o,h])=>{let c=l;_&&(t=this._DownsampleFace(t,s,a,4),i=this._DownsampleFace(i,s,a,4),r=this._DownsampleFace(r,s,a,4),n=this._DownsampleFace(n,s,a,4),o=this._DownsampleFace(o,s,a,4),h=this._DownsampleFace(h,s,a,4),c=a);let d={size:c,right:i,left:t,up:r,down:n,front:o,back:h,format:5,type:+(t instanceof Float32Array),gammaSpace:p};e(this.ConvertCubeMapToSphericalPolynomial(d))})})}static _AreaElement(e,t){return Math.atan2(e*t,Math.sqrt(e*e+t*t+1))}static _DownsampleFace(e,t,i,s){let r=e instanceof Float32Array?e:Float32Array.from(e),a=i*i*s,n=new Float32Array(a),o=t/i,h=1/(o*o);for(let e=0;e<i;e++){let a=Math.floor(e*o),l=Math.floor((e+1)*o);for(let c=0;c<i;c++){let d=Math.floor(c*o),u=Math.floor((c+1)*o),f=(e*i+c)*s;for(let e=0;e<s;e++){let i=0;for(let n=a;n<l;n++)for(let a=d;a<u;a++)i+=r[(n*t+a)*s+e];n[f+e]=i*h}}}if(e instanceof Float32Array)return n;let l=new e.constructor(a);for(let e=0;e<a;e++)l[e]=n[e]+.5|0;return l}static ConvertCubeMapToSphericalPolynomial(e,t=0){let n=t>0?this._NearestPow2Floor(t):0;if(n>0&&e.size>n){let t=5===e.format?4:3,i={};for(let s of["right","left","up","down","front","back"])i[s]=this._DownsampleFace(e[s],e.size,n,t);e={...e,...i,size:n}}let o=new s.SphericalHarmonics,h=0,l=2/e.size,c=.5*l,d=c-1;for(let t=0;t<6;t++){let s=this._FileFaces[t],n=e[s.name],u=d,f=5===e.format?4:3;for(let t=0;t<e.size;t++){let p=d;for(let d=0;d<e.size;d++){let _=s.worldAxisForFileX.scale(p).add(s.worldAxisForFileY.scale(u)).add(s.worldAxisForNormal);_.normalize();let m=this._AreaElement(p-c,u-c)-this._AreaElement(p-c,u+c)-this._AreaElement(p+c,u-c)+this._AreaElement(p+c,u+c),x=n[t*e.size*f+d*f+0],g=n[t*e.size*f+d*f+1],v=n[t*e.size*f+d*f+2];isNaN(x)&&(x=0),isNaN(g)&&(g=0),isNaN(v)&&(v=0),0===e.type&&(x/=255,g/=255,v/=255),e.gammaSpace&&(x=Math.pow((0,i.Clamp)(x),r.ToLinearSpace),g=Math.pow((0,i.Clamp)(g),r.ToLinearSpace),v=Math.pow((0,i.Clamp)(v),r.ToLinearSpace));let R=this.MAX_HDRI_VALUE;if(this.PRESERVE_CLAMPED_COLORS){let e=Math.max(x,g,v);if(e>R){let t=R/e;x*=t,g*=t,v*=t}}else x=(0,i.Clamp)(x,0,R),g=(0,i.Clamp)(g,0,R),v=(0,i.Clamp)(v,0,R);let T=new a.Color3(x,g,v);o.addLight(_,T,m),h+=m,p+=l}u+=l}}let u=4*Math.PI*6/6/h;return o.scaleInPlace(u),o.convertIncidentRadianceToIrradiance(),o.convertIrradianceToLambertianRadiance(),s.SphericalPolynomial.FromHarmonics(o)}}o._FileFaces=[new n("right",new t.Vector3(1,0,0),new t.Vector3(0,0,-1),new t.Vector3(0,-1,0)),new n("left",new t.Vector3(-1,0,0),new t.Vector3(0,0,1),new t.Vector3(0,-1,0)),new n("up",new t.Vector3(0,1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,1)),new n("down",new t.Vector3(0,-1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,-1)),new n("front",new t.Vector3(0,0,1),new t.Vector3(1,0,0),new t.Vector3(0,-1,0)),new n("back",new t.Vector3(0,0,-1),new t.Vector3(-1,0,0),new t.Vector3(0,-1,0))],o.MAX_HDRI_VALUE=4096,o.PRESERVE_CLAMPED_COLORS=!1,e.s(["CubeMapToSphericalPolynomialTools",0,o])},37348,518,e=>{"use strict";var t=e.i(10272),i=e.i(35407),s=e.i(25348),r=e.i(99267),a=e.i(99904),n=e.i(44939);let o={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]};class h{constructor(e,t=o){this._fullscreenViewport=new s.Viewport(0,0,1,1);const r=t.positions??o.positions,a=t.indices??o.indices;this.engine=e,this._vertexBuffers={[i.VertexBuffer.PositionKind]:new i.VertexBuffer(e,r,i.VertexBuffer.PositionKind,!1,!1,2)},this._indexBuffer=e.createIndexBuffer(a),this._indexBufferLength=a.length,this._onContextRestoredObserver=e.onContextRestoredObservable.add(()=>{for(let t in this._indexBuffer=e.createIndexBuffer(a),this._vertexBuffers)this._vertexBuffers[t]._rebuild()})}setViewport(e=this._fullscreenViewport){this.engine.setViewport(e)}bindBuffers(e){this.engine.bindBuffers(this._vertexBuffers,this._indexBuffer,e)}applyEffectWrapper(e,t=!1,i=!1){this.engine.setState(!0),this.engine.depthCullingState.depthTest=t,this.engine.stencilState.stencilTest=i,this.engine.enableEffect(e.drawWrapper),this.bindBuffers(e.effect),e.onApplyObservable.notifyObservers({})}saveStates(){this._savedStateDepthTest=this.engine.depthCullingState.depthTest,this._savedStateStencilTest=this.engine.stencilState.stencilTest}restoreStates(){this.engine.depthCullingState.depthTest=this._savedStateDepthTest,this.engine.stencilState.stencilTest=this._savedStateStencilTest}draw(){this.engine.drawElementsType(0,0,this._indexBufferLength)}_isRenderTargetTexture(e){return void 0!==e.renderTarget}render(e,t=null){if(!e.effect.isReady())return;this.saveStates(),this.setViewport();let i=null===t?null:this._isRenderTargetTexture(t)?t.renderTarget:t;i&&this.engine.bindFramebuffer(i),this.applyEffectWrapper(e),this.draw(),i&&this.engine.unBindFramebuffer(i),this.restoreStates()}dispose(){let e=this._vertexBuffers[i.VertexBuffer.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[i.VertexBuffer.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer),this._onContextRestoredObserver&&(this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}}class l{static RegisterShaderCodeProcessing(e,t){t?l._CustomShaderCodeProcessing[e??""]=t:delete l._CustomShaderCodeProcessing[e??""]}static _GetShaderCodeProcessing(e){return l._CustomShaderCodeProcessing[e]??l._CustomShaderCodeProcessing[""]}get name(){return this.options.name}set name(e){this.options.name=e}isReady(){return this._drawWrapper.effect?.isReady()??!1}get drawWrapper(){return this._drawWrapper}get effect(){return this._drawWrapper.effect}set effect(e){this._drawWrapper.effect=e}constructor(e){this.alphaMode=0,this.onEffectCreatedObservable=new r.Observable(void 0,!0),this.onApplyObservable=new r.Observable,this._shadersLoaded=!1,this._webGPUReady=!1,this._importPromises=[],this.options={...e,name:e.name||"effectWrapper",engine:e.engine,uniforms:e.uniforms||e.uniformNames||[],uniformNames:void 0,samplers:e.samplers||e.samplerNames||[],samplerNames:void 0,attributeNames:e.attributeNames||["position"],uniformBuffers:e.uniformBuffers||[],defines:e.defines||"",useShaderStore:e.useShaderStore||!1,vertexUrl:e.vertexUrl||e.vertexShader||"postprocess",vertexShader:void 0,fragmentShader:e.fragmentShader||"pass",indexParameters:e.indexParameters,blockCompilation:e.blockCompilation||!1,shaderLanguage:e.shaderLanguage||0,onCompiled:e.onCompiled||void 0,extraInitializations:e.extraInitializations||void 0,extraInitializationsAsync:e.extraInitializationsAsync||void 0,useAsPostProcess:e.useAsPostProcess??!1,allowEmptySourceTexture:e.allowEmptySourceTexture??!1},this.options.uniformNames=this.options.uniforms,this.options.samplerNames=this.options.samplers,this.options.vertexShader=this.options.vertexUrl,this.options.useAsPostProcess&&(this.options.allowEmptySourceTexture||-1!==this.options.samplers.indexOf("textureSampler")||this.options.samplers.push("textureSampler"),-1===this.options.uniforms.indexOf("scale")&&this.options.uniforms.push("scale")),e.vertexUrl||e.vertexShader?this._shaderPath={vertexSource:this.options.vertexShader}:(this.options.useAsPostProcess||(this.options.uniforms.push("scale"),this.onApplyObservable.add(()=>{this.effect.setFloat2("scale",1,1)})),this._shaderPath={vertex:this.options.vertexShader}),this._shaderPath.fragmentSource=this.options.fragmentShader,this._shaderPath.spectorName=this.options.name,this.options.useShaderStore&&(this._shaderPath.fragment=this._shaderPath.fragmentSource,this._shaderPath.vertex||(this._shaderPath.vertex=this._shaderPath.vertexSource),delete this._shaderPath.fragmentSource,delete this._shaderPath.vertexSource),this.onApplyObservable.add(()=>{this.bind()}),this.options.useShaderStore||(this._onContextRestoredObserver=this.options.engine.onContextRestoredObservable.add(()=>{this.effect._pipelineContext=null,this.effect._prepareEffect()})),this._drawWrapper=new n.DrawWrapper(this.options.engine),this._webGPUReady=1===this.options.shaderLanguage;const t=Array.isArray(this.options.defines)?this.options.defines.join("\n"):this.options.defines;this._postConstructor(this.options.blockCompilation,t,this.options.extraInitializations)}_gatherImports(e=!1,t){}_postConstructor(t,i=null,s,r){this._importPromises.length=0,r&&this._importPromises.push(...r);let a=this.options.engine.isWebGPU&&!l.ForceGLSL;this._gatherImports(a,this._importPromises),this.options.useShaderStore&&"postprocess"===this._shaderPath.vertex&&this._importPromises.push(a&&this._webGPUReady?e.A(37828):e.A(35413)),void 0!==s&&s(a,this._importPromises),a&&this._webGPUReady&&(this.options.shaderLanguage=1),t||this.updateEffect(i)}updateEffect(e=null,t=null,i=null,s,r,n,o,h){let c,d=l._GetShaderCodeProcessing(this.name);if(d?.defineCustomBindings){let s=t?.slice()??[];s.push(...this.options.uniforms);let r=i?.slice()??[];r.push(...this.options.samplers),e=d.defineCustomBindings(this.name,e,s,r),t=s,i=r}this.options.defines=e||"";let u=this._shadersLoaded||0===this._importPromises.length?void 0:async()=>{await Promise.all(this._importPromises),this._shadersLoaded=!0};c=this.options.extraInitializationsAsync?async()=>{await u?.(),await this.options.extraInitializationsAsync()}:u,this.options.useShaderStore?this._drawWrapper.effect=this.options.engine.createEffect({vertex:o??this._shaderPath.vertex,fragment:h??this._shaderPath.fragment},{attributes:this.options.attributeNames,uniformsNames:t||this.options.uniforms,uniformBuffersNames:this.options.uniformBuffers,samplers:i||this.options.samplers,defines:null!==e?e:"",fallbacks:null,onCompiled:r??this.options.onCompiled,onError:n??null,indexParameters:s||this.options.indexParameters,processCodeAfterIncludes:d?.processCodeAfterIncludes?(e,t)=>d.processCodeAfterIncludes(this.name,e,t):null,processFinalCode:d?.processFinalCode?(e,t)=>d.processFinalCode(this.name,e,t):null,shaderLanguage:this.options.shaderLanguage,extraInitializationsAsync:c},this.options.engine):this._drawWrapper.effect=new a.Effect(this._shaderPath,this.options.attributeNames,t||this.options.uniforms,i||this.options.samplerNames,this.options.engine,e,void 0,r||this.options.onCompiled,void 0,void 0,void 0,this.options.shaderLanguage,c),this.onEffectCreatedObservable.notifyObservers(this._drawWrapper.effect)}bind(e=!1){this.options.useAsPostProcess&&!e&&(this.options.engine.setAlphaMode(this.alphaMode),this.drawWrapper.effect.setFloat2("scale",1,1)),l._GetShaderCodeProcessing(this.name)?.bindCustomBindings?.(this.name,this._drawWrapper.effect)}dispose(e=!1){this._onContextRestoredObserver&&(this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null),this.onEffectCreatedObservable.clear(),this._drawWrapper.dispose(!0)}}l.ForceGLSL=!1,l._CustomShaderCodeProcessing={},e.s(["EffectRenderer",0,h,"EffectWrapper",0,l],518);var c=e.i(65740),d=e.i(46703),u=e.i(81623),f=e.i(13379),p=e.i(49311),_=e.i(37143);let m=null;async function x(){let t=u.EngineStore.LastCreatedEngine?.createCanvas(100,100)??new OffscreenCanvas(100,100);t instanceof OffscreenCanvas&&f.Logger.Warn("DumpData: OffscreenCanvas will be used for dumping data. This may result in lossy alpha values.");let{ThinEngine:i}=await e.A(33558);if(!i.IsSupported)throw Error("DumpData: No WebGL context available. Cannot dump data.");let s=new i(t,!1,{preserveDrawingBuffer:!0,depth:!1,stencil:!1,alpha:!0,premultipliedAlpha:!1,antialias:!1,failIfMajorPerformanceCaveat:!1});u.EngineStore.Instances.pop(),u.EngineStore.OnEnginesDisposedObservable.add(e=>{s&&e!==s&&!s.isDisposed&&0===u.EngineStore.Instances.length&&E()}),s.getCaps().parallelShaderCompile=void 0;let r=new h(s),{passPixelShader:a}=await e.A(21236),n=new l({engine:s,name:a.name,fragmentShader:a.shader,samplerNames:["textureSampler"]});return{canvas:t,dumpEngine:{engine:s,renderer:r,wrapper:n}}}async function g(){return m||(m=x()),await m}class v{static async EncodeImageAsync(e,t,i,s,r,a){let n=await g(),o=n.dumpEngine;o.engine.setSize(t,i,!0);let h=o.engine.createRawTexture(e,t,i,5,!1,!r,1);return o.renderer.setViewport(),o.renderer.applyEffectWrapper(o.wrapper),o.wrapper.effect._bindTexture("textureSampler",h),o.renderer.draw(),h.dispose(),await new Promise((e,t)=>{c.Tools.ToBlob(n.canvas,i=>{i?e(i):t(Error("EncodeImageAsync: Failed to convert canvas to blob."))},s,a)})}}(0,t.__decorate)([_.nativeOverride],v,"EncodeImageAsync",null);let R=v.EncodeImageAsync;async function T(e,t,i,s,r="image/png",a,n){let o=new Uint8Array((await i.readPixels(0,0,e,t)).buffer);S(e,t,o,s,r,a,!0,void 0,n)}async function M(e,t,i,s="image/png",r,a=!1,n=!1,o){if(i instanceof Float32Array){let e=new Uint8Array(i.length),t=i.length;for(;t--;){let s=i[t];e[t]=Math.round(255*(0,d.Clamp)(s))}i=e}let h=await v.EncodeImageAsync(i,e,t,s,a,o);void 0!==r&&c.Tools.DownloadBlob(h,r),h.type!==s&&f.Logger.Warn(`DumpData: The requested mimeType '${s}' is not supported. The result has mimeType '${h.type}' instead.`);let l=await h.arrayBuffer();return n?l:`data:${s};base64,${(0,p.EncodeArrayBufferToBase64)(l)}`}function S(e,t,i,s,r="image/png",a,n=!1,o=!1,h){void 0!==a||s||(a=""),M(e,t,i,r,a,n,o,h).then(e=>{s&&s(e)})}function E(){m&&(m?.then(e=>{e.canvas instanceof HTMLCanvasElement&&e.canvas.remove(),e.dumpEngine&&(e.dumpEngine.engine.dispose(),e.dumpEngine.renderer.dispose(),e.dumpEngine.wrapper.dispose())}),m=null)}let b=!1;e.s(["Dispose",0,E,"DumpData",0,S,"DumpDataAsync",0,M,"DumpFramebuffer",0,T,"DumpTools",0,{DumpData:S,DumpDataAsync:M,DumpFramebuffer:T,Dispose:E},"EncodeImageAsync",0,R,"RegisterDumpTools",0,function(){b||(b=!0,c.Tools.DumpData=S,c.Tools.DumpDataAsync=M,c.Tools.DumpFramebuffer=T)}],37348)},35413,e=>{e.v(t=>Promise.all(["static/chunks/112hws17nz665.js"].map(t=>e.l(t))).then(()=>t(37717)))},37828,e=>{e.v(t=>Promise.all(["static/chunks/296w2ke-v5tbm.js"].map(t=>e.l(t))).then(()=>t(2689)))},49950,e=>{e.v(t=>Promise.all(["static/chunks/0dn0yx0rn6mpf.js"].map(t=>e.l(t))).then(()=>t(16681)))},21236,e=>{e.v(t=>Promise.all(["static/chunks/17q0c2h5ui10r.js"].map(t=>e.l(t))).then(()=>t(39218)))},78398,e=>{e.v(t=>Promise.all(["static/chunks/2cbmf9m7lqv6k.js"].map(t=>e.l(t))).then(()=>t(34637)))},26167,e=>{e.v(t=>Promise.all(["static/chunks/29tfeb6amdkjb.js"].map(t=>e.l(t))).then(()=>t(88647)))},7133,e=>{e.v(t=>Promise.all(["static/chunks/1a9l89j7e6mqu.js"].map(t=>e.l(t))).then(()=>t(85528)))},29574,e=>{e.v(t=>Promise.all(["static/chunks/38fhw7fatsyvd.js"].map(t=>e.l(t))).then(()=>t(49697)))},53578,e=>{e.v(t=>Promise.all(["static/chunks/3yfrsm8lfi6ls.js"].map(t=>e.l(t))).then(()=>t(95170)))},9368,e=>{e.v(t=>Promise.all(["static/chunks/0flc7nppbmsl1.js"].map(t=>e.l(t))).then(()=>t(1753)))},54745,e=>{e.v(t=>Promise.all(["static/chunks/2a3spdq-m8drh.js"].map(t=>e.l(t))).then(()=>t(74441)))},32289,e=>{e.v(t=>Promise.all(["static/chunks/0rys92_73hdb0.js"].map(t=>e.l(t))).then(()=>t(31507)))},88211,e=>{e.v(t=>Promise.all(["static/chunks/15s7425ffrec9.js"].map(t=>e.l(t))).then(()=>t(71773)))},19392,e=>{e.v(t=>Promise.all(["static/chunks/1dsy2ngmfflis.js"].map(t=>e.l(t))).then(()=>t(94597)))},35527,e=>{e.v(t=>Promise.all(["static/chunks/2xwy0-qfho1iz.js"].map(t=>e.l(t))).then(()=>t(8617)))},72206,e=>{e.v(t=>Promise.all(["static/chunks/0jmn7u31w95ly.js"].map(t=>e.l(t))).then(()=>t(7295)))},62039,e=>{e.v(t=>Promise.all(["static/chunks/35h5n42wxwgzk.js"].map(t=>e.l(t))).then(()=>t(85949)))},33558,e=>{e.v(t=>Promise.all(["static/chunks/2712627rfsmwn.js"].map(t=>e.l(t))).then(()=>t(40422)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12423,t=>{"use strict";class e{static GetShadersRepository(t=0){return 0===t?e.ShadersRepository:e.ShadersRepositoryWGSL}static GetShadersStore(t=0){return 0===t?e.ShadersStore:e.ShadersStoreWGSL}static GetIncludesShadersStore(t=0){return 0===t?e.IncludesShadersStore:e.IncludesShadersStoreWGSL}}e.ShadersRepository="src/Shaders/",e.ShadersStore={},e.IncludesShadersStore={},e.ShadersRepositoryWGSL="src/ShadersWGSL/",e.ShadersStoreWGSL={},e.IncludesShadersStoreWGSL={},t.s(["ShaderStore",0,e])},1773,t=>{"use strict";t.s(["useOpenGLOrientationForUV",()=>!1])},25348,t=>{"use strict";class e{constructor(t,e,n,s){this.x=t,this.y=e,this.width=n,this.height=s}toGlobal(t,n){return new e(this.x*t,this.y*n,this.width*t,this.height*n)}toGlobalToRef(t,e,n){return n.x=this.x*t,n.y=this.y*e,n.width=this.width*t,n.height=this.height*e,this}clone(){return new e(this.x,this.y,this.width,this.height)}}t.s(["Viewport",0,e])},70247,t=>{"use strict";var e,n,s,r,a=t.i(96265);(e=s||(s={}))[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE";class i{}i.X=new a.Vector3(1,0,0),i.Y=new a.Vector3(0,1,0),i.Z=new a.Vector3(0,0,1),(n=r||(r={}))[n.X=0]="X",n[n.Y=1]="Y",n[n.Z=2]="Z",t.s(["Axis",0,i,"Coordinate",0,r,"Space",0,s])},44939,t=>{"use strict";var e=t.i(23240);t.s(["DrawWrapper",0,class{static GetEffect(t){return void 0===t.getPipelineContext?t.effect:t}constructor(t,e=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=t.createDrawContext(),e&&(this.materialContext=t.createMaterialContext())}setEffect(t,e,n=!0){this.effect=t,void 0!==e&&(this.defines=e),n&&this.drawContext?.reset()}dispose(t=!1){if(this.effect){let n=this.effect;t?n.dispose():e.TimingTools.SetImmediate(()=>{n.getEngine().onEndFrameObservable.addOnce(()=>{n.dispose()})}),this.effect=null}this.drawContext?.dispose()}}])},49007,t=>{"use strict";t.s(["IntersectionInfo",0,class{constructor(t,e,n){this.bu=t,this.bv=e,this.distance=n,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}])},26831,t=>{"use strict";t.s([],71911);var e=t.i(96265),n=t.i(13379),s=t.i(70227),r=t.i(40408),a=t.i(35407);let i="bakedVertexAnimationSettingsInstanced";function o(t){let e=t.bakedVertexAnimationManager?.texture?.getInternalTexture()?._bufferView;return e instanceof Float32Array||e instanceof Uint16Array}let h=!1;function f(){h||(h=!0,r.Mesh.prototype.thinInstanceAdd=function(t,e=!0){if(!this.getScene().getEngine().getCaps().instancedArrays)return n.Logger.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"),-1;this._thinInstanceUpdateBufferSize("matrix",Array.isArray(t)?t.length:1);let s=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(t))for(let n=0;n<t.length;++n)this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,t[n],n===t.length-1&&e);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,t,e);return s},r.Mesh.prototype.thinInstanceAddSelf=function(t=!0){return this.thinInstanceAdd(e.Matrix.IdentityReadOnly,t)},r.Mesh.prototype.thinInstanceRegisterAttribute=function(t,e){t===a.VertexBuffer.ColorKind&&(t=a.VertexBuffer.ColorInstanceKind),this.removeVerticesData(t),this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.strides[t]=e,this._userThinInstanceBuffersStorage.sizes[t]=e*Math.max(32,this._thinInstanceDataStorage.instancesCount),this._userThinInstanceBuffersStorage.data[t]=new Float32Array(this._userThinInstanceBuffersStorage.sizes[t]),this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a.VertexBuffer(this.getEngine(),this._userThinInstanceBuffersStorage.data[t],t,!0,!1,e,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t])},r.Mesh.prototype.thinInstanceSetMatrixAt=function(t,e,n=!0){if(!this._thinInstanceDataStorage.matrixData||t>=this._thinInstanceDataStorage.instancesCount)return!1;let s=this._thinInstanceDataStorage.matrixData;return e.copyToArray(s,16*t),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[t]=e),n&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0},r.Mesh.prototype.thinInstanceSetAttributeAt=function(t,e,n,s=!0){return t===a.VertexBuffer.ColorKind&&(t=a.VertexBuffer.ColorInstanceKind),!!this._userThinInstanceBuffersStorage&&!!this._userThinInstanceBuffersStorage.data[t]&&!(e>=this._thinInstanceDataStorage.instancesCount)&&(this._thinInstanceUpdateBufferSize(t,0),this._userThinInstanceBuffersStorage.data[t].set(n,e*this._userThinInstanceBuffersStorage.strides[t]),s&&this.thinInstanceBufferUpdated(t),!0)},Object.defineProperty(r.Mesh.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(t){let e=this._thinInstanceDataStorage.matrixData??this.source?._thinInstanceDataStorage.matrixData;t<=(e?e.length/16:0)&&(this._thinInstanceDataStorage.instancesCount=t)},enumerable:!0,configurable:!0}),r.Mesh.prototype._thinInstanceCreateMatrixBuffer=function(t,e,n=!0){let s=new a.Buffer(this.getEngine(),e,!n,16,!1,!0);for(let e=0;e<4;e++)this.setVerticesBuffer(s.createVertexBuffer(t+e,4*e,4));return s},r.Mesh.prototype.thinInstanceSetBuffer=function(t,e,n=0,s=!0){if(n=n||16,"matrix"===t)this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=e?e.length:32*n,this._thinInstanceDataStorage.matrixData=e,this._thinInstanceDataStorage.worldMatrices=null,null!==e?(this._thinInstanceDataStorage.instancesCount=e.length/n,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",e,s),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo());else if("previousMatrix"===t)this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=e,null!==e&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",e,s));else if("splatIndex"===t&&e){this._thinInstanceInitializeUserStorage(),this._thinInstanceDataStorage.instancesCount=e.length/n,this._userThinInstanceBuffersStorage.data[t]=e,this._userThinInstanceBuffersStorage.strides[t]=n,this._userThinInstanceBuffersStorage.sizes[t]=e.length;let s=new a.Buffer(this.getEngine(),e,!0,16,!1,!0);this._thinInstanceDataStorage.matrixBuffer=s;for(let e=0;e<4;e++)this.setVerticesBuffer(s.createVertexBuffer(t+e,4*e,4))}else t===a.VertexBuffer.ColorKind&&(t=a.VertexBuffer.ColorInstanceKind),null===e?this._userThinInstanceBuffersStorage?.data[t]&&(this.removeVerticesData(t),delete this._userThinInstanceBuffersStorage.data[t],delete this._userThinInstanceBuffersStorage.strides[t],delete this._userThinInstanceBuffersStorage.sizes[t],delete this._userThinInstanceBuffersStorage.vertexBuffers[t]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[t]=e,this._userThinInstanceBuffersStorage.strides[t]=n,this._userThinInstanceBuffersStorage.sizes[t]=e.length,this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a.VertexBuffer(this.getEngine(),e,t,!s,!1,n,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t]))},r.Mesh.prototype.thinInstanceBufferUpdated=function(t){"matrix"===t?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):"previousMatrix"===t?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):"splatIndex"===t?this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._userThinInstanceBuffersStorage.data[t],0,this._thinInstanceDataStorage.instancesCount):(t===a.VertexBuffer.ColorKind&&(t=a.VertexBuffer.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[t]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[t].isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._userThinInstanceBuffersStorage.vertexBuffers[t].updateDirectly(this._userThinInstanceBuffersStorage.data[t],0)))},r.Mesh.prototype.thinInstancePartialBufferUpdate=function(t,e,n){if("matrix"===t)this._thinInstanceDataStorage.matrixBuffer&&("number"==typeof e?this._thinInstanceDataStorage.matrixBuffer.updateDirectly(new Float32Array(this._thinInstanceDataStorage.matrixData.buffer,this._thinInstanceDataStorage.matrixData.byteOffset+16*n*Float32Array.BYTES_PER_ELEMENT,16*e),16*n):this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e,n));else if(t===a.VertexBuffer.ColorKind&&(t=a.VertexBuffer.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[t]){let s=this._userThinInstanceBuffersStorage.vertexBuffers[t];if("number"==typeof e){let s=new Float32Array(this._userThinInstanceBuffersStorage.data[t].buffer,this._userThinInstanceBuffersStorage.data[t].byteOffset+n*this._userThinInstanceBuffersStorage.strides[t]*Float32Array.BYTES_PER_ELEMENT,e*this._userThinInstanceBuffersStorage.strides[t]);this._userThinInstanceBuffersStorage.vertexBuffers[t].updateDirectly(s,n*this._userThinInstanceBuffersStorage.strides[t])}else s.updateDirectly(e,n)}},r.Mesh.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];let t=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let n=0;n<this._thinInstanceDataStorage.instancesCount;++n)this._thinInstanceDataStorage.worldMatrices[n]=e.Matrix.FromArray(t,16*n)}return this._thinInstanceDataStorage.worldMatrices},r.Mesh.prototype.thinInstanceRefreshBoundingInfo=function(t=!1,n=!1,r=!1,h=!1){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return;let f=this._thinInstanceDataStorage.boundingVectors;if(t||!this.rawBoundingInfo){if(f.length=0,h&&function(t,n,r){let h=t._userThinInstanceBuffersStorage,f=h?.data[i],u=h?.strides[i];if(!f||!u||u<4||!o(t))return!1;let c=t._thinInstanceDataStorage.matrixData;if(!c)return!1;let I={},g=e.TmpVectors.Vector4[0],l=e.TmpVectors.Vector3[1],d=e.TmpVectors.Vector3[2],S=e.TmpVectors.Vector3[3],B=e.TmpVectors.Vector3[4],x=e.TmpVectors.Vector3[5],_=e.TmpVectors.Vector3[6],p=e.TmpVectors.Matrix[2],m=t.geometry?t.geometry.boundingBias:null,D=t.getTotalVertices();l.setAll(1/0),d.setAll(-1/0),S.setAll(1/0),B.setAll(-1/0);for(let n=0;n<t._thinInstanceDataStorage.instancesCount;++n){let s=n*u;g.set(f[s],f[s+1],f[s+2],f[s+3]);let i=t._getData({applyMorph:r,applyBakedVertexAnimation:!0,bakedVertexAnimationSettings:g,updatePositionsArray:!1,cache:I},null,a.VertexBuffer.PositionKind);if(!i)return!1;x.setAll(1/0),_.setAll(-1/0);for(let t=0;t<3*D;t+=3){let e=i[t],n=i[t+1],s=i[t+2];e<x.x&&(x.x=e),n<x.y&&(x.y=n),s<x.z&&(x.z=s),e>_.x&&(_.x=e),n>_.y&&(_.y=n),s>_.z&&(_.z=s)}m&&(x.x-=x.x*m.x+m.y,x.y-=x.y*m.x+m.y,x.z-=x.z*m.x+m.y,_.x+=_.x*m.x+m.y,_.y+=_.y*m.x+m.y,_.z+=_.z*m.x+m.y),l.minimizeInPlace(x),d.maximizeInPlace(_),e.Matrix.FromArrayToRef(c,16*n,p),m?function(t,n,s,r,a){let i=e.TmpVectors.Vector3[7],o=e.TmpVectors.Vector3[8];for(let h=0;h<2;++h)for(let f=0;f<2;++f)for(let u=0;u<2;++u)i.set(h?n.x:t.x,f?n.y:t.y,u?n.z:t.z),e.Vector3.TransformCoordinatesToRef(i,s,o),r.minimizeInPlace(o),a.maximizeInPlace(o)}(x,_,p,S,B):function(t,n,s,r,a){let i=e.TmpVectors.Vector3[7];for(let o=0;o<3*n;o+=3)e.Vector3.TransformCoordinatesFromFloatsToRef(t[o],t[o+1],t[o+2],s,i),r.minimizeInPlace(i),a.maximizeInPlace(i)}(i,D,p,S,B)}if(!isFinite(l.x)||!isFinite(S.x))return!1;t.getBoundingInfo().reConstruct(S,B),t.rawBoundingInfo=new s.BoundingInfo(l,d);var T=t.rawBoundingInfo;n.length=0;for(let t=0;t<T.boundingBox.vectors.length;++t)n.push(T.boundingBox.vectors[t].clone());return t._updateBoundingInfo(),!0}(this,f,r))return;h&&this.bakedVertexAnimationManager?.isEnabled&&o(this)?this.refreshBoundingInfo({applySkeleton:n,applyMorph:r,applyBakedVertexAnimation:!0,updatePositionsArray:!1}):this.refreshBoundingInfo(n,r);let t=this.getBoundingInfo();this.rawBoundingInfo=new s.BoundingInfo(t.minimum,t.maximum)}let u=this.getBoundingInfo(),c=this._thinInstanceDataStorage.matrixData;if(0===f.length)for(let t=0;t<u.boundingBox.vectors.length;++t)f.push(u.boundingBox.vectors[t].clone());e.TmpVectors.Vector3[0].setAll(1/0),e.TmpVectors.Vector3[1].setAll(-1/0);for(let t=0;t<this._thinInstanceDataStorage.instancesCount;++t){e.Matrix.FromArrayToRef(c,16*t,e.TmpVectors.Matrix[0]);for(let t=0;t<f.length;++t)e.Vector3.TransformCoordinatesToRef(f[t],e.TmpVectors.Matrix[0],e.TmpVectors.Vector3[2]),e.TmpVectors.Vector3[0].minimizeInPlace(e.TmpVectors.Vector3[2]),e.TmpVectors.Vector3[1].maximizeInPlace(e.TmpVectors.Vector3[2])}u.reConstruct(e.TmpVectors.Vector3[0],e.TmpVectors.Vector3[1]),this._updateBoundingInfo()},r.Mesh.prototype._thinInstanceRecreateBuffer=function(t,e=!0){"matrix"===t?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",this._thinInstanceDataStorage.matrixData,e)):"previousMatrix"===t?this._scene.needsPreviousWorldMatrices&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.previousMatrixData??this._thinInstanceDataStorage.matrixData,e)):(t===a.VertexBuffer.ColorKind&&(t=a.VertexBuffer.ColorInstanceKind),this._userThinInstanceBuffersStorage.vertexBuffers[t]?.dispose(),this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a.VertexBuffer(this.getEngine(),this._userThinInstanceBuffersStorage.data[t],t,!e,!1,this._userThinInstanceBuffersStorage.strides[t],!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t]))},r.Mesh.prototype._thinInstanceUpdateBufferSize=function(t,e=1){t===a.VertexBuffer.ColorKind&&(t=a.VertexBuffer.ColorInstanceKind);let n="matrix"===t;if(!n&&(!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.strides[t]))return;let s=n?16:this._userThinInstanceBuffersStorage.strides[t],r=n?this._thinInstanceDataStorage.matrixBufferSize:this._userThinInstanceBuffersStorage.sizes[t],i=n?this._thinInstanceDataStorage.matrixData:this._userThinInstanceBuffersStorage.data[t],o=(this._thinInstanceDataStorage.instancesCount+e)*s,h=r;for(;h<o;)h*=2;if(!i||r!=h){if(i){let t=new Float32Array(h);t.set(i,0),i=t}else i=new Float32Array(h);n?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",i,!1),this._thinInstanceDataStorage.matrixData=i,this._thinInstanceDataStorage.matrixBufferSize=h,this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",i,!1))):(this._userThinInstanceBuffersStorage.vertexBuffers[t]?.dispose(),this._userThinInstanceBuffersStorage.data[t]=i,this._userThinInstanceBuffersStorage.sizes[t]=h,this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a.VertexBuffer(this.getEngine(),i,t,!0,!1,s,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t]))}},r.Mesh.prototype._thinInstanceInitializeUserStorage=function(){this._userThinInstanceBuffersStorage||(this._userThinInstanceBuffersStorage={data:{},sizes:{},vertexBuffers:{},strides:{}})},r.Mesh.prototype._disposeThinInstanceSpecificData=function(){this._thinInstanceDataStorage?.matrixBuffer&&(this._thinInstanceDataStorage.matrixBuffer.dispose(),this._thinInstanceDataStorage.matrixBuffer=null),this._thinInstanceDataStorage?.previousMatrixBuffer&&(this._thinInstanceDataStorage.previousMatrixBuffer.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null)})}t.s(["RegisterThinInstanceMesh",0,f],3246),f(),t.s([],7549),t.i(7549),t.i(71911),t.i(3246),t.s(["RegisterThinInstanceMesh",0,f],26831)},42829,t=>{t.v(e=>Promise.all(["static/chunks/3l1dr_qm_x5kp.js"].map(e=>t.l(e))).then(()=>e(47786)))}]);