@antv/layout 0.2.0 → 0.2.3

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 (297) hide show
  1. package/dist/layout.min.js +1 -1
  2. package/dist/layout.min.js.LICENSE.txt +0 -9
  3. package/dist/layout.min.js.map +1 -1
  4. package/es/layout/circular.js.map +1 -1
  5. package/es/layout/comboCombined.js +3 -19
  6. package/es/layout/comboCombined.js.map +1 -1
  7. package/es/layout/concentric.js.map +1 -1
  8. package/es/layout/dagre/graph.d.ts +91 -0
  9. package/es/layout/dagre/graph.js +4 -0
  10. package/es/layout/dagre/graph.js.map +1 -0
  11. package/es/layout/dagre/index.d.ts +3 -4
  12. package/es/layout/dagre/index.js +0 -2
  13. package/es/layout/dagre/index.js.map +1 -1
  14. package/es/layout/dagre/src/acyclic.d.ts +1 -2
  15. package/es/layout/dagre/src/acyclic.js +7 -7
  16. package/es/layout/dagre/src/acyclic.js.map +1 -1
  17. package/es/layout/dagre/src/add-border-segments.d.ts +1 -2
  18. package/es/layout/dagre/src/add-border-segments.js +5 -5
  19. package/es/layout/dagre/src/add-border-segments.js.map +1 -1
  20. package/es/layout/dagre/src/coordinate-system.d.ts +1 -2
  21. package/es/layout/dagre/src/coordinate-system.js +15 -5
  22. package/es/layout/dagre/src/coordinate-system.js.map +1 -1
  23. package/es/layout/dagre/src/data/list.d.ts +9 -5
  24. package/es/layout/dagre/src/data/list.js +25 -27
  25. package/es/layout/dagre/src/data/list.js.map +1 -1
  26. package/es/layout/dagre/src/debug.d.ts +2 -3
  27. package/es/layout/dagre/src/debug.js +3 -5
  28. package/es/layout/dagre/src/debug.js.map +1 -1
  29. package/es/layout/dagre/src/greedy-fas.d.ts +2 -3
  30. package/es/layout/dagre/src/greedy-fas.js +16 -15
  31. package/es/layout/dagre/src/greedy-fas.js.map +1 -1
  32. package/es/layout/dagre/src/layout.d.ts +2 -3
  33. package/es/layout/dagre/src/layout.js +170 -91
  34. package/es/layout/dagre/src/layout.js.map +1 -1
  35. package/es/layout/dagre/src/nesting-graph.d.ts +1 -2
  36. package/es/layout/dagre/src/nesting-graph.js +15 -10
  37. package/es/layout/dagre/src/nesting-graph.js.map +1 -1
  38. package/es/layout/dagre/src/normalize.d.ts +1 -2
  39. package/es/layout/dagre/src/normalize.js +12 -11
  40. package/es/layout/dagre/src/normalize.js.map +1 -1
  41. package/es/layout/dagre/src/order/add-subgraph-constraints.d.ts +1 -2
  42. package/es/layout/dagre/src/order/add-subgraph-constraints.js.map +1 -1
  43. package/es/layout/dagre/src/order/barycenter.d.ts +1 -2
  44. package/es/layout/dagre/src/order/barycenter.js.map +1 -1
  45. package/es/layout/dagre/src/order/build-layer-graph.d.ts +2 -3
  46. package/es/layout/dagre/src/order/build-layer-graph.js +12 -8
  47. package/es/layout/dagre/src/order/build-layer-graph.js.map +1 -1
  48. package/es/layout/dagre/src/order/cross-count.d.ts +2 -3
  49. package/es/layout/dagre/src/order/cross-count.js +13 -12
  50. package/es/layout/dagre/src/order/cross-count.js.map +1 -1
  51. package/es/layout/dagre/src/order/index.d.ts +2 -3
  52. package/es/layout/dagre/src/order/index.js +17 -15
  53. package/es/layout/dagre/src/order/index.js.map +1 -1
  54. package/es/layout/dagre/src/order/init-data-order.d.ts +1 -2
  55. package/es/layout/dagre/src/order/init-data-order.js +3 -5
  56. package/es/layout/dagre/src/order/init-data-order.js.map +1 -1
  57. package/es/layout/dagre/src/order/init-order.d.ts +2 -3
  58. package/es/layout/dagre/src/order/init-order.js +1 -2
  59. package/es/layout/dagre/src/order/init-order.js.map +1 -1
  60. package/es/layout/dagre/src/order/resolve-conflicts.d.ts +18 -3
  61. package/es/layout/dagre/src/order/resolve-conflicts.js +9 -29
  62. package/es/layout/dagre/src/order/resolve-conflicts.js.map +1 -1
  63. package/es/layout/dagre/src/order/sort-subgraph.d.ts +6 -3
  64. package/es/layout/dagre/src/order/sort-subgraph.js +19 -14
  65. package/es/layout/dagre/src/order/sort-subgraph.js.map +1 -1
  66. package/es/layout/dagre/src/order/sort.d.ts +6 -1
  67. package/es/layout/dagre/src/order/sort.js +2 -2
  68. package/es/layout/dagre/src/order/sort.js.map +1 -1
  69. package/es/layout/dagre/src/parent-dummy-chains.d.ts +1 -2
  70. package/es/layout/dagre/src/parent-dummy-chains.js +47 -44
  71. package/es/layout/dagre/src/parent-dummy-chains.js.map +1 -1
  72. package/es/layout/dagre/src/position/bk.d.ts +22 -31
  73. package/es/layout/dagre/src/position/bk.js +49 -83
  74. package/es/layout/dagre/src/position/bk.js.map +1 -1
  75. package/es/layout/dagre/src/position/index.d.ts +1 -2
  76. package/es/layout/dagre/src/position/index.js +12 -14
  77. package/es/layout/dagre/src/position/index.js.map +1 -1
  78. package/es/layout/dagre/src/rank/feasible-tree.d.ts +5 -6
  79. package/es/layout/dagre/src/rank/feasible-tree.js +1 -2
  80. package/es/layout/dagre/src/rank/feasible-tree.js.map +1 -1
  81. package/es/layout/dagre/src/rank/index.d.ts +2 -3
  82. package/es/layout/dagre/src/rank/index.js.map +1 -1
  83. package/es/layout/dagre/src/rank/network-simplex.d.ts +8 -11
  84. package/es/layout/dagre/src/rank/network-simplex.js +18 -31
  85. package/es/layout/dagre/src/rank/network-simplex.js.map +1 -1
  86. package/es/layout/dagre/src/rank/util.d.ts +4 -5
  87. package/es/layout/dagre/src/rank/util.js +37 -20
  88. package/es/layout/dagre/src/rank/util.js.map +1 -1
  89. package/es/layout/dagre/src/util.d.ts +29 -48
  90. package/es/layout/dagre/src/util.js +91 -101
  91. package/es/layout/dagre/src/util.js.map +1 -1
  92. package/es/layout/dagre.d.ts +1 -1
  93. package/es/layout/dagre.js +28 -24
  94. package/es/layout/dagre.js.map +1 -1
  95. package/es/layout/fruchterman.js.map +1 -1
  96. package/es/layout/gForce.js +14 -6
  97. package/es/layout/gForce.js.map +1 -1
  98. package/lib/index.js +5 -1
  99. package/lib/index.js.map +1 -1
  100. package/lib/layout/circular.js.map +1 -1
  101. package/lib/layout/comboCombined.js +2 -18
  102. package/lib/layout/comboCombined.js.map +1 -1
  103. package/lib/layout/comboForce.js +5 -5
  104. package/lib/layout/comboForce.js.map +1 -1
  105. package/lib/layout/concentric.js.map +1 -1
  106. package/lib/layout/dagre/graph.d.ts +91 -0
  107. package/lib/layout/dagre/graph.js +28 -0
  108. package/lib/layout/dagre/graph.js.map +1 -0
  109. package/lib/layout/dagre/index.d.ts +3 -4
  110. package/lib/layout/dagre/index.js +0 -2
  111. package/lib/layout/dagre/index.js.map +1 -1
  112. package/lib/layout/dagre/src/acyclic.d.ts +1 -2
  113. package/lib/layout/dagre/src/acyclic.js +7 -7
  114. package/lib/layout/dagre/src/acyclic.js.map +1 -1
  115. package/lib/layout/dagre/src/add-border-segments.d.ts +1 -2
  116. package/lib/layout/dagre/src/add-border-segments.js +5 -8
  117. package/lib/layout/dagre/src/add-border-segments.js.map +1 -1
  118. package/lib/layout/dagre/src/coordinate-system.d.ts +1 -2
  119. package/lib/layout/dagre/src/coordinate-system.js +15 -5
  120. package/lib/layout/dagre/src/coordinate-system.js.map +1 -1
  121. package/lib/layout/dagre/src/data/list.d.ts +9 -5
  122. package/lib/layout/dagre/src/data/list.js +25 -26
  123. package/lib/layout/dagre/src/data/list.js.map +1 -1
  124. package/lib/layout/dagre/src/debug.d.ts +2 -3
  125. package/lib/layout/dagre/src/debug.js +6 -11
  126. package/lib/layout/dagre/src/debug.js.map +1 -1
  127. package/lib/layout/dagre/src/greedy-fas.d.ts +2 -3
  128. package/lib/layout/dagre/src/greedy-fas.js +41 -15
  129. package/lib/layout/dagre/src/greedy-fas.js.map +1 -1
  130. package/lib/layout/dagre/src/layout.d.ts +2 -3
  131. package/lib/layout/dagre/src/layout.js +171 -100
  132. package/lib/layout/dagre/src/layout.js.map +1 -1
  133. package/lib/layout/dagre/src/nesting-graph.d.ts +1 -2
  134. package/lib/layout/dagre/src/nesting-graph.js +15 -13
  135. package/lib/layout/dagre/src/nesting-graph.js.map +1 -1
  136. package/lib/layout/dagre/src/normalize.d.ts +1 -2
  137. package/lib/layout/dagre/src/normalize.js +12 -14
  138. package/lib/layout/dagre/src/normalize.js.map +1 -1
  139. package/lib/layout/dagre/src/order/add-subgraph-constraints.d.ts +1 -2
  140. package/lib/layout/dagre/src/order/add-subgraph-constraints.js.map +1 -1
  141. package/lib/layout/dagre/src/order/barycenter.d.ts +1 -2
  142. package/lib/layout/dagre/src/order/barycenter.js.map +1 -1
  143. package/lib/layout/dagre/src/order/build-layer-graph.d.ts +2 -3
  144. package/lib/layout/dagre/src/order/build-layer-graph.js +13 -12
  145. package/lib/layout/dagre/src/order/build-layer-graph.js.map +1 -1
  146. package/lib/layout/dagre/src/order/cross-count.d.ts +2 -3
  147. package/lib/layout/dagre/src/order/cross-count.js +14 -13
  148. package/lib/layout/dagre/src/order/cross-count.js.map +1 -1
  149. package/lib/layout/dagre/src/order/index.d.ts +2 -3
  150. package/lib/layout/dagre/src/order/index.js +15 -13
  151. package/lib/layout/dagre/src/order/index.js.map +1 -1
  152. package/lib/layout/dagre/src/order/init-data-order.d.ts +1 -2
  153. package/lib/layout/dagre/src/order/init-data-order.js +3 -5
  154. package/lib/layout/dagre/src/order/init-data-order.js.map +1 -1
  155. package/lib/layout/dagre/src/order/init-order.d.ts +2 -3
  156. package/lib/layout/dagre/src/order/init-order.js +1 -2
  157. package/lib/layout/dagre/src/order/init-order.js.map +1 -1
  158. package/lib/layout/dagre/src/order/resolve-conflicts.d.ts +18 -3
  159. package/lib/layout/dagre/src/order/resolve-conflicts.js +9 -29
  160. package/lib/layout/dagre/src/order/resolve-conflicts.js.map +1 -1
  161. package/lib/layout/dagre/src/order/sort-subgraph.d.ts +6 -3
  162. package/lib/layout/dagre/src/order/sort-subgraph.js +16 -11
  163. package/lib/layout/dagre/src/order/sort-subgraph.js.map +1 -1
  164. package/lib/layout/dagre/src/order/sort.d.ts +6 -1
  165. package/lib/layout/dagre/src/order/sort.js +2 -5
  166. package/lib/layout/dagre/src/order/sort.js.map +1 -1
  167. package/lib/layout/dagre/src/parent-dummy-chains.d.ts +1 -2
  168. package/lib/layout/dagre/src/parent-dummy-chains.js +47 -44
  169. package/lib/layout/dagre/src/parent-dummy-chains.js.map +1 -1
  170. package/lib/layout/dagre/src/position/bk.d.ts +22 -31
  171. package/lib/layout/dagre/src/position/bk.js +75 -85
  172. package/lib/layout/dagre/src/position/bk.js.map +1 -1
  173. package/lib/layout/dagre/src/position/index.d.ts +1 -2
  174. package/lib/layout/dagre/src/position/index.js +14 -17
  175. package/lib/layout/dagre/src/position/index.js.map +1 -1
  176. package/lib/layout/dagre/src/rank/feasible-tree.d.ts +5 -6
  177. package/lib/layout/dagre/src/rank/feasible-tree.js +3 -7
  178. package/lib/layout/dagre/src/rank/feasible-tree.js.map +1 -1
  179. package/lib/layout/dagre/src/rank/index.d.ts +2 -3
  180. package/lib/layout/dagre/src/rank/index.js.map +1 -1
  181. package/lib/layout/dagre/src/rank/network-simplex.d.ts +8 -11
  182. package/lib/layout/dagre/src/rank/network-simplex.js +27 -35
  183. package/lib/layout/dagre/src/rank/network-simplex.js.map +1 -1
  184. package/lib/layout/dagre/src/rank/util.d.ts +4 -5
  185. package/lib/layout/dagre/src/rank/util.js +36 -19
  186. package/lib/layout/dagre/src/rank/util.js.map +1 -1
  187. package/lib/layout/dagre/src/util.d.ts +29 -48
  188. package/lib/layout/dagre/src/util.js +80 -92
  189. package/lib/layout/dagre/src/util.js.map +1 -1
  190. package/lib/layout/dagre.d.ts +1 -1
  191. package/lib/layout/dagre.js +27 -23
  192. package/lib/layout/dagre.js.map +1 -1
  193. package/lib/layout/er/core.js +5 -1
  194. package/lib/layout/er/core.js.map +1 -1
  195. package/lib/layout/force/force-in-a-box.js +7 -3
  196. package/lib/layout/force/force-in-a-box.js.map +1 -1
  197. package/lib/layout/force/force.js +5 -1
  198. package/lib/layout/force/force.js.map +1 -1
  199. package/lib/layout/force/index.js +5 -1
  200. package/lib/layout/force/index.js.map +1 -1
  201. package/lib/layout/fruchterman.js.map +1 -1
  202. package/lib/layout/gForce.js +10 -2
  203. package/lib/layout/gForce.js.map +1 -1
  204. package/lib/layout/grid.js +2 -2
  205. package/lib/layout/grid.js.map +1 -1
  206. package/lib/layout/index.js +5 -1
  207. package/lib/layout/index.js.map +1 -1
  208. package/lib/layout/radial/index.js +5 -1
  209. package/lib/layout/radial/index.js.map +1 -1
  210. package/lib/registy/index.js +1 -1
  211. package/lib/registy/index.js.map +1 -1
  212. package/lib/util/index.js +5 -1
  213. package/lib/util/index.js.map +1 -1
  214. package/package.json +3 -2
  215. package/src/index.ts +7 -0
  216. package/src/layout/base.ts +54 -0
  217. package/src/layout/circular.ts +369 -0
  218. package/src/layout/comboCombined.ts +390 -0
  219. package/src/layout/comboForce.ts +873 -0
  220. package/src/layout/concentric.ts +289 -0
  221. package/src/layout/constants.ts +21 -0
  222. package/src/layout/dagre/graph.ts +104 -0
  223. package/src/layout/dagre/index.ts +31 -0
  224. package/src/layout/dagre/src/acyclic.ts +58 -0
  225. package/src/layout/dagre/src/add-border-segments.ts +47 -0
  226. package/src/layout/dagre/src/coordinate-system.ts +77 -0
  227. package/src/layout/dagre/src/data/list.ts +60 -0
  228. package/src/layout/dagre/src/debug.ts +30 -0
  229. package/src/layout/dagre/src/greedy-fas.ts +144 -0
  230. package/src/layout/dagre/src/layout.ts +580 -0
  231. package/src/layout/dagre/src/nesting-graph.ts +143 -0
  232. package/src/layout/dagre/src/normalize.ts +96 -0
  233. package/src/layout/dagre/src/order/add-subgraph-constraints.ts +29 -0
  234. package/src/layout/dagre/src/order/barycenter.ts +26 -0
  235. package/src/layout/dagre/src/order/build-layer-graph.ts +82 -0
  236. package/src/layout/dagre/src/order/cross-count.ts +77 -0
  237. package/src/layout/dagre/src/order/index.ts +105 -0
  238. package/src/layout/dagre/src/order/init-data-order.ts +27 -0
  239. package/src/layout/dagre/src/order/init-order.ts +56 -0
  240. package/src/layout/dagre/src/order/resolve-conflicts.ts +152 -0
  241. package/src/layout/dagre/src/order/sort-subgraph.ts +105 -0
  242. package/src/layout/dagre/src/order/sort.ts +76 -0
  243. package/src/layout/dagre/src/parent-dummy-chains.ts +102 -0
  244. package/src/layout/dagre/src/position/bk.ts +494 -0
  245. package/src/layout/dagre/src/position/index.ts +82 -0
  246. package/src/layout/dagre/src/rank/feasible-tree.ts +165 -0
  247. package/src/layout/dagre/src/rank/index.ts +54 -0
  248. package/src/layout/dagre/src/rank/network-simplex.ts +225 -0
  249. package/src/layout/dagre/src/rank/util.ts +157 -0
  250. package/src/layout/dagre/src/util.ts +308 -0
  251. package/src/layout/dagre.ts +423 -0
  252. package/src/layout/dagreCompound.ts +518 -0
  253. package/src/layout/er/core.ts +117 -0
  254. package/src/layout/er/forceGrid.ts +95 -0
  255. package/src/layout/er/grid.ts +185 -0
  256. package/src/layout/er/index.ts +68 -0
  257. package/src/layout/er/mysqlWorkbench.ts +345 -0
  258. package/src/layout/er/type.ts +39 -0
  259. package/src/layout/force/force-in-a-box.ts +400 -0
  260. package/src/layout/force/force.ts +391 -0
  261. package/src/layout/force/index.ts +1 -0
  262. package/src/layout/forceAtlas2/body.ts +115 -0
  263. package/src/layout/forceAtlas2/index.ts +556 -0
  264. package/src/layout/forceAtlas2/quad.ts +115 -0
  265. package/src/layout/forceAtlas2/quadTree.ts +107 -0
  266. package/src/layout/fruchterman.ts +361 -0
  267. package/src/layout/gForce.ts +487 -0
  268. package/src/layout/gpu/fruchterman.ts +314 -0
  269. package/src/layout/gpu/fruchtermanShader.ts +204 -0
  270. package/src/layout/gpu/gForce.ts +406 -0
  271. package/src/layout/gpu/gForceShader.ts +221 -0
  272. package/src/layout/grid.ts +391 -0
  273. package/src/layout/index.ts +45 -0
  274. package/src/layout/layout.ts +75 -0
  275. package/src/layout/mds.ts +140 -0
  276. package/src/layout/radial/index.ts +1 -0
  277. package/src/layout/radial/mds.ts +51 -0
  278. package/src/layout/radial/radial.ts +500 -0
  279. package/src/layout/radial/radialNonoverlapForce.ts +189 -0
  280. package/src/layout/random.ts +75 -0
  281. package/src/layout/types.ts +421 -0
  282. package/src/registy/index.ts +43 -0
  283. package/src/util/array.ts +1 -0
  284. package/src/util/function.ts +64 -0
  285. package/src/util/gpu.ts +254 -0
  286. package/src/util/index.ts +6 -0
  287. package/src/util/math.ts +158 -0
  288. package/src/util/number.ts +8 -0
  289. package/src/util/object.ts +28 -0
  290. package/src/util/string.ts +18 -0
  291. package/CHANGELOG.md +0 -78
  292. package/es/layout/dagre/src/graphlib.d.ts +0 -2
  293. package/es/layout/dagre/src/graphlib.js +0 -51
  294. package/es/layout/dagre/src/graphlib.js.map +0 -1
  295. package/lib/layout/dagre/src/graphlib.d.ts +0 -2
  296. package/lib/layout/dagre/src/graphlib.js +0 -56
  297. package/lib/layout/dagre/src/graphlib.js.map +0 -1
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see layout.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.layout=e():t.layout=e()}(self,(function(){return(()=>{var t={7294:()=>{},9586:()=>{},2697:()=>{},1894:()=>{},1186:()=>{},5275:()=>{},2862:()=>{},9633:()=>{},7222:()=>{},5965:()=>{},2391:()=>{},3945:()=>{},9216:(t,e,n)=>{"use strict";n(9504),n(3982),n(721),n(5778),n(3898),n(7536),n(5834),n(6945),n(547),n(5967),n(3515),n(3042),n(4962),n(405)},122:(t,e,n)=>{t.exports=n(405)},8311:(t,e,n)=>{var r=n(1946);t.exports={Graph:r.Graph,json:n(1603),alg:n(638),version:r.version}},5267:(t,e,n)=>{var r=n(6879);t.exports=function(t){var e,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,e.push(i),r.each(t.successors(i),o),r.each(t.predecessors(i),o))}return r.each(t.nodes(),(function(t){e=[],o(t),e.length&&i.push(e)})),i}},4370:(t,e,n)=>{var r=n(6879);function i(t,e,n,o,a,u){r.has(o,e)||(o[e]=!0,n||u.push(e),r.each(a(e),(function(e){i(t,e,n,o,a,u)})),n&&u.push(e))}t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],u={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(t,e,"post"===n,u,o,a)})),a}},5566:(t,e,n)=>{var r=n(7435),i=n(6879);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},7435:(t,e,n)=>{var r=n(6879),i=n(758);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,u={},s=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=u[e],i=n(t),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,s.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;u[t]={distance:n},s.add(t,n)}));s.size()>0&&(o=s.removeMin(),(a=u[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return u}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},5488:(t,e,n)=>{var r=n(6879),i=n(4155);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},7003:(t,e,n)=>{var r=n(6879);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],u=r.distance+i.distance;u<a.distance&&(a.distance=u,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},638:(t,e,n)=>{t.exports={components:n(5267),dijkstra:n(7435),dijkstraAll:n(5566),findCycles:n(5488),floydWarshall:n(7003),isAcyclic:n(6515),postorder:n(4654),preorder:n(2746),prim:n(6828),tarjan:n(4155),topsort:n(4417)}},6515:(t,e,n)=>{var r=n(4417);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},4654:(t,e,n)=>{var r=n(4370);t.exports=function(t,e){return r(t,e,"post")}},2746:(t,e,n)=>{var r=n(4370);t.exports=function(t,e){return r(t,e,"pre")}},6828:(t,e,n)=>{var r=n(6879),i=n(5256),o=n(758);t.exports=function(t,e){var n,a=new i,u={},s=new o;function c(t){var r=t.v===n?t.w:t.v,i=s.priority(r);if(void 0!==i){var o=e(t);o<i&&(u[r]=n,s.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){s.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),s.decrease(t.nodes()[0],0);for(var f=!1;s.size()>0;){if(n=s.removeMin(),r.has(u,n))a.setEdge(n,u[n]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}t.nodeEdges(n).forEach(c)}return a}},4155:(t,e,n)=>{var r=n(6879);t.exports=function(t){var e=0,n=[],i={},o=[];function a(u){var s=i[u]={onStack:!0,lowlink:e,index:e++};if(n.push(u),t.successors(u).forEach((function(t){r.has(i,t)?i[t].onStack&&(s.lowlink=Math.min(s.lowlink,i[t].index)):(a(t),s.lowlink=Math.min(s.lowlink,i[t].lowlink))})),s.lowlink===s.index){var c,f=[];do{c=n.pop(),i[c].onStack=!1,f.push(c)}while(u!==c);o.push(f)}}return t.nodes().forEach((function(t){r.has(i,t)||a(t)})),o}},4417:(t,e,n)=>{var r=n(6879);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(u){if(r.has(n,u))throw new o;r.has(e,u)||(n[u]=!0,e[u]=!0,r.each(t.predecessors(u),a),delete n[u],i.push(u))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o},758:(t,e,n)=>{var r=n(6879);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},i.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},i.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e}},5256:(t,e,n)=>{"use strict";var r=n(6879);t.exports=o;var i="\0";function o(t){this._isDirected=!r.has(t,"directed")||t.directed,this._isMultigraph=!!r.has(t,"multigraph")&&t.multigraph,this._isCompound=!!r.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(t,e){t[e]?t[e]++:t[e]=1}function u(t,e){--t[e]||delete t[e]}function s(t,e,n,i){var o=""+e,a=""+n;if(!t&&o>a){var u=o;o=a,a=u}return o+""+a+""+(r.isUndefined(i)?"\0":i)}function c(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var u={v:i,w:o};return r&&(u.name=r),u}function f(t,e){return s(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){return r.filter(this.nodes(),r.bind((function(t){return r.isEmpty(this._in[t])}),this))},o.prototype.sinks=function(){return r.filter(this.nodes(),r.bind((function(t){return r.isEmpty(this._out[t])}),this))},o.prototype.setNodes=function(t,e){var n=arguments;return r.each(t,r.bind((function(t){n.length>1?this.setNode(t,e):this.setNode(t)}),this)),this},o.prototype.setNode=function(t,e){return r.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=i,this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return r.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(r.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],r.each(this.children(t),r.bind((function(t){this.setParent(t)}),this)),delete this._children[t]),r.each(r.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],r.each(r.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(e))e=i;else{for(var n=e+="";!r.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==i)return e}},o.prototype.children=function(t){if(r.isUndefined(t)&&(t=i),this._isCompound){var e=this._children[t];if(e)return r.keys(e)}else{if(t===i)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return r.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return r.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return r.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),r.each(this._nodes,r.bind((function(n,r){t(r)&&e.setNode(r,n)}),this)),r.each(this._edgeObjs,r.bind((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,this.edge(t))}),this));var n=this,i={};function o(t){var r=n.parent(t);return void 0===r||e.hasNode(r)?(i[t]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,i=arguments;return r.reduce(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this},o.prototype.setEdge=function(){var t,e,n,i,o=!1,u=arguments[0];"object"==typeof u&&null!==u&&"v"in u?(t=u.v,e=u.w,n=u.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=u,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,r.isUndefined(n)||(n=""+n);var f=s(this._isDirected,t,e,n);if(r.has(this._edgeLabels,f))return o&&(this._edgeLabels[f]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[f]=o?i:this._defaultEdgeLabelFn(t,e,n);var l=c(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[f]=l,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][f]=l,this._out[t][f]=l,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var i=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[e],t),u(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.v===e})):i}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.w===e})):i}},o.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},1946:(t,e,n)=>{t.exports={Graph:n(5256),version:n(7942)}},1603:(t,e,n)=>{var r=n(6879),i=n(5256);function o(t){return r.map(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(n)||(i.value=n),i}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:a(t)};return r.isUndefined(t.graph())||(e.value=r.clone(t.graph())),e},read:function(t){var e=new i(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},6879:(t,e,n)=>{var r;try{r=n(9392)}catch(t){}r||(r=window._),t.exports=r},7942:t=>{t.exports="2.1.4"},8344:(t,e)=>{"use strict";var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,w,x,E,S,A,T;(e.UX||(e.UX={})).TextureCompressionBC="texture-compression-bc",(T=e.OB||(e.OB={})).ClampToEdge="clamp-to-edge",T.Repeat="repeat",T.MirrorRepeat="mirror-repeat",(A=e.$l||(e.$l={})).UniformBuffer="uniform-buffer",A.StorageBuffer="storage-buffer",A.ReadonlyStorageBuffer="readonly-storage-buffer",A.Sampler="sampler",A.ComparisonSampler="comparison-sampler",A.SampledTexture="sampled-texture",A.ReadonlyStorageTexture="readonly-storage-texture",A.WriteonlyStorageTexture="writeonly-storage-texture",(S=e.zi||(e.zi={})).Zero="zero",S.One="one",S.SrcColor="src-color",S.OneMinusSrcColor="one-minus-src-color",S.SrcAlpha="src-alpha",S.OneMinusSrcAlpha="one-minus-src-alpha",S.DstColor="dst-color",S.OneMinusDstColor="one-minus-dst-color",S.DstAlpha="dst-alpha",S.OneMinusDstAlpha="one-minus-dst-alpha",S.SrcAlphaSaturated="src-alpha-saturated",S.BlendColor="blend-color",S.OneMinusBlendColor="one-minus-blend-color",(E=e.db||(e.db={})).Add="add",E.Subtract="subtract",E.ReverseSubtract="reverse-subtract",E.Min="min",E.Max="max",(x=e.wb||(e.wb={})).Never="never",x.Less="less",x.Equal="equal",x.LessEqual="less-equal",x.Greater="greater",x.NotEqual="not-equal",x.GreaterEqual="greater-equal",x.Always="always",(w=e.Wf||(e.Wf={})).None="none",w.Front="front",w.Back="back",(_=e.X9||(e.X9={})).Nearest="nearest",_.Linear="linear",(b=e.zX||(e.zX={})).CCW="ccw",b.CW="cw",(m=e.iD||(e.iD={})).Uint16="uint16",m.Uint32="uint32",(y=e.V||(e.V={})).Vertex="vertex",y.Instance="instance",(e.Ws||(e.Ws={})).Load="load",(g=e.YV||(e.YV={})).PointList="point-list",g.LineList="line-list",g.LineStrip="line-strip",g.TriangleList="triangle-list",g.TriangleStrip="triangle-strip",(v=e.xS||(e.xS={})).Keep="keep",v.Zero="zero",v.Replace="replace",v.Invert="invert",v.IncrementClamp="increment-clamp",v.DecrementClamp="decrement-clamp",v.IncrementWrap="increment-wrap",v.DecrementWrap="decrement-wrap",(p=e.EG||(e.EG={})).Store="store",p.Clear="clear",(d=e.kd||(e.kd={})).E1d="1d",d.E2d="2d",d.E3d="3d",(h=e.EV||(e.EV={})).R8Unorm="r8unorm",h.R8Snorm="r8snorm",h.R8Uint="r8uint",h.R8Sint="r8sint",h.R16Uint="r16uint",h.R16Sint="r16sint",h.R16Float="r16float",h.RG8Unorm="rg8unorm",h.RG8Snorm="rg8snorm",h.RG8Uint="rg8uint",h.RG8Sint="rg8sint",h.R32Uint="r32uint",h.R32Sint="r32sint",h.R32Float="r32float",h.RG16Uint="rg16uint",h.RG16Sint="rg16sint",h.RG16Float="rg16float",h.RGBA8Unorm="rgba8unorm",h.RGBA8UnormSRGB="rgba8unorm-srgb",h.RGBA8Snorm="rgba8snorm",h.RGBA8Uint="rgba8uint",h.RGBA8Sint="rgba8sint",h.BGRA8Unorm="bgra8unorm",h.BGRA8UnormSRGB="bgra8unorm-srgb",h.RGB10A2Unorm="rgb10a2unorm",h.RG11B10Float="rg11b10float",h.RG32Uint="rg32uint",h.RG32Sint="rg32sint",h.RG32Float="rg32float",h.RGBA16Uint="rgba16uint",h.RGBA16Sint="rgba16sint",h.RGBA16Float="rgba16float",h.RGBA32Uint="rgba32uint",h.RGBA32Sint="rgba32sint",h.RGBA32Float="rgba32float",h.Depth32Float="depth32float",h.Depth24Plus="depth24plus",h.Depth24PlusStencil8="depth24plus-stencil8",(l=e.Ek||(e.Ek={})).Float="float",l.Sint="sint",l.Uint="uint",(f=e.p_||(e.p_={})).E1d="1d",f.E2d="2d",f.E2dArray="2d-array",f.Cube="cube",f.CubeArray="cube-array",f.E3d="3d",(c=e.gB||(e.gB={})).Uchar2="uchar2",c.Uchar4="uchar4",c.Char2="char2",c.Char4="char4",c.Uchar2Norm="uchar2norm",c.Uchar4Norm="uchar4norm",c.Char2Norm="char2norm",c.Char4Norm="char4norm",c.Ushort2="ushort2",c.Ushort4="ushort4",c.Short2="short2",c.Short4="short4",c.Ushort2Norm="ushort2norm",c.Ushort4Norm="ushort4norm",c.Short2Norm="short2norm",c.Short4Norm="short4norm",c.Half2="half2",c.Half4="half4",c.Float="float",c.Float2="float2",c.Float3="float3",c.Float4="float4",c.Uint="uint",c.Uint2="uint2",c.Uint3="uint3",c.Uint4="uint4",c.Int="int",c.Int2="int2",c.Int3="int3",c.Int4="int4",(s=e.H7||(e.H7={})).All="all",s.StencilOnly="stencil-only",s.DepthOnly="depth-only",(u=e.mj||(e.mj={})).Error="error",u.Warning="warning",u.Info="info",(e.xL||(e.xL={})).Occlusion="occlusion",(a=e.FB||(e.FB={}))[a.MapRead=1]="MapRead",a[a.MapWrite=2]="MapWrite",a[a.CopySrc=4]="CopySrc",a[a.CopyDst=8]="CopyDst",a[a.Index=16]="Index",a[a.Vertex=32]="Vertex",a[a.Uniform=64]="Uniform",a[a.Storage=128]="Storage",a[a.Indirect=256]="Indirect",a[a.QueryResolve=512]="QueryResolve",(o=e.Yw||(e.Yw={}))[o.Red=1]="Red",o[o.Green=2]="Green",o[o.Blue=4]="Blue",o[o.Alpha=8]="Alpha",o[o.All=15]="All",(i=e.$X||(e.$X={}))[i.Vertex=1]="Vertex",i[i.Fragment=2]="Fragment",i[i.Compute=4]="Compute",(r=e.v2||(e.v2={}))[r.CopySrc=1]="CopySrc",r[r.CopyDst=2]="CopyDst",r[r.Sampled=4]="Sampled",r[r.Storage=8]="Storage",r[r.OutputAttachment=16]="OutputAttachment",(n=e.gc||(e.gc={}))[n.Read=1]="Read",n[n.Write=2]="Write"},9504:(t,e,n)=>{n(2825),n(6051),n(2640),n(9518),n(8201),n(470),n(5723),n(7525),n(9788),n(1498),n(7577),n(6129),n(2802),n(7940),n(5261),n(9340),n(1584),n(7298),n(1765),n(5747),n(7451),n(2784),n(2809),n(7454),n(3053),n(8032),n(7551),n(2929),n(215),n(6183),n(8190),n(476),n(948),n(942),n(2870),n(2212),n(4230),n(9754),n(2811),n(3998),n(1769),n(8789),n(2848),n(1762),n(1323),n(6063),n(3282),n(6816),n(1854),n(3303),n(4421),n(2203),n(1028),n(6818),n(5557),n(7938),n(8316),n(7937),n(637),n(8219),n(9029),n(3157),n(9791),n(2296),n(4555),n(6505),n(4722),n(9713),n(7392),n(4687),n(3684),n(3339),n(4148),n(7754),n(4094),n(8781),n(5013),n(3735),n(8723),n(2247),n(9689),n(9003),n(9026),n(4088),n(535),n(5788),n(7878),n(5119),n(3135),n(5015),n(8059),n(646),n(5377),n(9879),n(5305),n(6341),n(5915),n(4488),n(9281),n(163),n(6668),n(7139),n(6408),n(8686),n(5480),n(9121),n(914),n(7742),n(7843),n(6441),n(429),n(2214),n(498),n(6349),n(3742),n(9604),n(2592),n(9290),n(9363),n(3871),n(8632),n(1838),n(3421),n(6144),n(8275),n(2552),n(3077),n(1031),n(8916),n(8978),n(8531),n(7323),n(3704),n(3153),n(8812),n(2636),n(1602),n(377),t.exports=n(2845)},721:(t,e,n)=>{n(7744),t.exports=n(2845).Array.flatMap},3982:(t,e,n)=>{n(5448),t.exports=n(2845).Array.includes},3515:(t,e,n)=>{n(8938),t.exports=n(2845).Object.entries},547:(t,e,n)=>{n(7819),t.exports=n(2845).Object.getOwnPropertyDescriptors},5967:(t,e,n)=>{n(6572),t.exports=n(2845).Object.values},3042:(t,e,n)=>{"use strict";n(7843),n(8228),t.exports=n(2845).Promise.finally},3898:(t,e,n)=>{n(3336),t.exports=n(2845).String.padEnd},5778:(t,e,n)=>{n(3718),t.exports=n(2845).String.padStart},5834:(t,e,n)=>{n(6642),t.exports=n(2845).String.trimRight},7536:(t,e,n)=>{n(7831),t.exports=n(2845).String.trimLeft},6945:(t,e,n)=>{n(9956),t.exports=n(7686).f("asyncIterator")},2680:(t,e,n)=>{n(8358),t.exports=n(3142).global},3749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8891:(t,e,n)=>{var r=n(2799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},3142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},5526:(t,e,n)=>{var r=n(3749);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},7498:(t,e,n)=>{t.exports=!n(9880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2004:(t,e,n)=>{var r=n(2799),i=n(5505).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},2069:(t,e,n)=>{var r=n(5505),i=n(3142),o=n(5526),a=n(5954),u=n(9761),s=function(t,e,n){var c,f,l,h=t&s.F,d=t&s.G,p=t&s.S,v=t&s.P,g=t&s.B,y=t&s.W,m=d?i:i[e]||(i[e]={}),b=m.prototype,_=d?r:p?r[e]:(r[e]||{}).prototype;for(c in d&&(n=e),n)(f=!h&&_&&void 0!==_[c])&&u(m,c)||(l=f?_[c]:n[c],m[c]=d&&"function"!=typeof _[c]?n[c]:g&&f?o(l,r):y&&_[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&s.R&&b&&!b[c]&&a(b,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},9880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},5505:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},9761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},5954:(t,e,n)=>{var r=n(5584),i=n(5734);t.exports=n(7498)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},4053:(t,e,n)=>{t.exports=!n(7498)&&!n(9880)((function(){return 7!=Object.defineProperty(n(2004)("div"),"a",{get:function(){return 7}}).a}))},2799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5584:(t,e,n)=>{var r=n(8891),i=n(4053),o=n(923),a=Object.defineProperty;e.f=n(7498)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},5734:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},923:(t,e,n)=>{var r=n(2799);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},8358:(t,e,n)=>{var r=n(2069);r(r.G,{global:n(5505)})},1464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8347:(t,e,n)=>{var r=n(1669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},4691:(t,e,n)=>{var r=n(341)("unscopables"),i=Array.prototype;null==i[r]&&n(913)(i,r,{}),t.exports=function(t){i[r][t]=!0}},178:(t,e,n)=>{"use strict";var r=n(8016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},6903:t=>{t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},486:(t,e,n)=>{var r=n(1255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1064:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=[].copyWithin||function(t,e){var n=r(this),a=o(n.length),u=i(t,a),s=i(e,a),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?a:i(c,a))-s,a-u),l=1;for(s<u&&u<s+f&&(l=-1,s+=f-1,u+=f-1);f-- >0;)s in n?n[u]=n[s]:delete n[u],u+=l,s+=l;return n}},8676:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=function(t){for(var e=r(this),n=o(e.length),a=arguments.length,u=i(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,c=void 0===s?n:i(s,n);c>u;)e[u++]=t;return e}},4538:(t,e,n)=>{var r=n(8182),i=n(8087),o=n(9260);t.exports=function(t){return function(e,n,a){var u,s=r(e),c=i(s.length),f=o(a,c);if(t&&n!=n){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},7622:(t,e,n)=>{var r=n(994),i=n(8579),o=n(7583),a=n(8087),u=n(6699);t.exports=function(t,e){var n=1==t,s=2==t,c=3==t,f=4==t,l=6==t,h=5==t||l,d=e||u;return function(e,u,p){for(var v,g,y=o(e),m=i(y),b=r(u,p,3),_=a(m.length),w=0,x=n?d(e,_):s?d(e,0):void 0;_>w;w++)if((h||w in m)&&(g=b(v=m[w],w,y),t))if(n)x[w]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return w;case 2:x.push(v)}else if(f)return!1;return l?-1:c||f?f:x}}},5336:(t,e,n)=>{var r=n(1464),i=n(7583),o=n(8579),a=n(8087);t.exports=function(t,e,n,u,s){r(e);var c=i(t),f=o(c),l=a(c.length),h=s?l-1:0,d=s?-1:1;if(n<2)for(;;){if(h in f){u=f[h],h+=d;break}if(h+=d,s?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;s?h>=0:l>h;h+=d)h in f&&(u=e(u,f[h],h,c));return u}},7600:(t,e,n)=>{var r=n(1255),i=n(7183),o=n(341)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},6699:(t,e,n)=>{var r=n(7600);t.exports=function(t,e){return new(r(t))(e)}},8366:(t,e,n)=>{"use strict";var r=n(1464),i=n(1255),o=n(8262),a=[].slice,u={},s=function(t,e,n){if(!(e in u)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";u[e]=Function("F,a","return new F("+r.join(",")+")")}return u[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?s(e,r.length,r):o(e,r,t)};return i(e.prototype)&&(u.prototype=e.prototype),u}},4939:(t,e,n)=>{var r=n(1669),i=n(341)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},1669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},3050:(t,e,n)=>{"use strict";var r=n(3886).f,i=n(9055),o=n(8565),a=n(994),u=n(6903),s=n(9822),c=n(966),f=n(8782),l=n(4412),h=n(1216),d=n(4278).fastKey,p=n(4664),v=h?"_s":"size",g=function(t,e){var n,r=d(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var f=t((function(t,r){u(t,f,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&s(r,n,t[c],t)}));return o(f.prototype,{clear:function(){for(var t=p(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=p(this,e),r=g(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(t){p(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(p(this,e),t)}}),h&&r(f.prototype,"size",{get:function(){return p(this,e)[v]}}),f},def:function(t,e,n){var r,i,o=g(t,e);return o?o.v=n:(t._l=o={i:i=d(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[v]++,"F"!==i&&(t._i[i]=o)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=p(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?f(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,f(1))}),n?"entries":"values",!n,!0),l(e)}}},1990:(t,e,n)=>{"use strict";var r=n(8565),i=n(4278).getWeak,o=n(486),a=n(1255),u=n(6903),s=n(9822),c=n(7622),f=n(7384),l=n(4664),h=c(5),d=c(6),p=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},y=function(t,e){return h(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=d(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var c=t((function(t,r){u(t,c,e,"_i"),t._t=e,t._i=p++,t._l=void 0,null!=r&&s(r,n,t[o],t)}));return r(c.prototype,{delete:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).has(t):n&&f(n,this._i)}}),c},def:function(t,e,n){var r=i(o(e),!0);return!0===r?v(t).set(e,n):r[t._i]=n,t},ufstore:v}},859:(t,e,n)=>{"use strict";var r=n(7571),i=n(7044),o=n(6476),a=n(8565),u=n(4278),s=n(9822),c=n(6903),f=n(1255),l=n(5338),h=n(2803),d=n(5837),p=n(116);t.exports=function(t,e,n,v,g,y){var m=r[t],b=m,_=g?"set":"add",w=b&&b.prototype,x={},E=function(t){var e=w[t];o(w,t,"delete"==t||"has"==t?function(t){return!(y&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(y||w.forEach&&!l((function(){(new b).entries().next()})))){var S=new b,A=S[_](y?{}:-0,1)!=S,T=l((function(){S.has(1)})),I=h((function(t){new b(t)})),N=!y&&l((function(){for(var t=new b,e=5;e--;)t[_](e,e);return!t.has(-0)}));I||((b=e((function(e,n){c(e,b,t);var r=p(new m,e,b);return null!=n&&s(n,g,r[_],r),r}))).prototype=w,w.constructor=b),(T||N)&&(E("delete"),E("has"),g&&E("get")),(N||A)&&E(_),y&&w.clear&&delete w.clear}else b=v.getConstructor(e,t,g,_),a(b.prototype,n),u.NEED=!0;return d(b,t),x[t]=b,i(i.G+i.W+i.F*(b!=m),x),y||v.setStrong(b,t,g),b}},2845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},1395:(t,e,n)=>{"use strict";var r=n(3886),i=n(8328);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},994:(t,e,n)=>{var r=n(1464);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},4506:(t,e,n)=>{"use strict";var r=n(5338),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},9514:(t,e,n)=>{"use strict";var r=n(486),i=n(4467),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),t!=o)}},5091:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},1216:(t,e,n)=>{t.exports=!n(5338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(1255),i=n(7571).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},9824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},6397:(t,e,n)=>{var r=n(9804),i=n(3844),o=n(4179);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,u=n(t),s=o.f,c=0;u.length>c;)s.call(t,a=u[c++])&&e.push(a);return e}},7044:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(913),a=n(6476),u=n(994),s=function(t,e,n){var c,f,l,h,d=t&s.F,p=t&s.G,v=t&s.S,g=t&s.P,y=t&s.B,m=p?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=p?i:i[e]||(i[e]={}),_=b.prototype||(b.prototype={});for(c in p&&(n=e),n)l=((f=!d&&m&&void 0!==m[c])?m:n)[c],h=y&&f?u(l,r):g&&"function"==typeof l?u(Function.call,l):l,m&&a(m,c,l,t&s.U),b[c]!=l&&o(b,c,h),g&&_[c]!=l&&(_[c]=l)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},2910:(t,e,n)=>{var r=n(341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},5338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(7139);var r=n(6476),i=n(913),o=n(5338),a=n(5091),u=n(341),s=n(9020),c=u("species"),f=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var h=u(t),d=!o((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),p=d?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[h](""),!e})):void 0;if(!d||!p||"replace"===t&&!f||"split"===t&&!l){var v=/./[h],g=n(a,h,""[t],(function(t,e,n,r,i){return e.exec===s?d&&!i?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),y=g[0],m=g[1];r(String.prototype,t,y),i(RegExp.prototype,h,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},3649:(t,e,n)=>{"use strict";var r=n(486);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},6806:(t,e,n)=>{"use strict";var r=n(7183),i=n(1255),o=n(8087),a=n(994),u=n(341)("isConcatSpreadable");t.exports=function t(e,n,s,c,f,l,h,d){for(var p,v,g=f,y=0,m=!!h&&a(h,d,3);y<c;){if(y in s){if(p=m?m(s[y],y,n):s[y],v=!1,i(p)&&(v=void 0!==(v=p[u])?!!v:r(p)),v&&l>0)g=t(e,n,p,o(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}y++}return g}},9822:(t,e,n)=>{var r=n(994),i=n(4902),o=n(9981),a=n(486),u=n(8087),s=n(9685),c={},f={},l=t.exports=function(t,e,n,l,h){var d,p,v,g,y=h?function(){return t}:s(t),m=r(n,l,e?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=u(t.length);d>b;b++)if((g=e?m(a(p=t[b])[0],p[1]):m(t[b]))===c||g===f)return g}else for(v=y.call(t);!(p=v.next()).done;)if((g=i(v,m,p.value,e))===c||g===f)return g};l.BREAK=c,l.RETURN=f},8454:(t,e,n)=>{t.exports=n(5570)("native-function-to-string",Function.toString)},7571:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},7384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},913:(t,e,n)=>{var r=n(3886),i=n(8328);t.exports=n(1216)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},7680:(t,e,n)=>{var r=n(7571).document;t.exports=r&&r.documentElement},6252:(t,e,n)=>{t.exports=!n(1216)&&!n(5338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},116:(t,e,n)=>{var r=n(1255),i=n(473).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},8262:t=>{t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},8579:(t,e,n)=>{var r=n(1669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},9981:(t,e,n)=>{var r=n(9740),i=n(341)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},7183:(t,e,n)=>{var r=n(1669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},1272:(t,e,n)=>{var r=n(1255),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},1255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},8990:(t,e,n)=>{var r=n(1255),i=n(1669),o=n(341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},4902:(t,e,n)=>{var r=n(486);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},4529:(t,e,n)=>{"use strict";var r=n(9055),i=n(8328),o=n(5837),a={};n(913)(a,n(341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},966:(t,e,n)=>{"use strict";var r=n(2725),i=n(7044),o=n(6476),a=n(913),u=n(9740),s=n(4529),c=n(5837),f=n(9881),l=n(341)("iterator"),h=!([].keys&&"next"in[].keys()),d="keys",p="values",v=function(){return this};t.exports=function(t,e,n,g,y,m,b){s(n,e,g);var _,w,x,E=function(t){if(!h&&t in I)return I[t];switch(t){case d:case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=y==p,T=!1,I=t.prototype,N=I[l]||I["@@iterator"]||y&&I[y],k=N||E(y),C=y?A?E("entries"):k:void 0,O="Array"==e&&I.entries||N;if(O&&(x=f(O.call(new t)))!==Object.prototype&&x.next&&(c(x,S,!0),r||"function"==typeof x[l]||a(x,l,v)),A&&N&&N.name!==p&&(T=!0,k=function(){return N.call(this)}),r&&!b||!h&&!T&&I[l]||a(I,l,k),u[e]=k,u[S]=v,y)if(_={values:A?k:E(p),keys:m?k:E(d),entries:C},b)for(w in _)w in I||o(I,w,_[w]);else i(i.P+i.F*(h||T),e,_);return _}},2803:(t,e,n)=>{var r=n(341)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},8782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},9740:t=>{t.exports={}},2725:t=>{t.exports=!1},959:t=>{var e=Math.expm1;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},7682:(t,e,n)=>{var r=n(2987),i=Math.pow,o=i(2,-52),a=i(2,-23),u=i(2,127)*(2-a),s=i(2,-126);t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),c=r(t);return i<s?c*(i/s/a+1/o-1/o)*s*a:(n=(e=(1+a/o)*i)-(e-i))>u||n!=n?c*(1/0):c*n}},1618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},2987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4278:(t,e,n)=>{var r=n(4316)("meta"),i=n(1255),o=n(7384),a=n(3886).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(5338)((function(){return s(Object.preventExtensions({}))})),f=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!o(t,r)&&f(t),t}}},7485:(t,e,n)=>{var r=n(7571),i=n(7225).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(1669)(a);t.exports=function(){var t,e,n,c=function(){var r,i;for(s&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var f=u.resolve(void 0);n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},449:(t,e,n)=>{"use strict";var r=n(1464);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},4643:(t,e,n)=>{"use strict";var r=n(1216),i=n(9804),o=n(3844),a=n(4179),u=n(7583),s=n(8579),c=Object.assign;t.exports=!c||n(5338)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=u(t),c=arguments.length,f=1,l=o.f,h=a.f;c>f;)for(var d,p=s(arguments[f++]),v=l?i(p).concat(l(p)):i(p),g=v.length,y=0;g>y;)d=v[y++],r&&!h.call(p,d)||(n[d]=p[d]);return n}:c},9055:(t,e,n)=>{var r=n(486),i=n(6283),o=n(9824),a=n(3574)("IE_PROTO"),u=function(){},s=function(){var t,e=n(3438)("iframe"),r=o.length;for(e.style.display="none",n(7680).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[o[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(u.prototype=r(t),n=new u,u.prototype=null,n[a]=t):n=s(),void 0===e?n:i(n,e)}},3886:(t,e,n)=>{var r=n(486),i=n(6252),o=n(4467),a=Object.defineProperty;e.f=n(1216)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},6283:(t,e,n)=>{var r=n(3886),i=n(486),o=n(9804);t.exports=n(1216)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),u=a.length,s=0;u>s;)r.f(t,n=a[s++],e[n]);return t}},5385:(t,e,n)=>{var r=n(4179),i=n(8328),o=n(8182),a=n(4467),u=n(7384),s=n(6252),c=Object.getOwnPropertyDescriptor;e.f=n(1216)?c:function(t,e){if(t=o(t),e=a(e,!0),s)try{return c(t,e)}catch(t){}if(u(t,e))return i(!r.f.call(t,e),t[e])}},3473:(t,e,n)=>{var r=n(8182),i=n(6907).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(r(t))}},6907:(t,e,n)=>{var r=n(946),i=n(9824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},3844:(t,e)=>{e.f=Object.getOwnPropertySymbols},9881:(t,e,n)=>{var r=n(7384),i=n(7583),o=n(3574)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},946:(t,e,n)=>{var r=n(7384),i=n(8182),o=n(4538)(!1),a=n(3574)("IE_PROTO");t.exports=function(t,e){var n,u=i(t),s=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~o(c,n)||c.push(n));return c}},9804:(t,e,n)=>{var r=n(946),i=n(9824);t.exports=Object.keys||function(t){return r(t,i)}},4179:(t,e)=>{e.f={}.propertyIsEnumerable},381:(t,e,n)=>{var r=n(7044),i=n(2845),o=n(5338);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},6460:(t,e,n)=>{var r=n(1216),i=n(9804),o=n(8182),a=n(4179).f;t.exports=function(t){return function(e){for(var n,u=o(e),s=i(u),c=s.length,f=0,l=[];c>f;)n=s[f++],r&&!a.call(u,n)||l.push(t?[n,u[n]]:u[n]);return l}}},8125:(t,e,n)=>{var r=n(6907),i=n(3844),o=n(486),a=n(7571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},1885:(t,e,n)=>{var r=n(7571).parseFloat,i=n(4961).trim;t.exports=1/r(n(1644)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},343:(t,e,n)=>{var r=n(7571).parseInt,i=n(4961).trim,o=n(1644),a=/^[-+]?0[xX]/;t.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(t,e){var n=i(String(t),3);return r(n,e>>>0||(a.test(n)?16:10))}:r},9696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},909:(t,e,n)=>{var r=n(486),i=n(1255),o=n(449);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},8328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8565:(t,e,n)=>{var r=n(6476);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},6476:(t,e,n)=>{var r=n(7571),i=n(913),o=n(7384),a=n(4316)("src"),u=n(8454),s="toString",c=(""+u).split(s);n(2845).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(s&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||u.call(this)}))},2968:(t,e,n)=>{"use strict";var r=n(4939),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},9020:(t,e,n)=>{"use strict";var r,i,o=n(3649),a=RegExp.prototype.exec,u=String.prototype.replace,s=a,c=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),f=void 0!==/()??/.exec("")[1];(c||f)&&(s=function(t){var e,n,r,i,s=this;return f&&(n=new RegExp("^"+s.source+"$(?!\\s)",o.call(s))),c&&(e=s.lastIndex),r=a.call(s,t),c&&r&&(s.lastIndex=s.global?r.index+r[0].length:e),f&&r&&r.length>1&&u.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=s},6962:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},473:(t,e,n)=>{var r=n(1255),i=n(486),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(994)(Function.call,n(5385).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},4412:(t,e,n)=>{"use strict";var r=n(7571),i=n(3886),o=n(1216),a=n(341)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},5837:(t,e,n)=>{var r=n(3886).f,i=n(7384),o=n(341)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},3574:(t,e,n)=>{var r=n(5570)("keys"),i=n(4316);t.exports=function(t){return r[t]||(r[t]=i(t))}},5570:(t,e,n)=>{var r=n(2845),i=n(7571),o="__core-js_shared__",a=i[o]||(i[o]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(2725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8713:(t,e,n)=>{var r=n(486),i=n(1464),o=n(341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},5296:(t,e,n)=>{"use strict";var r=n(5338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},8016:(t,e,n)=>{var r=n(5845),i=n(5091);t.exports=function(t){return function(e,n){var o,a,u=String(i(e)),s=r(n),c=u.length;return s<0||s>=c?t?"":void 0:(o=u.charCodeAt(s))<55296||o>56319||s+1===c||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):o:t?u.slice(s,s+2):a-56320+(o-55296<<10)+65536}}},5692:(t,e,n)=>{var r=n(8990),i=n(5091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},5264:(t,e,n)=>{var r=n(7044),i=n(5338),o=n(5091),a=/"/g,u=function(t,e,n,r){var i=String(o(t)),u="<"+e;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,"&quot;")+'"'),u+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(u),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},8261:(t,e,n)=>{var r=n(8087),i=n(5458),o=n(5091);t.exports=function(t,e,n,a){var u=String(o(t)),s=u.length,c=void 0===n?" ":String(n),f=r(e);if(f<=s||""==c)return u;var l=f-s,h=i.call(c,Math.ceil(l/c.length));return h.length>l&&(h=h.slice(0,l)),a?h+u:u+h}},5458:(t,e,n)=>{"use strict";var r=n(5845),i=n(5091);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},4961:(t,e,n)=>{var r=n(7044),i=n(5091),o=n(5338),a=n(1644),u="["+a+"]",s=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),f=function(t,e,n){var i={},u=o((function(){return!!a[t]()||"​…"!="​…"[t]()})),s=i[t]=u?e(l):a[t];n&&(i[n]=s),r(r.P+r.F*u,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},1644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},7225:(t,e,n)=>{var r,i,o,a=n(994),u=n(8262),s=n(7680),c=n(3438),f=n(7571),l=f.process,h=f.setImmediate,d=f.clearImmediate,p=f.MessageChannel,v=f.Dispatch,g=0,y={},m=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){m.call(t.data)};h&&d||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++g]=function(){u("function"==typeof t?t:Function(t),e)},r(g),g},d=function(t){delete y[t]},"process"==n(1669)(l)?r=function(t){l.nextTick(a(m,t,1))}:v&&v.now?r=function(t){v.now(a(m,t,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(t){s.appendChild(c("script")).onreadystatechange=function(){s.removeChild(this),m.call(t)}}:function(t){setTimeout(a(m,t,1),0)}),t.exports={set:h,clear:d}},9260:(t,e,n)=>{var r=n(5845),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},5e3:(t,e,n)=>{var r=n(5845),i=n(8087);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},5845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},8182:(t,e,n)=>{var r=n(8579),i=n(5091);t.exports=function(t){return r(i(t))}},8087:(t,e,n)=>{var r=n(5845),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},7583:(t,e,n)=>{var r=n(5091);t.exports=function(t){return Object(r(t))}},4467:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},1063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(2725),i=n(7571),o=n(5338),a=n(7044),u=n(604),s=n(1541),c=n(994),f=n(6903),l=n(8328),h=n(913),d=n(8565),p=n(5845),v=n(8087),g=n(5e3),y=n(9260),m=n(4467),b=n(7384),_=n(4939),w=n(1255),x=n(7583),E=n(9981),S=n(9055),A=n(9881),T=n(6907).f,I=n(9685),N=n(4316),k=n(341),C=n(7622),O=n(4538),D=n(8713),R=n(163),M=n(9740),P=n(2803),G=n(4412),L=n(8676),j=n(1064),U=n(3886),B=n(5385),z=U.f,F=B.f,W=i.RangeError,V=i.TypeError,H=i.Uint8Array,X="ArrayBuffer",q="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",K=Array.prototype,$=s.ArrayBuffer,Z=s.DataView,J=C(0),Q=C(2),tt=C(3),et=C(4),nt=C(5),rt=C(6),it=O(!0),ot=O(!1),at=R.values,ut=R.keys,st=R.entries,ct=K.lastIndexOf,ft=K.reduce,lt=K.reduceRight,ht=K.join,dt=K.sort,pt=K.slice,vt=K.toString,gt=K.toLocaleString,yt=k("iterator"),mt=k("toStringTag"),bt=N("typed_constructor"),_t=N("def_constructor"),wt=u.CONSTR,xt=u.TYPED,Et=u.VIEW,St="Wrong length!",At=C(1,(function(t,e){return Ct(D(t,t[_t]),e)})),Tt=o((function(){return 1===new H(new Uint16Array([1]).buffer)[0]})),It=!!H&&!!H.prototype.set&&o((function(){new H(1).set({})})),Nt=function(t,e){var n=p(t);if(n<0||n%e)throw W("Wrong offset!");return n},kt=function(t){if(w(t)&&xt in t)return t;throw V(t+" is not a typed array!")},Ct=function(t,e){if(!w(t)||!(bt in t))throw V("It is not a typed array constructor!");return new t(e)},Ot=function(t,e){return Dt(D(t,t[_t]),e)},Dt=function(t,e){for(var n=0,r=e.length,i=Ct(t,r);r>n;)i[n]=e[n++];return i},Rt=function(t,e,n){z(t,e,{get:function(){return this._d[n]}})},Mt=function(t){var e,n,r,i,o,a,u=x(t),s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,h=I(u);if(null!=h&&!E(h)){for(a=h.call(u),r=[],e=0;!(o=a.next()).done;e++)r.push(o.value);u=r}for(l&&s>2&&(f=c(f,arguments[2],2)),e=0,n=v(u.length),i=Ct(this,n);n>e;e++)i[e]=l?f(u[e],e):u[e];return i},Pt=function(){for(var t=0,e=arguments.length,n=Ct(this,e);e>t;)n[t]=arguments[t++];return n},Gt=!!H&&o((function(){gt.call(new H(1))})),Lt=function(){return gt.apply(Gt?pt.call(kt(this)):kt(this),arguments)},jt={copyWithin:function(t,e){return j.call(kt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return et(kt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(kt(this),arguments)},filter:function(t){return Ot(this,Q(kt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(kt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return rt(kt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(kt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return ot(kt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(kt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(kt(this),arguments)},lastIndexOf:function(t){return ct.apply(kt(this),arguments)},map:function(t){return At(kt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ft.apply(kt(this),arguments)},reduceRight:function(t){return lt.apply(kt(this),arguments)},reverse:function(){for(var t,e=this,n=kt(e).length,r=Math.floor(n/2),i=0;i<r;)t=e[i],e[i++]=e[--n],e[n]=t;return e},some:function(t){return tt(kt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return dt.call(kt(this),t)},subarray:function(t,e){var n=kt(this),r=n.length,i=y(t,r);return new(D(n,n[_t]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:y(e,r))-i))}},Ut=function(t,e){return Ot(this,pt.call(kt(this),t,e))},Bt=function(t){kt(this);var e=Nt(arguments[1],1),n=this.length,r=x(t),i=v(r.length),o=0;if(i+e>n)throw W(St);for(;o<i;)this[e+o]=r[o++]},zt={entries:function(){return st.call(kt(this))},keys:function(){return ut.call(kt(this))},values:function(){return at.call(kt(this))}},Ft=function(t,e){return w(t)&&t[xt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Wt=function(t,e){return Ft(t,e=m(e,!0))?l(2,t[e]):F(t,e)},Vt=function(t,e,n){return!(Ft(t,e=m(e,!0))&&w(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?z(t,e,n):(t[e]=n.value,t)};wt||(B.f=Wt,U.f=Vt),a(a.S+a.F*!wt,"Object",{getOwnPropertyDescriptor:Wt,defineProperty:Vt}),o((function(){vt.call({})}))&&(vt=gt=function(){return ht.call(this)});var Ht=d({},jt);d(Ht,zt),h(Ht,yt,zt.values),d(Ht,{slice:Ut,set:Bt,constructor:function(){},toString:vt,toLocaleString:Lt}),Rt(Ht,"buffer","b"),Rt(Ht,"byteOffset","o"),Rt(Ht,"byteLength","l"),Rt(Ht,"length","e"),z(Ht,mt,{get:function(){return this[xt]}}),t.exports=function(t,e,n,s){var c=t+((s=!!s)?"Clamped":"")+"Array",l="get"+t,d="set"+t,p=i[c],y=p||{},m=p&&A(p),b=!p||!u.ABV,x={},E=p&&p.prototype,I=function(t,n){z(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[l](n*e+r.o,Tt)}(this,n)},set:function(t){return function(t,n,r){var i=t._d;s&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[d](n*e+i.o,r,Tt)}(this,n,t)},enumerable:!0})};b?(p=n((function(t,n,r,i){f(t,p,c,"_d");var o,a,u,s,l=0,d=0;if(w(n)){if(!(n instanceof $||(s=_(n))==X||s==q))return xt in n?Dt(p,n):Mt.call(p,n);o=n,d=Nt(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw W(St);if((a=y-d)<0)throw W(St)}else if((a=v(i)*e)+d>y)throw W(St);u=a/e}else u=g(n),o=new $(a=u*e);for(h(t,"_d",{b:o,o:d,l:a,e:u,v:new Z(o)});l<u;)I(t,l++)})),E=p.prototype=S(Ht),h(E,"constructor",p)):o((function(){p(1)}))&&o((function(){new p(-1)}))&&P((function(t){new p,new p(null),new p(1.5),new p(t)}),!0)||(p=n((function(t,n,r,i){var o;return f(t,p,c),w(n)?n instanceof $||(o=_(n))==X||o==q?void 0!==i?new y(n,Nt(r,e),i):void 0!==r?new y(n,Nt(r,e)):new y(n):xt in n?Dt(p,n):Mt.call(p,n):new y(g(n))})),J(m!==Function.prototype?T(y).concat(T(m)):T(y),(function(t){t in p||h(p,t,y[t])})),p.prototype=E,r||(E.constructor=p));var N=E[yt],k=!!N&&("values"==N.name||null==N.name),C=zt.values;h(p,bt,!0),h(E,xt,c),h(E,Et,!0),h(E,_t,p),(s?new p(1)[mt]==c:mt in E)||z(E,mt,{get:function(){return c}}),x[c]=p,a(a.G+a.W+a.F*(p!=y),x),a(a.S,c,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*o((function(){y.of.call(p,1)})),c,{from:Mt,of:Pt}),Y in E||h(E,Y,e),a(a.P,c,jt),G(c),a(a.P+a.F*It,c,{set:Bt}),a(a.P+a.F*!k,c,zt),r||E.toString==vt||(E.toString=vt),a(a.P+a.F*o((function(){new p(1).slice()})),c,{slice:Ut}),a(a.P+a.F*(o((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!o((function(){E.toLocaleString.call([1,2])}))),c,{toLocaleString:Lt}),M[c]=k?N:C,r||k||h(E,yt,C)}}else t.exports=function(){}},1541:(t,e,n)=>{"use strict";var r=n(7571),i=n(1216),o=n(2725),a=n(604),u=n(913),s=n(8565),c=n(5338),f=n(6903),l=n(5845),h=n(8087),d=n(5e3),p=n(6907).f,v=n(3886).f,g=n(8676),y=n(5837),m="ArrayBuffer",b="DataView",_="Wrong index!",w=r.ArrayBuffer,x=r.DataView,E=r.Math,S=r.RangeError,A=r.Infinity,T=w,I=E.abs,N=E.pow,k=E.floor,C=E.log,O=E.LN2,D="buffer",R="byteLength",M="byteOffset",P=i?"_b":D,G=i?"_l":R,L=i?"_o":M;function j(t,e,n){var r,i,o,a=new Array(n),u=8*n-e-1,s=(1<<u)-1,c=s>>1,f=23===e?N(2,-24)-N(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=I(t))!=t||t===A?(i=t!=t?1:0,r=s):(r=k(C(t)/O),t*(o=N(2,-r))<1&&(r--,o*=2),(t+=r+c>=1?f/o:f*N(2,1-c))*o>=2&&(r++,o/=2),r+c>=s?(i=0,r=s):r+c>=1?(i=(t*o-1)*N(2,e),r+=c):(i=t*N(2,c-1)*N(2,e),r=0));e>=8;a[l++]=255&i,i/=256,e-=8);for(r=r<<e|i,u+=e;u>0;a[l++]=255&r,r/=256,u-=8);return a[--l]|=128*h,a}function U(t,e,n){var r,i=8*n-e-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;f=256*f+t[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===f)f=1-a;else{if(f===o)return r?NaN:c?-A:A;r+=N(2,e),f-=a}return(c?-1:1)*r*N(2,f-e)}function B(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function z(t){return[255&t]}function F(t){return[255&t,t>>8&255]}function W(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function V(t){return j(t,52,8)}function H(t){return j(t,23,4)}function X(t,e,n){v(t.prototype,e,{get:function(){return this[n]}})}function q(t,e,n,r){var i=d(+n);if(i+e>t[G])throw S(_);var o=t[P]._b,a=i+t[L],u=o.slice(a,a+e);return r?u:u.reverse()}function Y(t,e,n,r,i,o){var a=d(+n);if(a+e>t[G])throw S(_);for(var u=t[P]._b,s=a+t[L],c=r(+i),f=0;f<e;f++)u[s+f]=c[o?f:e-f-1]}if(a.ABV){if(!c((function(){w(1)}))||!c((function(){new w(-1)}))||c((function(){return new w,new w(1.5),new w(NaN),w.name!=m}))){for(var K,$=(w=function(t){return f(this,w),new T(d(t))}).prototype=T.prototype,Z=p(T),J=0;Z.length>J;)(K=Z[J++])in w||u(w,K,T[K]);o||($.constructor=w)}var Q=new x(new w(2)),tt=x.prototype.setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||s(x.prototype,{setInt8:function(t,e){tt.call(this,t,e<<24>>24)},setUint8:function(t,e){tt.call(this,t,e<<24>>24)}},!0)}else w=function(t){f(this,w,m);var e=d(t);this._b=g.call(new Array(e),0),this[G]=e},x=function(t,e,n){f(this,x,b),f(t,w,b);var r=t[G],i=l(e);if(i<0||i>r)throw S("Wrong offset!");if(i+(n=void 0===n?r-i:h(n))>r)throw S("Wrong length!");this[P]=t,this[L]=i,this[G]=n},i&&(X(w,R,"_l"),X(x,D,"_b"),X(x,R,"_l"),X(x,M,"_o")),s(x.prototype,{getInt8:function(t){return q(this,1,t)[0]<<24>>24},getUint8:function(t){return q(this,1,t)[0]},getInt16:function(t){var e=q(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=q(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return B(q(this,4,t,arguments[1]))},getUint32:function(t){return B(q(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return U(q(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return U(q(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){Y(this,1,t,z,e)},setUint8:function(t,e){Y(this,1,t,z,e)},setInt16:function(t,e){Y(this,2,t,F,e,arguments[2])},setUint16:function(t,e){Y(this,2,t,F,e,arguments[2])},setInt32:function(t,e){Y(this,4,t,W,e,arguments[2])},setUint32:function(t,e){Y(this,4,t,W,e,arguments[2])},setFloat32:function(t,e){Y(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){Y(this,8,t,V,e,arguments[2])}});y(w,m),y(x,b),u(x.prototype,a.VIEW,!0),e.ArrayBuffer=w,e.DataView=x},604:(t,e,n)=>{for(var r,i=n(7571),o=n(913),a=n(4316),u=a("typed_array"),s=a("view"),c=!(!i.ArrayBuffer||!i.DataView),f=c,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(r=i[h[l++]])?(o(r.prototype,u,!0),o(r.prototype,s,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:u,VIEW:s}},4316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},2541:(t,e,n)=>{var r=n(7571).navigator;t.exports=r&&r.userAgent||""},4664:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6262:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(2725),a=n(7686),u=n(3886).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},7686:(t,e,n)=>{e.f=n(341)},341:(t,e,n)=>{var r=n(5570)("wks"),i=n(4316),o=n(7571).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},9685:(t,e,n)=>{var r=n(4939),i=n(341)("iterator"),o=n(9740);t.exports=n(2845).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},5305:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{copyWithin:n(1064)}),n(4691)("copyWithin")},5015:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(4);r(r.P+r.F*!n(5296)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},6341:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{fill:n(8676)}),n(4691)("fill")},5119:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(2);r(r.P+r.F*!n(5296)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},4488:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5915:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(5),o="find",a=!0;o in[]&&Array(1).find((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5788:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(0),o=n(5296)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},9689:(t,e,n)=>{"use strict";var r=n(994),i=n(7044),o=n(7583),a=n(4902),u=n(9981),s=n(8087),c=n(1395),f=n(9685);i(i.S+i.F*!n(2803)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,l,h=o(t),d="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,y=0,m=f(h);if(g&&(v=r(v,p>2?arguments[2]:void 0,2)),null==m||d==Array&&u(m))for(n=new d(e=s(h.length));e>y;y++)c(n,y,g?v(h[y],y):h[y]);else for(l=m.call(h),n=new d;!(i=l.next()).done;y++)c(n,y,g?a(l,v,[i.value,y],!0):i.value);return n.length=y,n}})},5377:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(5296)(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(7044);r(r.S,"Array",{isArray:n(7183)})},163:(t,e,n)=>{"use strict";var r=n(4691),i=n(8782),o=n(9740),a=n(8182);t.exports=n(966)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},9026:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=[].join;r(r.P+r.F*(n(8579)!=Object||!n(5296)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},9879:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=n(5845),a=n(8087),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(5296)(u)),"Array",{lastIndexOf:function(t){if(s)return u.apply(this,arguments)||0;var e=i(this),n=a(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},7878:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(1);r(r.P+r.F*!n(5296)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},9003:(t,e,n)=>{"use strict";var r=n(7044),i=n(1395);r(r.S+r.F*n(5338)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)i(n,t,arguments[t++]);return n.length=e,n}})},646:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},8059:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},4088:(t,e,n)=>{"use strict";var r=n(7044),i=n(7680),o=n(1669),a=n(9260),u=n(8087),s=[].slice;r(r.P+r.F*n(5338)((function(){i&&s.call(i)})),"Array",{slice:function(t,e){var n=u(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return s.call(this,t,e);for(var i=a(t,n),c=a(e,n),f=u(c-i),l=new Array(f),h=0;h<f;h++)l[h]="String"==r?this.charAt(i+h):this[i+h];return l}})},3135:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(3);r(r.P+r.F*!n(5296)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},535:(t,e,n)=>{"use strict";var r=n(7044),i=n(1464),o=n(7583),a=n(5338),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(5296)(u)),"Array",{sort:function(t){return void 0===t?u.call(o(this)):u.call(o(this),i(t))}})},9281:(t,e,n)=>{n(4412)("Array")},4094:(t,e,n)=>{var r=n(7044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},5013:(t,e,n)=>{var r=n(7044),i=n(4506);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},8781:(t,e,n)=>{"use strict";var r=n(7044),i=n(7583),o=n(4467);r(r.P+r.F*n(5338)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=i(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},8723:(t,e,n)=>{var r=n(341)("toPrimitive"),i=Date.prototype;r in i||n(913)(i,r,n(9514))},3735:(t,e,n)=>{var r=Date.prototype,i="Invalid Date",o=r.toString,a=r.getTime;new Date(NaN)+""!=i&&n(6476)(r,"toString",(function(){var t=a.call(this);return t==t?o.call(this):i}))},1765:(t,e,n)=>{var r=n(7044);r(r.P,"Function",{bind:n(8366)})},7451:(t,e,n)=>{"use strict";var r=n(1255),i=n(9881),o=n(341)("hasInstance"),a=Function.prototype;o in a||n(3886).f(a,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},5747:(t,e,n)=>{var r=n(3886).f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n(1216)&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},6441:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664),o="Map";t.exports=n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(i(this,o),t);return e&&e.v},set:function(t,e){return r.def(i(this,o),0===t?0:t,e)}},r,!0)},2212:(t,e,n)=>{var r=n(7044),i=n(1618),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},4230:(t,e,n)=>{var r=n(7044),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},9754:(t,e,n)=>{var r=n(7044),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},2811:(t,e,n)=>{var r=n(7044),i=n(2987);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},3998:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},1769:(t,e,n)=>{var r=n(7044),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},8789:(t,e,n)=>{var r=n(7044),i=n(959);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},2848:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(7044),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,a=0,u=arguments.length,s=0;a<u;)s<(n=i(arguments[a++]))?(o=o*(r=s/n)*r+1,s=n):o+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*Math.sqrt(o)}})},1323:(t,e,n)=>{var r=n(7044),i=Math.imul;r(r.S+r.F*n(5338)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(t,e){var n=65535,r=+t,i=+e,o=n&r,a=n&i;return 0|o*a+((n&r>>>16)*a+o*(n&i>>>16)<<16>>>0)}})},6063:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3282:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log1p:n(1618)})},6816:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},1854:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{sign:n(2987)})},3303:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S+r.F*n(5338)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},4421:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S,"Math",{tanh:function(t){var e=i(t=+t),n=i(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},2203:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},7454:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1669),a=n(116),u=n(4467),s=n(5338),c=n(6907).f,f=n(5385).f,l=n(3886).f,h=n(4961).trim,d="Number",p=r.Number,v=p,g=p.prototype,y=o(n(9055)(g))==d,m="trim"in String.prototype,b=function(t){var e=u(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=m?e.trim():h(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,s=e.slice(2),c=0,f=s.length;c<f;c++)if((a=s.charCodeAt(c))<48||a>i)return NaN;return parseInt(s,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(y?s((function(){g.valueOf.call(n)})):o(n)!=d)?a(new v(b(e)),n,p):b(e)};for(var _,w=n(1216)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;w.length>x;x++)i(v,_=w[x])&&!i(p,_)&&l(p,_,f(v,_));p.prototype=g,g.constructor=p,n(6476)(r,d,p)}},7551:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},2929:(t,e,n)=>{var r=n(7044),i=n(7571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},215:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isInteger:n(1272)})},6183:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},8190:(t,e,n)=>{var r=n(7044),i=n(1272),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},476:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},948:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},942:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},2870:(t,e,n)=>{var r=n(7044),i=n(343);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},3053:(t,e,n)=>{"use strict";var r=n(7044),i=n(5845),o=n(8347),a=n(5458),u=1..toFixed,s=Math.floor,c=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",l="0",h=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=s(r/1e7)},d=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=s(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+a.call(l,7-n.length)+n}return e},v=function(t,e,n){return 0===e?n:e%2==1?v(t,e-1,n*t):v(t*t,e/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5338)((function(){u.call({})}))),"Number",{toFixed:function(t){var e,n,r,u,s=o(this,f),c=i(t),g="",y=l;if(c<0||c>20)throw RangeError(f);if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(g="-",s=-s),s>1e-21)if(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(s*v(2,69,1))-69,n=e<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,(e=52-e)>0){for(h(0,n),r=c;r>=7;)h(1e7,0),r-=7;for(h(v(10,r,1),0),r=e-1;r>=23;)d(1<<23),r-=23;d(1<<r),h(1,1),d(2),y=p()}else h(0,n),h(1<<-e,0),y=p()+a.call(l,c);return c>0?g+((u=y.length)<=c?"0."+a.call(l,c-u)+y:y.slice(0,u-c)+"."+y.slice(u-c)):g+y}})},8032:(t,e,n)=>{"use strict";var r=n(7044),i=n(5338),o=n(8347),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},5261:(t,e,n)=>{var r=n(7044);r(r.S+r.F,"Object",{assign:n(4643)})},6051:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{create:n(9055)})},9518:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(6283)})},2640:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(3886).f})},9788:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("freeze",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},8201:(t,e,n)=>{var r=n(8182),i=n(5385).f;n(381)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},7525:(t,e,n)=>{n(381)("getOwnPropertyNames",(function(){return n(3473).f}))},470:(t,e,n)=>{var r=n(7583),i=n(9881);n(381)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},7940:(t,e,n)=>{var r=n(1255);n(381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},6129:(t,e,n)=>{var r=n(1255);n(381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},2802:(t,e,n)=>{var r=n(1255);n(381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9340:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{is:n(6962)})},5723:(t,e,n)=>{var r=n(7583),i=n(9804);n(381)("keys",(function(){return function(t){return i(r(t))}}))},7577:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1498:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("seal",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1584:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{setPrototypeOf:n(473).set})},7298:(t,e,n)=>{"use strict";var r=n(4939),i={};i[n(341)("toStringTag")]="z",i+""!="[object z]"&&n(6476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},2809:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},2784:(t,e,n)=>{var r=n(7044),i=n(343);r(r.G+r.F*(parseInt!=i),{parseInt:i})},7843:(t,e,n)=>{"use strict";var r,i,o,a,u=n(2725),s=n(7571),c=n(994),f=n(4939),l=n(7044),h=n(1255),d=n(1464),p=n(6903),v=n(9822),g=n(8713),y=n(7225).set,m=n(7485)(),b=n(449),_=n(9696),w=n(2541),x=n(909),E="Promise",S=s.TypeError,A=s.process,T=A&&A.versions,I=T&&T.v8||"",N=s.Promise,k="process"==f(A),C=function(){},O=i=b.f,D=!!function(){try{var t=N.resolve(1),e=(t.constructor={})[n(341)("species")]=function(t){t(C,C)};return(k||"function"==typeof PromiseRejectionEvent)&&t.then(C)instanceof e&&0!==I.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(t){}}(),R=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){for(var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,u=i?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{u?(i||(2==t._h&&L(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(o=R(n))?o.call(n,s,c):s(n)):c(r)}catch(t){f&&!a&&f.exit(),c(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&P(t)}))}},P=function(t){y.call(s,(function(){var e,n,r,i=t._v,o=G(t);if(o&&(e=_((function(){k?A.emit("unhandledRejection",i,t):(n=s.onunhandledrejection)?n({promise:t,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=k||G(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},G=function(t){return 1!==t._h&&0===(t._a||t._c).length},L=function(t){y.call(s,(function(){var e;k?A.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})}))},j=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},U=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=R(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(U,r,1),c(j,r,1))}catch(t){j.call(r,t)}})):(n._v=t,n._s=1,M(n,!1))}catch(t){j.call({_w:n,_d:!1},t)}}};D||(N=function(t){p(this,N,E,"_h"),d(t),r.call(this);try{t(c(U,this,1),c(j,this,1))}catch(t){j.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(8565)(N.prototype,{then:function(t,e){var n=O(g(this,N));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=k?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(U,t,1),this.reject=c(j,t,1)},b.f=O=function(t){return t===N||t===a?new o(t):i(t)}),l(l.G+l.W+l.F*!D,{Promise:N}),n(5837)(N,E),n(4412)(E),a=n(2845).Promise,l(l.S+l.F*!D,E,{reject:function(t){var e=O(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!D),E,{resolve:function(t){return x(u&&this===a?N:this,t)}}),l(l.S+l.F*!(D&&n(2803)((function(t){N.all(t).catch(C)}))),E,{all:function(t){var e=this,n=O(e),r=n.resolve,i=n.reject,o=_((function(){var n=[],o=0,a=1;v(t,!1,(function(t){var u=o++,s=!1;n.push(void 0),a++,e.resolve(t).then((function(t){s||(s=!0,n[u]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=O(e),r=n.reject,i=_((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},8275:(t,e,n)=>{var r=n(7044),i=n(1464),o=n(486),a=(n(7571).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(5338)((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=i(t),s=o(n);return a?a(r,e,s):u.call(r,e,s)}})},2552:(t,e,n)=>{var r=n(7044),i=n(9055),o=n(1464),a=n(486),u=n(1255),s=n(5338),c=n(8366),f=(n(7571).Reflect||{}).construct,l=s((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),h=!s((function(){f((function(){}))}));r(r.S+r.F*(l||h),"Reflect",{construct:function(t,e){o(t),a(e);var n=arguments.length<3?t:o(arguments[2]);if(h&&!l)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var s=n.prototype,d=i(u(s)?s:Object.prototype),p=Function.apply.call(t,d,e);return u(p)?p:d}})},3077:(t,e,n)=>{var r=n(3886),i=n(7044),o=n(486),a=n(4467);i(i.S+i.F*n(5338)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){o(t),e=a(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},1031:(t,e,n)=>{var r=n(7044),i=n(5385).f,o=n(486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},8916:(t,e,n)=>{"use strict";var r=n(7044),i=n(486),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(4529)(o,"Object",(function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new o(t)}})},8531:(t,e,n)=>{var r=n(5385),i=n(7044),o=n(486);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},7323:(t,e,n)=>{var r=n(7044),i=n(9881),o=n(486);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},8978:(t,e,n)=>{var r=n(5385),i=n(9881),o=n(7384),a=n(7044),u=n(1255),s=n(486);a(a.S,"Reflect",{get:function t(e,n){var a,c,f=arguments.length<3?e:arguments[2];return s(e)===f?e[n]:(a=r.f(e,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:u(c=i(e))?t(c,n,f):void 0}})},3704:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},3153:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},8812:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{ownKeys:n(8125)})},2636:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},377:(t,e,n)=>{var r=n(7044),i=n(473);i&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){i.check(t,e);try{return i.set(t,e),!0}catch(t){return!1}}})},1602:(t,e,n)=>{var r=n(3886),i=n(5385),o=n(9881),a=n(7384),u=n(7044),s=n(8328),c=n(486),f=n(1255);u(u.S,"Reflect",{set:function t(e,n,u){var l,h,d=arguments.length<4?e:arguments[3],p=i.f(c(e),n);if(!p){if(f(h=o(e)))return t(h,n,u,d);p=s(0)}if(a(p,"value")){if(!1===p.writable||!f(d))return!1;if(l=i.f(d,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=u,r.f(d,n,l)}else r.f(d,n,s(0,u));return!0}return void 0!==p.set&&(p.set.call(d,u),!0)}})},6668:(t,e,n)=>{var r=n(7571),i=n(116),o=n(3886).f,a=n(6907).f,u=n(8990),s=n(3649),c=r.RegExp,f=c,l=c.prototype,h=/a/g,d=/a/g,p=new c(h)!==h;if(n(1216)&&(!p||n(5338)((function(){return d[n(341)("match")]=!1,c(h)!=h||c(d)==d||"/a/i"!=c(h,"i")})))){c=function(t,e){var n=this instanceof c,r=u(t),o=void 0===e;return!n&&r&&t.constructor===c&&o?t:i(p?new f(r&&!o?t.source:t,e):f((r=t instanceof c)?t.source:t,r&&o?s.call(t):e),n?this:l,c)};for(var v=function(t){t in c||o(c,t,{configurable:!0,get:function(){return f[t]},set:function(e){f[t]=e}})},g=a(f),y=0;g.length>y;)v(g[y++]);l.constructor=c,c.prototype=l,n(6476)(r,"RegExp",c)}n(4412)("RegExp")},7139:(t,e,n)=>{"use strict";var r=n(9020);n(7044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},8686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(3886).f(RegExp.prototype,"flags",{configurable:!0,get:n(3649)})},5480:(t,e,n)=>{"use strict";var r=n(486),i=n(8087),o=n(178),a=n(2968);n(6719)("match",1,(function(t,e,n,u){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=u(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this);if(!s.global)return a(s,c);var f=s.unicode;s.lastIndex=0;for(var l,h=[],d=0;null!==(l=a(s,c));){var p=String(l[0]);h[d]=p,""===p&&(s.lastIndex=o(c,i(s.lastIndex),f)),d++}return 0===d?null:h}]}))},9121:(t,e,n)=>{"use strict";var r=n(486),i=n(7583),o=n(8087),a=n(5845),u=n(178),s=n(2968),c=Math.max,f=Math.min,l=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;n(6719)("replace",2,(function(t,e,n,p){return[function(r,i){var o=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(t,e){var i=p(n,t,this,e);if(i.done)return i.value;var l=r(t),h=String(this),d="function"==typeof e;d||(e=String(e));var g=l.global;if(g){var y=l.unicode;l.lastIndex=0}for(var m=[];;){var b=s(l,h);if(null===b)break;if(m.push(b),!g)break;""===String(b[0])&&(l.lastIndex=u(h,o(l.lastIndex),y))}for(var _,w="",x=0,E=0;E<m.length;E++){b=m[E];for(var S=String(b[0]),A=c(f(a(b.index),h.length),0),T=[],I=1;I<b.length;I++)T.push(void 0===(_=b[I])?_:String(_));var N=b.groups;if(d){var k=[S].concat(T,A,h);void 0!==N&&k.push(N);var C=String(e.apply(void 0,k))}else C=v(S,h,A,T,N,e);A>=x&&(w+=h.slice(x,A)+C,x=A+S.length)}return w+h.slice(x)}];function v(t,e,r,o,a,u){var s=r+t.length,c=o.length,f=d;return void 0!==a&&(a=i(a),f=h),n.call(u,f,(function(n,i){var u;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(s);case"<":u=a[i.slice(1,-1)];break;default:var f=+i;if(0===f)return n;if(f>c){var h=l(f/10);return 0===h?n:h<=c?void 0===o[h-1]?i.charAt(1):o[h-1]+i.charAt(1):n}u=o[f-1]}return void 0===u?"":u}))}}))},914:(t,e,n)=>{"use strict";var r=n(486),i=n(6962),o=n(2968);n(6719)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),s=String(this),c=u.lastIndex;i(c,0)||(u.lastIndex=0);var f=o(u,s);return i(u.lastIndex,c)||(u.lastIndex=c),null===f?-1:f.index}]}))},7742:(t,e,n)=>{"use strict";var r=n(8990),i=n(486),o=n(8713),a=n(178),u=n(8087),s=n(2968),c=n(9020),f=n(5338),l=Math.min,h=[].push,d=4294967295,p=!f((function(){RegExp(d,"y")}));n(6719)("split",2,(function(t,e,n,f){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);for(var o,a,u,s=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,p=void 0===e?d:e>>>0,v=new RegExp(t.source,f+"g");(o=c.call(v,i))&&!((a=v.lastIndex)>l&&(s.push(i.slice(l,o.index)),o.length>1&&o.index<i.length&&h.apply(s,o.slice(1)),u=o[0].length,l=a,s.length>=p));)v.lastIndex===o.index&&v.lastIndex++;return l===i.length?!u&&v.test("")||s.push(""):s.push(i.slice(l)),s.length>p?s.slice(0,p):s}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):v.call(String(i),n,r)},function(t,e){var r=f(v,t,this,e,v!==n);if(r.done)return r.value;var c=i(t),h=String(this),g=o(c,RegExp),y=c.unicode,m=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(p?"y":"g"),b=new g(p?c:"^(?:"+c.source+")",m),_=void 0===e?d:e>>>0;if(0===_)return[];if(0===h.length)return null===s(b,h)?[h]:[];for(var w=0,x=0,E=[];x<h.length;){b.lastIndex=p?x:0;var S,A=s(b,p?h:h.slice(x));if(null===A||(S=l(u(b.lastIndex+(p?0:x)),h.length))===w)x=a(h,x,y);else{if(E.push(h.slice(w,x)),E.length===_)return E;for(var T=1;T<=A.length-1;T++)if(E.push(A[T]),E.length===_)return E;x=w=S}}return E.push(h.slice(w)),E}]}))},6408:(t,e,n)=>{"use strict";n(8686);var r=n(486),i=n(3649),o=n(1216),a="toString",u=/./.toString,s=function(t){n(6476)(RegExp.prototype,a,t,!0)};n(5338)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?s((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):u.name!=a&&s((function(){return u.call(this)}))},429:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664);t.exports=n(859)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"Set"),t=0===t?0:t,t)}},r)},3157:(t,e,n)=>{"use strict";n(5264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},9791:(t,e,n)=>{"use strict";n(5264)("big",(function(t){return function(){return t(this,"big","","")}}))},2296:(t,e,n)=>{"use strict";n(5264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},4555:(t,e,n)=>{"use strict";n(5264)("bold",(function(t){return function(){return t(this,"b","","")}}))},8316:(t,e,n)=>{"use strict";var r=n(7044),i=n(8016)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="endsWith",u="".endsWith;r(r.P+r.F*n(2910)(a),"String",{endsWith:function(t){var e=o(this,t,a),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),s=void 0===n?r:Math.min(i(n),r),c=String(t);return u?u.call(e,c,s):e.slice(s-c.length,s)===c}})},6505:(t,e,n)=>{"use strict";n(5264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(5264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},9713:(t,e,n)=>{"use strict";n(5264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(7044),i=n(9260),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,a=0;r>a;){if(e=+arguments[a++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},637:(t,e,n)=>{"use strict";var r=n(7044),i=n(5692),o="includes";r(r.P+r.F*n(2910)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7392:(t,e,n)=>{"use strict";n(5264)("italics",(function(t){return function(){return t(this,"i","","")}}))},7938:(t,e,n)=>{"use strict";var r=n(8016)(!0);n(966)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},4687:(t,e,n)=>{"use strict";n(5264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},6818:(t,e,n)=>{var r=n(7044),i=n(8182),o=n(8087);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(e[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},8219:(t,e,n)=>{var r=n(7044);r(r.P,"String",{repeat:n(5458)})},3684:(t,e,n)=>{"use strict";n(5264)("small",(function(t){return function(){return t(this,"small","","")}}))},9029:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="startsWith",u="".startsWith;r(r.P+r.F*n(2910)(a),"String",{startsWith:function(t){var e=o(this,t,a),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},3339:(t,e,n)=>{"use strict";n(5264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},4148:(t,e,n)=>{"use strict";n(5264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},7754:(t,e,n)=>{"use strict";n(5264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},5557:(t,e,n)=>{"use strict";n(4961)("trim",(function(t){return function(){return t(this,3)}}))},2825:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1216),a=n(7044),u=n(6476),s=n(4278).KEY,c=n(5338),f=n(5570),l=n(5837),h=n(4316),d=n(341),p=n(7686),v=n(6262),g=n(6397),y=n(7183),m=n(486),b=n(1255),_=n(7583),w=n(8182),x=n(4467),E=n(8328),S=n(9055),A=n(3473),T=n(5385),I=n(3844),N=n(3886),k=n(9804),C=T.f,O=N.f,D=A.f,R=r.Symbol,M=r.JSON,P=M&&M.stringify,G=d("_hidden"),L=d("toPrimitive"),j={}.propertyIsEnumerable,U=f("symbol-registry"),B=f("symbols"),z=f("op-symbols"),F=Object.prototype,W="function"==typeof R&&!!I.f,V=r.QObject,H=!V||!V.prototype||!V.prototype.findChild,X=o&&c((function(){return 7!=S(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=C(F,e);r&&delete F[e],O(t,e,n),r&&t!==F&&O(F,e,r)}:O,q=function(t){var e=B[t]=S(R.prototype);return e._k=t,e},Y=W&&"symbol"==typeof R.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof R},K=function(t,e,n){return t===F&&K(z,e,n),m(t),e=x(e,!0),m(n),i(B,e)?(n.enumerable?(i(t,G)&&t[G][e]&&(t[G][e]=!1),n=S(n,{enumerable:E(0,!1)})):(i(t,G)||O(t,G,E(1,{})),t[G][e]=!0),X(t,e,n)):O(t,e,n)},$=function(t,e){m(t);for(var n,r=g(e=w(e)),i=0,o=r.length;o>i;)K(t,n=r[i++],e[n]);return t},Z=function(t){var e=j.call(this,t=x(t,!0));return!(this===F&&i(B,t)&&!i(z,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,G)&&this[G][t])||e)},J=function(t,e){if(t=w(t),e=x(e,!0),t!==F||!i(B,e)||i(z,e)){var n=C(t,e);return!n||!i(B,e)||i(t,G)&&t[G][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=D(w(t)),r=[],o=0;n.length>o;)i(B,e=n[o++])||e==G||e==s||r.push(e);return r},tt=function(t){for(var e,n=t===F,r=D(n?z:w(t)),o=[],a=0;r.length>a;)!i(B,e=r[a++])||n&&!i(F,e)||o.push(B[e]);return o};W||(R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===F&&e.call(z,n),i(this,G)&&i(this[G],t)&&(this[G][t]=!1),X(this,t,E(1,n))};return o&&H&&X(F,t,{configurable:!0,set:e}),q(t)},u(R.prototype,"toString",(function(){return this._k})),T.f=J,N.f=K,n(6907).f=A.f=Q,n(4179).f=Z,I.f=tt,o&&!n(2725)&&u(F,"propertyIsEnumerable",Z,!0),p.f=function(t){return q(d(t))}),a(a.G+a.W+a.F*!W,{Symbol:R});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)d(et[nt++]);for(var rt=k(d.store),it=0;rt.length>it;)v(rt[it++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return i(U,t+="")?U[t]:U[t]=R(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in U)if(U[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!W,"Object",{create:function(t,e){return void 0===e?S(t):$(S(t),e)},defineProperty:K,defineProperties:$,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:tt});var ot=c((function(){I.f(1)}));a(a.S+a.F*ot,"Object",{getOwnPropertySymbols:function(t){return I.f(_(t))}}),M&&a(a.S+a.F*(!W||c((function(){var t=R();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(b(e)||void 0!==t)&&!Y(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,P.apply(M,r)}}),R.prototype[L]||n(913)(R.prototype,L,R.prototype.valueOf),l(R,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},6349:(t,e,n)=>{"use strict";var r=n(7044),i=n(604),o=n(1541),a=n(486),u=n(9260),s=n(8087),c=n(1255),f=n(7571).ArrayBuffer,l=n(8713),h=o.ArrayBuffer,d=o.DataView,p=i.ABV&&f.isView,v=h.prototype.slice,g=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(f!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,y,{isView:function(t){return p&&p(t)||c(t)&&g in t}}),r(r.P+r.U+r.F*n(5338)((function(){return!new h(2).slice(1,void 0).byteLength})),y,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var n=a(this).byteLength,r=u(t,n),i=u(void 0===e?n:e,n),o=new(l(this,h))(s(i-r)),c=new d(this),f=new d(o),p=0;r<i;)f.setUint8(p++,c.getUint8(r++));return o}}),n(4412)(y)},3742:(t,e,n)=>{var r=n(7044);r(r.G+r.W+r.F*!n(604).ABV,{DataView:n(1541).DataView})},3421:(t,e,n)=>{n(1063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6144:(t,e,n)=>{n(1063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9363:(t,e,n)=>{n(1063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},8632:(t,e,n)=>{n(1063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9604:(t,e,n)=>{n(1063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3871:(t,e,n)=>{n(1063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(1063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2592:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9290:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},2214:(t,e,n)=>{"use strict";var r,i=n(7571),o=n(7622)(0),a=n(6476),u=n(4278),s=n(4643),c=n(1990),f=n(1255),l=n(4664),h=n(4664),d=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",v=u.getWeak,g=Object.isExtensible,y=c.ufstore,m=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(t){if(f(t)){var e=v(t);return!0===e?y(l(this,p)).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,p),t,e)}},_=t.exports=n(859)(p,m,b,c,!0,!0);h&&d&&(s((r=c.getConstructor(m,p)).prototype,b),u.NEED=!0,o(["delete","has","get","set"],(function(t){var e=_.prototype,n=e[t];a(e,t,(function(e,i){if(f(e)&&!g(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)}))})))},498:(t,e,n)=>{"use strict";var r=n(1990),i=n(4664),o="WeakSet";n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,o),t,!0)}},r,!1,!0)},7744:(t,e,n)=>{"use strict";var r=n(7044),i=n(6806),o=n(7583),a=n(8087),u=n(1464),s=n(6699);r(r.P,"Array",{flatMap:function(t){var e,n,r=o(this);return u(t),e=a(r.length),n=s(r,0),i(n,r,r,e,0,1,t,arguments[1]),n}}),n(4691)("flatMap")},5448:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)("includes")},8938:(t,e,n)=>{var r=n(7044),i=n(6460)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},7819:(t,e,n)=>{var r=n(7044),i=n(8125),o=n(8182),a=n(5385),u=n(1395);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),s=a.f,c=i(r),f={},l=0;c.length>l;)void 0!==(n=s(r,e=c[l++]))&&u(f,e,n);return f}})},6572:(t,e,n)=>{var r=n(7044),i=n(6460)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},8228:(t,e,n)=>{"use strict";var r=n(7044),i=n(2845),o=n(7571),a=n(8713),u=n(909);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return u(e,t()).then((function(){return n}))}:t,n?function(n){return u(e,t()).then((function(){throw n}))}:t)}})},3336:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},3718:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},7831:(t,e,n)=>{"use strict";n(4961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},6642:(t,e,n)=>{"use strict";n(4961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9956:(t,e,n)=>{n(6262)("asyncIterator")},4367:(t,e,n)=>{for(var r=n(163),i=n(9804),o=n(6476),a=n(7571),u=n(913),s=n(9740),c=n(341),f=c("iterator"),l=c("toStringTag"),h=s.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(d),v=0;v<p.length;v++){var g,y=p[v],m=d[y],b=a[y],_=b&&b.prototype;if(_&&(_[f]||u(_,f,h),_[l]||u(_,l,y),s[y]=h,m))for(g in r)_[g]||o(_,g,r[g],!0)}},4433:(t,e,n)=>{var r=n(7044),i=n(7225);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},110:(t,e,n)=>{var r=n(7571),i=n(7044),o=n(2541),a=[].slice,u=/MSIE .\./.test(o),s=function(t){return function(e,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,n)}};i(i.G+i.B+i.F*u,{setTimeout:s(r.setTimeout),setInterval:s(r.setInterval)})},4962:(t,e,n)=>{n(110),n(4433),n(4367),t.exports=n(2845)},5229:t=>{t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},8356:t=>{t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}},5375:t=>{t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},3422:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},5128:t=>{t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},134:t=>{t.exports=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}},7223:(t,e,n)=>{t.exports=n(2274)},2274:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},6770:(t,e,n)=>{t.exports=n(236)},236:t=>{t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},6064:t=>{t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},2157:t=>{t.exports=1e-6},6922:(t,e,n)=>{t.exports=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r*Math.max(1,Math.abs(i),Math.abs(a))};var r=n(2157)},6066:t=>{t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},4860:t=>{t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},7395:(t,e,n)=>{t.exports=function(t,e,n,i,o,a){var u,s;for(e||(e=2),n||(n=0),s=i?Math.min(i*e+n,t.length):t.length,u=n;u<s;u+=e)r[0]=t[u],r[1]=t[u+1],o(r,r,a),t[u]=r[0],t[u+1]=r[1];return t};var r=n(5128)()},4697:t=>{t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},7801:(t,e,n)=>{t.exports={EPSILON:n(2157),create:n(5128),clone:n(5375),fromValues:n(4697),copy:n(3422),set:n(6765),equals:n(6922),exactEquals:n(6066),add:n(5229),subtract:n(4186),sub:n(5302),multiply:n(3848),mul:n(1665),divide:n(236),div:n(6770),inverse:n(1873),min:n(6780),max:n(9564),rotate:n(8615),floor:n(4860),ceil:n(8356),round:n(7313),scale:n(6526),scaleAndAdd:n(7781),distance:n(2274),dist:n(7223),squaredDistance:n(6534),sqrDist:n(4969),length:n(360),len:n(2256),squaredLength:n(5476),sqrLen:n(508),negate:n(388),normalize:n(5927),dot:n(6064),cross:n(134),lerp:n(1099),random:n(679),transformMat2:n(367),transformMat2d:n(655),transformMat3:n(2730),transformMat4:n(4020),forEach:n(7395),limit:n(8709)}},1873:t=>{t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},2256:(t,e,n)=>{t.exports=n(360)},360:t=>{t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},1099:t=>{t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}},8709:t=>{t.exports=function(t,e,n){var r=e[0]*e[0]+e[1]*e[1];if(r>n*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},9564:t=>{t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},6780:t=>{t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}},1665:(t,e,n)=>{t.exports=n(3848)},3848:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},388:t=>{t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},5927:t=>{t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t}},679:t=>{t.exports=function(t,e){e=e||1;var n=2*Math.random()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}},8615:t=>{t.exports=function(t,e,n){var r=Math.cos(n),i=Math.sin(n),o=e[0],a=e[1];return t[0]=o*r-a*i,t[1]=o*i+a*r,t}},7313:t=>{t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},6526:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},7781:t=>{t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},6765:t=>{t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},4969:(t,e,n)=>{t.exports=n(6534)},508:(t,e,n)=>{t.exports=n(5476)},6534:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},5476:t=>{t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},5302:(t,e,n)=>{t.exports=n(4186)},4186:t=>{t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},367:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}},655:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}},2730:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}},4020:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},3039:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Symbol.for("INJECTION");function r(t,e,r,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(n,this,e)&&Reflect.defineMetadata(n,r(),this,e),Reflect.hasMetadata(n,this,e)?Reflect.getMetadata(n,this,e):r()},set:function(t){Reflect.defineMetadata(n,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,i){return function(o,a){r(o,a,(function(){return t.getNamed(n,i)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,i,o){return function(a,u){r(a,u,(function(){return t.getTagged(n,i,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.getAll(n)}),e)}}}},1922:(t,e,n)=>{"use strict";var r=n(3039);e.Z=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},626:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(6078),i=n(295);function o(t,e,n,i,o){var a={},u="number"==typeof o,s=void 0!==o&&u?o.toString():n;if(u&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[s];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var h=l[f];if(h.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+h.key.toString())}else c=[];c.push(i),a[s]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function u(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([u(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},6213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(6078),i=n(295),o=n(5092),a=n(626),u=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=u,e.inject=function(t){return function(e,n,u){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var s=new o.Metadata(i.INJECT_TAG,t);"number"==typeof u?a.tagParameter(e,n,u,s):a.tagProperty(e,n,s)}}},1773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(6078),i=n(295);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},1528:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(295),i=n(5092),o=n(626);e.multiInject=function(t){return function(e,n,a){var u=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},9817:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(295),i=n(5092),o=n(626);e.named=function(t){return function(e,n,a){var u=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},1316:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(295),i=n(5092),o=n(626);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},1971:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(6078),i=n(295),o=n(5092);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},9189:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(5092),i=n(626);e.tagged=function(t,e){return function(n,o,a){var u=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,u):i.tagProperty(n,o,u)}}},8245:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(295),i=n(5092),o=n(626);e.targetName=function(t){return function(e,n,a){var u=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,u)}}},9235:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(295),i=n(5092),o=n(626);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},683:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(7690),i=n(23),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===r.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},3497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},6078:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]},e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},7690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0,e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"},e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},295:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]},596:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var a=n(683),u=n(6078),s=n(7690),c=n(295),f=n(3870),l=n(4142),h=n(9386),d=n(3313),p=n(23),v=n(9552),g=n(1878),y=n(2543),m=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+u.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=p.id(),this._bindingDictionary=new y.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var a=new t,u=o([e,n],r).map((function(t){return l.getBindingDictionary(t)})),s=l.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return u.forEach((function(t){c(t,s)})),a},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return n<r.length?(o=r[n],a=e(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||s.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new d.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(u.CANNOT_UNBIND+" "+v.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new y.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,c.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=l.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(g.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(u.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,c.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,c.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(u.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=l.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),h.resolve(n)}},t}();e.Container=m},2913:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(23);e.ContainerModule=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=r.id(),this.registry=t}},1878:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n},2543:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(6078),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},9311:(t,e,n)=>{"use strict";e.f3=e.t6=e.b2=e.W2=void 0,n(295);var r=n(596);Object.defineProperty(e,"W2",{enumerable:!0,get:function(){return r.Container}});n(7690),n(2913);var i=n(1773);Object.defineProperty(e,"b2",{enumerable:!0,get:function(){return i.injectable}});n(9189);var o=n(9817);Object.defineProperty(e,"t6",{enumerable:!0,get:function(){return o.named}});var a=n(6213);Object.defineProperty(e,"f3",{enumerable:!0,get:function(){return a.inject}});n(1316),n(9235),n(1528),n(8245),n(1971),n(3870),n(23),n(626),n(3140),n(9552),n(4384)},1519:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(23),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},5092:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(295),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},3870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(295),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},6335:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}},4142:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(3497),i=n(6078),o=n(7690),a=n(295),u=n(2542),s=n(9552),c=n(1519),f=n(5092),l=n(6335),h=n(6664),d=n(4810),p=n(9660);function v(t){return t._bindingDictionary}function g(t,e,n,o,a){var u,c=m(n.container,a.serviceIdentifier);return c.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),c=m(n.container,a.serviceIdentifier)),u=e?c:c.filter((function(t){var e=new d.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=s.getServiceIdentifierAsString(t),u=i.NOT_REGISTERED;throw u+=s.listMetadataForTarget(a,n),u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;throw a=s.getServiceIdentifierAsString(t),u=i.AMBIGUOUS_MATCH+" "+a,u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u)}}(a.serviceIdentifier,u,a,n.container),u}function y(t,e,n,r,a,u){var s,c;if(null===a){s=g(t,e,r,null,u),c=new d.Request(n,r,null,s,u);var f=new l.Plan(r,c);r.addPlan(f)}else s=g(t,e,r,a,u),c=a.addChildRequest(u.serviceIdentifier,s,u);s.forEach((function(e){var n=null;if(u.isArray())n=c.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=c}if(e.type===o.BindingTypeEnum.Instance&&null!==e.implementationType){var a=h.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks){var s=h.getBaseClassDependencyCount(t,e.implementationType);if(a.length<s){var f=i.ARGUMENTS_LENGTH_MISMATCH(h.getFunctionName(e.implementationType));throw new Error(f)}}a.forEach((function(e){y(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function m(t,e){var n=[],r=v(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=m(t.parent,e)),n}e.getBindingDictionary=v,e.plan=function(t,e,n,r,i,o,l,h){void 0===h&&(h=!1);var d=new c.Context(e),v=function(t,e,n,r,i,o){var u=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,s=new f.Metadata(u,n),c=new p.Target(e,"",n,s);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}(n,r,i,0,o,l);try{return y(t,h,i,d,null,v),d}catch(t){throw u.isStackOverflowExeption(t)&&d.plan&&s.circularDependencyToException(d.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new p.Target(o.TargetTypeEnum.Variable,"",e,new f.Metadata(n,r)),a=new c.Context(t);return new d.Request(e,a,null,[],i)}},8634:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n},6664:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0;var i=n(6213),o=n(6078),a=n(7690),u=n(295),s=n(9552);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return s.getFunctionName}});var c=n(9660);function f(t,e,n,i){var a=t.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(void 0===u){var s=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(s)}var c=a.userGeneratedMetadata,f=Object.keys(c),d=0===n.length&&f.length>0,p=f.length>n.length,v=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var u=l(a,t,e,n,r);null!==u&&o.push(u)}return o}(i,e,u,c,d||p?f.length:n.length),g=h(t,n);return r(r([],v),g)}function l(t,e,n,r,u){var s=u[t.toString()]||[],f=d(s),l=!0!==f.unmanaged,h=r[t];if((h=f.inject||f.multiInject||h)instanceof i.LazyServiceIdentifer&&(h=h.unwrap()),l){if(!e&&(h===Object||h===Function||void 0===h)){var p=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(p)}var v=new c.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,h);return v.metadata=s,v}return null}function h(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,u=Object.keys(n);o<u.length;o++){var s=u[o],f=n[s],l=d(n[s]),p=l.targetName||s,v=l.inject||l.multiInject,g=new c.Target(a.TargetTypeEnum.ClassProperty,p,v);g.metadata=f,i.push(g)}var y=Object.getPrototypeOf(e.prototype).constructor;if(y!==Object){var m=h(t,y);i=r(r([],i),m)}return i}function d(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[u.INJECT_TAG],multiInject:e[u.MULTI_INJECT_TAG],targetName:e[u.NAME_TAG],unmanaged:e[u.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return f(t,s.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=f(e,s.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===u.UNMANAGED_TAG}))})),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:t(e,r)}return 0}},4810:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(23),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},9660:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(295),i=n(23),o=n(5092),a=n(8634),u=function(){function t(t,e,n,u){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var s=null;"string"==typeof u?s=new o.Metadata(r.NAMED_TAG,u):u instanceof o.Metadata&&(s=u),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++)if(n[e].key===t)return!0;return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=u},8544:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0;var i=n(6078),o=n(7690),a=n(295);e.resolveInstance=function(t,e,n){var u,s,c=null;e.length>0?(s=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n),c=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(c=new((u=t).bind.apply(u,r([void 0],s))),e,n)):c=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,c),c}},9386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(6078),i=n(7690),o=n(2542),a=n(9552),u=n(8544),s=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},c=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,f=e.target&&e.target.isArray(),l=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(f&&l)return o.map((function(e){return c(t)(e)}));var h=null;if(!e.target.isOptional()||0!==n.length){var d=n[0],p=d.scope===i.BindingScopeEnum.Singleton,v=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(v&&null!==t&&t.has(d.id))return t.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Function)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Constructor)h=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)h=s("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)h=s("toFactory",d.serviceIdentifier,(function(){return d.factory(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)h=s("toProvider",d.serviceIdentifier,(function(){return d.provider(e.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var g=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+g)}h=u.resolveInstance(d.implementationType,o,c(t))}return"function"==typeof d.onActivation&&(h=d.onActivation(e.parentContext,h)),p&&(d.cache=h,d.activated=!0),v&&null!==t&&!t.has(d.id)&&t.set(d.id,h),h}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},1640:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(7690),i=n(6890),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},2386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(1640),i=n(8926),o=n(2700),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},8926:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(2700),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},3313:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(6078),i=n(7690),o=n(2386),a=n(6890),u=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=u},6890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(8926),i=n(2700),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},2700:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(8926),i=n(3140),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},3140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(295),i=n(5092),o=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||o(n,e))};e.traverseAncerstors=o;var a=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=a;var u=a(r.NAMED_TAG);e.namedConstraint=u,e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},4384:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0,e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},2542:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(6078);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},23:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},9552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0;var r=n(6078);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||o(t.parentRequest,e))}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=i,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(o(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=i(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=a},9392:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",u="__lodash_placeholder__",s=32,c=128,f=1/0,l=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",m="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",E="[object Number]",S="[object Object]",A="[object Promise]",T="[object RegExp]",I="[object Set]",N="[object String]",k="[object Symbol]",C="[object WeakMap]",O="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",M="[object Float64Array]",P="[object Int8Array]",G="[object Int16Array]",L="[object Int32Array]",j="[object Uint8Array]",U="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",F=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,q=RegExp(H.source),Y=RegExp(X.source),K=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="["+St+"]",Tt="["+wt+"]",It="\\d+",Nt="["+xt+"]",kt="[^\\ud800-\\udfff"+St+It+"\\u2700-\\u27bf"+xt+Et+"]",Ct="\\ud83c[\\udffb-\\udfff]",Ot="[^\\ud800-\\udfff]",Dt="(?:\\ud83c[\\udde6-\\uddff]){2}",Rt="[\\ud800-\\udbff][\\udc00-\\udfff]",Mt="["+Et+"]",Pt="(?:"+Nt+"|"+kt+")",Gt="(?:"+Mt+"|"+kt+")",Lt="(?:['’](?:d|ll|m|re|s|t|ve))?",jt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ut="(?:"+Tt+"|"+Ct+")?",Bt="[\\ufe0e\\ufe0f]?",zt=Bt+Ut+"(?:\\u200d(?:"+[Ot,Dt,Rt].join("|")+")"+Bt+Ut+")*",Ft="(?:"+["[\\u2700-\\u27bf]",Dt,Rt].join("|")+")"+zt,Wt="(?:"+[Ot+Tt+"?",Tt,Dt,Rt,"[\\ud800-\\udfff]"].join("|")+")",Vt=RegExp("['’]","g"),Ht=RegExp(Tt,"g"),Xt=RegExp(Ct+"(?="+Ct+")|"+Wt+zt,"g"),qt=RegExp([Mt+"?"+Nt+"+"+Lt+"(?="+[At,Mt,"$"].join("|")+")",Gt+"+"+jt+"(?="+[At,Mt+Pt,"$"].join("|")+")",Mt+"?"+Pt+"+"+Lt,Mt+"+"+jt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It,Ft].join("|"),"g"),Yt=RegExp("[\\u200d\\ud800-\\udfff"+wt+"\\ufe0e\\ufe0f]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zt=-1,Jt={};Jt[R]=Jt[M]=Jt[P]=Jt[G]=Jt[L]=Jt[j]=Jt[U]=Jt[B]=Jt[z]=!0,Jt[v]=Jt[g]=Jt[O]=Jt[y]=Jt[D]=Jt[m]=Jt[b]=Jt[_]=Jt[x]=Jt[E]=Jt[S]=Jt[T]=Jt[I]=Jt[N]=Jt[C]=!1;var Qt={};Qt[v]=Qt[g]=Qt[O]=Qt[D]=Qt[y]=Qt[m]=Qt[R]=Qt[M]=Qt[P]=Qt[G]=Qt[L]=Qt[x]=Qt[E]=Qt[S]=Qt[T]=Qt[I]=Qt[N]=Qt[k]=Qt[j]=Qt[U]=Qt[B]=Qt[z]=!0,Qt[b]=Qt[_]=Qt[C]=!1;var te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ee=parseFloat,ne=parseInt,re="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ie="object"==typeof self&&self&&self.Object===Object&&self,oe=re||ie||Function("return this")(),ae=e&&!e.nodeType&&e,ue=ae&&t&&!t.nodeType&&t,se=ue&&ue.exports===ae,ce=se&&re.process,fe=function(){try{return ue&&ue.require&&ue.require("util").types||ce&&ce.binding&&ce.binding("util")}catch(t){}}(),le=fe&&fe.isArrayBuffer,he=fe&&fe.isDate,de=fe&&fe.isMap,pe=fe&&fe.isRegExp,ve=fe&&fe.isSet,ge=fe&&fe.isTypedArray;function ye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function me(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function _e(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function we(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function xe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Ee(t,e){return!(null==t||!t.length)&&Re(t,e,0)>-1}function Se(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ae(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Te(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ie(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ne(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function ke(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Ce=Le("length");function Oe(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function De(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Re(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):De(t,Pe,n)}function Me(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Pe(t){return t!=t}function Ge(t,e){var n=null==t?0:t.length;return n?Be(t,e)/n:h}function Le(t){return function(e){return null==e?i:e[t]}}function je(t){return function(e){return null==t?i:t[e]}}function Ue(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Be(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function ze(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Fe(t){return t?t.slice(0,un(t)+1).replace(rt,""):t}function We(t){return function(e){return t(e)}}function Ve(t,e){return Ae(e,(function(e){return t[e]}))}function He(t,e){return t.has(e)}function Xe(t,e){for(var n=-1,r=t.length;++n<r&&Re(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length;n--&&Re(e,t[n],0)>-1;);return n}function Ye(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Ke=je({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),$e=je({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ze(t){return"\\"+te[t]}function Je(t){return Yt.test(t)}function Qe(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function tn(t,e){return function(n){return t(e(n))}}function en(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==u||(t[n]=u,o[i++]=n)}return o}function nn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function on(t){return Je(t)?function(t){for(var e=Xt.lastIndex=0;Xt.test(t);)++e;return e}(t):Ce(t)}function an(t){return Je(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.split("")}(t)}function un(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var sn=je({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),cn=function t(e){var n,r=(e=null==e?oe:cn.defaults(oe.Object(),e,cn.pick(oe,$t))).Array,it=e.Date,wt=e.Error,xt=e.Function,Et=e.Math,St=e.Object,At=e.RegExp,Tt=e.String,It=e.TypeError,Nt=r.prototype,kt=xt.prototype,Ct=St.prototype,Ot=e["__core-js_shared__"],Dt=kt.toString,Rt=Ct.hasOwnProperty,Mt=0,Pt=(n=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Gt=Ct.toString,Lt=Dt.call(St),jt=oe._,Ut=At("^"+Dt.call(Rt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=se?e.Buffer:i,zt=e.Symbol,Ft=e.Uint8Array,Wt=Bt?Bt.allocUnsafe:i,Xt=tn(St.getPrototypeOf,St),Yt=St.create,te=Ct.propertyIsEnumerable,re=Nt.splice,ie=zt?zt.isConcatSpreadable:i,ae=zt?zt.iterator:i,ue=zt?zt.toStringTag:i,ce=function(){try{var t=co(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==oe.clearTimeout&&e.clearTimeout,Ce=it&&it.now!==oe.Date.now&&it.now,je=e.setTimeout!==oe.setTimeout&&e.setTimeout,fn=Et.ceil,ln=Et.floor,hn=St.getOwnPropertySymbols,dn=Bt?Bt.isBuffer:i,pn=e.isFinite,vn=Nt.join,gn=tn(St.keys,St),yn=Et.max,mn=Et.min,bn=it.now,_n=e.parseInt,wn=Et.random,xn=Nt.reverse,En=co(e,"DataView"),Sn=co(e,"Map"),An=co(e,"Promise"),Tn=co(e,"Set"),In=co(e,"WeakMap"),Nn=co(St,"create"),kn=In&&new In,Cn={},On=Uo(En),Dn=Uo(Sn),Rn=Uo(An),Mn=Uo(Tn),Pn=Uo(In),Gn=zt?zt.prototype:i,Ln=Gn?Gn.valueOf:i,jn=Gn?Gn.toString:i;function Un(t){if(nu(t)&&!Ha(t)&&!(t instanceof Wn)){if(t instanceof Fn)return t;if(Rt.call(t,"__wrapped__"))return Bo(t)}return new Fn(t)}var Bn=function(){function t(){}return function(e){if(!eu(e))return{};if(Yt)return Yt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function Fn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Hn(t);this.size=e.size}function Kn(t,e){var n=Ha(t),r=!n&&Va(t),i=!n&&!r&&Ka(t),o=!n&&!r&&!i&&fu(t),a=n||r||i||o,u=a?ze(t.length,Tt):[],s=u.length;for(var c in t)!e&&!Rt.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yo(c,s))||u.push(c);return u}function $n(t){var e=t.length;return e?t[Xr(0,e-1)]:i}function Zn(t,e){return Mo(Ii(t),ar(e,0,t.length))}function Jn(t){return Mo(Ii(t))}function Qn(t,e,n){(n!==i&&!za(t[e],n)||n===i&&!(e in t))&&ir(t,e,n)}function tr(t,e,n){var r=t[e];Rt.call(t,e)&&za(r,n)&&(n!==i||e in t)||ir(t,e,n)}function er(t,e){for(var n=t.length;n--;)if(za(t[n][0],e))return n;return-1}function nr(t,e,n,r){return lr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function rr(t,e){return t&&Ni(e,Du(e),t)}function ir(t,e,n){"__proto__"==e&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(t,e){for(var n=-1,o=e.length,a=r(o),u=null==t;++n<o;)a[n]=u?i:Iu(t,e[n]);return a}function ar(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ur(t,e,n,r,o,a){var u,s=1&e,c=2&e,f=4&e;if(n&&(u=o?n(t,r,o,a):n(t)),u!==i)return u;if(!eu(t))return t;var l=Ha(t);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Ii(t,u)}else{var h=ho(t),d=h==_||h==w;if(Ka(t))return wi(t,s);if(h==S||h==v||d&&!o){if(u=c||d?{}:vo(t),!s)return c?function(t,e){return Ni(t,lo(t),e)}(t,function(t,e){return t&&Ni(e,Ru(e),t)}(u,t)):function(t,e){return Ni(t,fo(t),e)}(t,rr(u,t))}else{if(!Qt[h])return o?t:{};u=function(t,e,n){var r,i=t.constructor;switch(e){case O:return xi(t);case y:case m:return new i(+t);case D:return function(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case R:case M:case P:case G:case L:case j:case U:case B:case z:return Ei(t,n);case x:case I:return new i;case E:case N:return new i(t);case T:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case k:return r=t,Ln?St(Ln.call(r)):{}}}(t,h,s)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,u),uu(t)?t.forEach((function(r){u.add(ur(r,e,n,r,t,a))})):ru(t)&&t.forEach((function(r,i){u.set(i,ur(r,e,n,i,t,a))}));var g=l?i:(f?c?no:eo:c?Ru:Du)(t);return be(g||t,(function(r,i){g&&(r=t[i=r]),tr(u,i,ur(r,e,n,i,t,a))})),u}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=St(t);r--;){var o=n[r],a=e[o],u=t[o];if(u===i&&!(o in t)||!a(u))return!1}return!0}function cr(t,e,n){if("function"!=typeof t)throw new It(o);return Co((function(){t.apply(i,n)}),e)}function fr(t,e,n,r){var i=-1,o=Ee,a=!0,u=t.length,s=[],c=e.length;if(!u)return s;n&&(e=Ae(e,We(n))),r?(o=Se,a=!1):e.length>=200&&(o=He,a=!1,e=new qn(e));t:for(;++i<u;){var f=t[i],l=null==n?f:n(f);if(f=r||0!==f?f:0,a&&l==l){for(var h=c;h--;)if(e[h]===l)continue t;s.push(f)}else o(e,l,r)||s.push(f)}return s}Un.templateSettings={escape:K,evaluate:$,interpolate:Z,variable:"",imports:{_:Un}},Un.prototype=zn.prototype,Un.prototype.constructor=Un,Fn.prototype=Bn(zn.prototype),Fn.prototype.constructor=Fn,Wn.prototype=Bn(zn.prototype),Wn.prototype.constructor=Wn,Vn.prototype.clear=function(){this.__data__=Nn?Nn(null):{},this.size=0},Vn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vn.prototype.get=function(t){var e=this.__data__;if(Nn){var n=e[t];return n===a?i:n}return Rt.call(e,t)?e[t]:i},Vn.prototype.has=function(t){var e=this.__data__;return Nn?e[t]!==i:Rt.call(e,t)},Vn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Nn&&e===i?a:e,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(t){var e=this.__data__,n=er(e,t);return!(n<0||(n==e.length-1?e.pop():re.call(e,n,1),--this.size,0))},Hn.prototype.get=function(t){var e=this.__data__,n=er(e,t);return n<0?i:e[n][1]},Hn.prototype.has=function(t){return er(this.__data__,t)>-1},Hn.prototype.set=function(t,e){var n=this.__data__,r=er(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Sn||Hn),string:new Vn}},Xn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return uo(this,t).get(t)},Xn.prototype.has=function(t){return uo(this,t).has(t)},Xn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(t){return this.__data__.set(t,a),this},qn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Hn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var lr=Oi(br),hr=Oi(_r,!0);function dr(t,e){var n=!0;return lr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function pr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],u=e(a);if(null!=u&&(s===i?u==u&&!cu(u):n(u,s)))var s=u,c=a}return c}function vr(t,e){var n=[];return lr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function gr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=go),i||(i=[]);++o<a;){var u=t[o];e>0&&n(u)?e>1?gr(u,e-1,n,r,i):Te(i,u):r||(i[i.length]=u)}return i}var yr=Di(),mr=Di(!0);function br(t,e){return t&&yr(t,e,Du)}function _r(t,e){return t&&mr(t,e,Du)}function wr(t,e){return xe(e,(function(e){return Ja(t[e])}))}function xr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[jo(e[n++])];return n&&n==r?t:i}function Er(t,e,n){var r=e(t);return Ha(t)?r:Te(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":ue&&ue in St(t)?function(t){var e=Rt.call(t,ue),n=t[ue];try{t[ue]=i;var r=!0}catch(t){}var o=Gt.call(t);return r&&(e?t[ue]=n:delete t[ue]),o}(t):function(t){return Gt.call(t)}(t)}function Ar(t,e){return t>e}function Tr(t,e){return null!=t&&Rt.call(t,e)}function Ir(t,e){return null!=t&&e in St(t)}function Nr(t,e,n){for(var o=n?Se:Ee,a=t[0].length,u=t.length,s=u,c=r(u),f=1/0,l=[];s--;){var h=t[s];s&&e&&(h=Ae(h,We(e))),f=mn(h.length,f),c[s]=!n&&(e||a>=120&&h.length>=120)?new qn(s&&h):i}h=t[0];var d=-1,p=c[0];t:for(;++d<a&&l.length<f;){var v=h[d],g=e?e(v):v;if(v=n||0!==v?v:0,!(p?He(p,g):o(l,g,n))){for(s=u;--s;){var y=c[s];if(!(y?He(y,g):o(t[s],g,n)))continue t}p&&p.push(g),l.push(v)}}return l}function kr(t,e,n){var r=null==(t=To(t,e=yi(e,t)))?t:t[jo(Zo(e))];return null==r?i:ye(r,t,n)}function Cr(t){return nu(t)&&Sr(t)==v}function Or(t,e,n,r,o){return t===e||(null==t||null==e||!nu(t)&&!nu(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var u=Ha(t),s=Ha(e),c=u?g:ho(t),f=s?g:ho(e),l=(c=c==v?S:c)==S,h=(f=f==v?S:f)==S,d=c==f;if(d&&Ka(t)){if(!Ka(e))return!1;u=!0,l=!1}if(d&&!l)return a||(a=new Yn),u||fu(t)?Qi(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case D:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case O:return!(t.byteLength!=e.byteLength||!o(new Ft(t),new Ft(e)));case y:case m:case E:return za(+t,+e);case b:return t.name==e.name&&t.message==e.message;case T:case N:return t==e+"";case x:var u=Qe;case I:var s=1&r;if(u||(u=nn),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=Qi(u(t),u(e),r,i,o,a);return a.delete(t),f;case k:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,e,c,n,r,o,a);if(!(1&n)){var p=l&&Rt.call(t,"__wrapped__"),_=h&&Rt.call(e,"__wrapped__");if(p||_){var w=p?t.value():t,A=_?e.value():e;return a||(a=new Yn),o(w,A,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var u=1&n,s=eo(t),c=s.length;if(c!=eo(e).length&&!u)return!1;for(var f=c;f--;){var l=s[f];if(!(u?l in e:Rt.call(e,l)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=u;++f<c;){var g=t[l=s[f]],y=e[l];if(r)var m=u?r(y,g,l,e,t,a):r(g,y,l,t,e,a);if(!(m===i?g===y||o(g,y,n,r,a):m)){p=!1;break}v||(v="constructor"==l)}if(p&&!v){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,Or,o))}function Dr(t,e,n,r){var o=n.length,a=o,u=!r;if(null==t)return!a;for(t=St(t);o--;){var s=n[o];if(u&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){var c=(s=n[o])[0],f=t[c],l=s[1];if(u&&s[2]){if(f===i&&!(c in t))return!1}else{var h=new Yn;if(r)var d=r(f,l,c,t,e,h);if(!(d===i?Or(l,f,3,r,h):d))return!1}}return!0}function Rr(t){return!(!eu(t)||(e=t,Pt&&Pt in e))&&(Ja(t)?Ut:vt).test(Uo(t));var e}function Mr(t){return"function"==typeof t?t:null==t?is:"object"==typeof t?Ha(t)?Ur(t[0],t[1]):jr(t):ds(t)}function Pr(t){if(!xo(t))return gn(t);var e=[];for(var n in St(t))Rt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Gr(t,e){return t<e}function Lr(t,e){var n=-1,i=qa(t)?r(t.length):[];return lr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function jr(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||Dr(n,t,e)}}function Ur(t,e){return bo(t)&&Eo(e)?So(jo(t),e):function(n){var r=Iu(n,t);return r===i&&r===e?Nu(n,t):Or(e,r,3)}}function Br(t,e,n,r,o){t!==e&&yr(e,(function(a,u){if(o||(o=new Yn),eu(a))!function(t,e,n,r,o,a,u){var s=No(t,n),c=No(e,n),f=u.get(c);if(f)Qn(t,n,f);else{var l=a?a(s,c,n+"",t,e,u):i,h=l===i;if(h){var d=Ha(c),p=!d&&Ka(c),v=!d&&!p&&fu(c);l=c,d||p||v?Ha(s)?l=s:Ya(s)?l=Ii(s):p?(h=!1,l=wi(c,!0)):v?(h=!1,l=Ei(c,!0)):l=[]:ou(c)||Va(c)?(l=s,Va(s)?l=mu(s):eu(s)&&!Ja(s)||(l=vo(c))):h=!1}h&&(u.set(c,l),o(l,c,r,a,u),u.delete(c)),Qn(t,n,l)}}(t,e,u,n,Br,r,o);else{var s=r?r(No(t,u),a,u+"",t,e,o):i;s===i&&(s=a),Qn(t,u,s)}}),Ru)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function Fr(t,e,n){e=e.length?Ae(e,(function(t){return Ha(t)?function(e){return xr(e,1===t.length?t[0]:t)}:t})):[is];var r=-1;e=Ae(e,We(ao()));var i=Lr(t,(function(t,n,i){var o=Ae(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,u=n.length;++r<a;){var s=Si(i[r],o[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Wr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],u=xr(t,a);n(u,a)&&Zr(o,yi(a,t),u)}return o}function Vr(t,e,n,r){var i=r?Me:Re,o=-1,a=e.length,u=t;for(t===e&&(e=Ii(e)),n&&(u=Ae(t,We(n)));++o<a;)for(var s=0,c=e[o],f=n?n(c):c;(s=i(u,f,s,r))>-1;)u!==t&&re.call(u,s,1),re.call(t,s,1);return t}function Hr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?re.call(t,i,1):ci(t,i)}}return t}function Xr(t,e){return t+ln(wn()*(e-t+1))}function qr(t,e){var n="";if(!t||e<1||e>l)return n;do{e%2&&(n+=t),(e=ln(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return Oo(Ao(t,e,is),t+"")}function Kr(t){return $n(zu(t))}function $r(t,e){var n=zu(t);return Mo(n,ar(e,0,n.length))}function Zr(t,e,n,r){if(!eu(t))return t;for(var o=-1,a=(e=yi(e,t)).length,u=a-1,s=t;null!=s&&++o<a;){var c=jo(e[o]),f=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=u){var l=s[c];(f=r?r(l,c,s):i)===i&&(f=eu(l)?l:yo(e[o+1])?[]:{})}tr(s,c,f),s=s[c]}return t}var Jr=kn?function(t,e){return kn.set(t,e),t}:is,Qr=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:es(e),writable:!0})}:is;function ti(t){return Mo(zu(t))}function ei(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ni(t,e){var n;return lr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ri(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!cu(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ii(t,e,is,n)}function ii(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var u=(e=n(e))!=e,s=null===e,c=cu(e),f=e===i;o<a;){var l=ln((o+a)/2),h=n(t[l]),d=h!==i,p=null===h,v=h==h,g=cu(h);if(u)var y=r||v;else y=f?v&&(r||d):s?v&&d&&(r||!p):c?v&&d&&!p&&(r||!g):!p&&!g&&(r?h<=e:h<e);y?o=l+1:a=l}return mn(a,4294967294)}function oi(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],u=e?e(a):a;if(!n||!za(u,s)){var s=u;o[i++]=0===a?0:a}}return o}function ai(t){return"number"==typeof t?t:cu(t)?h:+t}function ui(t){if("string"==typeof t)return t;if(Ha(t))return Ae(t,ui)+"";if(cu(t))return jn?jn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=Ee,o=t.length,a=!0,u=[],s=u;if(n)a=!1,i=Se;else if(o>=200){var c=e?null:qi(t);if(c)return nn(c);a=!1,i=He,s=new qn}else s=e?[]:u;t:for(;++r<o;){var f=t[r],l=e?e(f):f;if(f=n||0!==f?f:0,a&&l==l){for(var h=s.length;h--;)if(s[h]===l)continue t;e&&s.push(l),u.push(f)}else i(s,l,n)||(s!==u&&s.push(l),u.push(f))}return u}function ci(t,e){return null==(t=To(t,e=yi(e,t)))||delete t[jo(Zo(e))]}function fi(t,e,n,r){return Zr(t,e,n(xr(t,e)),r)}function li(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ei(t,r?0:o,r?o+1:i):ei(t,r?o+1:0,r?i:o)}function hi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Ie(e,(function(t,e){return e.func.apply(e.thisArg,Te([t],e.args))}),n)}function di(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var u=t[o],s=-1;++s<i;)s!=o&&(a[o]=fr(a[o]||u,t[s],e,n));return si(gr(a,1),e,n)}function pi(t,e,n){for(var r=-1,o=t.length,a=e.length,u={};++r<o;){var s=r<a?e[r]:i;n(u,t[r],s)}return u}function vi(t){return Ya(t)?t:[]}function gi(t){return"function"==typeof t?t:is}function yi(t,e){return Ha(t)?t:bo(t,e)?[t]:Lo(bu(t))}var mi=Yr;function bi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ei(t,e,n)}var _i=fe||function(t){return oe.clearTimeout(t)};function wi(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function xi(t){var e=new t.constructor(t.byteLength);return new Ft(e).set(new Ft(t)),e}function Ei(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=cu(t),u=e!==i,s=null===e,c=e==e,f=cu(e);if(!s&&!f&&!a&&t>e||a&&u&&c&&!s&&!f||r&&u&&c||!n&&c||!o)return 1;if(!r&&!a&&!f&&t<e||f&&n&&o&&!r&&!a||s&&n&&o||!u&&o||!c)return-1}return 0}function Ai(t,e,n,i){for(var o=-1,a=t.length,u=n.length,s=-1,c=e.length,f=yn(a-u,0),l=r(c+f),h=!i;++s<c;)l[s]=e[s];for(;++o<u;)(h||o<a)&&(l[n[o]]=t[o]);for(;f--;)l[s++]=t[o++];return l}function Ti(t,e,n,i){for(var o=-1,a=t.length,u=-1,s=n.length,c=-1,f=e.length,l=yn(a-s,0),h=r(l+f),d=!i;++o<l;)h[o]=t[o];for(var p=o;++c<f;)h[p+c]=e[c];for(;++u<s;)(d||o<a)&&(h[p+n[u]]=t[o++]);return h}function Ii(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ni(t,e,n,r){var o=!n;n||(n={});for(var a=-1,u=e.length;++a<u;){var s=e[a],c=r?r(n[s],t[s],s,n,t):i;c===i&&(c=t[s]),o?ir(n,s,c):tr(n,s,c)}return n}function ki(t,e){return function(n,r){var i=Ha(n)?me:nr,o=e?e():{};return i(n,t,ao(r,2),o)}}function Ci(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,u=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,u&&mo(n[0],n[1],u)&&(a=o<3?i:a,o=1),e=St(e);++r<o;){var s=n[r];s&&t(e,s,r,a)}return e}))}function Oi(t,e){return function(n,r){if(null==n)return n;if(!qa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=St(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Di(t){return function(e,n,r){for(var i=-1,o=St(e),a=r(e),u=a.length;u--;){var s=a[t?u:++i];if(!1===n(o[s],s,o))break}return e}}function Ri(t){return function(e){var n=Je(e=bu(e))?an(e):i,r=n?n[0]:e.charAt(0),o=n?bi(n,1).join(""):e.slice(1);return r[t]()+o}}function Mi(t){return function(e){return Ie(Ju(Vu(e).replace(Vt,"")),t,"")}}function Pi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Bn(t.prototype),r=t.apply(n,e);return eu(r)?r:n}}function Gi(t){return function(e,n,r){var o=St(e);if(!qa(e)){var a=ao(n,3);e=Du(e),n=function(t){return a(o[t],t,o)}}var u=t(e,n,r);return u>-1?o[a?e[u]:u]:i}}function Li(t){return to((function(e){var n=e.length,r=n,a=Fn.prototype.thru;for(t&&e.reverse();r--;){var u=e[r];if("function"!=typeof u)throw new It(o);if(a&&!s&&"wrapper"==io(u))var s=new Fn([],!0)}for(r=s?r:n;++r<n;){var c=io(u=e[r]),f="wrapper"==c?ro(u):i;s=f&&_o(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?s[io(f[0])].apply(s,f[3]):1==u.length&&_o(u)?s[c]():s.thru(u)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&Ha(r))return s.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function ji(t,e,n,o,a,u,s,f,l,h){var d=e&c,p=1&e,v=2&e,g=24&e,y=512&e,m=v?i:Pi(t);return function i(){for(var c=arguments.length,b=r(c),_=c;_--;)b[_]=arguments[_];if(g)var w=oo(i),x=Ye(b,w);if(o&&(b=Ai(b,o,a,g)),u&&(b=Ti(b,u,s,g)),c-=x,g&&c<h){var E=en(b,w);return Hi(t,e,ji,i.placeholder,n,b,E,f,l,h-c)}var S=p?n:this,A=v?S[t]:t;return c=b.length,f?b=Io(b,f):y&&c>1&&b.reverse(),d&&l<c&&(b.length=l),this&&this!==oe&&this instanceof i&&(A=m||Pi(A)),A.apply(S,b)}}function Ui(t,e){return function(n,r){return function(t,e,n,r){return br(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Bi(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=ai(n),r=ai(r)),o=t(n,r)}return o}}function zi(t){return to((function(e){return e=Ae(e,We(ao())),Yr((function(n){var r=this;return t(e,(function(t){return ye(t,r,n)}))}))}))}function Fi(t,e){var n=(e=e===i?" ":ui(e)).length;if(n<2)return n?qr(e,t):e;var r=qr(e,fn(t/on(e)));return Je(e)?bi(an(r),0,t).join(""):r.slice(0,t)}function Wi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=pu(e),n===i?(n=e,e=0):n=pu(n),function(t,e,n,i){for(var o=-1,a=yn(fn((e-t)/(n||1)),0),u=r(a);a--;)u[i?a:++o]=t,t+=n;return u}(e,n,o=o===i?e<n?1:-1:pu(o),t)}}function Vi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=yu(e),n=yu(n)),t(e,n)}}function Hi(t,e,n,r,o,a,u,c,f,l){var h=8&e;e|=h?s:64,4&(e&=~(h?64:s))||(e&=-4);var d=[t,e,o,h?a:i,h?u:i,h?i:a,h?i:u,c,f,l],p=n.apply(i,d);return _o(t)&&ko(p,d),p.placeholder=r,Do(p,t,e)}function Xi(t){var e=Et[t];return function(t,n){if(t=yu(t),(n=null==n?0:mn(vu(n),292))&&pn(t)){var r=(bu(t)+"e").split("e");return+((r=(bu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var qi=Tn&&1/nn(new Tn([,-0]))[1]==f?function(t){return new Tn(t)}:cs;function Yi(t){return function(e){var n=ho(e);return n==x?Qe(e):n==I?rn(e):function(t,e){return Ae(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ki(t,e,n,a,f,l,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new It(o);var v=a?a.length:0;if(v||(e&=-97,a=f=i),h=h===i?h:yn(vu(h),0),d=d===i?d:vu(d),v-=f?f.length:0,64&e){var g=a,y=f;a=f=i}var m=p?i:ro(t),b=[t,e,n,a,f,g,y,l,h,d];if(m&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==c&&8==n||r==c&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var s=e[3];if(s){var f=t[3];t[3]=f?Ai(f,s,e[4]):s,t[4]=f?en(t[3],u):e[4]}(s=e[5])&&(f=t[5],t[5]=f?Ti(f,s,e[6]):s,t[6]=f?en(t[5],u):e[6]),(s=e[7])&&(t[7]=s),r&c&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,m),t=b[0],e=b[1],n=b[2],a=b[3],f=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||16==e?function(t,e,n){var o=Pi(t);return function a(){for(var u=arguments.length,s=r(u),c=u,f=oo(a);c--;)s[c]=arguments[c];var l=u<3&&s[0]!==f&&s[u-1]!==f?[]:en(s,f);return(u-=l.length)<n?Hi(t,e,ji,a.placeholder,i,s,l,i,i,n-u):ye(this&&this!==oe&&this instanceof a?o:t,this,s)}}(t,e,d):e!=s&&33!=e||f.length?ji.apply(i,b):function(t,e,n,i){var o=1&e,a=Pi(t);return function e(){for(var u=-1,s=arguments.length,c=-1,f=i.length,l=r(f+s),h=this&&this!==oe&&this instanceof e?a:t;++c<f;)l[c]=i[c];for(;s--;)l[c++]=arguments[++u];return ye(h,o?n:this,l)}}(t,e,n,a);else var _=function(t,e,n){var r=1&e,i=Pi(t);return function e(){return(this&&this!==oe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Do((m?Jr:ko)(_,b),t,e)}function $i(t,e,n,r){return t===i||za(t,Ct[n])&&!Rt.call(r,n)?e:t}function Zi(t,e,n,r,o,a){return eu(t)&&eu(e)&&(a.set(e,t),Br(t,e,i,Zi,a),a.delete(e)),t}function Ji(t){return ou(t)?i:t}function Qi(t,e,n,r,o,a){var u=1&n,s=t.length,c=e.length;if(s!=c&&!(u&&c>s))return!1;var f=a.get(t),l=a.get(e);if(f&&l)return f==e&&l==t;var h=-1,d=!0,p=2&n?new qn:i;for(a.set(t,e),a.set(e,t);++h<s;){var v=t[h],g=e[h];if(r)var y=u?r(g,v,h,e,t,a):r(v,g,h,t,e,a);if(y!==i){if(y)continue;d=!1;break}if(p){if(!ke(e,(function(t,e){if(!He(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==g&&!o(v,g,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function to(t){return Oo(Ao(t,i,Xo),t+"")}function eo(t){return Er(t,Du,fo)}function no(t){return Er(t,Ru,lo)}var ro=kn?function(t){return kn.get(t)}:cs;function io(t){for(var e=t.name+"",n=Cn[e],r=Rt.call(Cn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function oo(t){return(Rt.call(Un,"placeholder")?Un:t).placeholder}function ao(){var t=Un.iteratee||os;return t=t===os?Mr:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=Du(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Eo(i)]}return e}function co(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Rr(n)?n:i}var fo=hn?function(t){return null==t?[]:(t=St(t),xe(hn(t),(function(e){return te.call(t,e)})))}:gs,lo=hn?function(t){for(var e=[];t;)Te(e,fo(t)),t=Xt(t);return e}:gs,ho=Sr;function po(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=jo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&tu(i)&&yo(a,i)&&(Ha(t)||Va(t))}function vo(t){return"function"!=typeof t.constructor||xo(t)?{}:Bn(Xt(t))}function go(t){return Ha(t)||Va(t)||!!(ie&&t&&t[ie])}function yo(t,e){var n=typeof t;return!!(e=null==e?l:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!eu(n))return!1;var r=typeof e;return!!("number"==r?qa(n)&&yo(e,n.length):"string"==r&&e in n)&&za(n[e],t)}function bo(t,e){if(Ha(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!cu(t))||Q.test(t)||!J.test(t)||null!=e&&t in St(e)}function _o(t){var e=io(t),n=Un[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=ro(n);return!!r&&t===r[0]}(En&&ho(new En(new ArrayBuffer(1)))!=D||Sn&&ho(new Sn)!=x||An&&ho(An.resolve())!=A||Tn&&ho(new Tn)!=I||In&&ho(new In)!=C)&&(ho=function(t){var e=Sr(t),n=e==S?t.constructor:i,r=n?Uo(n):"";if(r)switch(r){case On:return D;case Dn:return x;case Rn:return A;case Mn:return I;case Pn:return C}return e});var wo=Ot?Ja:ys;function xo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ct)}function Eo(t){return t==t&&!eu(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in St(n))}}function Ao(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),u=r(a);++o<a;)u[o]=i[e+o];o=-1;for(var s=r(e+1);++o<e;)s[o]=i[o];return s[e]=n(u),ye(t,this,s)}}function To(t,e){return e.length<2?t:xr(t,ei(e,0,-1))}function Io(t,e){for(var n=t.length,r=mn(e.length,n),o=Ii(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}function No(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var ko=Ro(Jr),Co=je||function(t,e){return oe.setTimeout(t,e)},Oo=Ro(Qr);function Do(t,e,n){var r=e+"";return Oo(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return be(p,(function(n){var r="_."+n[0];e&n[1]&&!Ee(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ut):[]}(r),n)))}function Ro(t){var e=0,n=0;return function(){var r=bn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Mo(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Xr(n,o),u=t[a];t[a]=t[n],t[n]=u}return t.length=e,t}var Po,Go,Lo=(Po=Pa((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ft,"$1"):n||t)})),e}),(function(t){return 500===Go.size&&Go.clear(),t})),Go=Po.cache,Po);function jo(t){if("string"==typeof t||cu(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Uo(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Bo(t){if(t instanceof Wn)return t.clone();var e=new Fn(t.__wrapped__,t.__chain__);return e.__actions__=Ii(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var zo=Yr((function(t,e){return Ya(t)?fr(t,gr(e,1,Ya,!0)):[]})),Fo=Yr((function(t,e){var n=Zo(e);return Ya(n)&&(n=i),Ya(t)?fr(t,gr(e,1,Ya,!0),ao(n,2)):[]})),Wo=Yr((function(t,e){var n=Zo(e);return Ya(n)&&(n=i),Ya(t)?fr(t,gr(e,1,Ya,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:vu(n);return i<0&&(i=yn(r+i,0)),De(t,ao(e,3),i)}function Ho(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=vu(n),o=n<0?yn(r+o,0):mn(o,r-1)),De(t,ao(e,3),o,!0)}function Xo(t){return null!=t&&t.length?gr(t,1):[]}function qo(t){return t&&t.length?t[0]:i}var Yo=Yr((function(t){var e=Ae(t,vi);return e.length&&e[0]===t[0]?Nr(e):[]})),Ko=Yr((function(t){var e=Zo(t),n=Ae(t,vi);return e===Zo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Nr(n,ao(e,2)):[]})),$o=Yr((function(t){var e=Zo(t),n=Ae(t,vi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Nr(n,i,e):[]}));function Zo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Jo=Yr(Qo);function Qo(t,e){return t&&t.length&&e&&e.length?Vr(t,e):t}var ta=to((function(t,e){var n=null==t?0:t.length,r=or(t,e);return Hr(t,Ae(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function ea(t){return null==t?t:xn.call(t)}var na=Yr((function(t){return si(gr(t,1,Ya,!0))})),ra=Yr((function(t){var e=Zo(t);return Ya(e)&&(e=i),si(gr(t,1,Ya,!0),ao(e,2))})),ia=Yr((function(t){var e=Zo(t);return e="function"==typeof e?e:i,si(gr(t,1,Ya,!0),i,e)}));function oa(t){if(!t||!t.length)return[];var e=0;return t=xe(t,(function(t){if(Ya(t))return e=yn(t.length,e),!0})),ze(e,(function(e){return Ae(t,Le(e))}))}function aa(t,e){if(!t||!t.length)return[];var n=oa(t);return null==e?n:Ae(n,(function(t){return ye(e,i,t)}))}var ua=Yr((function(t,e){return Ya(t)?fr(t,e):[]})),sa=Yr((function(t){return di(xe(t,Ya))})),ca=Yr((function(t){var e=Zo(t);return Ya(e)&&(e=i),di(xe(t,Ya),ao(e,2))})),fa=Yr((function(t){var e=Zo(t);return e="function"==typeof e?e:i,di(xe(t,Ya),i,e)})),la=Yr(oa),ha=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,aa(t,n)}));function da(t){var e=Un(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var va=to((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Wn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:pa,args:[o],thisArg:i}),new Fn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),ga=ki((function(t,e,n){Rt.call(t,n)?++t[n]:ir(t,n,1)})),ya=Gi(Vo),ma=Gi(Ho);function ba(t,e){return(Ha(t)?be:lr)(t,ao(e,3))}function _a(t,e){return(Ha(t)?_e:hr)(t,ao(e,3))}var wa=ki((function(t,e,n){Rt.call(t,n)?t[n].push(e):ir(t,n,[e])})),xa=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=qa(t)?r(t.length):[];return lr(t,(function(t){a[++i]=o?ye(e,t,n):kr(t,e,n)})),a})),Ea=ki((function(t,e,n){ir(t,n,e)}));function Sa(t,e){return(Ha(t)?Ae:Lr)(t,ao(e,3))}var Aa=ki((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),Fr(t,gr(e,1),[])})),Ia=Ce||function(){return oe.Date.now()};function Na(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ki(t,c,i,i,i,i,e)}function ka(t,e){var n;if("function"!=typeof e)throw new It(o);return t=vu(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Ca=Yr((function(t,e,n){var r=1;if(n.length){var i=en(n,oo(Ca));r|=s}return Ki(t,r,e,n,i)})),Oa=Yr((function(t,e,n){var r=3;if(n.length){var i=en(n,oo(Oa));r|=s}return Ki(e,r,t,n,i)}));function Da(t,e,n){var r,a,u,s,c,f,l=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new It(o);function v(e){var n=r,o=a;return r=a=i,l=e,s=t.apply(o,n)}function g(t){return l=t,c=Co(m,e),h?v(t):s}function y(t){var n=t-f;return f===i||n>=e||n<0||d&&t-l>=u}function m(){var t=Ia();if(y(t))return b(t);c=Co(m,function(t){var n=e-(t-f);return d?mn(n,u-(t-l)):n}(t))}function b(t){return c=i,p&&r?v(t):(r=a=i,s)}function _(){var t=Ia(),n=y(t);if(r=arguments,a=this,f=t,n){if(c===i)return g(f);if(d)return _i(c),c=Co(m,e),v(f)}return c===i&&(c=Co(m,e)),s}return e=yu(e)||0,eu(n)&&(h=!!n.leading,u=(d="maxWait"in n)?yn(yu(n.maxWait)||0,e):u,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&_i(c),l=0,r=f=a=c=i},_.flush=function(){return c===i?s:b(Ia())},_}var Ra=Yr((function(t,e){return cr(t,1,e)})),Ma=Yr((function(t,e,n){return cr(t,yu(e)||0,n)}));function Pa(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Pa.Cache||Xn),n}function Ga(t){if("function"!=typeof t)throw new It(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Pa.Cache=Xn;var La=mi((function(t,e){var n=(e=1==e.length&&Ha(e[0])?Ae(e[0],We(ao())):Ae(gr(e,1),We(ao()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ye(t,this,r)}))})),ja=Yr((function(t,e){var n=en(e,oo(ja));return Ki(t,s,i,e,n)})),Ua=Yr((function(t,e){var n=en(e,oo(Ua));return Ki(t,64,i,e,n)})),Ba=to((function(t,e){return Ki(t,256,i,i,i,e)}));function za(t,e){return t===e||t!=t&&e!=e}var Fa=Vi(Ar),Wa=Vi((function(t,e){return t>=e})),Va=Cr(function(){return arguments}())?Cr:function(t){return nu(t)&&Rt.call(t,"callee")&&!te.call(t,"callee")},Ha=r.isArray,Xa=le?We(le):function(t){return nu(t)&&Sr(t)==O};function qa(t){return null!=t&&tu(t.length)&&!Ja(t)}function Ya(t){return nu(t)&&qa(t)}var Ka=dn||ys,$a=he?We(he):function(t){return nu(t)&&Sr(t)==m};function Za(t){if(!nu(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ou(t)}function Ja(t){if(!eu(t))return!1;var e=Sr(t);return e==_||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qa(t){return"number"==typeof t&&t==vu(t)}function tu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function eu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function nu(t){return null!=t&&"object"==typeof t}var ru=de?We(de):function(t){return nu(t)&&ho(t)==x};function iu(t){return"number"==typeof t||nu(t)&&Sr(t)==E}function ou(t){if(!nu(t)||Sr(t)!=S)return!1;var e=Xt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==Lt}var au=pe?We(pe):function(t){return nu(t)&&Sr(t)==T},uu=ve?We(ve):function(t){return nu(t)&&ho(t)==I};function su(t){return"string"==typeof t||!Ha(t)&&nu(t)&&Sr(t)==N}function cu(t){return"symbol"==typeof t||nu(t)&&Sr(t)==k}var fu=ge?We(ge):function(t){return nu(t)&&tu(t.length)&&!!Jt[Sr(t)]},lu=Vi(Gr),hu=Vi((function(t,e){return t<=e}));function du(t){if(!t)return[];if(qa(t))return su(t)?an(t):Ii(t);if(ae&&t[ae])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ae]());var e=ho(t);return(e==x?Qe:e==I?nn:zu)(t)}function pu(t){return t?(t=yu(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function vu(t){var e=pu(t),n=e%1;return e==e?n?e-n:e:0}function gu(t){return t?ar(vu(t),0,d):0}function yu(t){if("number"==typeof t)return t;if(cu(t))return h;if(eu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=eu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Fe(t);var n=pt.test(t);return n||gt.test(t)?ne(t.slice(2),n?2:8):dt.test(t)?h:+t}function mu(t){return Ni(t,Ru(t))}function bu(t){return null==t?"":ui(t)}var _u=Ci((function(t,e){if(xo(e)||qa(e))Ni(e,Du(e),t);else for(var n in e)Rt.call(e,n)&&tr(t,n,e[n])})),wu=Ci((function(t,e){Ni(e,Ru(e),t)})),xu=Ci((function(t,e,n,r){Ni(e,Ru(e),t,r)})),Eu=Ci((function(t,e,n,r){Ni(e,Du(e),t,r)})),Su=to(or),Au=Yr((function(t,e){t=St(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],u=Ru(a),s=-1,c=u.length;++s<c;){var f=u[s],l=t[f];(l===i||za(l,Ct[f])&&!Rt.call(t,f))&&(t[f]=a[f])}return t})),Tu=Yr((function(t){return t.push(i,Zi),ye(Pu,i,t)}));function Iu(t,e,n){var r=null==t?i:xr(t,e);return r===i?n:r}function Nu(t,e){return null!=t&&po(t,e,Ir)}var ku=Ui((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),t[e]=n}),es(is)),Cu=Ui((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),Rt.call(t,e)?t[e].push(n):t[e]=[n]}),ao),Ou=Yr(kr);function Du(t){return qa(t)?Kn(t):Pr(t)}function Ru(t){return qa(t)?Kn(t,!0):function(t){if(!eu(t))return function(t){var e=[];if(null!=t)for(var n in St(t))e.push(n);return e}(t);var e=xo(t),n=[];for(var r in t)("constructor"!=r||!e&&Rt.call(t,r))&&n.push(r);return n}(t)}var Mu=Ci((function(t,e,n){Br(t,e,n)})),Pu=Ci((function(t,e,n,r){Br(t,e,n,r)})),Gu=to((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ae(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Ni(t,no(t),n),r&&(n=ur(n,7,Ji));for(var i=e.length;i--;)ci(n,e[i]);return n})),Lu=to((function(t,e){return null==t?{}:function(t,e){return Wr(t,e,(function(e,n){return Nu(t,n)}))}(t,e)}));function ju(t,e){if(null==t)return{};var n=Ae(no(t),(function(t){return[t]}));return e=ao(e),Wr(t,n,(function(t,n){return e(t,n[0])}))}var Uu=Yi(Du),Bu=Yi(Ru);function zu(t){return null==t?[]:Ve(t,Du(t))}var Fu=Mi((function(t,e,n){return e=e.toLowerCase(),t+(n?Wu(e):e)}));function Wu(t){return Zu(bu(t).toLowerCase())}function Vu(t){return(t=bu(t))&&t.replace(mt,Ke).replace(Ht,"")}var Hu=Mi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Xu=Mi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),qu=Ri("toLowerCase"),Yu=Mi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ku=Mi((function(t,e,n){return t+(n?" ":"")+Zu(e)})),$u=Mi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Zu=Ri("toUpperCase");function Ju(t,e,n){return t=bu(t),(e=n?i:e)===i?function(t){return Kt.test(t)}(t)?function(t){return t.match(qt)||[]}(t):function(t){return t.match(st)||[]}(t):t.match(e)||[]}var Qu=Yr((function(t,e){try{return ye(t,i,e)}catch(t){return Za(t)?t:new wt(t)}})),ts=to((function(t,e){return be(e,(function(e){e=jo(e),ir(t,e,Ca(t[e],t))})),t}));function es(t){return function(){return t}}var ns=Li(),rs=Li(!0);function is(t){return t}function os(t){return Mr("function"==typeof t?t:ur(t,1))}var as=Yr((function(t,e){return function(n){return kr(n,t,e)}})),us=Yr((function(t,e){return function(n){return kr(t,n,e)}}));function ss(t,e,n){var r=Du(e),i=wr(e,r);null!=n||eu(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=wr(e,Du(e)));var o=!(eu(n)&&"chain"in n&&!n.chain),a=Ja(t);return be(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Ii(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Te([this.value()],arguments))})})),t}function cs(){}var fs=zi(Ae),ls=zi(we),hs=zi(ke);function ds(t){return bo(t)?Le(jo(t)):function(t){return function(e){return xr(e,t)}}(t)}var ps=Wi(),vs=Wi(!0);function gs(){return[]}function ys(){return!1}var ms,bs=Bi((function(t,e){return t+e}),0),_s=Xi("ceil"),ws=Bi((function(t,e){return t/e}),1),xs=Xi("floor"),Es=Bi((function(t,e){return t*e}),1),Ss=Xi("round"),As=Bi((function(t,e){return t-e}),0);return Un.after=function(t,e){if("function"!=typeof e)throw new It(o);return t=vu(t),function(){if(--t<1)return e.apply(this,arguments)}},Un.ary=Na,Un.assign=_u,Un.assignIn=wu,Un.assignInWith=xu,Un.assignWith=Eu,Un.at=Su,Un.before=ka,Un.bind=Ca,Un.bindAll=ts,Un.bindKey=Oa,Un.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ha(t)?t:[t]},Un.chain=da,Un.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(vu(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,u=0,s=r(fn(o/e));a<o;)s[u++]=ei(t,a,a+=e);return s},Un.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Un.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Te(Ha(n)?Ii(n):[n],gr(e,1))},Un.cond=function(t){var e=null==t?0:t.length,n=ao();return t=e?Ae(t,(function(t){if("function"!=typeof t[1])throw new It(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(ye(i[0],this,n))return ye(i[1],this,n)}}))},Un.conforms=function(t){return function(t){var e=Du(t);return function(n){return sr(n,t,e)}}(ur(t,1))},Un.constant=es,Un.countBy=ga,Un.create=function(t,e){var n=Bn(t);return null==e?n:rr(n,e)},Un.curry=function t(e,n,r){var o=Ki(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Un.curryRight=function t(e,n,r){var o=Ki(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Un.debounce=Da,Un.defaults=Au,Un.defaultsDeep=Tu,Un.defer=Ra,Un.delay=Ma,Un.difference=zo,Un.differenceBy=Fo,Un.differenceWith=Wo,Un.drop=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,(e=n||e===i?1:vu(e))<0?0:e,r):[]},Un.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,0,(e=r-(e=n||e===i?1:vu(e)))<0?0:e):[]},Un.dropRightWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!0,!0):[]},Un.dropWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!0):[]},Un.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=vu(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:vu(r))<0&&(r+=o),r=n>r?0:gu(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Un.filter=function(t,e){return(Ha(t)?xe:vr)(t,ao(e,3))},Un.flatMap=function(t,e){return gr(Sa(t,e),1)},Un.flatMapDeep=function(t,e){return gr(Sa(t,e),f)},Un.flatMapDepth=function(t,e,n){return n=n===i?1:vu(n),gr(Sa(t,e),n)},Un.flatten=Xo,Un.flattenDeep=function(t){return null!=t&&t.length?gr(t,f):[]},Un.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===i?1:vu(e)):[]},Un.flip=function(t){return Ki(t,512)},Un.flow=ns,Un.flowRight=rs,Un.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Un.functions=function(t){return null==t?[]:wr(t,Du(t))},Un.functionsIn=function(t){return null==t?[]:wr(t,Ru(t))},Un.groupBy=wa,Un.initial=function(t){return null!=t&&t.length?ei(t,0,-1):[]},Un.intersection=Yo,Un.intersectionBy=Ko,Un.intersectionWith=$o,Un.invert=ku,Un.invertBy=Cu,Un.invokeMap=xa,Un.iteratee=os,Un.keyBy=Ea,Un.keys=Du,Un.keysIn=Ru,Un.map=Sa,Un.mapKeys=function(t,e){var n={};return e=ao(e,3),br(t,(function(t,r,i){ir(n,e(t,r,i),t)})),n},Un.mapValues=function(t,e){var n={};return e=ao(e,3),br(t,(function(t,r,i){ir(n,r,e(t,r,i))})),n},Un.matches=function(t){return jr(ur(t,1))},Un.matchesProperty=function(t,e){return Ur(t,ur(e,1))},Un.memoize=Pa,Un.merge=Mu,Un.mergeWith=Pu,Un.method=as,Un.methodOf=us,Un.mixin=ss,Un.negate=Ga,Un.nthArg=function(t){return t=vu(t),Yr((function(e){return zr(e,t)}))},Un.omit=Gu,Un.omitBy=function(t,e){return ju(t,Ga(ao(e)))},Un.once=function(t){return ka(2,t)},Un.orderBy=function(t,e,n,r){return null==t?[]:(Ha(e)||(e=null==e?[]:[e]),Ha(n=r?i:n)||(n=null==n?[]:[n]),Fr(t,e,n))},Un.over=fs,Un.overArgs=La,Un.overEvery=ls,Un.overSome=hs,Un.partial=ja,Un.partialRight=Ua,Un.partition=Aa,Un.pick=Lu,Un.pickBy=ju,Un.property=ds,Un.propertyOf=function(t){return function(e){return null==t?i:xr(t,e)}},Un.pull=Jo,Un.pullAll=Qo,Un.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,ao(n,2)):t},Un.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,i,n):t},Un.pullAt=ta,Un.range=ps,Un.rangeRight=vs,Un.rearg=Ba,Un.reject=function(t,e){return(Ha(t)?xe:vr)(t,Ga(ao(e,3)))},Un.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=ao(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Hr(t,i),n},Un.rest=function(t,e){if("function"!=typeof t)throw new It(o);return Yr(t,e=e===i?e:vu(e))},Un.reverse=ea,Un.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:vu(e),(Ha(t)?Zn:$r)(t,e)},Un.set=function(t,e,n){return null==t?t:Zr(t,e,n)},Un.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Zr(t,e,n,r)},Un.shuffle=function(t){return(Ha(t)?Jn:ti)(t)},Un.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:vu(e),n=n===i?r:vu(n)),ei(t,e,n)):[]},Un.sortBy=Ta,Un.sortedUniq=function(t){return t&&t.length?oi(t):[]},Un.sortedUniqBy=function(t,e){return t&&t.length?oi(t,ao(e,2)):[]},Un.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=bu(t))&&("string"==typeof e||null!=e&&!au(e))&&!(e=ui(e))&&Je(t)?bi(an(t),0,n):t.split(e,n):[]},Un.spread=function(t,e){if("function"!=typeof t)throw new It(o);return e=null==e?0:yn(vu(e),0),Yr((function(n){var r=n[e],i=bi(n,0,e);return r&&Te(i,r),ye(t,this,i)}))},Un.tail=function(t){var e=null==t?0:t.length;return e?ei(t,1,e):[]},Un.take=function(t,e,n){return t&&t.length?ei(t,0,(e=n||e===i?1:vu(e))<0?0:e):[]},Un.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,(e=r-(e=n||e===i?1:vu(e)))<0?0:e,r):[]},Un.takeRightWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!1,!0):[]},Un.takeWhile=function(t,e){return t&&t.length?li(t,ao(e,3)):[]},Un.tap=function(t,e){return e(t),t},Un.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new It(o);return eu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Da(t,e,{leading:r,maxWait:e,trailing:i})},Un.thru=pa,Un.toArray=du,Un.toPairs=Uu,Un.toPairsIn=Bu,Un.toPath=function(t){return Ha(t)?Ae(t,jo):cu(t)?[t]:Ii(Lo(bu(t)))},Un.toPlainObject=mu,Un.transform=function(t,e,n){var r=Ha(t),i=r||Ka(t)||fu(t);if(e=ao(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:eu(t)&&Ja(o)?Bn(Xt(t)):{}}return(i?be:br)(t,(function(t,r,i){return e(n,t,r,i)})),n},Un.unary=function(t){return Na(t,1)},Un.union=na,Un.unionBy=ra,Un.unionWith=ia,Un.uniq=function(t){return t&&t.length?si(t):[]},Un.uniqBy=function(t,e){return t&&t.length?si(t,ao(e,2)):[]},Un.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Un.unset=function(t,e){return null==t||ci(t,e)},Un.unzip=oa,Un.unzipWith=aa,Un.update=function(t,e,n){return null==t?t:fi(t,e,gi(n))},Un.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:fi(t,e,gi(n),r)},Un.values=zu,Un.valuesIn=function(t){return null==t?[]:Ve(t,Ru(t))},Un.without=ua,Un.words=Ju,Un.wrap=function(t,e){return ja(gi(e),t)},Un.xor=sa,Un.xorBy=ca,Un.xorWith=fa,Un.zip=la,Un.zipObject=function(t,e){return pi(t||[],e||[],tr)},Un.zipObjectDeep=function(t,e){return pi(t||[],e||[],Zr)},Un.zipWith=ha,Un.entries=Uu,Un.entriesIn=Bu,Un.extend=wu,Un.extendWith=xu,ss(Un,Un),Un.add=bs,Un.attempt=Qu,Un.camelCase=Fu,Un.capitalize=Wu,Un.ceil=_s,Un.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=yu(n))==n?n:0),e!==i&&(e=(e=yu(e))==e?e:0),ar(yu(t),e,n)},Un.clone=function(t){return ur(t,4)},Un.cloneDeep=function(t){return ur(t,5)},Un.cloneDeepWith=function(t,e){return ur(t,5,e="function"==typeof e?e:i)},Un.cloneWith=function(t,e){return ur(t,4,e="function"==typeof e?e:i)},Un.conformsTo=function(t,e){return null==e||sr(t,e,Du(e))},Un.deburr=Vu,Un.defaultTo=function(t,e){return null==t||t!=t?e:t},Un.divide=ws,Un.endsWith=function(t,e,n){t=bu(t),e=ui(e);var r=t.length,o=n=n===i?r:ar(vu(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Un.eq=za,Un.escape=function(t){return(t=bu(t))&&Y.test(t)?t.replace(X,$e):t},Un.escapeRegExp=function(t){return(t=bu(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Un.every=function(t,e,n){var r=Ha(t)?we:dr;return n&&mo(t,e,n)&&(e=i),r(t,ao(e,3))},Un.find=ya,Un.findIndex=Vo,Un.findKey=function(t,e){return Oe(t,ao(e,3),br)},Un.findLast=ma,Un.findLastIndex=Ho,Un.findLastKey=function(t,e){return Oe(t,ao(e,3),_r)},Un.floor=xs,Un.forEach=ba,Un.forEachRight=_a,Un.forIn=function(t,e){return null==t?t:yr(t,ao(e,3),Ru)},Un.forInRight=function(t,e){return null==t?t:mr(t,ao(e,3),Ru)},Un.forOwn=function(t,e){return t&&br(t,ao(e,3))},Un.forOwnRight=function(t,e){return t&&_r(t,ao(e,3))},Un.get=Iu,Un.gt=Fa,Un.gte=Wa,Un.has=function(t,e){return null!=t&&po(t,e,Tr)},Un.hasIn=Nu,Un.head=qo,Un.identity=is,Un.includes=function(t,e,n,r){t=qa(t)?t:zu(t),n=n&&!r?vu(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),su(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Re(t,e,n)>-1},Un.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:vu(n);return i<0&&(i=yn(r+i,0)),Re(t,e,i)},Un.inRange=function(t,e,n){return e=pu(e),n===i?(n=e,e=0):n=pu(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=yu(t),e,n)},Un.invoke=Ou,Un.isArguments=Va,Un.isArray=Ha,Un.isArrayBuffer=Xa,Un.isArrayLike=qa,Un.isArrayLikeObject=Ya,Un.isBoolean=function(t){return!0===t||!1===t||nu(t)&&Sr(t)==y},Un.isBuffer=Ka,Un.isDate=$a,Un.isElement=function(t){return nu(t)&&1===t.nodeType&&!ou(t)},Un.isEmpty=function(t){if(null==t)return!0;if(qa(t)&&(Ha(t)||"string"==typeof t||"function"==typeof t.splice||Ka(t)||fu(t)||Va(t)))return!t.length;var e=ho(t);if(e==x||e==I)return!t.size;if(xo(t))return!Pr(t).length;for(var n in t)if(Rt.call(t,n))return!1;return!0},Un.isEqual=function(t,e){return Or(t,e)},Un.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Or(t,e,i,n):!!r},Un.isError=Za,Un.isFinite=function(t){return"number"==typeof t&&pn(t)},Un.isFunction=Ja,Un.isInteger=Qa,Un.isLength=tu,Un.isMap=ru,Un.isMatch=function(t,e){return t===e||Dr(t,e,so(e))},Un.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Dr(t,e,so(e),n)},Un.isNaN=function(t){return iu(t)&&t!=+t},Un.isNative=function(t){if(wo(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(t)},Un.isNil=function(t){return null==t},Un.isNull=function(t){return null===t},Un.isNumber=iu,Un.isObject=eu,Un.isObjectLike=nu,Un.isPlainObject=ou,Un.isRegExp=au,Un.isSafeInteger=function(t){return Qa(t)&&t>=-9007199254740991&&t<=l},Un.isSet=uu,Un.isString=su,Un.isSymbol=cu,Un.isTypedArray=fu,Un.isUndefined=function(t){return t===i},Un.isWeakMap=function(t){return nu(t)&&ho(t)==C},Un.isWeakSet=function(t){return nu(t)&&"[object WeakSet]"==Sr(t)},Un.join=function(t,e){return null==t?"":vn.call(t,e)},Un.kebabCase=Hu,Un.last=Zo,Un.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=vu(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):De(t,Pe,o,!0)},Un.lowerCase=Xu,Un.lowerFirst=qu,Un.lt=lu,Un.lte=hu,Un.max=function(t){return t&&t.length?pr(t,is,Ar):i},Un.maxBy=function(t,e){return t&&t.length?pr(t,ao(e,2),Ar):i},Un.mean=function(t){return Ge(t,is)},Un.meanBy=function(t,e){return Ge(t,ao(e,2))},Un.min=function(t){return t&&t.length?pr(t,is,Gr):i},Un.minBy=function(t,e){return t&&t.length?pr(t,ao(e,2),Gr):i},Un.stubArray=gs,Un.stubFalse=ys,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=Es,Un.nth=function(t,e){return t&&t.length?zr(t,vu(e)):i},Un.noConflict=function(){return oe._===this&&(oe._=jt),this},Un.noop=cs,Un.now=Ia,Un.pad=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Fi(ln(i),n)+t+Fi(fn(i),n)},Un.padEnd=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;return e&&r<e?t+Fi(e-r,n):t},Un.padStart=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;return e&&r<e?Fi(e-r,n)+t:t},Un.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),_n(bu(t).replace(rt,""),e||0)},Un.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=pu(t),e===i?(e=t,t=0):e=pu(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=wn();return mn(t+o*(e-t+ee("1e-"+((o+"").length-1))),e)}return Xr(t,e)},Un.reduce=function(t,e,n){var r=Ha(t)?Ie:Ue,i=arguments.length<3;return r(t,ao(e,4),n,i,lr)},Un.reduceRight=function(t,e,n){var r=Ha(t)?Ne:Ue,i=arguments.length<3;return r(t,ao(e,4),n,i,hr)},Un.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:vu(e),qr(bu(t),e)},Un.replace=function(){var t=arguments,e=bu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Un.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[jo(e[r])];a===i&&(r=o,a=n),t=Ja(a)?a.call(t):a}return t},Un.round=Ss,Un.runInContext=t,Un.sample=function(t){return(Ha(t)?$n:Kr)(t)},Un.size=function(t){if(null==t)return 0;if(qa(t))return su(t)?on(t):t.length;var e=ho(t);return e==x||e==I?t.size:Pr(t).length},Un.snakeCase=Yu,Un.some=function(t,e,n){var r=Ha(t)?ke:ni;return n&&mo(t,e,n)&&(e=i),r(t,ao(e,3))},Un.sortedIndex=function(t,e){return ri(t,e)},Un.sortedIndexBy=function(t,e,n){return ii(t,e,ao(n,2))},Un.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ri(t,e);if(r<n&&za(t[r],e))return r}return-1},Un.sortedLastIndex=function(t,e){return ri(t,e,!0)},Un.sortedLastIndexBy=function(t,e,n){return ii(t,e,ao(n,2),!0)},Un.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ri(t,e,!0)-1;if(za(t[n],e))return n}return-1},Un.startCase=Ku,Un.startsWith=function(t,e,n){return t=bu(t),n=null==n?0:ar(vu(n),0,t.length),e=ui(e),t.slice(n,n+e.length)==e},Un.subtract=As,Un.sum=function(t){return t&&t.length?Be(t,is):0},Un.sumBy=function(t,e){return t&&t.length?Be(t,ao(e,2)):0},Un.template=function(t,e,n){var r=Un.templateSettings;n&&mo(t,e,n)&&(e=i),t=bu(t),e=xu({},e,r,$i);var o,a,u=xu({},e.imports,r.imports,$i),s=Du(u),c=Ve(u,s),f=0,l=e.interpolate||bt,h="__p += '",d=At((e.escape||bt).source+"|"+l.source+"|"+(l===Z?lt:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Rt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zt+"]")+"\n";t.replace(d,(function(e,n,r,i,u,s){return r||(r=i),h+=t.slice(f,s).replace(_t,Ze),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),u&&(a=!0,h+="';\n"+u+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=s+e.length,e})),h+="';\n";var v=Rt.call(e,"variable")&&e.variable;if(v){if(ct.test(v))throw new wt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(F,""):h).replace(W,"$1").replace(V,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Qu((function(){return xt(s,p+"return "+h).apply(i,c)}));if(g.source=h,Za(g))throw g;return g},Un.times=function(t,e){if((t=vu(t))<1||t>l)return[];var n=d,r=mn(t,d);e=ao(e),t-=d;for(var i=ze(r,e);++n<t;)e(n);return i},Un.toFinite=pu,Un.toInteger=vu,Un.toLength=gu,Un.toLower=function(t){return bu(t).toLowerCase()},Un.toNumber=yu,Un.toSafeInteger=function(t){return t?ar(vu(t),-9007199254740991,l):0===t?t:0},Un.toString=bu,Un.toUpper=function(t){return bu(t).toUpperCase()},Un.trim=function(t,e,n){if((t=bu(t))&&(n||e===i))return Fe(t);if(!t||!(e=ui(e)))return t;var r=an(t),o=an(e);return bi(r,Xe(r,o),qe(r,o)+1).join("")},Un.trimEnd=function(t,e,n){if((t=bu(t))&&(n||e===i))return t.slice(0,un(t)+1);if(!t||!(e=ui(e)))return t;var r=an(t);return bi(r,0,qe(r,an(e))+1).join("")},Un.trimStart=function(t,e,n){if((t=bu(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ui(e)))return t;var r=an(t);return bi(r,Xe(r,an(e))).join("")},Un.truncate=function(t,e){var n=30,r="...";if(eu(e)){var o="separator"in e?e.separator:o;n="length"in e?vu(e.length):n,r="omission"in e?ui(e.omission):r}var a=(t=bu(t)).length;if(Je(t)){var u=an(t);a=u.length}if(n>=a)return t;var s=n-on(r);if(s<1)return r;var c=u?bi(u,0,s).join(""):t.slice(0,s);if(o===i)return c+r;if(u&&(s+=c.length-s),au(o)){if(t.slice(s).search(o)){var f,l=c;for(o.global||(o=At(o.source,bu(ht.exec(o))+"g")),o.lastIndex=0;f=o.exec(l);)var h=f.index;c=c.slice(0,h===i?s:h)}}else if(t.indexOf(ui(o),s)!=s){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},Un.unescape=function(t){return(t=bu(t))&&q.test(t)?t.replace(H,sn):t},Un.uniqueId=function(t){var e=++Mt;return bu(t)+e},Un.upperCase=$u,Un.upperFirst=Zu,Un.each=ba,Un.eachRight=_a,Un.first=qo,ss(Un,(ms={},br(Un,(function(t,e){Rt.call(Un.prototype,e)||(ms[e]=t)})),ms),{chain:!1}),Un.VERSION="4.17.21",be(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Un[t].placeholder=Un})),be(["drop","take"],(function(t,e){Wn.prototype[t]=function(n){n=n===i?1:yn(vu(n),0);var r=this.__filtered__&&!e?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),be(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ao(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),be(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),be(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(is)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return kr(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Ga(ao(t)))},Wn.prototype.slice=function(t,e){t=vu(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=vu(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(d)},br(Wn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Un[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Un.prototype[e]=function(){var e=this.__wrapped__,u=r?[1]:arguments,s=e instanceof Wn,c=u[0],f=s||Ha(e),l=function(t){var e=o.apply(Un,Te([t],u));return r&&h?e[0]:e};f&&n&&"function"==typeof c&&1!=c.length&&(s=f=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=s&&!d;if(!a&&f){e=v?e:new Wn(this);var g=t.apply(e,u);return g.__actions__.push({func:pa,args:[l],thisArg:i}),new Fn(g,h)}return p&&v?t.apply(this,u):(g=this.thru(l),p?r?g.value()[0]:g.value():g)})})),be(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Un.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ha(i)?i:[],t)}return this[n]((function(n){return e.apply(Ha(n)?n:[],t)}))}})),br(Wn.prototype,(function(t,e){var n=Un[e];if(n){var r=n.name+"";Rt.call(Cn,r)||(Cn[r]=[]),Cn[r].push({name:e,func:n})}})),Cn[ji(i,2).name]=[{name:"wrapper",func:i}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ha(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,c=r?u:a-1,f=this.__iteratees__,l=f.length,h=0,d=mn(s,this.__takeCount__);if(!n||!r&&i==s&&d==s)return hi(t,this.__actions__);var p=[];t:for(;s--&&h<d;){for(var v=-1,g=t[c+=e];++v<l;){var y=f[v],m=y.iteratee,b=y.type,_=m(g);if(2==b)g=_;else if(!_){if(1==b)continue t;break t}}p[h++]=g}return p},Un.prototype.at=va,Un.prototype.chain=function(){return da(this)},Un.prototype.commit=function(){return new Fn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=du(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Bo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Un.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:pa,args:[ea],thisArg:i}),new Fn(e,this.__chain__)}return this.thru(ea)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,ae&&(Un.prototype[ae]=function(){return this}),Un}();oe._=cn,(r=function(){return cn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},1739:(t,e,n)=>{var r=n(5229),i=n(6765),o=n(5927),a=n(4186),u=n(6064),s=[0,0];t.exports.x7=function(t,e,n,a,c){return r(t,n,a),o(t,t),i(e,-t[1],t[0]),i(s,-n[1],n[0]),c/u(e,s)},t.exports.mJ=function(t,e){return i(t,-e[1],e[0]),t},t.exports.o7=function(t,e,n){return a(t,e,n),o(t,t),t}},8892:(t,e,n)=>{var r;!function(t){!function(e){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!o&&!a,s={create:o?function(){return P(Object.create(null))}:a?function(){return P({__proto__:null})}:function(){return P({})},has:u?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:u?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),f="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,l=f||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}():Map,h=f||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new l}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}():Set,d=new(f||"function"!=typeof WeakMap?function(){var t=s.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&s.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?s.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var e;do{e="@@WeakMap@@"+a()}while(s.has(t,e));return t[e]=!0,e}function i(t,r){if(!e.call(t,n)){if(!r)return;Object.defineProperty(t,n,{value:s.create()})}return t[n]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<16;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function p(t,e,n){var r=d.get(t);if(E(r)){if(!n)return;r=new l,d.set(t,r)}var i=r.get(e);if(E(i)){if(!n)return;i=new l,r.set(e,i)}return i}function v(t,e,n){if(g(t,e,n))return!0;var r=M(e);return!S(r)&&v(t,r,n)}function g(t,e,n){var r=p(e,n,!1);return!E(r)&&!!r.has(t)}function y(t,e,n){if(g(t,e,n))return m(t,e,n);var r=M(e);return S(r)?void 0:y(t,r,n)}function m(t,e,n){var r=p(e,n,!1);if(!E(r))return r.get(t)}function b(t,e,n,r){p(n,r,!0).set(t,e)}function _(t,e){var n=w(t,e),r=M(t);if(null===r)return n;var i=_(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new h,a=[],u=0,s=n;u<s.length;u++){var c=s[u];o.has(c)||(o.add(c),a.push(c))}for(var f=0,l=i;f<l.length;f++)c=l[f],o.has(c)||(o.add(c),a.push(c));return a}function w(t,e){var n=[],r=p(t,e,!1);if(E(r))return n;for(var o=function(t){var e=O(t,i);if(!k(e))throw new TypeError;var n=e.call(t);if(!A(n))throw new TypeError;return n}(r.keys()),a=0;;){var u=D(o);if(!u)return n.length=a,n;var s=u.value;try{n[a]=s}catch(t){try{R(o)}finally{throw t}}a++}}function x(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function S(t){return null===t}function A(t){return"object"==typeof t?null!==t:"function"==typeof t}function T(t,e){switch(x(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=O(t,r);if(void 0!==i){var o=i.call(t,n);if(A(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(k(n)&&!A(i=n.call(t)))return i;if(k(r=t.valueOf)&&!A(i=r.call(t)))return i}else{var r;if(k(r=t.valueOf)&&!A(i=r.call(t)))return i;var i,o=t.toString;if(k(o)&&!A(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function I(t){var e=T(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function N(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function k(t){return"function"==typeof t}function C(t){return"function"==typeof t}function O(t,e){var n=t[e];if(null!=n){if(!k(n))throw new TypeError;return n}}function D(t){var e=t.next();return!e.done&&e}function R(t){var e=t.return;e&&e.call(t)}function M(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function P(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,n,r){if(E(n)){if(!N(t))throw new TypeError;if(!C(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!E(r)&&!S(r)){if(!C(r))throw new TypeError;e=r}}return e}(t,e)}if(!N(t))throw new TypeError;if(!A(e))throw new TypeError;if(!A(r)&&!E(r)&&!S(r))throw new TypeError;return S(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!E(o)&&!S(o)){if(!A(o))throw new TypeError;r=o}}return r}(t,e,n=I(n),r)})),t("metadata",(function(t,e){return function(n,r){if(!A(n))throw new TypeError;if(!E(r)&&!function(t){switch(x(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),t("defineMetadata",(function(t,e,n,r){if(!A(n))throw new TypeError;return E(r)||(r=I(r)),b(t,e,n,r)})),t("hasMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),v(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),g(t,e,n)})),t("getMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),y(t,e,n)})),t("getOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),m(t,e,n)})),t("getMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),w(t,e)})),t("deleteMetadata",(function(t,e,n){if(!A(e))throw new TypeError;E(n)||(n=I(n));var r=p(e,n,!1);if(E(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}))}(i)}()}(r||(r={}))},405:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),a=new N(r||[]);return o._invoke=function(t,e,n){var r=l;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=A(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=f(t,e,n);if("normal"===s.type){if(r=n.done?p:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=p,n.method="throw",n.arg=s.arg)}}}(t,n,a),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function g(){}function y(){}function m(){}var b={};s(b,o,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(k([])));w&&w!==n&&r.call(w,o)&&(b=w);var x=m.prototype=g.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,u){var s=f(t[i],t,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function A(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=f(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:C}}function C(){return{value:e,done:!0}}return y.prototype=m,s(x,"constructor",m),s(m,"constructor",y),y.displayName=s(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},E(S.prototype),s(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(x),s(x,u,"Generator"),s(x,o,(function(){return this})),s(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},6377:function(t){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},n="\n";function r(t){var e=new Error("(regl) "+t);throw console.error(e),e}function i(t,e){t||r(e)}function o(t){return t?": "+t:""}function a(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"==typeof t;case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"==typeof t}}function u(t,e,n){e.indexOf(t)<0&&r("invalid value"+o(n)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function h(t,e,n){this.file=t,this.line=e,this.message=n}function d(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function v(t,e){var n,r=t.split("\n"),i=1,o=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||d(),a.unknown.lines.push(new l(0,""));for(var u=0;u<r.length;++u){var s=r[u],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(s);if(c)switch(c[1]){case"line":var h=/(\d+)(\s+\d+)?/.exec(c[2]);h&&(i=0|h[1],h[2]&&((o=0|h[2])in a||(a[o]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new l(i++,s))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function g(t){t._commandRef=d()}function y(t,e){var n=p();r(t+" in command "+(e||d())+("unknown"===n?"":" called from "+n))}function m(t,e,n,r){a(t,e)||y("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t,r||d())}var b=33071,_={};function w(t,e){return 32820===t||32819===t||33635===t?2:34042===t?4:_[t]*e}function x(t){return!(t&t-1||!t)}_[5120]=_[5121]=1,_[5122]=_[5123]=_[36193]=_[33635]=_[32819]=_[32820]=2,_[5124]=_[5125]=_[5126]=_[34042]=4;var E=e(i,{optional:function(t){t()},raise:r,commandRaise:y,command:function(t,e,n){t||y(e,n||d())},parameter:function(t,e,n){t in e||r("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||y("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join(),r||d())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&r('invalid regl constructor argument "'+t+'". must be one of '+s)}))},type:function(t,e,n){a(t,e)||r("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t)},commandType:m,isTypedArray:function(e,n){t(e)||r("invalid parameter type"+o(n)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||r("invalid parameter type, ("+t+")"+o(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,r,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var u=t.getShaderInfoLog(e),s=o===t.FRAGMENT_SHADER?"fragment":"vertex";m(r,"string",s+" shader source must be a string",a);var f=v(r,a),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(u);(function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))})(f,l),Object.keys(f).forEach((function(t){var e=f[t];if(e.hasErrors){var r=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+n,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(r){var i=r.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var u=a[1];i=a[2],"assign"===u&&(u="="),e=Math.max(t.line.indexOf(u,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+n,"font-weight:bold"),o(c("| ",6)),o(i+n,"font-weight:bold")})),o(c("| ",6)+n)}else o(c(t.number,4)+"| "),o(t.line+n,"color:red")})),"undefined"==typeof document||window.chrome?console.log(r.join("")):(i[0]=r.join("%c"),console.log.apply(console,i))}function o(t,e){r.push(t),i.push(e||"")}})),i.raise("Error compiling "+s+" shader, "+f[0].name)}},linkError:function(t,e,r,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var u=t.getProgramInfoLog(e),s=v(r,a),c='Error linking program with vertex shader, "'+v(o,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+u,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+u),i.raise(c)}},callSite:p,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var u=t._attributeSet={};o(u,n.static),o(u,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,n){var r,o=e.width,a=e.height,u=e.channels;i(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),t.wrapS===b&&t.wrapT===b||i(x(o)&&x(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&i(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(i(x(o)&&x(a),"texture must be a square power of 2 to support mipmapping"),i(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&i(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),i(!t.genMipmaps,"mipmap generation not supported with float textures"));var s=e.images;for(r=0;r<16;++r)if(s[r]){var c=o>>r,f=a>>r;i(e.mipmask&1<<r,"missing mipmap data");var l=s[r];if(i(l.width===c&&l.height===f,"invalid shape for mip images"),i(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var h=Math.ceil(w(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;i(l.data.byteLength===h*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||i(0==(e.mipmask&1<<r),"extra mipmap data");e.compressed&&i(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,r){var o=t.width,a=t.height,u=t.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(e.wrapS===b&&e.wrapT===b,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];i(c.width===o&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(i(!c.compressed,"can not generate mipmap for compressed textures"),i(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var h=f[l];if(h){var d=o>>l,p=a>>l;i(c.mipmask&1<<l,"missing mipmap data"),i(h.width===d&&h.height===p,"invalid shape for mip images"),i(h.format===t.format&&h.internalformat===t.internalformat&&h.type===t.type,"incompatible type for mip image"),h.compressed||(h.data?i(h.data.byteLength===d*p*Math.max(w(h.type,u),h.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):h.element||h.copy)}}}}}),S=0;function A(t,e){this.id=S++,this.type=t,this.data=e}function T(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function I(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+T(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return I(t.substr(0,r.index)).concat(I(r[1])).concat(I(t.substr(r.index+r[0].length)));var i=t.split(".");if(1===i.length)return['"'+T(t)+'"'];for(var o=[],a=0;a<i.length;++a)o=o.concat(I(i[a]));return o}function N(t){return"["+I(t).join("][")+"]"}var k={DynamicVariable:A,define:function(t,e){return new A(t,N(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof A},unbox:function t(e,n){return"function"==typeof e?new A(0,e):"number"==typeof e||"boolean"==typeof e?new A(5,e):Array.isArray(e)?new A(6,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof A?e:void E(!1,"invalid option type in uniform "+n)},accessor:N},C={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},O="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function D(t){return"string"==typeof t?t.split():(E(Array.isArray(t),"invalid extension array"),t)}function R(t){return"string"==typeof t?(E("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function M(t){var n,r,i,o,a,u=t||{},s={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,h=!1,d=function(t){t&&E.raise(t)},p=function(){};if("string"==typeof u?(E("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),E(n,"invalid query string for element")):"object"==typeof u?"string"==typeof(a=u).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=u:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(u)?i=(o=u).canvas:(E.constructor(u),"gl"in u?o=u.gl:"canvas"in u?i=R(u.canvas):"container"in u&&(r=R(u.container)),"attributes"in u&&(s=u.attributes,E.type(s,"object","invalid context attributes")),"extensions"in u&&(c=D(u.extensions)),"optionalExtensions"in u&&(f=D(u.optionalExtensions)),"onDone"in u&&(E.type(u.onDone,"function","invalid or missing onDone callback"),d=u.onDone),"profile"in u&&(h=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,E(l>0,"invalid pixel ratio"))):E.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){E("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,l);if(!v)return null;i=v.canvas,p=v.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,s)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:f,pixelRatio:l,profile:h,onDone:d,onDestroy:p}:(p(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function G(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function L(){var t=P(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[G(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[G(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var j=L();j.zero=L();var U=3553,B=6408,z=5126,F=36160;function W(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var V=function(t){return Object.keys(t).map((function(e){return t[e]}))},H={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||j.allocType(n,i);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var i=0,o=0;o<e;++o)for(var a=t[o],u=0;u<n;++u)r[i++]=a[u]}(t,e[0],e[1],a);break;case 3:X(t,e[0],e[1],e[2],a,0);break;default:q(t,e,0,a,0)}return a}};function X(t,e,n,r,i,o){for(var a=o,u=0;u<e;++u)for(var s=t[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)i[a++]=f[l]}function q(t,e,n,r,i){for(var o=1,a=n+1;a<e.length;++a)o*=e[a];var u=e[n];if(e.length-n==4){var s=e[n+1],c=e[n+2],f=e[n+3];for(a=0;a<u;++a)X(t[a],s,c,f,r,i),i+=o}else for(a=0;a<u;++a)q(t[a],e,n+1,r,i),i+=o}var Y={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},$={dynamic:35048,stream:35040,static:35044},Z=H.flatten,J=H.shape,Q=5121,tt=5126,et=[];function nt(t){return 0|Y[Object.prototype.toString.call(t)]}function rt(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function it(t,e,n,r,i,o,a){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)t[u++]=e[i*s+o*c+a]}et[5120]=1,et[5122]=2,et[5124]=4,et[5121]=1,et[5123]=2,et[5125]=4,et[5126]=4;var ot={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},at=5121,ut=5123,st=5125,ct=34963;var ft=new Float32Array(1),lt=new Uint32Array(ft.buffer);function ht(t){for(var e=j.allocType(5123,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{ft[0]=t[n];var r=lt[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var u=-14-o;e[n]=i+(a+1024>>u)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function dt(e){return Array.isArray(e)||t(e)}var pt=function(t){return!(t&t-1||!t)},vt=3553,gt=34067,yt=34069,mt=6408,bt=6406,_t=6407,wt=6409,xt=6410,Et=32855,St=6402,At=34041,Tt=35904,It=35906,Nt=36193,kt=33776,Ct=33777,Ot=33778,Dt=33779,Rt=5121,Mt=5123,Pt=5125,Gt=5126,Lt=33071,jt=9728,Ut=9984,Bt=9987,zt=4352,Ft=33984,Wt=[Ut,9986,9985,Bt],Vt=[0,wt,xt,_t,mt],Ht={};function Xt(t){return"[object "+t+"]"}Ht[6409]=Ht[6406]=Ht[6402]=1,Ht[34041]=Ht[6410]=2,Ht[6407]=Ht[35904]=3,Ht[6408]=Ht[35906]=4;var qt=Xt("HTMLCanvasElement"),Yt=Xt("OffscreenCanvas"),Kt=Xt("CanvasRenderingContext2D"),$t=Xt("ImageBitmap"),Zt=Xt("HTMLImageElement"),Jt=Xt("HTMLVideoElement"),Qt=Object.keys(Y).concat([qt,Yt,Kt,$t,Zt,Jt]),te=[];te[5121]=1,te[5126]=4,te[36193]=2,te[5123]=2,te[5125]=4;var ee=[];function ne(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function re(t){return!!Array.isArray(t)&&!(0===t.length||!dt(t[0]))}function ie(t){return Object.prototype.toString.call(t)}function oe(t){return ie(t)===qt}function ae(t){return ie(t)===Yt}function ue(t){if(!t)return!1;var e=ie(t);return Qt.indexOf(e)>=0||ne(t)||re(t)||W(t)}function se(t){return 0|Y[Object.prototype.toString.call(t)]}function ce(t,e){return j.allocType(t.type===Nt?Gt:t.type,e)}function fe(t,e){t.type===Nt?(t.data=ht(e),j.freeType(e)):t.data=e}function le(t,e,n,r,i,o){var a;if(a=void 0!==ee[t]?ee[t]:Ht[t]*te[e],o&&(a*=6),i){for(var u=0,s=n;s>=1;)u+=a*s*s,s/=2;return u}return a*n*r}function he(n,r,i,o,a,u,s){var c={"don't care":zt,"dont care":zt,nice:4354,fast:4353},f={repeat:10497,clamp:Lt,mirror:33648},l={nearest:jt,linear:9729},h=e({mipmap:Bt,"nearest mipmap nearest":Ut,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":Bt},l),d={none:0,browser:37444},p={uint8:Rt,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:bt,luminance:wt,"luminance alpha":xt,rgb:_t,rgba:mt,rgba4:32854,"rgb5 a1":Et,rgb565:36194},g={};r.ext_srgb&&(v.srgb=Tt,v.srgba=It),r.oes_texture_float&&(p.float32=p.float=Gt),r.oes_texture_half_float&&(p.float16=p["half float"]=Nt),r.webgl_depth_texture&&(e(v,{depth:St,"depth stencil":At}),e(p,{uint16:Mt,uint32:Pt,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":kt,"rgba s3tc dxt1":Ct,"rgba s3tc dxt3":Ot,"rgba s3tc dxt5":Dt}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(n.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(v[t]=e)}));var m=Object.keys(v);i.textureFormats=m;var b=[];Object.keys(v).forEach((function(t){var e=v[t];b[e]=t}));var _=[];Object.keys(p).forEach((function(t){var e=p[t];_[e]=t}));var w=[];Object.keys(l).forEach((function(t){w[l[t]]=t}));var x=[];Object.keys(h).forEach((function(t){var e=h[t];x[e]=t}));var S=[];Object.keys(f).forEach((function(t){S[f[t]]=t}));var A=m.reduce((function(t,e){var n=v[e];return n===wt||n===bt||n===wt||n===xt||n===St||n===At||r.ext_srgb&&(n===Tt||n===It)?t[n]=n:n===Et||e.indexOf("rgba")>=0?t[n]=mt:t[n]=_t,t}),{});function T(){this.internalformat=mt,this.format=mt,this.type=Rt,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function N(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(E.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(E.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(E.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(E.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var n=e.type;E(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),E(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),E(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(n,p,"invalid texture type"),t.type=p[n]}var o=t.width,a=t.height,u=t.channels,s=!1;"shape"in e?(E(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(u=e.shape[2],E(u>0&&u<=4,"invalid number of channels"),s=!0),E(o>=0&&o<=i.maxTextureSize,"invalid width"),E(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,E(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,E(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,E(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,E(u>0&&u<=4,"invalid number of channels"),s=!0)),t.width=0|o,t.height=0|a,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;E(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(f,v,"invalid texture format");var l=t.internalformat=v[f];t.format=A[l],f in p&&("type"in e||(t.type=p[f])),f in g&&(t.compressed=!0),c=!0}!s&&c?t.channels=Ht[t.format]:s&&!c?t.channels!==Vt[t.format]&&(t.format=t.internalformat=Vt[t.channels]):c&&s&&E(t.channels===Ht[t.format],"number of channels inconsistent with specified format")}}function k(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function C(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(e,n){var r=null;if(ue(n)?r=n:n&&(E.type(n,"object","invalid pixel data type"),N(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),ue(n.data)&&(r=n.data)),E(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){E(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,u=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||u-e.yOffset,e.needsCopy=!0,E(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<u&&e.width>0&&e.width<=o&&e.height>0&&e.height<=u,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||e.type!==Rt||(e.type=se(r));else if(ne(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case Rt:case Mt:case Pt:case Gt:var r=j.allocType(t.type,n);r.set(e),t.data=r;break;case Nt:t.data=ht(e);break;default:E.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(W(r)){var s=r.data;Array.isArray(s)||e.type!==Rt||(e.type=se(s));var c,f,l,h,d,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(E(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=v[0],f=v[1],h=g[0],d=g[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=Vt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,u=t.height,s=t.channels,c=ce(t,a*u*s),f=0,l=0;l<u;++l)for(var h=0;h<a;++h)for(var d=0;d<s;++d)c[f++]=e[n*h+r*l+i*d+o];fe(t,c)}(e,s,h,d,p,r.offset)}else if(oe(r)||ae(r)||ie(r)===Kt)oe(r)||ae(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return ie(t)===$t}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return ie(t)===Zt}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return ie(t)===Jt}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(re(r)){var y=e.width||r[0].length,m=e.height||r.length,b=e.channels;b=dt(r[0][0])?b||r[0][0].length:b||1;for(var _=H.shape(r),w=1,x=0;x<_.length;++x)w*=_[x];var S=ce(e,w);H.flatten(r,_,"",S),fe(e,S),e.alignment=1,e.width=y,e.height=m,e.channels=b,e.format=e.internalformat=Vt[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===Gt?E(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===Nt&&E(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function D(t,e,r){var i=t.element,a=t.data,u=t.internalformat,s=t.format,c=t.type,f=t.width,l=t.height;k(t),i?n.texImage2D(e,r,s,s,c,i):t.compressed?n.compressedTexImage2D(e,r,u,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,s,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,s,f,l,0,s,c,a||null)}function R(t,e,r,i,a){var u=t.element,s=t.data,c=t.internalformat,f=t.format,l=t.type,h=t.width,d=t.height;k(t),u?n.texSubImage2D(e,a,r,i,f,l,u):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,s):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,h,d)):n.texSubImage2D(e,a,r,i,h,d,f,l,s)}var M=[];function P(){return M.pop()||new C}function G(t){t.needsFree&&j.freeType(t.data),C.call(t),M.push(t)}function L(){T.call(this),this.genMipmaps=!1,this.mipmapHint=zt,this.mipmask=0,this.images=Array(16)}function U(t,e,n){var r=t.images[0]=P();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function B(t,e){var n=null;if(ue(e))I(n=t.images[0]=P(),t),O(n,e),t.mipmask=1;else if(N(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)I(n=t.images[i]=P(),t),n.width>>=i,n.height>>=i,O(n,r[i]),t.mipmask|=1<<i;else I(n=t.images[0]=P(),t),O(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==kt&&t.internalformat!==Ct&&t.internalformat!==Ot&&t.internalformat!==Dt||E(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function z(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;D(n[r],e,r)}}var F=[];function X(){var t=F.pop()||new L;T.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function q(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&G(e[n]),e[n]=null;F.push(t)}function Y(){this.minFilter=jt,this.magFilter=jt,this.wrapS=Lt,this.wrapT=Lt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=zt}function K(t,e){if("min"in e){var n=e.min;E.parameter(n,h),t.minFilter=h[n],Wt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;E.parameter(r,l),t.magFilter=l[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(E.parameter(u,f),o=a=f[u]):Array.isArray(u)&&(E.parameter(u[0],f),E.parameter(u[1],f),o=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;E.parameter(s,f),o=f[s]}if("wrapT"in e){var d=e.wrapT;E.parameter(d,f),a=f[d]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;E("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(typeof e.mipmap){case"string":E.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":E(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:E.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=Ut)}}function $(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var Z=0,J={},Q=i.maxTextureUnits,tt=Array(Q).map((function(){return null}));function et(t){T.call(this),this.mipmask=0,this.internalformat=mt,this.id=Z++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Y,s.profile&&(this.stats={size:0})}function nt(t){n.activeTexture(Ft),n.bindTexture(t.target,t.texture)}function rt(){var t=tt[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(vt,null)}function it(t){var e=t.texture;E(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(Ft+r),n.bindTexture(i,null),tt[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete J[t.id],u.textureCount--}return e(et.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<Q;++r){var i=tt[r];if(i){if(i.bindCount>0)continue;i.unit=-1}tt[r]=t,e=r;break}e>=Q&&E.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(Ft+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&it(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(J).forEach((function(e){t+=J[e].stats.size})),t}),{create2D:function(t,e){var r=new et(vt);function o(t,e){var n=r.texInfo;Y.call(n);var a=X();return"number"==typeof t?U(a,0|t,"number"==typeof e?0|e:0|t):t?(E.type(t,"object","invalid arguments to regl.texture"),K(n,t),B(a,t)):U(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),E.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,nt(r),z(a,vt),$(n,vt),rt(),q(a),s.profile&&(r.stats.size=le(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=b[r.internalformat],o.type=_[r.type],o.mag=w[n.magFilter],o.min=x[n.minFilter],o.wrapS=S[n.wrapS],o.wrapT=S[n.wrapT],o}return J[r.id]=r,u.textureCount++,o(t,e),o.subimage=function(t,e,n,i){E(!!t,"must specify image data");var a=0|e,u=0|n,s=0|i,c=P();return I(c,r),c.width=0,c.height=0,O(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,E(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),E(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),E(r.mipmask&1<<s,"missing mipmap data"),E(c.data||c.element||c.needsCopy,"missing image data"),nt(r),R(c,vt,a,u,s),rt(),G(c),o},o.resize=function(t,e){var i=0|t,a=0|e||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,nt(r);for(var u=0;r.mipmask>>u;++u){var c=i>>u,f=a>>u;if(!c||!f)break;n.texImage2D(vt,u,r.format,c,f,0,r.format,r.type,null)}return rt(),s.profile&&(r.stats.size=le(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,s.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,a,c){var f=new et(gt);J[f.id]=f,u.cubeCount++;var l=new Array(6);function h(t,e,n,r,o,a){var u,c=f.texInfo;for(Y.call(c),u=0;u<6;++u)l[u]=X();if("number"!=typeof t&&t)if("object"==typeof t)if(e)B(l[0],t),B(l[1],e),B(l[2],n),B(l[3],r),B(l[4],o),B(l[5],a);else if(K(c,t),N(f,t),"faces"in t){var d=t.faces;for(E(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),u=0;u<6;++u)E("object"==typeof d[u]&&!!d[u],"invalid input for cube map face"),I(l[u],f),B(l[u],d[u])}else for(u=0;u<6;++u)B(l[u],t);else E.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)U(l[u],p,p)}for(I(f,l[0]),i.npotTextureCube||E(pt(f.width)&&pt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(l[0].width<<1)-1:f.mipmask=l[0].mipmask,E.textureCube(f,c,l,i),f.internalformat=l[0].internalformat,h.width=l[0].width,h.height=l[0].height,nt(f),u=0;u<6;++u)z(l[u],yt+u);for($(c,gt),rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,h.width,h.height,c.genMipmaps,!0)),h.format=b[f.internalformat],h.type=_[f.type],h.mag=w[c.magFilter],h.min=x[c.minFilter],h.wrapS=S[c.wrapS],h.wrapT=S[c.wrapT],u=0;u<6;++u)q(l[u]);return h}return h(t,e,r,o,a,c),h.subimage=function(t,e,n,r,i){E(!!e,"must specify image data"),E("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,u=0|i,s=P();return I(s,f),s.width=0,s.height=0,O(s,e),s.width=s.width||(f.width>>u)-o,s.height=s.height||(f.height>>u)-a,E(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),E(o>=0&&a>=0&&o+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),E(f.mipmask&1<<u,"missing mipmap data"),E(s.data||s.element||s.needsCopy,"missing image data"),nt(f),R(s,yt+t,o,a,u),rt(),G(s),h},h.resize=function(t){var e=0|t;if(e!==f.width){h.width=f.width=e,h.height=f.height=e,nt(f);for(var r=0;r<6;++r)for(var i=0;f.mipmask>>i;++i)n.texImage2D(yt+r,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=f,s.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){for(var t=0;t<Q;++t)n.activeTexture(Ft+t),n.bindTexture(vt,null),tt[t]=null;V(J).forEach(it),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null)}V(J).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(t.target===vt)n.texImage2D(vt,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(yt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);$(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null),n.activeTexture(Ft+t),n.bindTexture(vt,null),n.bindTexture(gt,null)}}}}ee[32854]=2,ee[32855]=2,ee[36194]=2,ee[34041]=4,ee[33776]=.5,ee[33777]=.5,ee[33778]=1,ee[33779]=1,ee[35986]=.5,ee[35987]=1,ee[34798]=1,ee[35840]=.5,ee[35841]=.25,ee[35842]=.5,ee[35843]=.25,ee[36196]=.5;var de=36161,pe=32854,ve=[];function ge(t,e,n){return ve[t]*e*n}ve[32854]=2,ve[32855]=2,ve[36194]=2,ve[33189]=2,ve[36168]=1,ve[34041]=4,ve[35907]=4,ve[34836]=16,ve[34842]=8,ve[34843]=6;var ye=36160,me=36161,be=3553,_e=34069,we=[6407,6408],xe=[];xe[6408]=4,xe[6407]=3;var Ee=[];Ee[5121]=1,Ee[5126]=4,Ee[36193]=2;var Se=[32854,32855,36194,35907,34842,34843,34836],Ae={};Ae[36053]="complete",Ae[36054]="incomplete attachment",Ae[36057]="incomplete dimensions",Ae[36055]="incomplete, missing attachment",Ae[36061]="unsupported";function Te(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}var Ie=5121,Ne=5126;function ke(e,n,r,i,o,a,u){function s(s){var c;null===n.next?(E(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=Ie):(E(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(E(c===Ie||c===Ne,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===Ne&&E(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):E(c===Ie,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,h=i.framebufferWidth,d=i.framebufferHeight,p=null;t(s)?p=s:s&&(E.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,E(f>=0&&f<i.framebufferWidth,"invalid x offset for regl.read"),E(l>=0&&l<i.framebufferHeight,"invalid y offset for regl.read"),h=0|(s.width||i.framebufferWidth-f),d=0|(s.height||i.framebufferHeight-l),p=s.data||null),p&&(c===Ie?E(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===Ne&&E(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),E(h>0&&h+f<=i.framebufferWidth,"invalid width for read pixels"),E(d>0&&d+l<=i.framebufferHeight,"invalid height for read pixels"),r();var v=h*d*4;return p||(c===Ie?p=new Uint8Array(v):c===Ne&&(p=p||new Float32Array(v))),E.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),E(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(f,l,h,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=s(t)})),e}(t):s(t)}}function Ce(t){return Array.prototype.slice.call(t)}function Oe(t){return Ce(t).join("")}var De="xyzw".split(""),Re="dither",Me="blend.enable",Pe="blend.color",Ge="blend.equation",Le="blend.func",je="depth.enable",Ue="depth.func",Be="depth.range",ze="depth.mask",Fe="colorMask",We="cull.enable",Ve="cull.face",He="frontFace",Xe="lineWidth",qe="polygonOffset.enable",Ye="polygonOffset.offset",Ke="sample.alpha",$e="sample.enable",Ze="sample.coverage",Je="stencil.enable",Qe="stencil.mask",tn="stencil.func",en="stencil.opFront",nn="stencil.opBack",rn="scissor.enable",on="scissor.box",an="viewport",un="profile",sn="framebuffer",cn="vert",fn="frag",ln="elements",hn="primitive",dn="count",pn="offset",vn="instances",gn="vao",yn="Width",mn="Height",bn=sn+yn,_n=sn+mn,wn="drawingBufferWidth",xn="drawingBufferHeight",En=[Le,Ge,tn,en,nn,Ze,an,on,Ye],Sn=34962,An=5126,Tn=35664,In=35665,Nn=35666,kn=5124,Cn=35667,On=35668,Dn=35669,Rn=35670,Mn=35671,Pn=35672,Gn=35673,Ln=35674,jn=35675,Un=35676,Bn=35678,zn=35680,Fn=1028,Wn=1029,Vn=2305,Hn=7680,Xn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},qn=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Yn={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Kn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$n={frag:35632,vert:35633},Zn={cw:2304,ccw:Vn};function Jn(e){return Array.isArray(e)||t(e)||W(e)}function Qn(t){return t.sort((function(t,e){return t===an?-1:e===an?1:t<e?-1:1}))}function tr(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function er(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function nr(t){return new tr(!1,!1,!1,t)}function rr(t,e){var n=t.type;if(0===n){var r=t.data.length;return new tr(!0,r>=1,r>=2,e)}if(4===n){var i=t.data;return new tr(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new tr(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(1===c.type)u=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new tr(o,a,u,e)}return new tr(3===n,2===n,1===n,e)}var ir=new tr(!1,!1,!1,(function(){}));function or(t,n,r,i,o,a,u,s,c,f,l,h,d,p,v){var g=f.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=32775,y.max=32776);var m=r.angle_instanced_arrays,b=r.webgl_draw_buffers,_={dirty:!0,profile:v.profile},w={},x=[],S={},A={};function T(t){return t.replace(".","_")}function I(t,e,n){var r=T(t);x.push(t),w[r]=_[r]=!!n,S[r]=e}function N(t,e,n){var r=T(t);x.push(t),Array.isArray(n)?(_[r]=n.slice(),w[r]=n.slice()):_[r]=w[r]=n,A[r]=e}I(Re,3024),I(Me,3042),N(Pe,"blendColor",[0,0,0,0]),N(Ge,"blendEquationSeparate",[32774,32774]),N(Le,"blendFuncSeparate",[1,0,1,0]),I(je,2929,!0),N(Ue,"depthFunc",513),N(Be,"depthRange",[0,1]),N(ze,"depthMask",!0),N(Fe,Fe,[!0,!0,!0,!0]),I(We,2884),N(Ve,"cullFace",Wn),N(He,He,Vn),N(Xe,Xe,1),I(qe,32823),N(Ye,"polygonOffset",[0,0]),I(Ke,32926),I($e,32928),N(Ze,"sampleCoverage",[1,!1]),I(Je,2960),N(Qe,"stencilMask",-1),N(tn,"stencilFunc",[519,0,-1]),N(en,"stencilOpSeparate",[Fn,Hn,Hn,Hn]),N(nn,"stencilOpSeparate",[Wn,Hn,Hn,Hn]),I(rn,3089),N(on,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),N(an,an,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var C={gl:t,context:d,strings:n,next:w,current:_,draw:h,elements:a,buffer:o,shader:l,attributes:f.state,vao:f,uniforms:c,framebuffer:s,extensions:r,timer:p,isBufferArgs:Jn},O={primTypes:ot,compareFuncs:Yn,blendFuncs:Xn,blendEquations:y,stencilOps:Kn,glTypes:K,orientationType:Zn};E.optional((function(){C.isArrayLike=dt})),b&&(O.backBuffer=[Wn],O.drawBuffer=P(i.maxDrawbuffers,(function(t){return 0===t?[0]:P(t,(function(t){return 36064+t}))})));var D=0;function R(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,Ce(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Ce(arguments)),n.push(";")),e},toString:function(){return Oe([r.length>0?"var "+r.join(",")+";":"",Oe(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Ce(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),u={};return{global:a,link:function(e){for(var i=0;i<r.length;++i)if(r[i]===e)return n[i];var o="g"+t++;return n.push(o),r.push(e),o},block:i,proc:function(t,n){var r=[];function i(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)i();var s=o(),c=s.toString;return u[t]=e(s,{arg:i,toString:function(){return Oe(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var t=Oe(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Ce(arguments)),this},else:function(){return r.apply(r,Ce(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Oe(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e=Oe(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,i=t.global;t.id=D++,t.batchId="0";var o=r(C),a=t.shared={props:"a0"};Object.keys(C).forEach((function(t){a[t]=i.def(o,".",t)})),E.optional((function(){t.CHECK=r(E),t.commandStr=E.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},O.invalidBlendCombinations=qn}));var u=t.next={},s=t.current={};Object.keys(A).forEach((function(t){Array.isArray(_[t])&&(u[t]=i.def(a.next,".",t),s[t]=i.def(a.current,".",t))}));var c=t.constants={};Object.keys(O).forEach((function(t){c[t]=i.def(JSON.stringify(O[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var l={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in l)return l[e];var i=f.scope[e];return i||(i=f.scope[e]=new g),l[e]=r(i)},t}function M(t,e,u,c,h){var d=t.static,p=t.dynamic;E.optional((function(){var t=[sn,cn,fn,ln,hn,pn,dn,vn,un,gn].concat(x);function e(e){Object.keys(e).forEach((function(e){E.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',h.commandStr)}))}e(d),e(p)}));var v=function(t,e){var n=t.static;if("string"==typeof n[fn]&&"string"==typeof n[cn]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)E("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),b=function(t,e){var n=t.static,r=t.dynamic;if(sn in n){var i=n[sn];return i?(i=s.getFramebuffer(i),E.command(i,"invalid framebuffer object"),nr((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+bn,n+".width"),e.set(o,"."+_n,n+".height"),n}))):nr((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+bn,r+"."+wn),e.set(r,"."+_n,r+"."+xn),"null"}))}if(sn in r){var o=r[sn];return rr(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");E.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var u=r.context;return e.set(u,"."+bn,a+"?"+a+".width:"+u+"."+wn),e.set(u,"."+_n,a+"?"+a+".height:"+u+"."+xn),a}))}return null}(t),_=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];E.commandType(o,"object","invalid "+t,n.commandStr);var a,u,s=!0,c=0|o.x,f=0|o.y;return"width"in o?(a=0|o.width,E.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in o?(u=0|o.height,E.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new tr(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",bn,"-",c));var i=u;return"height"in o||(i=e.def(n,".",_n,"-",f)),[c,f,r,i]}))}if(t in i){var l=i[t],h=rr(l,(function(e,n){var r=e.invoke(n,l);E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),u=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",bn,"-",o,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",_n,"-",a,")");return E.optional((function(){e.assert(n,u+">=0&&"+s+">=0","invalid "+t)})),[o,a,u,s]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new tr(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",bn),e.def(n,".",_n)]})):null}var a=o(an);if(a){var u=a;a=new tr(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o(on)}}(t,b,h),w=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(ln in n){var t=n[ln];Jn(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),E.command(t,"invalid elements",e.commandStr));var i=nr((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(ln in r){var o=r[ln];return rr(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),u=e.def("null"),s=e.def(r,"(",a,")"),c=t.cond(s).then(u,"=",i,".createStream(",a,");").else(u,"=",i,".getElements(",a,");");return E.optional((function(){t.assert(c.else,"!"+a+"||"+u,"invalid elements")})),e.entry(c),e.exit(t.cond(s).then(i,".destroyStream(",u,");")),t.ELEMENTS=u,u}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return E.command(!o||a>=0,"invalid "+t,e.commandStr),nr((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return rr(u,(function(e,n){var r=e.invoke(n,u);return o&&(e.OFFSET=r,E.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?nr((function(t,e){return t.OFFSET="0",0})):null}var u=o(pn,!0);return{elements:i,primitive:function(){if(hn in n){var t=n[hn];return E.commandParameter(t,ot,"invalid primitve",e.commandStr),nr((function(e,n){return ot[t]}))}if(hn in r){var o=r[hn];return rr(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return E.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(ot))})),e.def(n,"[",r,"]")}))}return i?er(i)?i.value?nr((function(t,e){return e.def(t.ELEMENTS,".primType")})):nr((function(){return 4})):new tr(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(dn in n){var t=0|n[dn];return E.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),nr((function(){return t}))}if(dn in r){var o=r[dn];return rr(o,(function(t,e){var n=t.invoke(e,o);return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(er(i)){if(i)return u?new tr(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return E.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):nr((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=nr((function(){return-1}));return E.optional((function(){a.MISSING=!0})),a}var s=new tr(i.thisDep||u.thisDep,i.contextDep||u.contextDep,i.propDep||u.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return E.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:o(vn,!1),offset:u}}(t,h),S=function(t,e){var n=t.static,r=t.dynamic,o={};return x.forEach((function(t){var a=T(t);function u(e,i){if(t in n){var u=e(n[t]);o[a]=nr((function(){return u}))}else if(t in r){var s=r[t];o[a]=rr(s,(function(t,e){return i(t,e,t.invoke(e,s))}))}}switch(t){case We:case Me:case Re:case Je:case je:case rn:case qe:case Ke:case $e:case ze:return u((function(n){return E.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return E.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case Ue:return u((function(n){return E.commandParameter(n,Yn,"invalid "+t,e.commandStr),Yn[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return E.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Yn))})),n.def(i,"[",r,"]")}));case Be:return u((function(t){return E.command(dt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case Le:return u((function(t){E.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return E.commandParameter(n,Xn,a+".srcRGB",e.commandStr),E.commandParameter(r,Xn,a+".srcAlpha",e.commandStr),E.commandParameter(i,Xn,a+".dstRGB",e.commandStr),E.commandParameter(o,Xn,a+".dstAlpha",e.commandStr),E.command(-1===qn.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Xn[n],Xn[i],Xn[r],Xn[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var u=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return E.optional((function(){e.assert(n,u+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Xn))})),u}E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),u=o("dst","RGB");E.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[s,n.def(i,"[",u,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case Ge:return u((function(n){return"string"==typeof n?(E.commandParameter(n,y,"invalid "+t,e.commandStr),[y[n],y[n]]):"object"==typeof n?(E.commandParameter(n.rgb,y,t+".rgb",e.commandStr),E.commandParameter(n.alpha,y,t+".alpha",e.commandStr),[y[n.rgb],y[n.alpha]]):void E.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),u=e.cond("typeof ",r,'==="string"');return E.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(y))}n(u.then,t,r),e.assert(u.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(u.else,t+".rgb",r+".rgb"),n(u.else,t+".alpha",r+".alpha")})),u.then(o,"=",a,"=",i,"[",r,"];"),u.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(u),[o,a]}));case Pe:return u((function(t){return E.command(dt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),P(4,(function(e){return+t[e]}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),P(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Qe:return u((function(t){return E.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case tn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return E.commandParameter(r,Yn,t+".cmp",e.commandStr),E.commandType(i,"number",t+".ref",e.commandStr),E.commandType(o,"number",t+".mask",e.commandStr),[Yn[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return E.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",Hn),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case en:case nn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return E.commandParameter(r,Kn,t+".fail",e.commandStr),E.commandParameter(i,Kn,t+".zfail",e.commandStr),E.commandParameter(o,Kn,t+".zpass",e.commandStr),[t===nn?Wn:Fn,Kn[r],Kn[i],Kn[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return E.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Kn))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",Hn)}return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===nn?Wn:Fn,o("fail"),o("zfail"),o("zpass")]}));case Ye:return u((function(t){E.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return E.commandType(n,"number",a+".factor",e.commandStr),E.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case Ve:return u((function(t){var n=0;return"front"===t?n=Fn:"back"===t&&(n=Wn),E.command(!!n,a,e.commandStr),n}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',Fn,":",Wn)}));case Xe:return u((function(t){return E.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case He:return u((function(t){return E.commandParameter(t,Zn,a,e.commandStr),Zn[t]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:'+Vn)}));case Fe:return u((function(t){return E.command(dt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),P(4,(function(t){return"!!"+n+"["+t+"]"}))}));case Ze:return u((function(t){E.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return E.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,h),A=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);E.optional((function(){l.shader($n[t],e,E.guessCommand())}));var r=nr((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return rr(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return E.optional((function(){n(e.shared.shader,".shader(",$n[t],",",i,",",e.command,");")})),i}))}return null}var u,s=a(fn),c=a(cn),f=null;return er(s)&&er(c)?(f=l.program(c.id,s.id,null,r),u=nr((function(t,e){return t.link(f)}))):u=new tr(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=s?s.append(t,e):e.def(r,".",fn);var i=r+".program("+(c?c.append(t,e):e.def(r,".",cn))+","+n;return E.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:s,vert:c,progVar:u,program:f}}(t,0,v);function I(t){var e=_[t];e&&(S[t]=e)}I(an),I(T(on));var N=Object.keys(S).length>0,k={framebuffer:b,draw:w,shader:A,state:S,dirty:N,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(k.profile=function(t){var e,n=t.static,r=t.dynamic;if(un in n){var i=!!n[un];(e=nr((function(t,e){return i}))).enable=i}else if(un in r){var o=r[un];e=rr(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),k.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=nr((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=nr((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(E.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=nr((function(t){return t.link(o.color[0])}))):E.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else dt(o)?r=nr((function(e){return e.global.def("[",P(o.length,(function(n){return E.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):E.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),i}(u,h),k.drawVAO=k.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(gn in n){var i=n[gn];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),nr((function(t){return t.link(f.getVAO(i))}))}if(gn in r){var o=r[gn];return rr(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!k.drawVAO&&A.program&&!v&&r.angle_instanced_arrays){var C=!0,O=A.program.attributes.map((function(t){var n=e.static[t];return C=C&&!!n,n}));if(C&&O.length>0){var D=f.getVAO(f.createVAO(O));k.drawVAO=new tr(null,null,null,(function(t,e){return t.link(D)})),k.useVAO=!0}}return v?k.useVAO=!0:k.attributes=function(t,e){var r=t.static,i=t.dynamic,a={};return Object.keys(r).forEach((function(t){var i=r[t],u=n.id(t),s=new g;if(Jn(i))s.state=1,s.buffer=o.getBuffer(o.create(i,Sn,!1,!0)),s.type=0;else{var c=o.getBuffer(i);if(c)s.state=1,s.buffer=c,s.type=0;else if(E.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;s.buffer="null",s.state=2,"number"==typeof f?s.x=f:(E.command(dt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),De.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=Jn(i.buffer)?o.getBuffer(o.create(i.buffer,Sn,!1,!0)):o.getBuffer(i.buffer),E.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|i.offset;E.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var h=0|i.stride;E.command(h>=0&&h<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;E.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!i.normalized,v=0;"type"in i&&(E.commandParameter(i.type,K,"invalid type for attribute "+t,e.commandStr),v=K[i.type]);var y=0|i.divisor;"divisor"in i&&(E.command(0===y||m,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),E.command(y>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),E.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){E.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=1,s.size=d,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=h,s.divisor=y}}a[t]=nr((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(s).forEach((function(t){r[t]=s[t]})),s.buffer&&(r.buffer=t.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];a[t]=rr(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,u=o.isBufferArgs,s=o.buffer;E.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+u+"("+i+")||"+s+".getBuffer("+i+")||"+s+".getBuffer("+i+".buffer)||"+u+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},f=new g;f.state=1,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,h=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",u,"(",i,")){",c.isStream,"=true;",l,"=",s,".createStream(",Sn,",",i,");",h,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",i,");","if(",l,"){",h,"=",l,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[De[0]],"=",i,".constant;",De.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",De.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",i,".buffer)){",l,"=",s,".createStream(",Sn,",",i,".buffer);","}else{",l,"=",s,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),a}(e,h),k.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=nr((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),k}function G(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function L(t,e,n,r){var i,o=t.shared,a=o.gl,u=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var s,c=t.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(t,e):e.def(u,".next"),r||e("if(",s,"!==",u,".cur){"),e("if(",s,"){",a,".bindFramebuffer(",36160,",",s,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function j(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,u=r.current,s=r.next,c=t.cond(u,".dirty");x.forEach((function(e){var r,f,l=T(e);if(!(l in n.state))if(l in a){r=a[l],f=o[l];var h=P(_[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(h.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(i,".",A[l],"(",h,");",h.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(s,".",l);var d=t.cond(r,"!==",u,".",l);c(d),l in S?d(t.cond(r).then(i,".enable(",S[l],");").else(i,".disable(",S[l],");"),u,".",l,"=",r,";"):d(i,".",A[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),e(c)}function U(t,e,n,r){var i=t.shared,o=t.current,a=i.current,u=i.gl;Qn(Object.keys(n)).forEach((function(i){var s=n[i];if(!r||r(s)){var c=s.append(t,e);if(S[i]){var f=S[i];er(s)?e(u,c?".enable(":".disable(",f,");"):e(t.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(dt(c)){var l=o[i];e(u,".",A[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(u,".",A[i],"(",c,");",a,".",i,"=",c,";")}}))}function B(t,e){m&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,n,r,i){var o,a,u,s=t.shared,c=t.stats,f=s.current,l=s.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function v(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function g(t){t(c,".cpuTime+=",d(),"-",o,";"),p&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function y(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(h){if(er(h))return void(h.enable?(v(e),g(e.exit),y("true")):y("false"));y(u=h.append(t,e))}else u=e.def(f,".profile");var m=t.block();v(m),e("if(",u,"){",m,"}");var b=t.block();g(b),e.exit("if(",u,"){",b,"}")}function F(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;a=s.append(t,e)}else{if(!i(ir))return;var c=t.scopeAttrib(u);E.optional((function(){t.assert(e,c+".state","missing attribute "+u)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,u=e.def(n,".location"),s=e.def(o.attributes,"[",u,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){e("if(!",s,".buffer){",a,".enableVertexAttribArray(",u,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",s,".type!==",o,"||",s,".size!==",n,"||",h.map((function(t){return s+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",Sn,",",f,".buffer);",a,".vertexAttribPointer(",[u,n,o,i.normalized,i.stride,i.offset],");",s,".type=",o,";",s,".size=",n,";",h.map((function(t){return s+"."+t+"="+i[t]+";"})).join(""),"}"),m){var c=i.divisor;e("if(",s,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function p(){e("if(",s,".buffer){",a,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",De.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",De.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case Tn:case Cn:case Mn:return 2;case In:case On:case Pn:return 3;case Nn:case Dn:case Gn:return 4;default:return 1}}(r.info.type),a)}))}function W(t,e,r,i,o){for(var a,u=t.shared,s=u.gl,c=0;c<i.length;++c){var f,l=i[c],h=l.name,d=l.info.type,p=r.uniforms[h],v=t.link(l)+".location";if(p){if(!o(p))continue;if(er(p)){var g=p.value;if(E.command(null!=g,'missing uniform "'+h+'"',t.commandStr),d===Bn||d===zn){E.command("function"==typeof g&&(d===Bn&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||d===zn&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+h,t.commandStr);var y=t.link(g._texture||g.color[0]._texture);e(s,".uniform1i(",v,",",y+".bind());"),e.exit(y,".unbind();")}else if(d===Ln||d===jn||d===Un){E.optional((function(){E.command(dt(g),"invalid matrix for uniform "+h,t.commandStr),E.command(d===Ln&&4===g.length||d===jn&&9===g.length||d===Un&&16===g.length,"invalid length for matrix uniform "+h,t.commandStr)}));var m=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),b=2;d===jn?b=3:d===Un&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",m,");")}else{switch(d){case An:E.commandType(g,"number","uniform "+h,t.commandStr),a="1f";break;case Tn:E.command(dt(g)&&2===g.length,"uniform "+h,t.commandStr),a="2f";break;case In:E.command(dt(g)&&3===g.length,"uniform "+h,t.commandStr),a="3f";break;case Nn:E.command(dt(g)&&4===g.length,"uniform "+h,t.commandStr),a="4f";break;case Rn:E.commandType(g,"boolean","uniform "+h,t.commandStr),a="1i";break;case kn:E.commandType(g,"number","uniform "+h,t.commandStr),a="1i";break;case Mn:case Cn:E.command(dt(g)&&2===g.length,"uniform "+h,t.commandStr),a="2i";break;case Pn:case On:E.command(dt(g)&&3===g.length,"uniform "+h,t.commandStr),a="3i";break;case Gn:case Dn:E.command(dt(g)&&4===g.length,"uniform "+h,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",dt(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!o(ir))continue;f=e.def(u.uniforms,"[",n.id(h),"]")}d===Bn?(E(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):d===zn&&(E(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),E.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+h+'". '+r)}function r(t){E(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+'==="'+t+'"',"invalid type, expected "+t)}function i(e,r){Array.isArray(f)?E(f.length===e,"must have length "+e):n(u.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){E(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(3553===e?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case kn:case An:r("number");break;case Cn:case Tn:case Mn:i(2);break;case On:case In:case Pn:i(3);break;case Dn:case Nn:case Ln:case Gn:i(4);break;case Rn:r("boolean");break;case jn:i(9);break;case Un:i(16);break;case Bn:o(3553);break;case zn:o(34067)}}));var _=1;switch(d){case Bn:case zn:var w=e.def(f,"._texture");e(s,".uniform1i(",v,",",w,".bind());"),e.exit(w,".unbind();");continue;case kn:case Rn:a="1i";break;case Cn:case Mn:a="2i",_=2;break;case On:case Pn:a="3i",_=3;break;case Dn:case Gn:a="4i",_=4;break;case An:a="1f";break;case Tn:a="2f",_=2;break;case In:a="3f",_=3;break;case Nn:a="4f",_=4;break;case Ln:a="Matrix2fv";break;case jn:a="Matrix3fv";break;case Un:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var x=Math.pow(d-Ln+2,2),S=t.global.def("new Float32Array(",x,")");Array.isArray(f)?e("false,(",P(x,(function(t){return S+"["+t+"]="+f[t]})),",",S,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",P(x,(function(t){return S+"["+t+"]="+f+"["+t+"]"})),",",S,")")}else _>1?e(P(_,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(E(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function V(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,u=r.draw;var s=function(){var i,s=u.elements,c=e;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),i=s.append(t,c)):i=c.def(a,".",ln),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=u[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var f,l,h=c(hn),d=c(pn),p=function(){var i,o=u.count,s=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(s=n),i=o.append(t,s),E.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(s,i+">=0","missing vertex count")}))):(i=s.def(a,".",dn),E.optional((function(){t.assert(s,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");m&&(f=c(vn),l=t.instancing);var v=s+".type",g=u.elements&&er(u.elements);function y(){function t(){n(l,".drawElementsInstancedANGLE(",[h,p,v,d+"<<(("+v+"-5121)>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[h,d,p,f],");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(o+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[h,d,p]+");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}m&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),y(),n("}else if(",f,"<0){"),b(),n("}")):y():b()}function H(t,e,n,r,i){var o=R(),a=o.proc("body",i);return E.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),m&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function X(t,e,n,r){B(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),F(t,e,n,r.attributes,(function(){return!0}))),W(t,e,n,r.uniforms,(function(){return!0})),V(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",B(t,e),F(t,e,n,r.attributes,i),W(t,e,n,r.uniforms,i),V(t,e,e,n)}function Y(t,e,n,r){B(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var u=t.scope(),s=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(u.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",s,"}",u.exit),n.needsContext&&G(t,s,n.context),n.needsFramebuffer&&L(t,s,n.framebuffer),U(t,s,n.state,c),n.profile&&c(n.profile)&&z(t,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),F(t,u,n,r.attributes,f),F(t,s,n,r.attributes,c)),W(t,u,n,r.uniforms,f),W(t,s,n,r.uniforms,c),V(t,u,s,n);else{var l=t.global.def("{}"),h=n.shader.progVar.append(t,s),d=s.def(h,".id"),p=s.def(l,"[",d,"]");s(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",l,"[",d,"]=",t.link((function(e){return H(q,t,n,e,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function $(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!dt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(k.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),a=!1,u=!1,s=!1,c=t.global.def("{}");o.forEach((function(e){var n=r[e];if(k.isDynamic(n)){"function"==typeof n&&(n=r[e]=k.unbox(n));var o=rr(n,null);a=a||o.thisDep,s=s||o.propDep,u=u||o.contextDep}else{switch(i(c,".",e,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new k.DynamicVariable(4,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){o.forEach((function(n){var i=r[n];if(k.isDynamic(i)){var o=t.invoke(e,i);e(c,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:w,current:_,procs:function(){var t=R(),e=t.proc("poll"),n=t.proc("refresh"),o=t.block();e(o),n(o);var a,u=t.shared,s=u.gl,c=u.next,f=u.current;o(f,".dirty=false;"),L(t,e),L(t,n,null,!0),m&&(a=t.link(m)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<i.maxAttributes;++l){var h=n.def(u.attributes,"[",l,"]"),d=t.cond(h,".buffer");d.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",Sn,",",h,".buffer.buffer);",s,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(d),m&&n(a,".vertexAttribDivisorANGLE(",l,",",h,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(S).forEach((function(r){var i=S[r],a=o.def(c,".",r),u=t.block();u("if(",a,"){",s,".enable(",i,")}else{",s,".disable(",i,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")})),Object.keys(A).forEach((function(r){var i,a,u=A[r],l=_[r],h=t.block();if(h(s,".",u,"("),dt(l)){var d=l.length;i=t.global.def(c,".",r),a=t.global.def(f,".",r),h(P(d,(function(t){return i+"["+t+"]"})),");",P(d,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",P(d,(function(t){return i+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",h,"}")}else i=o.def(c,".",r),a=o.def(f,".",r),h(i,");",f,".",r,"=",i,";"),e("if(",i,"!==",a,"){",h,"}");n(h)})),t.compile()}(),compile:function(t,r,i,o,a){var u=R();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){$(u,r,t)})),En.forEach((function(e){$(u,t,e)}));var s=M(t,r,i,o,u);return function(t,e){var n=t.proc("draw",1);B(t,n),G(t,n,e.context),L(t,n,e.framebuffer),j(t,n,e),U(t,n,e.state),z(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)X(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return H(X,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}G(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),Qn(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);dt(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),z(t,r,e,!0,!0),[ln,pn,dn,vn,hn].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new g).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(cn),a(fn),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(u,s),function(t,e){var n=t.proc("batch",2);t.batchId="0",B(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(G(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function u(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||L(t,n,o)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),j(t,n,e),U(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||z(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var s=e.shader.progVar;if(s.contextDep&&r||s.propDep)Y(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),h=n.def(f,"[",l,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",f,"[",l,"]=",t.link((function(n){return H(Y,t,e,n,2)})),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),e(u.compile(),{destroy:function(){s.shader.program.destroy()}})}}}var ar=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function u(t){a.push(t)}var s=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){l.length=Math.max(l.length,o+1),f.length=Math.max(f.length,o+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var c=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[t++]=c,f[n+1]=a,l[n+1]=t}for(i.length=t,t=0,n=0;n<s.length;++n){var h=s[n],d=h.startQueryIndex,p=h.endQueryIndex;h.sum+=f[p]-f[d];var v=l[d],g=l[p];g===v?(h.stats.gpuTime+=h.sum/1e6,u(h)):(h.startQueryIndex=v,h.endQueryIndex=g,s[t++]=h)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}},ur="webglcontextlost",sr="webglcontextrestored";function cr(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=M(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),u=function(t,e){var n={};function r(e){E.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(i,r);if(!u)return null;var s,c,f=(s={"":0},c=[""],{id:function(t){var e=s[t];return e||(e=s[t]=c.length,c.push(t),e)},str:function(t){return c[t]}}),l={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},h=u.extensions,d=ar(0,h),p=O(),v=i.drawingBufferWidth,g=i.drawingBufferHeight,y={tick:0,time:0,viewportWidth:v,viewportHeight:g,framebufferWidth:v,framebufferHeight:g,drawingBufferWidth:v,drawingBufferHeight:g,pixelRatio:r.pixelRatio},m=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(U,a),t.texImage2D(U,0,B,1,1,0,B,z,null);var u=t.createFramebuffer();if(t.bindFramebuffer(F,u),t.framebufferTexture2D(F,36064,U,a,0),t.bindTexture(U,null),36053!==t.checkFramebufferStatus(F))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=j.allocType(z,4);t.readPixels(0,0,1,1,B,z,s),t.getError()?o=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),o=1===s[0]),j.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=j.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,B,3,3,0,B,5121,l),j.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,h),b=function(e,n,r,i){var o=0,a={};function u(t){this.id=o++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=Q,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,i,o,a){var u,s;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||tt,n.length>0)if(Array.isArray(n[0])){u=J(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=Z(n,u,e.dtype),r),a?e.persistentData=s:j.freeType(s)}else if("number"==typeof n[0]){e.dimension=o;var h=j.allocType(e.dtype,n.length);rt(h,n),c(e,h,r),a?e.persistentData=h:j.freeType(h)}else t(n[0])?(e.dimension=n[0].length,e.dtype=i||nt(n[0])||tt,c(e,s=Z(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:j.freeType(s)):E.raise("invalid buffer data")}else if(t(n))e.dtype=i||nt(n),e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(W(n)){u=n.shape;var d=n.stride,p=n.offset,v=0,g=0,y=0,m=0;1===u.length?(v=u[0],g=1,y=d[0],m=0):2===u.length?(v=u[0],g=u[1],y=d[0],m=d[1]):E.raise("invalid shape"),e.dtype=i||nt(n.data)||tt,e.dimension=g;var b=j.allocType(e.dtype,v*g);it(b,n.data,v,g,y,m,p),c(e,b,r),a?e.persistentData=b:j.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=Q,e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):E.raise("invalid buffer data")}function l(t){n.bufferCount--,i(t);var r=t.buffer;E(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(i,o,s,c){n.bufferCount++;var h=new u(o);function d(n){var i=35044,o=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||W(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(E.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(E(null===o||Array.isArray(o)||t(o)||W(o),"invalid data for buffer"),o=n.data),"usage"in n&&(E.parameter(n.usage,$,"invalid buffer usage"),i=$[n.usage]),"type"in n&&(E.parameter(n.type,K,"invalid buffer type"),u=K[n.type]),"dimension"in n&&(E.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(E.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),h.bind(),o?f(h,o,i,u,s,c):(a&&e.bufferData(h.type,a,i),h.dtype=u||Q,h.usage=i,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*et[h.dtype]),d}function p(t,n){E(n+t.byteLength<=h.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+h.byteLength),e.bufferSubData(h.type,n,t)}return a[h.id]=h,s||d(i),d._reglType="buffer",d._buffer=h,d.subdata=function(e,n){var r,i=0|(n||0);if(h.bind(),t(e)||e instanceof ArrayBuffer)p(e,i);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var o=j.allocType(h.dtype,e.length);rt(o,e),p(o,i),j.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=J(e);var a=Z(e,r,h.dtype);p(a,i),j.freeType(a)}else E.raise("invalid buffer data")}else if(W(e)){r=e.shape;var u=e.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):E.raise("invalid shape");var v=Array.isArray(e.data)?h.dtype:nt(e.data),g=j.allocType(v,s*c);it(g,e.data,s,c,f,l,e.offset),p(g,i),j.freeType(g)}else E.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){l(h)},d},createStream:function(t,e){var n=s.pop();return n||(n=new u(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){V(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){V(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(i,l,r,(function(t){return _.destroyBuffer(t)})),_=function(e,n,r,i,o){for(var a=r.maxAttributes,u=new Array(a),s=0;s<a;++s)u[s]=new Te;var c=0,f={},l={Record:Te,scope:{},state:u,currentVAO:null,targetVAO:null,restore:h()?function(){h()&&V(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){E(Array.isArray(e),"arguments to vertex array constructor must be an array"),E(e.length<a,"too many attributes"),E(e.length>0,"must specify at least one attribute");var i={},s=r.attributes;s.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],h=s[c]=new Te,d=l.data||l;Array.isArray(d)||t(d)||W(d)?(r.buffers[c]&&(f=r.buffers[c],t(d)&&f._buffer.byteLength>=d.byteLength?f.subdata(d):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=o.create(l,34962,!1,!0)),h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(l)?(h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(l.buffer)?(h.buffer=o.getBuffer(l.buffer),h.size=0|(+l.size||h.buffer.dimension),h.normalized=!!l.normalized||!1,"type"in l?(E.parameter(l.type,K,"invalid buffer type"),h.type=K[l.type]):h.type=h.buffer.dtype,h.offset=0|(l.offset||0),h.stride=0|(l.stride||0),h.divisor=0|(l.divisor||0),h.state=1,E(h.size>=1&&h.size<=4,"size must be between 1 and 4"),E(h.offset>=0,"invalid offset"),E(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),E(h.divisor>=0,"divisor must be positive"),E(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(E(c>0,"first attribute must not be a constant"),h.x=+l.x||0,h.y=+l.y||0,h.z=+l.z||0,h.w=+l.w||0,h.state=2):E(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),u}return i.vaoCount+=1,u.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},u._vao=r,u._reglType="vao",u(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:h()?function(t){if(t!==l.currentVAO){var e=h();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=d(),r=0;r<u.length;++r){var i=u[r];i.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}l.currentVAO=t}},clear:h()?function(){V(f).forEach((function(t){t.destroy()}))}:function(){}};function h(){return n.oes_vertex_array_object}function d(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=h();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=d(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)e.disableVertexAttribArray(o)},p.prototype.refresh=function(){var t=h();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=h();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],i.vaoCount-=1)},l}(i,h,m,l,b),w=function(e,n,r,i){var o={},a=0,u={uint8:at,uint16:ut};function s(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=st),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,o,a,u,s,c,f){var l;if(i.buffer.bind(),o){var h=f;f||t(o)&&(!W(o)||t(o.data))||(h=n.oes_element_index_uint?st:ut),r._initBuffer(i.buffer,o,a,h,3)}else e.bufferData(ct,c,a),i.buffer.dtype=l||at,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(l=f,!f){switch(i.buffer.dtype){case at:case 5120:l=at;break;case ut:case 5122:l=ut;break;case st:case 5124:l=st;break;default:E.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,E(l!==st||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=s;d<0&&(d=i.buffer.byteLength,l===ut?d>>=1:l===st&&(d>>=2)),i.vertCount=d;var p=u;if(u<0){p=4;var v=i.buffer.dimension;1===v&&(p=0),2===v&&(p=1),3===v&&(p=4)}i.primType=p}function l(t){i.elementsCount--,E(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,ct,!0),a=new s(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=at;else{var n=null,r=35044,i=-1,s=-1,l=0,h=0;Array.isArray(e)||t(e)||W(e)?n=e:(E.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,E(Array.isArray(n)||t(n)||W(n),"invalid data for element buffer")),"usage"in e&&(E.parameter(e.usage,$,"invalid element buffer usage"),r=$[e.usage]),"primitive"in e&&(E.parameter(e.primitive,ot,"invalid element buffer primitive"),i=ot[e.primitive]),"count"in e&&(E("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(E.parameter(e.type,u,"invalid buffer type"),h=u[e.type]),"length"in e?l=0|e.length:(l=s,h===ut||5122===h?l*=2:h!==st&&5124!==h||(l*=4))),f(a,n,r,i,s,l,h)}else o(),a.primType=4,a.vertCount=0,a.type=at;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new s(r.create(null,ct,!0,!1)._buffer)),f(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){V(o).forEach(l)}}}(i,h,b,l),x=function(t,n,r,i){var o={},a={};function u(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function s(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,i){var u=35632===e?o:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),E.shaderError(t,s,c,e,i),u[r]=s}return s}var f={},l=[],h=0;function d(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,o){var a,f,l=c(35632,e.fragId),h=c(35633,e.vertId),d=e.program=t.createProgram();if(t.attachShader(d,l),t.attachShader(d,h),o)for(a=0;a<o.length;++a){var p=o[a];t.bindAttribLocation(d,p[0],p[1])}t.linkProgram(d),E.linkError(t,d,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(d,35718);i.profile&&(e.stats.uniformsCount=v);var g=e.uniforms;for(a=0;a<v;++a)if(f=t.getActiveUniform(d,a))if(f.size>1)for(var y=0;y<f.size;++y){var m=f.name.replace("[0]","["+y+"]");s(g,new u(m,n.id(m),t.getUniformLocation(d,m),f))}else s(g,new u(f.name,n.id(f.name),t.getUniformLocation(d,f.name),f));var b=t.getProgramParameter(d,35721);i.profile&&(e.stats.attributesCount=b);var _=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(d,a))&&s(_,new u(f.name,n.id(f.name),t.getAttribLocation(d,f.name),f))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);V(o).forEach(e),o={},V(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,u,s){E.command(n>=0,"missing vertex shader",u),E.command(i>=0,"missing fragment shader",u);var c=f[i];c||(c=f[i]={});var h=c[n];if(h&&(h.refCount++,!s))return h;var v=new d(i,n);return r.shaderCount++,p(v,u,s),h||(c[n]=v),l.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=l.indexOf(v);l.splice(e,1),r.shaderCount--}c[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete f[v.fragId][v.vertId]),Object.keys(f[v.fragId]).length||(t.deleteShader(o[v.fragId]),delete o[v.fragId],delete f[v.fragId])}})},restore:function(){o={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(i,f,l,r),S=he(i,h,m,(function(){I.procs.poll()}),y,l,r),A=function(t,e,n,r,i){var o={rgba4:pe,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(t){var e=o[t];a[e]=t}));var u=0,s={};function c(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=pe,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;E(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(de,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete s[e.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&f(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach((function(e){t+=s[e].stats.size})),t}),{create:function(e,u){var f=new c(t.createRenderbuffer());function l(e,r){var u=0,s=0,c=pe;if("object"==typeof e&&e){var h=e;if("shape"in h){var d=h.shape;E(Array.isArray(d)&&d.length>=2,"invalid renderbuffer shape"),u=0|d[0],s=0|d[1]}else"radius"in h&&(u=s=0|h.radius),"width"in h&&(u=0|h.width),"height"in h&&(s=0|h.height);"format"in h&&(E.parameter(h.format,o,"invalid renderbuffer format"),c=o[h.format])}else"number"==typeof e?(u=0|e,s="number"==typeof r?0|r:u):e?E.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(E(u>0&&s>0&&u<=n.maxRenderbufferSize&&s<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||s!==f.height||c!==f.format)return l.width=f.width=u,l.height=f.height=s,f.format=c,t.bindRenderbuffer(de,f.renderbuffer),t.renderbufferStorage(de,c,u,s),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height)),l.format=a[f.format],l}return s[f.id]=f,r.renderbufferCount++,l(e,u),l.resize=function(e,r){var o=0|e,a=0|r||o;return o===f.width&&a===f.height||(E(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),l.width=f.width=o,l.height=f.height=a,t.bindRenderbuffer(de,f.renderbuffer),t.renderbufferStorage(de,f.format,o,a),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height))),l},l._reglType="renderbuffer",l._renderbuffer=f,i.profile&&(l.stats=f.stats),l.destroy=function(){f.decRef()},l},clear:function(){V(s).forEach(f)},restore:function(){V(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(de,e.renderbuffer),t.renderbufferStorage(de,e.format,e.width,e.height)})),t.bindRenderbuffer(de,null)}}}(i,h,m,l,r),T=function(t,n,r,i,o,a){var u={cur:null,next:null,dirty:!1,setFBO:null},s=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function l(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function h(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);E(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;E(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(ye,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(ye,e,me,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=be,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),E.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,E(e===be)):"textureCube"===o?(n=i,E(e>=_e&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=me):E.raise("invalid regl object for attachment"),new l(e,n,r)}function g(t,e,n,r,a){if(n){var u=i.create2D({width:t,height:e,format:r,type:a});return u._texture.refCount=0,new l(be,u,null)}var s=o.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(me,null,s)}function y(t){return t&&(t.texture||t.renderbuffer)}function m(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var b=0,_={};function w(){this.id=b++,_[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function x(t){t.colorAttachments.forEach(h),h(t.depthAttachment),h(t.stencilAttachment),h(t.depthStencilAttachment)}function S(e){var n=e.framebuffer;E(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete _[e.id]}function A(e){var n;t.bindFramebuffer(ye,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)p(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(ye,36064+n,be,null,0);t.framebufferTexture2D(ye,33306,be,null,0),t.framebufferTexture2D(ye,36096,be,null,0),t.framebufferTexture2D(ye,36128,be,null,0),p(36096,e.depthAttachment),p(36128,e.stencilAttachment),p(33306,e.depthStencilAttachment);var o=t.checkFramebufferStatus(ye);t.isContextLost()||36053===o||E.raise("framebuffer configuration not supported, status = "+Ae[o]),t.bindFramebuffer(ye,u.next?u.next.framebuffer:null),u.cur=u.next,t.getError()}function T(t,i){var o=new w;function l(t,e){var i;E(u.next!==o,"can not update framebuffer which is currently in use");var a=0,h=0,p=!0,m=!0,b=null,_=!0,w="rgba",S="uint8",T=1,I=null,N=null,k=null,C=!1;if("number"==typeof t)a=0|t,h=0|e||a;else if(t){E.type(t,"object","invalid arguments for framebuffer");var O=t;if("shape"in O){var D=O.shape;E(Array.isArray(D)&&D.length>=2,"invalid shape for framebuffer"),a=D[0],h=D[1]}else"radius"in O&&(a=h=O.radius),"width"in O&&(a=O.width),"height"in O&&(h=O.height);("color"in O||"colors"in O)&&(b=O.color||O.colors,Array.isArray(b)&&E(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in O&&(T=0|O.colorCount,E(T>0,"invalid color buffer count")),"colorTexture"in O&&(_=!!O.colorTexture,w="rgba4"),"colorType"in O&&(S=O.colorType,_?(E(n.oes_texture_float||!("float"===S||"float32"===S),"you must enable OES_texture_float in order to use floating point framebuffer objects"),E(n.oes_texture_half_float||!("half float"===S||"float16"===S),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===S||"float16"===S?(E(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),w="rgba16f"):"float"!==S&&"float32"!==S||(E(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),w="rgba32f"),E.oneOf(S,f,"invalid color type")),"colorFormat"in O&&(w=O.colorFormat,s.indexOf(w)>=0?_=!0:c.indexOf(w)>=0?_=!1:_?E.oneOf(O.colorFormat,s,"invalid color format for texture"):E.oneOf(O.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in O||"depthStencilTexture"in O)&&(C=!(!O.depthTexture&&!O.depthStencilTexture),E(!C||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in O&&("boolean"==typeof O.depth?p=O.depth:(I=O.depth,m=!1)),"stencil"in O&&("boolean"==typeof O.stencil?m=O.stencil:(N=O.stencil,p=!1)),"depthStencil"in O&&("boolean"==typeof O.depthStencil?p=m=O.depthStencil:(k=O.depthStencil,p=!1,m=!1))}else a=h=1;var R=null,M=null,P=null,G=null;if(Array.isArray(b))R=b.map(v);else if(b)R=[v(b)];else for(R=new Array(T),i=0;i<T;++i)R[i]=g(a,h,_,w,S);E(n.webgl_draw_buffers||R.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),E(R.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||R[0].width,h=h||R[0].height,I?M=v(I):p&&!m&&(M=g(a,h,C,"depth","uint32")),N?P=v(N):m&&!p&&(P=g(a,h,!1,"stencil","uint8")),k?G=v(k):!I&&!N&&m&&p&&(G=g(a,h,C,"depth stencil","depth stencil")),E(!!I+!!N+!!k<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var L=null;for(i=0;i<R.length;++i)if(d(R[i],a,h),E(!R[i]||R[i].texture&&we.indexOf(R[i].texture._texture.format)>=0||R[i].renderbuffer&&Se.indexOf(R[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),R[i]&&R[i].texture){var j=xe[R[i].texture._texture.format]*Ee[R[i].texture._texture.type];null===L?L=j:E(L===j,"all color attachments much have the same number of bits per pixel.")}return d(M,a,h),E(!M||M.texture&&6402===M.texture._texture.format||M.renderbuffer&&33189===M.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(P,a,h),E(!P||P.renderbuffer&&36168===P.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),d(G,a,h),E(!G||G.texture&&34041===G.texture._texture.format||G.renderbuffer&&34041===G.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),x(o),o.width=a,o.height=h,o.colorAttachments=R,o.depthAttachment=M,o.stencilAttachment=P,o.depthStencilAttachment=G,l.color=R.map(y),l.depth=y(M),l.stencil=y(P),l.depthStencil=y(G),l.width=o.width,l.height=o.height,A(o),l}return a.framebufferCount++,l(t,i),e(l,{resize:function(t,e){E(u.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return l;for(var i=o.colorAttachments,a=0;a<i.length;++a)m(i[a],n,r);return m(o.depthAttachment,n,r),m(o.stencilAttachment,n,r),m(o.depthStencilAttachment,n,r),o.width=l.width=n,o.height=l.height=r,A(o),l},_reglType:"framebuffer",_framebuffer:o,destroy:function(){S(o),x(o)},use:function(t){u.setFBO({framebuffer:l},t)}})}return e(u,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof w)return e}return null},create:T,createCube:function(t){var o=Array(6);function a(t){var r;E(o.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var c,l={color:null},h=0,d=null,p="rgba",v="uint8",g=1;if("number"==typeof t)h=0|t;else if(t){E.type(t,"object","invalid arguments for framebuffer");var y=t;if("shape"in y){var m=y.shape;E(Array.isArray(m)&&m.length>=2,"invalid shape for framebuffer"),E(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in y&&(h=0|y.radius),"width"in y?(h=0|y.width,"height"in y&&E(y.height===h,"must be square")):"height"in y&&(h=0|y.height);("color"in y||"colors"in y)&&(d=y.color||y.colors,Array.isArray(d)&&E(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in y&&(g=0|y.colorCount,E(g>0,"invalid color buffer count")),"colorType"in y&&(E.oneOf(y.colorType,f,"invalid color type"),v=y.colorType),"colorFormat"in y&&(p=y.colorFormat,E.oneOf(y.colorFormat,s,"invalid color format for texture"))),"depth"in y&&(l.depth=y.depth),"stencil"in y&&(l.stencil=y.stencil),"depthStencil"in y&&(l.depthStencil=y.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(c=[],r=0;r<d.length;++r)c[r]=d[r];else c=[d];else{c=Array(g);var b={radius:h,format:p,type:v};for(r=0;r<g;++r)c[r]=i.createCube(b)}for(l.color=Array(c.length),r=0;r<c.length;++r){var _=c[r];E("function"==typeof _&&"textureCube"===_._reglType,"invalid cube map"),h=h||_.width,E(_.width===h&&_.height===h,"invalid cube map shape"),l.color[r]={target:_e,data:c[r]}}for(r=0;r<6;++r){for(var w=0;w<c.length;++w)l.color[w].target=_e+r;r>0&&(l.depth=o[0].depth,l.stencil=o[0].stencil,l.depthStencil=o[0].depthStencil),o[r]?o[r](l):o[r]=T(l)}return e(a,{width:h,height:h,color:c})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(E(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){V(_).forEach(S)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,V(_).forEach((function(e){e.framebuffer=t.createFramebuffer(),A(e)}))}})}(i,h,m,S,A,l),I=or(i,f,h,m,b,w,0,T,{},_,x,{elements:null,primitive:4,count:-1,offset:0,instances:-1},y,d,r),N=ke(i,T,I.procs.poll,y,o,h,m),D=I.next,R=i.canvas,P=[],G=[],L=[],H=[r.onDestroy],X=null;function q(){if(0===P.length)return d&&d.update(),void(X=null);X=C.next(q),mt();for(var t=P.length-1;t>=0;--t){var e=P[t];e&&e(y,null,0)}i.flush(),d&&d.update()}function Y(){!X&&P.length>0&&(X=C.next(q))}function ft(){X&&(C.cancel(q),X=null)}function lt(t){t.preventDefault(),a=!0,ft(),G.forEach((function(t){t()}))}function ht(t){i.getError(),a=!1,u.restore(),x.restore(),b.restore(),S.restore(),A.restore(),T.restore(),_.restore(),d&&d.restore(),I.procs.refresh(),Y(),L.forEach((function(t){t()}))}function dt(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(k.isDynamic(o))r[i]=k.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(k.isDynamic(o[a]))return void(r[i]=k.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}E(!!t,"invalid args to regl({...})"),E.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),i=n(t.uniforms||{},!0),o=n(t.attributes||{},!1),u=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),s={gpuTime:0,cpuTime:0,count:0},c=I.compile(u,o,i,r,s),f=c.draw,l=c.batch,h=c.scope,d=[];return e((function(t,e){var n;if(a&&E.raise("context lost"),"function"==typeof t)return h.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)h.call(this,null,e,n);else{if(!Array.isArray(t))return h.call(this,t,e,0);for(n=0;n<t.length;++n)h.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;d.length<t;)d.push(null);return d}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:s,destroy:function(){c.destroy()}})}R&&(R.addEventListener(ur,lt,!1),R.addEventListener(sr,ht,!1));var pt=T.setFBO=dt({framebuffer:k.define.call(null,1,"framebuffer")});function vt(t,e){var n=0;I.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),E(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function gt(t){return E.type(t,"function","regl.frame() callback must be a function"),P.push(t),Y(),{cancel:function(){var e=cr(P,t);E(e>=0,"cannot cancel a frame twice"),P[e]=function t(){var e=cr(P,t);P[e]=P[P.length-1],P.length-=1,P.length<=0&&ft()}}}}function yt(){var t=D.viewport,e=D.scissor_box;t[0]=t[1]=e[0]=e[1]=0,y.viewportWidth=y.framebufferWidth=y.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,y.viewportHeight=y.framebufferHeight=y.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function mt(){y.tick+=1,y.time=_t(),yt(),I.procs.poll()}function bt(){S.refresh(),yt(),I.procs.refresh(),d&&d.update()}function _t(){return(O()-p)/1e3}bt();var wt=e(dt,{clear:function(t){if(E("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)pt(e({framebuffer:t.framebuffer.faces[n]},t),vt);else pt(t,vt);else vt(0,t)},prop:k.define.bind(null,1),context:k.define.bind(null,2),this:k.define.bind(null,3),draw:dt({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return w.create(t,!1)},texture:S.create2D,cube:S.createCube,renderbuffer:A.create,framebuffer:T.create,framebufferCube:T.createCube,vao:_.createVAO,attributes:o,frame:gt,on:function(t,e){var n;switch(E.type(e,"function","listener callback must be a function"),t){case"frame":return gt(e);case"lost":n=G;break;case"restore":n=L;break;case"destroy":n=H;break;default:E.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:m,hasExtension:function(t){return m.extensions.indexOf(t.toLowerCase())>=0},read:N,destroy:function(){P.length=0,ft(),R&&(R.removeEventListener(ur,lt),R.removeEventListener(sr,ht)),x.clear(),T.clear(),A.clear(),S.clear(),w.clear(),b.clear(),_.clear(),d&&d.clear(),H.forEach((function(t){t()}))},_gl:i,_refresh:bt,poll:function(){mt(),d&&d.update()},now:_t,stats:l});return r.onDone(null,wt),wt}}()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";n(9216);var t,e=(t=n(2680))&&t.__esModule?t:{default:t};e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0})(),(()=>{"use strict";n.r(r),n.d(r,{CircularLayout:()=>Pt,ComboCombinedLayout:()=>r_,ComboForceLayout:()=>t_,ConcentricLayout:()=>df,DagreCompoundLayout:()=>Dc,DagreLayout:()=>Gn,ERLayout:()=>T_,ForceAtlas2Layout:()=>f_,ForceLayout:()=>Ot,FruchtermanGPULayout:()=>Yb,FruchtermanLayout:()=>yf,GForceGPULayout:()=>Jb,GForceLayout:()=>D,GridLayout:()=>I,Layout:()=>I_,Layouts:()=>N_,MDSLayout:()=>vf,RadialLayout:()=>lf,RandomLayout:()=>k,getLayoutByName:()=>A,registerLayout:()=>E,unRegisterLayout:()=>S});var t=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}(),e=function(t){return"string"==typeof t},i=(Object.create(null),Array.isArray),o=function(t){return"number"==typeof t},a=function(t){return Number.isNaN(Number(t))};function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var s,c=function(){return c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},c.apply(this,arguments)},f=function(t){return null!==t&&"object"===u(t)},l=function t(e){if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){var n=[];return e.forEach((function(t){n.push(t)})),n.map((function(e){return t(e)}))}if("object"===u(e)&&e!=={}){var r=c({},e);return Object.keys(r).forEach((function(e){r[e]=t(r[e])})),r}return e},h=function(t,e){var n=t[e];return f(n)?n.cell:n},d=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n?(n.forEach((function(t){var n=h(t,"source"),i=h(t,"target");n&&(r[e[n]]+=1),i&&(r[e[i]]+=1)})),r):r},p=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},v=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e,i.push([])})),r&&r.forEach((function(t){var n=h(t,"source"),r=h(t,"target"),a=o[n],u=o[r];i[a][u]=1,e||(i[u][a]=1)})),i},g=function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)},y=function(t,e){"function"==typeof e&&g(t,e)},m=function(t){return"function"==typeof t},b=function(t,e,n){return n||(o(t)?function(){return t}:function(){return e})},_=function(t,e,n){return void 0===n&&(n=!0),e||0===e?m(e)?e:o(e)?function(){return e}:i(e)?function(){if(n){var r=Math.max.apply(Math,e);return isNaN(r)?t:r}return e}:f(e)?function(){if(n){var r=Math.max(e.width,e.height);return isNaN(r)?t:r}return[e.width,e.height]}:function(){return t}:function(e){return e.size?i(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:f(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}},w=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=new Map,E=function(e,n){if(x.get(e)&&console.warn("The layout with the name "+e+" exists already, it will be overridden"),f(n)){var r=function(t){function e(e){var r=t.call(this)||this,i=r,o={},a=i.getDefaultCfg();return Object.assign(o,a,n,e),Object.keys(o).forEach((function(t){var e=o[t];i[t]=e})),r}return w(e,t),e}(t);x.set(e,r)}else x.set(e,n);return x.get(e)},S=function(t){x.has(t)&&x.delete(t)},A=function(t){return x.has(t)?x.get(t):null},T=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),I=function(t){function n(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return T(n,t),n.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=t.begin,o=n.length;if(0===o)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};if(1===o)return n[0].x=i[0],n[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};var u=t.sortBy,s=t.width,c=t.height,f=t.condense,l=t.preventOverlapPadding,h=t.preventOverlap,p=t.nodeSpacing,v=t.nodeSize,g=[];n.forEach((function(t){g.push(t)}));var y={};if(g.forEach((function(t,e){y[t.id]=e})),("degree"===u||!e(u)||void 0===g[0][u])&&(u="degree",a(n[0].degree))){var m=d(g.length,y,r);g.forEach((function(t,e){t.degree=m[e]}))}g.sort((function(t,e){return e[u]-t[u]})),s||"undefined"==typeof window||(s=window.innerWidth),c||"undefined"==typeof window||(c=window.innerHeight);var b=t.rows,w=null!=t.cols?t.cols:t.columns;if(t.cells=o,null!=b&&null!=w?(t.rows=b,t.cols=w):null!=b&&null==w?(t.rows=b,t.cols=Math.ceil(t.cells/t.rows)):null==b&&null!=w?(t.cols=w,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.cols*t.rows>t.cells)((E=t.small())-1)*(x=t.large())>=t.cells?t.small(E-1):(x-1)*E>=t.cells&&t.large(x-1);else for(;t.cols*t.rows<t.cells;){var x,E=t.small();((x=t.large())+1)*E>=t.cells?t.large(x+1):t.small(E+1)}if(t.cellWidth=s/t.cols,t.cellHeight=c/t.rows,f&&(t.cellWidth=0,t.cellHeight=0),h||p){var S=_(10,p),A=_(30,v,!1);g.forEach((function(e){e.x&&e.y||(e.x=0,e.y=0);var n=A(e),r=n[0],i=void 0===r?30:r,o=n[1],a=void 0===o?30:o,u=void 0!==S?S(e):l,s=i+u,c=a+u;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,c)}))}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var T=0;T<g.length;T++){var I=g[T],N=void 0;if(t.position&&(N=t.position(I)),N&&(void 0!==N.row||void 0!==N.col)){var k={row:N.row,col:N.col};if(void 0===k.col)for(k.col=0;t.used(k.row,k.col);)k.col++;else if(void 0===k.row)for(k.row=0;t.used(k.row,k.col);)k.row++;t.id2manPos[I.id]=k,t.use(k.row,k.col)}t.getPos(I)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:r,nodes:g}},n.prototype.small=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.min(r,i):Math.min(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.large=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.max(r,i):Math.max(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.used=function(t,e){return this.cellUsed["c-"+t+"-"+e]||!1},n.prototype.use=function(t,e){this.cellUsed["c-"+t+"-"+e]=!0},n.prototype.moveToNextCell=function(){var t=this,e=t.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},n.prototype.getPos=function(t){var e,n,r=this,i=r.begin,o=r.cellWidth,a=r.cellHeight,u=r.id2manPos[t.id];if(u)e=u.col*o+o/2+i[0],n=u.row*a+a/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*o+o/2+i[0],n=r.row*a+a/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},n.prototype.getType=function(){return"grid"},n}(t),N=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return N(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(t),C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(t,e){return t?o(t)?function(e){return t}:t:function(t){return e||1}},D=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return C(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var a=n.center;if(1===r.length)return r[0].x=a[0],r[0].y=a[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var u={},s={};r.forEach((function(t,e){o(t.x)||(t.x=Math.random()*n.width),o(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),n.nodeMap=u,n.nodeIdxMap=s,n.linkDistance=O(n.linkDistance,1),n.nodeStrength=O(n.nodeStrength,1),n.edgeStrength=O(n.edgeStrength,1);var c,l=n.nodeSize;if(n.preventOverlap){var h,p=n.nodeSpacing;h=o(p)?function(){return p}:m(p)?p:function(){return 0},c=l?i(l)?function(t){return Math.max(l[0],l[1])+h(t)}:function(t){return l+h(t)}:function(t){return t.size?i(t.size)?Math.max(t.size[0],t.size[1])+h(t):f(t.size)?Math.max(t.size.width,t.size.height)+h(t):t.size+h(t):10+h(t)}}n.nodeSize=c;var v=n.edges;n.degrees=d(r.length,n.nodeIdxMap,v),n.getMass||(n.getMass=function(t){return t.mass||n.degrees[n.nodeIdxMap[t.id]]||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(r)if(i||!a){for(var u=0;u<n;u++){var s=e.runOneStep(u);if(e.reachMoveThreshold(r,s,o))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var c=0;this.timeInterval=window.setInterval((function(){var t,i;if(r){var a=e.runOneStep(c)||[];e.reachMoveThreshold(r,a,o)&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval)),++c>=n&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var i=t.x-e[n].x,o=t.y-e[n].y;r+=Math.sqrt(i*i+o*o)})),(r/=t.length)<n},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes,i=n.edges,o=[],a=[];if(r){r.forEach((function(t,e){o[2*e]=0,o[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),n.calRepulsive(o,r),i&&n.calAttractive(o,i),n.calGravity(o,r);var u=Math.max(.02,n.interval-.002*t);n.updateVelocity(o,a,u,r);var s=[];return r.forEach((function(t){s.push({x:t.x,y:t.y})})),n.updatePosition(a,u,r),null===(e=n.tick)||void 0===e||e.call(n),s}},e.prototype.calRepulsive=function(t,e){var n=this,r=n.getMass,i=n.factor,o=n.coulombDisScale,a=n.preventOverlap,u=n.collideStrength,s=void 0===u?1:u,c=n.nodeStrength,f=n.nodeSize;e.forEach((function(n,u){var l=r?r(n):1;e.forEach((function(e,h){if(!(u>=h)){var d=n.x-e.x,p=n.y-e.y,v=d*d+p*p+.01,g=Math.sqrt(v),y=(g+.1)*o,m=d/g,b=p/g,_=.5*(c(n)+c(e))*i/(y*y),w=r?r(e):1;if(t[2*u]+=m*_,t[2*u+1]+=b*_,t[2*h]-=m*_,t[2*h+1]-=b*_,a&&(f(n)+f(e))/2>g){var x=s*(c(n)+c(e))*.5/v;t[2*u]+=m*x/l,t[2*u+1]+=b*x/l,t[2*h]-=m*x/w,t[2*h+1]-=b*x/w}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,i=n.nodeIdxMap,o=n.linkDistance,a=n.edgeStrength,u=n.nodeSize,s=n.getMass;e.forEach((function(e,n){var c=h(e,"source"),f=h(e,"target"),l=r[c],d=r[f],p=d.x-l.x,v=d.y-l.y,g=Math.sqrt(p*p+v*v)+.01,y=p/g,m=v/g,b=((o(e,l,d)||1+(u(l)+u(l)||0)/2)-g)*a(e),_=i[c],w=i[f],x=s?s(l):1,E=s?s(d):1;t[2*_]-=y*b/x,t[2*_+1]-=m*b/x,t[2*w]+=y*b/E,t[2*w+1]+=m*b/E}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,i=n.gravity,a=n.degrees,u=e.length,s=0;s<u;s++){var c=e[s],f=c.x-r[0],l=c.y-r[1],h=i;if(n.getCenter){var d=n.getCenter(c,a[s]);d&&o(d[0])&&o(d[1])&&o(d[2])&&(f=c.x-d[0],l=c.y-d[1],h=d[2])}h&&(t[2*s]-=h*f,t[2*s+1]-=h*l)}},e.prototype.updateVelocity=function(t,e,n,r){var i=this,o=n*i.damping;r.forEach((function(n,r){var a=t[2*r]*o||.01,u=t[2*r+1]*o||.01,s=Math.sqrt(a*a+u*u);if(s>i.maxSpeed){var c=i.maxSpeed/s;a*=c,u*=c}e[2*r]=a,e[2*r+1]=u}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if(o(n.fx)&&o(n.fy))return n.x=n.fx,void(n.y=n.fy);var i=t[2*r]*e,a=t[2*r+1]*e;n.x+=i,n.y+=a}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(t);function R(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,u,s,c,f,l,h,d=t._root,p={data:r},v=t._x0,g=t._y0,y=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a,i=d,!(d=d[l=f<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===u&&n===s)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a}while((l=f<<1|c)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function M(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function P(t){return t[0]}function G(t){return t[1]}function L(t,e,n){var r=new j(null==e?P:e,null==n?G:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function j(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function U(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var B=L.prototype=j.prototype;function z(t){return function(){return t}}function F(t){return 1e-6*(t()-.5)}B.copy=function(){var t,e,n=new j(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=U(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=U(e));return n},B.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return R(this.cover(e,n),e,n,t)},B.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,u[n]=i,r<s&&(s=r),r>f&&(f=r),i<c&&(c=i),i>l&&(l=i));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;n<o;++n)R(this,a[n],u[n],t[n]);return this},B.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,u,s=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=c,c=a,s*=2,u){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},B.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},B.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},B.find=function(t,e,n){var r,i,o,a,u,s,c,f=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new M(v,f,l,h,d)),null==n?n=1/0:(f=t-n,l=e-n,h=t+n,d=e+n,n*=n);s=p.pop();)if(!(!(v=s.node)||(i=s.x0)>h||(o=s.y0)>d||(a=s.x1)<f||(u=s.y1)<l))if(v.length){var g=(i+a)/2,y=(o+u)/2;p.push(new M(v[3],g,y,a,u),new M(v[2],i,y,g,u),new M(v[1],g,o,a,y),new M(v[0],i,o,g,y)),(c=(e>=y)<<1|t>=g)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var m=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),_=m*m+b*b;if(_<n){var w=Math.sqrt(n=_);f=t-w,l=e-w,h=t+w,d=e+w,r=v.data}}return r},B.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,u,s,c,f,l,h,d=this._root,p=this._x0,v=this._y0,g=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(u=(p+g)/2))?p=u:g=u,(f=a>=(s=(v+y)/2))?v=s:y=s,e=d,!(d=d[l=f<<1|c]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},B.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},B.root=function(){return this._root},B.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},B.visit=function(t){var e,n,r,i,o,a,u=[],s=this._root;for(s&&u.push(new M(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&s.length){var c=(r+o)/2,f=(i+a)/2;(n=s[3])&&u.push(new M(n,c,f,o,a)),(n=s[2])&&u.push(new M(n,r,f,c,a)),(n=s[1])&&u.push(new M(n,c,i,o,f)),(n=s[0])&&u.push(new M(n,r,i,c,f))}return this},B.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new M(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,u=e.y0,s=e.x1,c=e.y1,f=(a+s)/2,l=(u+c)/2;(o=i[0])&&n.push(new M(o,a,u,f,l)),(o=i[1])&&n.push(new M(o,f,u,s,l)),(o=i[2])&&n.push(new M(o,a,l,f,c)),(o=i[3])&&n.push(new M(o,f,l,s,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},B.x=function(t){return arguments.length?(this._x=t,this):this._x},B.y=function(t){return arguments.length?(this._y=t,this):this._y};var W={value:()=>{}};function V(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new H(r)}function H(t){this._=t}function X(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function q(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Y(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=W,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}H.prototype=V.prototype={constructor:H,on:function(t,e){var n,r=this._,i=X(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=Y(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Y(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=q(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new H(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const K=V;var $,Z,J=0,Q=0,tt=0,et=0,nt=0,rt=0,it="object"==typeof performance&&performance.now?performance:Date,ot="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function at(){return nt||(ot(ut),nt=it.now()+rt)}function ut(){nt=0}function st(){this._call=this._time=this._next=null}function ct(t,e,n){var r=new st;return r.restart(t,e,n),r}function ft(){nt=(et=it.now())+rt,J=Q=0;try{!function(){at(),++J;for(var t,e=$;e;)(t=nt-e._time)>=0&&e._call.call(null,t),e=e._next;--J}()}finally{J=0,function(){for(var t,e,n=$,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:$=e);Z=t,ht(r)}(),nt=0}}function lt(){var t=it.now(),e=t-et;e>1e3&&(rt-=e,et=t)}function ht(t){J||(Q&&(Q=clearTimeout(Q)),t-nt>24?(t<1/0&&(Q=setTimeout(ft,t-it.now()-rt)),tt&&(tt=clearInterval(tt))):(tt||(et=it.now(),tt=setInterval(lt,1e3)),J=1,ot(ft)))}st.prototype=ct.prototype={constructor:st,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?at():+n)+(null==e?0:+e),this._next||Z===this||(Z?Z._next=this:$=this,Z=this),this._call=t,this._time=n,ht()},stop:function(){this._call&&(this._call=null,this._time=1/0,ht())}};const dt=4294967296;function pt(t){return t.x}function vt(t){return t.y}var gt=Math.PI*(3-Math.sqrt(5));function yt(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,u=new Map,s=ct(l),c=K("tick","end"),f=function(){let t=1;return()=>(t=(1664525*t+1013904223)%dt)/dt}();function l(){h(),c.call("tick",e),n<r&&(s.stop(),c.call("end",e))}function h(r){var s,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(o-n)*i,u.forEach((function(t){t(n)})),s=0;s<f;++s)null==(c=t[s]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*gt;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,f),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return s.restart(l),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),u.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(f=t,u.forEach(p),e):f},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(i=e-(u=t[c]).x)*i+(o=n-u.y)*o)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function mt(){var t,e,n,r,i,o=z(-30),a=1,u=1/0,s=.81;function c(n){var i,o=t.length,a=L(t,pt,vt).visitAfter(l);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function f(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function l(t){var e,n,r,o,a,u=0,s=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,o+=n*e.y);t.x=r/s,t.y=o/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=i[e.data.index]}while(e=e.next)}t.value=u}function h(t,o,c,f){if(!t.value)return!0;var l=t.x-e.x,h=t.y-e.y,d=f-o,p=l*l+h*h;if(d*d/s<p)return p<u&&(0===l&&(p+=(l=F(n))*l),0===h&&(p+=(h=F(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=F(n))*l),0===h&&(p+=(h=F(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=l*d,e.vy+=h*d)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:z(+t),f(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c}function bt(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;i<a;++i)u+=(o=n[i]).x,s+=o.y;for(u=(u/a-t)*r,s=(s/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=u,o.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}function _t(t){return t.index}function wt(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function xt(t){var e,n,r,i,o,a,u=_t,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=z(30),f=1;function l(r){for(var i=0,u=t.length;i<f;++i)for(var s,c,l,h,d,p,v,g=0;g<u;++g)c=(s=t[g]).source,h=(l=s.target).x+l.vx-c.x-c.vx||F(a),d=l.y+l.vy-c.y-c.vy||F(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[g])/p*r*e[g],d*=p,l.vx-=h*(v=o[g]),l.vy-=d*v,c.vx+=h*(v=1-v),c.vy+=d*v}function h(){if(r){var a,s,c=r.length,f=t.length,l=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(a=0,i=new Array(c);a<f;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=wt(l,s.source)),"object"!=typeof s.target&&(s.target=wt(l,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(f);a<f;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(f),d(),n=new Array(f),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,h()},l.links=function(e){return arguments.length?(t=e,h(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:z(+t),d(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:z(+t),p(),l):c},l}function Et(t){return t.x+t.vx}function St(t){return t.y+t.vy}function At(t){var e,n,r,i=1,o=1;function a(){for(var t,a,s,c,f,l,h,d=e.length,p=0;p<o;++p)for(a=L(e,Et,St).visitAfter(u),t=0;t<d;++t)s=e[t],l=n[s.index],h=l*l,c=s.x+s.vx,f=s.y+s.vy,a.visit(v);function v(t,e,n,o,a){var u=t.data,d=t.r,p=l+d;if(!u)return e>c+p||o<c-p||n>f+p||a<f-p;if(u.index>s.index){var v=c-u.x-u.vx,g=f-u.y-u.vy,y=v*v+g*g;y<p*p&&(0===v&&(y+=(v=F(r))*v),0===g&&(y+=(g=F(r))*g),y=(p-(y=Math.sqrt(y)))/y*i,s.vx+=(v*=y)*(p=(d*=d)/(h+d)),s.vy+=(g*=y)*p,u.vx-=v*(p=1-p),u.vy-=g*p)}}}function u(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=z(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:z(+e),s(),a):t},a}function Tt(t){var e,n,r,i=z(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=z(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:z(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:z(+e),a(),o):t},o}function It(t){var e,n,r,i=z(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=z(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:z(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:z(+e),a(),o):t},o}var Nt="GPU_LAYOUT_END",kt={gForce:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},Ct=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ot=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return Ct(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},e.prototype.init=function(t){var e=this;e.nodes=t.nodes||[];var n=t.edges||[];e.edges=n.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,u=e.alpha;if(i)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),r&&e.edgeForce?e.edgeForce.links(r):r&&!e.edgeForce&&(f=xt().id((function(t){return t.id})).links(r),e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f))),e.preventOverlap&&e.overlapProcess(i),i.alpha(u).restart(),this.ticking=!0;else try{var s=mt();if(e.nodeStrength&&s.strength(e.nodeStrength),i=yt().nodes(n),e.clustering){var c=function(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),i=t(-1),o=t(100),a=t(.1),u=[0,0],s=[],c={},f=[],l=100,d=100,p={none:{x:0,y:0}},v=[],g="force",y=!0,m=.1;function b(t){if(!y)return b;e.tick(),w();for(var r=0,i=s.length,o=void 0,a=t*m;r<i;++r)(o=s[r]).vx+=(p[n(o)].x-o.x)*a,o.vy+=(p[n(o)].y-o.y)*a}function _(){s&&function(){if(s&&s.length){if(void 0===n(s[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var t,u,p,g,y,m=(t=[],u=[],p={},y=[],g=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var i=n(t),o=r(t),a=e[i];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(o*o)*1.3,e[i]=a})),e}(s),y=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=h(t,"source"),r=h(t,"target"),i=n(c[e]),o=n(c[r]);return i<=o?i+"~"+o:o+"~"+i}(t),i=0;void 0!==e[r]&&(i=e[r]),i+=1,e[r]=i})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],i=e.split("~")[0],o=e.split("~")[1];void 0!==i&&void 0!==o&&r.push({source:i,target:o,count:n})})),r}(f),Object.keys(g).forEach((function(e,n){var r=g[e];t.push({id:e,size:r.count,r:Math.sqrt(r.sumforceNodeSize/Math.PI)}),p[e]=n})),y.forEach((function(t){var e=h(t,"source"),n=h(t,"target"),r=p[e],i=p[n];void 0!==r&&void 0!==i&&u.push({source:r,target:i,count:t.count})})),{nodes:t,links:u});e=yt(m.nodes).force("x",Tt(l).strength(.1)).force("y",It(d).strength(.1)).force("collide",At((function(t){return t.r})).iterations(4)).force("charge",mt().strength(i)).force("links",xt(m.nodes.length?m.links:[]).distance(o).strength(a)),v=e.nodes(),w()}}()}function w(){return p={none:{x:0,y:0}},v.forEach((function(t){p[t.id]={x:t.x-u[0],y:t.y-u[1]}})),p}function x(t){c={},t.forEach((function(t){c[t.id]=t}))}return b.initialize=function(t){s=t,_()},b.template=function(t){return arguments.length?(g=t,_(),b):g},b.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},b):(n=t,b):n},b.enableGrouping=function(t){return arguments.length?(y=t,b):y},b.strength=function(t){return arguments.length?(m=t,b):m},b.centerX=function(t){return arguments.length?(l=t,b):l},b.centerY=function(t){return arguments.length?(d=t,b):d},b.nodes=function(t){return arguments.length?(x(t||[]),s=t||[],b):s},b.links=function(t){return arguments.length?(f=t||[],_(),b):f},b.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),_(),b):r},b.nodeSize=b.forceNodeSize,b.forceCharge=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),_(),b):i},b.forceLinkDistance=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),_(),b):o},b.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),_(),b):a},b.offset=function(t){return arguments.length?(u=t,b):u},b.getFocis=w,b}();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,i.force("group",c)}if(i.force("center",bt(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=xt().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}if(e.workerEnabled&&!Dt()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),d=1;d<=l;d++)i.tick(),postMessage({nodes:n,currentTick:d,totalTicks:l,type:"LAYOUT_TICK"},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,a=r.nodeSize,u=r.nodeSpacing,s=r.collideStrength;if(n=o(u)?function(){return u}:m(u)?u:function(){return 0},a)if(m(a))e=function(t){return a(t)+n(t)};else if(i(a)){var c=(a[0]>a[1]?a[0]:a[1])/2;e=function(t){return c+n(t)}}else if(o(a)){var l=a/2;e=function(t){return l+n(t)}}else e=function(){return 10};else e=function(t){return t.size?i(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",At(e).strength(s))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(t);function Dt(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var Rt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Mt(t,e){var n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}var Pt=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return Rt(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this,n=e.nodes,r=e.edges,i=n.length;if(0!==i){e.width||"undefined"==typeof window||(e.width=window.innerWidth),e.height||"undefined"==typeof window||(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var o=e.center;if(1===i)return n[0].x=o[0],n[0].y=o[1],void(e.onLayoutEnd&&e.onLayoutEnd());var a=e.radius,u=e.startRadius,s=e.endRadius,c=e.divisions,f=e.startAngle,l=e.endAngle,h=e.angleRatio,p=e.ordering,v=e.clockwise,g=e.nodeSpacing,y=e.nodeSize,m=(l-f)/i,b={};n.forEach((function(t,e){b[t.id]=e})),e.nodeMap=b;var w=d(n.length,b,r);if(e.degrees=w,g){var x=_(10,g),E=_(10,y),S=-1/0;n.forEach((function(t){var e=E(t);S<e&&(S=e)}));var A=0;n.forEach((function(t,e){A+=0===e?S||10:(x(t)||0)+(S||10)})),a=A/(2*Math.PI)}else a||u||s?!u&&s?u=s:u&&!s&&(s=u):a=e.height>e.width?e.width/2:e.height/2;var T=m*h,I=[];I="topology"===p?e.topologyOrdering():"topology-directed"===p?e.topologyOrdering(!0):"degree"===p?e.degreeOrdering():n;for(var N=Math.ceil(i/c),k=0;k<i;++k){var C=a;C||null===u||null===s||(C=u+k*(s-u)/(i-1)),C||(C=10+100*k/(i-1));var O=f+k%N*T+2*Math.PI/c*Math.floor(k/N);v||(O=l-k%N*T-2*Math.PI/c*Math.floor(k/N)),I[k].x=o[0]+Math.cos(O)*C,I[k].y=o[1]+Math.sin(O)*C,I[k].weight=w[k]}return null===(t=e.onLayoutEnd)||void 0===t||t.call(e),{nodes:I,edges:this.edges}}e.onLayoutEnd&&e.onLayoutEnd()},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this,n=e.degrees,r=e.edges,i=e.nodes,o=l(i),a=e.nodeMap,u=[o[0]],s=[i[0]],c=[],f=i.length;c[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=h(e,"source"),i=h(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].parent;u.push(t[a].id),s.push(t[o].id)})):e.forEach((function(e){var r=h(e,"source"),i=h(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].children;u.push(t[a].id),s.push(t[o].id)}))}(o,r,a,t);var d=0;return o.forEach((function(t,e){if(0!==e)if(e!==f-1&&n[e]===n[e+1]&&!function(t,e,n){for(var r=n.length,i=0;i<r;i++){var o=h(n[i],"source"),a=h(n[i],"target");if(t.id===o&&e.id===a||e.id===o&&t.id===a)return!0}return!1}(u[d],t,r)||c[e]){for(var l=u[d].children,p=!1,v=0;v<l.length;v++){var g=a[l[v]];if(n[g]===n[e]&&!c[g]){u.push(o[g]),s.push(i[a[o[g].id]]),c[g]=!0,p=!0;break}}for(var y=0;!p&&(c[y]||(u.push(o[y]),s.push(i[a[o[y].id]]),c[y]=!0,p=!0),++y!==f););}else u.push(t),s.push(i[a[t.id]]),c[e]=!0,d++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r],e.push(t)})),e.sort(Mt),e},e.prototype.getType=function(){return"circular"},e}(t),Gt=n(8311),Lt=n.n(Gt)();Lt||"undefined"==typeof window||(Lt=window.graphlib),Array.prototype.flat||(Array.prototype.flat=function(t){var e=t||1;if(isFinite(e)){var n=this.length,r=[];if(0===this.length)return this;for(;e--;){var i=[],o=!1;if(0===r.length){o=!0;for(var a=0;a<n;a++)this[a]instanceof Array?r.push.apply(r,this[a]):r.push(this[a])}else{for(a=0;a<r.length;a++)r[a]instanceof Array?(o=!0,i.push.apply(i,r[a])):i.push(r[a]);r=i}if(!o&&e===1/0)break}return r}});const jt=Lt;var Ut=function(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev},Bt=function(t,e){if("_next"!==t&&"_prev"!==t)return e};const zt=function(){function t(){var t={};t._next=t._prev=t,this.isentinel=t}return t.prototype.dequeue=function(){var t=this.isentinel,e=t._prev;if(e!==t)return Ut(e),e},t.prototype.enqueue=function(){var t=this.isentinel,e=t._prev;if(e!==t)return Ut(e),e},t.prototype.toString=function(){for(var t=[],e=this.isentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,Bt)),n=n._prev;return"["+t.join(", ")+"]"},t}();var Ft=jt.Graph,Wt=function(){return 1},Vt=function(t,e,n,r,i){var o,a,u=i?[]:void 0;return null===(o=t.inEdges(r.v))||void 0===o||o.forEach((function(r){var o=t.edge(r),a=t.node(r.v);i&&u.push({v:r.v,w:r.w}),void 0===a.out&&(a.out=0),a.out-=o,Ht(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var i=t.edge(r),o=r.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,Ht(e,n,a)})),t.removeNode(r.v),u},Ht=function(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)};const Xt=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new Ft,r=0,i=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var o=n.edge(t.v,t.w)||0,a=null==e?void 0:e(t),u=o+a;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var o=[],a=i+r+3,u=0;u<a;u++)o.push(new zt);var s=r+1;return n.nodes().forEach((function(t){Ht(o,s,n.node(t))})),{buckets:o,zeroIdx:s,graph:n}}(t,e||Wt);return null===(n=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)Vt(t,e,n,r);for(;r=o.dequeue();)Vt(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(Vt(t,e,n,r,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx).map((function(e){return t.outEdges(e.v,e.w)})))||void 0===n?void 0:n.flat()};var qt=jt.Graph,Yt=function(t,e,n,r){var i;do{i=""+r+Math.random()}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i},Kt=function(t){var e=(new qt).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},$t=function(t,e){var n={};return null==t||t.forEach((function(t,r){n[t]=e[r]})),n},Zt=function(t){var e=t.nodes().filter((function(e){return void 0!==t.node(e).rank})).map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e);t.nodes().forEach((function(e){var r=t.node(e);r.hasOwnProperty("rank")&&(r.rank||(r.rank=0),r.rank-=n)}))},Jt=function(t){var e=t.nodes().filter((function(e){return void 0!==t.node(e).rank})).map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e),r=[];t.nodes().forEach((function(e){var i,o=((null===(i=t.node(e))||void 0===i?void 0:i.rank)||0)-n;r[o]||(r[o]=[]),r[o].push(e)}));for(var i=0,o=t.graph().nodeRankFactor||0,a=0;a<r.length;a++){var u=r[a];void 0===u&&a%o!=0?--i:i&&(null==u||u.forEach((function(e){t.node(e).rank||(t.node(e).rank=0),t.node(e).rank+=i})))}},Qt=function(t){var e=t.nodes().map((function(e){var n=t.node(e).rank;return void 0!==n?n:-1/0}));return Math.max.apply(Math,e)},te=function(t,e){var n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},ee=function(t,e){return e()},ne=function(t,e){var n,r=1/0;return null==t||t.forEach((function(t){var i=e(t);r>i&&(r=i,n=t)})),n};const re={addDummyNode:Yt,simplify:Kt,asNonCompoundGraph:function(t){var e=new qt({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){return e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=t.nodes().map((function(e){var n,r={};return null===(n=t.outEdges(e))||void 0===n||n.forEach((function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight})),r}));return $t(t.nodes(),e)},predecessorWeights:function(t){var e=t.nodes().map((function(e){var n,r={};return null===(n=t.inEdges(e))||void 0===n||n.forEach((function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight})),r}));return $t(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,u=e.y-o,s=t.width/2,c=t.height/2;return a||u?(Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:i+n,y:o+r}):{x:0,y:0}},buildLayerMatrix:function(t){for(var e=[],n=[],r=Qt(t)+1,i=0;i<r;i++)e.push([]),n.push([]);return t.nodes().forEach((function(r){var i=t.node(r).rank;void 0!==i&&e[i]&&n[i].push(r)})),null==n||n.forEach((function(n,r){null==n||n.sort((function(e,n){var r,i;return(null===(r=t.node(e))||void 0===r?void 0:r.order)-(null===(i=t.node(n))||void 0===i?void 0:i.order)})),n.forEach((function(t){e[r].push(t)}))})),e},normalizeRanks:Zt,removeEmptyRanks:Jt,addBorderNode:function(t,e,n,r){var i={width:0,height:0};return o(n)&&o(r)&&(i.rank=n,i.order=r),Yt(t,"border",i,e)},maxRank:Qt,partition:function(t,e){var n={lhs:[],rhs:[]};return null==t||t.forEach((function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:te,notime:ee,zipObject:$t,minBy:ne};const ie=function(t){t.graph().dummyChains=[],t.edges().forEach((function(e){return function(t,e){var n,r,i=e.v,o=t.node(i).rank,a=e.w,u=t.node(a).rank,s=e.name,c=t.edge(e),f=c.labelRank;if(u!==o+1){var l,h,d;for(t.removeEdge(e),d=0,++o;o<u;++d,++o)c.points=[],l=re.addDummyNode(t,"edge",h={edgeLabel:c,width:0,height:0,edgeObj:e,rank:o},"_d"),o===f&&(h.width=c.width,h.height=c.height,h.dummy="edge-label",h.labelpos=c.labelpos),t.setEdge(i,l,{weight:c.weight},s),0===d&&(t.graph().dummyChains||(t.graph().dummyChains=[]),null===(r=null===(n=t.graph())||void 0===n?void 0:n.dummyChains)||void 0===r||r.push(l)),i=l;t.setEdge(i,a,{weight:c.weight},s)}}(t,e)}))};var oe=function(t){var e,n={},r=function e(r){var i,o=t.node(r);if(n.hasOwnProperty(r))return o.rank;n[r]=!0;var a=null===(i=t.outEdges(r))||void 0===i?void 0:i.map((function(n){return e(n.w)-t.edge(n).minlen||1/0})),u=Math.min.apply(Math,a);return u!==Number.POSITIVE_INFINITY&&null!=u||(u=0),o.rank=u,u};null===(e=t.sources())||void 0===e||e.forEach((function(t){return r(t)}))},ae=function(t){var e,n={},r=0,i=function e(i){var o,a=t.node(i);if(n.hasOwnProperty(i))return a.rank;n[i]=!0;var u=null===(o=t.outEdges(i))||void 0===o?void 0:o.map((function(n){return e(n.w)-t.edge(n).minlen||1/0})),s=Math.min.apply(Math,u);return s!==Number.POSITIVE_INFINITY&&null!=s||(s=0),a.rank=s,r=Math.min(a.rank,r),a.rank};null===(e=t.sources())||void 0===e||e.forEach((function(t){return i(t)})),r+=1;var o=function e(n,r){var i,o=t.node(n),a=isNaN(o.layer)?r:o.layer;(void 0===o.rank||o.rank<a)&&(o.rank=a),null===(i=t.outEdges(n))||void 0===i||i.map((function(n){e(n.w,a+t.edge(n).minlen)}))};t.nodes().forEach((function(e){var n=t.node(e);isNaN(n.layer)?n.rank-=r:o(e,n.layer)}))},ue=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},se=jt.Graph,ce=function(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||ue(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},fe=function(t,e){return t.nodes().forEach((function n(r){var i;null===(i=e.nodeEdges(r))||void 0===i||i.forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||void 0===e.node(a).layer&&ue(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},le=function(t,e){return ne(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?ue(e,n):1/0}))},he=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},de=jt.alg,pe=de.preorder,ve=de.postorder,ge=function(t){t=Kt(t),oe(t);var e,n,r=function(t){var e,n,r=new se({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});ce(r,t)<o;)e=le(r,t),n=r.hasNode(e.v)?ue(t,e):-ue(t,e),he(r,t,n);return r}(t);for(_e(r),ye(r,t);e=xe(r);)n=Ee(r,t,e),Se(r,t,e,n)},ye=function(t,e){var n=ve(t,t.nodes());null==(n=null==n?void 0:n.slice(0,(null==n?void 0:n.length)-1))||n.forEach((function(n){me(t,e,n)}))},me=function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=be(t,e,n)},be=function(t,e,n){var r,i=t.node(n).parent,o=!0,a=e.edge(n,i),u=0;return a||(o=!1,a=e.edge(i,n)),u=a.weight,null===(r=e.nodeEdges(n))||void 0===r||r.forEach((function(r){var a=r.v===n,s=a?r.w:r.v;if(s!==i){var c=a===o,f=e.edge(r).weight;if(u+=c?f:-f,Te(t,n,s)){var l=t.edge(n,s).cutvalue;u+=c?-l:l}}})),u},_e=function(t,e){void 0!==e&&(e=t.nodes()[0]),we(t,{},1,e)},we=function t(e,n,r,i,o){var a,u=r,s=r,c=e.node(i);return n[i]=!0,null===(a=e.neighbors(i))||void 0===a||a.forEach((function(r){n.hasOwnProperty(r)||(s=t(e,n,s,r,i))})),c.low=u,c.lim=s++,o?c.parent=o:delete c.parent,s},xe=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},Ee=function(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var o=t.node(r),a=t.node(i),u=o,s=!1;o.lim>a.lim&&(u=a,s=!0);var c=e.edges().filter((function(e){return s===Ie(t,t.node(e.v),u)&&s!==Ie(t,t.node(e.w),u)}));return ne(c,(function(t){return ue(e,t)}))},Se=function(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),_e(t),ye(t,e),Ae(t,e)},Ae=function(t,e){var n=t.nodes().find((function(t){return!e.node(t).parent})),r=pe(t,n);null==(r=null==r?void 0:r.slice(1))||r.forEach((function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))},Te=function(t,e,n){return t.hasEdge(e,n)},Ie=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};ge.initLowLimValues=_e,ge.initCutValues=ye,ge.calcCutValue=be,ge.leaveEdge=xe,ge.enterEdge=Ee,ge.exchangeEdges=Se;const Ne=ge;var ke=oe,Ce=function(t){ae(t),function(t){var e,n,r=new se({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});fe(r,t)<o;)e=le(r,t),n=r.hasNode(e.v)?ue(t,e):-ue(t,e),he(r,t,n)}(t)};const Oe=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){Ne(t)}(t);break;default:Ce(t);break;case"longest-path":ke(t)}};const De=function(t){var e,n=function(t){var e,n={},r=0;return null===(e=t.children())||void 0===e||e.forEach((function e(i){var o,a=r;null===(o=t.children(i))||void 0===o||o.forEach(e),n[i]={low:a,lim:r++}})),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,i,o=t.node(e),a=o.edgeObj;if(a)for(var u=function(t,e,n,r){var i,o,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>s||c>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)u.push(i);return{lca:o,path:a.concat(u.reverse())}}(t,n,a.v,a.w),s=u.path,c=u.lca,f=0,l=s[f],h=!0;e!==a.w;){if(o=t.node(e),h){for(;(l=s[f])!==c&&t.node(l).maxRank<o.rank;)f++;l===c&&(h=!1)}if(!h){for(;f<s.length-1&&(null===(r=t.node(l=s[f+1]))||void 0===r?void 0:r.minRank)<=o.rank;)f++;l=s[f]}t.setParent(e,l),e=null===(i=t.successors(e))||void 0===i?void 0:i[0]}}))};var Re=function t(e,n,r,i,o,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=re.addBorderNode(e,"_bt"),f=re.addBorderNode(e,"_bb"),l=e.node(u);e.setParent(c,u),l.borderTop=c,e.setParent(f,u),l.borderBottom=f,null==s||s.forEach((function(s){t(e,n,r,i,o,a,s);var l=e.node(s),h=l.borderTop?l.borderTop:s,d=l.borderBottom?l.borderBottom:s,p=l.borderTop?i:2*i,v=h!==d?1:o-a[u]+1;e.setEdge(c,h,{minlen:v,weight:p,nestingEdge:!0}),e.setEdge(d,f,{minlen:v,weight:p,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:o+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})},Me=function(t){var e,n={},r=function e(r,i){var o=t.children(r);null==o||o.forEach((function(t){return e(t,i+1)})),n[r]=i};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n};const Pe=function(t){var e,n=re.addDummyNode(t,"root",{},"_root"),r=Me(t),i=Math.max.apply(Math,Object.values(r))-1,o=2*i+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=o}));var a=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e}(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){Re(t,n,o,a,i,r,e)})),t.graph().nodeRankFactor=o};var Ge=function(t,e,n,r,i,o){var a={rank:o,width:0,height:0,borderType:e},u=i[e][o-1],s=re.addDummyNode(t,"border",a,n);i[e][o]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const Le=function(t){var e,n=function e(n){var r=t.children(n),i=t.node(n);if((null==r?void 0:r.length)&&r.forEach((function(t){return e(t)})),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)Ge(t,"borderLeft","_bl",n,i,o),Ge(t,"borderRight","_br",n,i,o)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var je=function(t){t.nodes().forEach((function(e){Ue(t.node(e))})),t.edges().forEach((function(e){Ue(t.edge(e))}))},Ue=function(t){var e=t.width;t.width=t.height,t.height=e},Be=function(t){t.y=-t.y},ze=function(t){var e=t.x;t.x=t.y,t.y=e};const Fe=function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==n&&"rl"!==n||function(t){t.nodes().forEach((function(e){Be(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return Be(t)})),r.hasOwnProperty("y")&&Be(r)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){ze(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return ze(t)})),r.hasOwnProperty("x")&&ze(r)}))}(t),je(t))},We=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),i=Math.max.apply(Math,r),o=[],a=0;a<i+1;a++)o.push([]);var u=n.sort((function(e,n){return t.node(e).rank-t.node(n).rank})),s=u.filter((function(e){return void 0!==t.node(e).fixorder})),c=s.sort((function(e,n){return t.node(e).fixorder-t.node(n).fixorder}));return null==c||c.forEach((function(n){isNaN(t.node(n).rank)||o[t.node(n).rank].push(n),e[n]=!0})),null==u||u.forEach((function n(r){var i;if(!e.hasOwnProperty(r)){e[r]=!0;var a=t.node(r);isNaN(a.rank)||o[a.rank].push(r),null===(i=t.successors(r))||void 0===i||i.forEach((function(t){return n(t)}))}})),o};var Ve=function(t,e,n){for(var r=$t(n,n.map((function(t,e){return e}))),i=e.map((function(e){var n,i=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:r[e.w]||0,weight:t.edge(e).weight}}));return null==i?void 0:i.sort((function(t,e){return t.pos-e.pos}))})),o=i.flat().filter((function(t){return void 0!==t})),a=1;a<n.length;)a<<=1;var u=2*a-1;a-=1;var s=Array(u).fill(0,0,u),c=0;return null==o||o.forEach((function(t){var e=t.pos+a;s[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;c+=t.weight*n})),c};const He=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);++r)n+=Ve(t,e[r-1],e[r]);return n};var Xe=jt.Graph;const qe=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root"+Math.random()););return e}(t),i=new Xe({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(o){var a=t.node(o),u=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||r),t[n](o).forEach((function(e){var n=e.v===o?e.w:e.v,r=i.edge(n,o),a=void 0!==r?r.weight:0;i.setEdge(n,o,{weight:t.edge(e).weight+a})})),a.hasOwnProperty("minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),i};var Ye=function(t,e){var n,r=0,i=0;t.weight&&(r+=t.barycenter*t.weight,i+=t.weight),e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};const Ke=function(t,e){var n,r,i,o={};return null==t||t.forEach((function(t,e){var n=o[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(n=e.edges())||void 0===n||n.forEach((function(t){var e=o[t.v],n=o[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(o[t.w]))})),function(t){for(var e,n,r=[],i=function(){var i=t.pop();r.push(i),null===(e=i.in.reverse())||void 0===e||e.forEach((function(t){return(e=i,function(t){t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&Ye(e,t)})(t);var e})),null===(n=i.out)||void 0===n||n.forEach((function(e){return(n=i,function(e){e.in.push(n),0==--e.indegree&&t.push(e)})(e);var n}))};null==t?void 0:t.length;)i();var o=r.filter((function(t){return!t.merged})),a=["vs","i","barycenter","weight"];return o.map((function(t){var e={};return null==a||a.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))}(null===(i=(r=Object.values(o)).filter)||void 0===i?void 0:i.call(r,(function(t){return!t.indegree})))};var $e=function(t,e,n){for(var r,i=n;e.length&&(r=e[e.length-1]).i<=i;)e.pop(),null==t||t.push(r.vs),i++;return i};const Ze=function t(e,n,r,i,o){var a,u,s,c,f=e.children(n),l=e.node(n),h=l?l.borderLeft:void 0,d=l?l.borderRight:void 0,p={};h&&(f=null==f?void 0:f.filter((function(t){return t!==h&&t!==d})));var v=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null==n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return null==n||n.forEach((function(e){var n=t.edge(e),i=t.node(e.v);r.sum+=n.weight*i.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}(e,f||[]);null==v||v.forEach((function(n){var o,a,u;if(null===(o=e.children(n.v))||void 0===o?void 0:o.length){var s=t(e,n.v,r,i);p[n.v]=s,s.hasOwnProperty("barycenter")&&(u=s,void 0!==(a=n).barycenter?(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight):(a.barycenter=u.barycenter,a.weight=u.weight))}}));var g=Ke(v,r);(function(t,e){null==t||t.forEach((function(t){var n,r=null===(n=t.vs)||void 0===n?void 0:n.map((function(t){return e[t]?e[t].vs:t}));t.vs=r.flat()}))})(g,p),null===(a=g.filter((function(t){var e;return!!t.vs||(null===(e=t.vs)||void 0===e?void 0:e.length)>0})))||void 0===a||a.forEach((function(t){var n=e.node(t.vs[0]);t.fixorder=n.fixorder,t.order=n.order}));var y=function(t,e,n){var r=re.partition(t,(function(t){return t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder)||t.hasOwnProperty("barycenter")})),i=r.lhs,o=r.rhs.sort((function(t,e){return-t.i- -e.i})),a=[],u=0,s=0,c=0;null==i||i.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenter<r.barycenter)return-1;if(n.barycenter>r.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.order<r.order)return-1;if(n.order>r.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),c=$e(a,o,c),null==i||i.forEach((function(t){var e;c+=null===(e=t.vs)||void 0===e?void 0:e.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=$e(a,o,c)}));var f={vs:a.flat()};return s&&(f.barycenter=u/s,f.weight=s),f}(g,i,o);if(h&&(y.vs=[h,y.vs,d].flat(),null===(u=e.predecessors(h))||void 0===u?void 0:u.length)){var m=e.node((null===(s=e.predecessors(h))||void 0===s?void 0:s[0])||{}),b=e.node((null===(c=e.predecessors(d))||void 0===c?void 0:c[0])||{});y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+m.order+b.order)/(y.weight+2),y.weight+=2}return y};var Je=jt.Graph,Qe=function(t,e,n){return e.map((function(e){return qe(t,e,n)}))},tn=function(t,e,n){var r=new Je;null==t||t.forEach((function(t){for(var i,o=t.graph().root,a=Ze(t,o,r,e,n),u=0;u<(null===(i=a.vs)||void 0===i?void 0:i.length);u++)t.node(a.vs[u]).order=u;!function(t,e,n){var r,i={};null==n||n.forEach((function(n){for(var o,a,u=t.parent(n);u;){if((o=t.parent(u))?(a=i[o],i[o]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=o}}))}(t,r,a.vs)}))},en=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};var nn=jt.Graph,rn=function(t,e){var n;if(t.node(e).dummy)return null===(n=t.predecessors(e))||void 0===n?void 0:n.find((function(e){return t.node(e).dummy}))},on=function(t,e,n){var r=e,i=n;if(r>i){var o=r;r=i,i=o}var a=t[r];a||(t[r]=a={}),a[i]=!0},an=function(t,e,n){var r=e,i=n;return r>i&&(r=i,i=e),t[r]&&t[r].hasOwnProperty(i)},un=function(t,e,n,r){var i=new nn,o=t.graph(),a=sn(o.nodesep,o.edgesep,r);return null==e||e.forEach((function(e){var r;null==e||e.forEach((function(e){var o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edge(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e}))})),i};var sn=function(t,e,n){return function(r,i,o){var a,u=r.node(i),s=r.node(o),c=0;if(c+=u.width/2,u.hasOwnProperty("labelpos"))switch((u.labelpos||"").toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,s.hasOwnProperty("labelpos"))switch((s.labelpos||"").toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}},cn=function(t,e){var n;return(null===(n=t.node(e))||void 0===n?void 0:n.width)||0};const fn=function(t){var e;!function(t){var e=re.buildLayerMatrix(t),n=t.graph().ranksep,r=0;null==e||e.forEach((function(e){var i=e.map((function(e){return t.node(e).height})),o=Math.max.apply(Math,i);null==e||e.forEach((function(e){t.node(e).y=r+o/2})),r+=o+n}))}(t=re.asNonCompoundGraph(t));var n=function(t){var e,n=re.buildLayerMatrix(t),r=Object.assign(function(t,e){var n={};return(null==e?void 0:e.length)&&e.reduce((function(e,r){var i=0,o=0,a=e.length,u=null==r?void 0:r[(null==r?void 0:r.length)-1];return null==r||r.forEach((function(e,s){var c,f=rn(t,e),l=f?t.node(f).order:a;(f||e===u)&&(null===(c=r.slice(o,s+1))||void 0===c||c.forEach((function(e){var r;null===(r=t.predecessors(e))||void 0===r||r.forEach((function(r){var o=t.node(r),a=o.order;!(a<i||l<a)||o.dummy&&t.node(e).dummy||on(n,r,e)}))})),o=s+1,i=l)})),r})),n}(t,n),function(t,e){var n={},r=function(e,r,i,o,a){for(var u,s=[],c=r;c<i;c++)s.push(c);s.forEach((function(r){var i;u=e[r],t.node(u).dummy&&(null===(i=t.predecessors(u))||void 0===i||i.forEach((function(e){var r=t.node(e);r.dummy&&(r.order<o||r.order>a)&&on(n,e,u)})))}))};return(null==e?void 0:e.length)&&e.reduce((function(e,n){var i,o=-1,a=0;return null==n||n.forEach((function(u,s){if("border"===t.node(u).dummy){var c=t.predecessors(u)||[];c.length&&(i=t.node(c[0]).order,r(n,a,s,o,i),a=s,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,n)),i={};["u","d"].forEach((function(o){e="u"===o?n:Object.values(n).reverse(),["l","r"].forEach((function(n){"r"===n&&(e=e.map((function(t){return Object.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var i={},o={},a={};return null==e||e.forEach((function(t){null==t||t.forEach((function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),null==e||e.forEach((function(t){var e=-1;null==t||t.forEach((function(t){var u=r(t);if(u.length)for(var s=((u=u.sort((function(t,e){return a[t]-a[e]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];o[t]===t&&e<a[l]&&!an(n,t,l)&&(o[l]=t,o[t]=i[t]=i[l],e=a[l])}}))})),{root:i,align:o}}(0,e,r,a),s=function(t,e,n,r,i){var o,a={},u=un(t,e,n,i),s=i?"borderLeft":"borderRight",c=function(t,e){for(var n=u.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()};return c((function(t){a[t]=(u.inEdges(t)||[]).reduce((function(t,e){return Math.max(t,(a[e.v]||0)+u.edge(e))}),0)}),u.predecessors.bind(u)),c((function(e){var n=(u.outEdges(e)||[]).reduce((function(t,e){return Math.min(t,(a[e.w]||0)-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==s&&(a[e]=Math.max(a[e],n))}),u.successors.bind(u)),null===(o=Object.values(r))||void 0===o||o.forEach((function(t){a[t]=a[n[t]]})),a}(t,e,u.root,u.align,"r"===n);"r"===n&&Object.keys(s).forEach((function(t){return s[t]=-s[t]})),i[o+n]=s}))}));var o=function(t,e){return re.minBy(Object.values(e),(function(e){var n,r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return null===(n=Object.keys(e))||void 0===n||n.forEach((function(n){var o=e[n],a=cn(t,n)/2;r=Math.max(o+a,r),i=Math.min(o-a,i)})),r-i}))}(t,i);return o&&function(t,e){var n=Object.values(e),r=Math.min.apply(Math,n),i=Math.max.apply(Math,n);["u","d"].forEach((function(n){["l","r"].forEach((function(o){var a,u=n+o,s=t[u];if(s!==e){var c=Object.values(s);(a="l"===o?r-Math.min.apply(Math,c):i-Math.max.apply(Math,c))&&(t[u]={},Object.keys(s).forEach((function(e){t[u][e]=s[e]+a})))}}))}))}(i,o),function(t,e){var n={};return Object.keys(t.ul).forEach((function(r){if(e)n[r]=t[e.toLowerCase()][r];else{var i=Object.values(t).map((function(t){return t[r]})).sort((function(t,e){return t-e}));n[r]=(i[1]+i[2])/2}})),n}(i,t.graph().align)}(t);null===(e=Object.keys(n))||void 0===e||e.forEach((function(e){t.node(e).x=n[e]}))};var ln=jt.Graph,hn=function(t,e,n){e(" removeSelfEdges",(function(){kn(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?Xt(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return t.nodes().forEach((function i(o){var a;r.hasOwnProperty(o)||(r[o]=!0,n[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach((function(t){n.hasOwnProperty(t.w)?e.push(t):i(t.w)})),delete n[o])})),e}(t);null==e||e.forEach((function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-"+Math.random())}))}(t)})),e(" nestingGraph.run",(function(){Pe(t)})),e(" rank",(function(){Oe(re.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){wn(t)})),e(" removeEmptyRanks",(function(){Jt(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){Zt(t)})),e(" assignRankMinMax",(function(){xn(t)})),e(" removeEdgeLabelProxies",(function(){En(t)})),e(" normalize.run",(function(){ie(t)})),e(" parentDummyChains",(function(){De(t)})),e(" addBorderSegments",(function(){Le(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){!function(t,e){for(var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),i=Math.max.apply(Math,r),o=[],a=0;a<i+1;a++)o.push([]);null==e||e.forEach((function(e){var n=t.node(e);n&&!n.dummy&&(isNaN(n.rank)||(n.fixorder=o[n.rank].length,o[n.rank].push(e)))}))}(t,n.nodeOrder)})),e(" order",(function(){!function(t){for(var e=re.maxRank(t),n=[],r=[],i=1;i<e+1;i++)n.push(i);for(i=e-1;i>-1;i--)r.push(i);var o=Qe(t,n,"inEdges"),a=Qe(t,r,"outEdges"),u=We(t);en(t,u);for(var s,c=Number.POSITIVE_INFINITY,f=(i=0,0);f<4;++i,++f)tn(i%2?o:a,i%4>=2),u=re.buildLayerMatrix(t),(h=He(t,u))<c&&(f=0,s=l(u),c=h);for(u=We(t),en(t,u),i=0,f=0;f<4;++i,++f){var h;tn(i%2?o:a,i%4>=2,!0),u=re.buildLayerMatrix(t),(h=He(t,u))<c&&(f=0,s=l(u),c=h)}en(t,s)}(t)})),e(" insertSelfEdges",(function(){Cn(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==n&&"rl"!==n||je(t)}(t)})),e(" position",(function(){fn(t)})),e(" positionSelfEdges",(function(){On(t)})),e(" removeBorderNodes",(function(){Nn(t)})),e(" normalize.undo",(function(){!function(t){var e;null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var n,r,i=t.node(e),o=i.edgeLabel;i.edgeObj&&t.setEdge(i.edgeObj,o);for(var a=e;i.dummy;)r=null===(n=t.successors(a))||void 0===n?void 0:n[0],t.removeNode(a),o.points.push({x:i.x,y:i.y}),"edge-label"===i.dummy&&(o.x=i.x,o.y=i.y,o.width=i.width,o.height=i.height),a=r,i=t.node(a)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){Tn(t)})),e(" undoCoordinateSystem",(function(){Fe(t)})),e(" translateGraph",(function(){Sn(t)})),e(" assignNodeIntersects",(function(){An(t)})),e(" reversePoints",(function(){In(t)})),e(" acyclic.undo",(function(){!function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))},dn=["nodesep","edgesep","ranksep","marginx","marginy"],pn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vn=["acyclicer","ranker","rankdir","align"],gn=["width","height","layer","fixorder"],yn={width:0,height:0},mn=["minlen","weight","width","height","labeloffset"],bn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_n=["labelpos"],wn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={e,rank:(t.node(e.w).rank-r.rank)/2+r.rank};re.addDummyNode(t,"edge-proxy",i,"_ep")}}))},xn=function(t){var e=0;t.nodes().forEach((function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank||-1/0))})),t.graph().maxRank=e},En=function(t){t.nodes().forEach((function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))},Sn=function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=t.graph(),a=o.marginx||0,u=o.marginy||0,s=function(t){if(t){var o=t.x,a=t.y,u=t.width,s=t.height;isNaN(o)||isNaN(u)||(e=Math.min(e,o-u/2),n=Math.max(n,o+u/2)),isNaN(a)||isNaN(s)||(r=Math.min(r,a-s/2),i=Math.max(i,a+s/2))}};t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);n.hasOwnProperty("x")&&s(n)})),e-=a,r-=u,t.nodes().forEach((function(n){var i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((function(n){var i,o=t.edge(n);null===(i=o.points)||void 0===i||i.forEach((function(t){t.x-=e,t.y-=r})),o.hasOwnProperty("x")&&(o.x-=e),o.hasOwnProperty("y")&&(o.y-=r)})),o.width=n-e+a,o.height=i-r+u},An=function(t){t.edges().forEach((function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(re.intersectRect(o,n)),i.points.push(re.intersectRect(a,r))}))},Tn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))},In=function(t){t.edges().forEach((function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))},Nn=function(t){t.nodes().forEach((function(e){var n,r,i;if(null===(n=t.children(e))||void 0===n?void 0:n.length){var o=t.node(e),a=t.node(o.borderTop),u=t.node(o.borderBottom),s=t.node(o.borderLeft[(null===(r=o.borderLeft)||void 0===r?void 0:r.length)-1]),c=t.node(o.borderRight[(null===(i=o.borderRight)||void 0===i?void 0:i.length)-1]);o.width=Math.abs((null==c?void 0:c.x)-(null==s?void 0:s.x))||10,o.height=Math.abs((null==u?void 0:u.y)-(null==a?void 0:a.y))||10,o.x=((null==s?void 0:s.x)||0)+o.width/2,o.y=((null==a?void 0:a.y)||0)+o.height/2}})),t.nodes().forEach((function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))},kn=function(t){t.edges().forEach((function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))},Cn=function(t){var e=re.buildLayerMatrix(t);null==e||e.forEach((function(e){var n=0;null==e||e.forEach((function(e,r){var i,o=t.node(e);o.order=r+n,null===(i=o.selfEdges)||void 0===i||i.forEach((function(e){re.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))},On=function(t){t.nodes().forEach((function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{y:o,x:i+a},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],n.label.x=n.x,n.label.y=n.y}}))},Dn=function(t,e){var n={};return null==e||e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},Rn=function(t){void 0===t&&(t={});var e={};return Object.keys(t).forEach((function(n){var r=t[n];e[n.toLowerCase()]=r})),e};const Mn={graphlib:jt,layout:function(t,e){var n=e&&e.debugTiming?re.time:re.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,r,i;n=t,r=e.prevGraph,i=r._nodes||{},n.nodes().forEach((function(t){var e=n.node(t);void 0!==i[t]?(e.fixorder=i[t]._order,delete i[t]._order):delete e.fixorder}))}));var r=n(" buildLayoutGraph",(function(){return function(t){var e=new ln({multigraph:!0,compound:!0}),n=Rn(t.graph()),r={};return null==vn||vn.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},pn,Dn(n,dn),r)),t.nodes().forEach((function(n){var r=Rn(t.node(n)),i=Dn(r,gn);Object.keys(yn).forEach((function(t){void 0===i[t]&&(i[t]=yn[t])})),e.setNode(n,i),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=Rn(t.edge(n)),i={};null==_n||_n.forEach((function(t){void 0!==r[t]&&(i[t]=r[t])})),e.setEdge(n,Object.assign({},bn,Dn(r,mn),i))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach((function(e){var n=t.node(e);isNaN(n.layer)||(n.layer?n.layer*=2:n.layer=0)})),t.edges().forEach((function(n){var r,i=t.edge(n);i.minlen*=2,"c"!==(null===(r=i.labelpos)||void 0===r?void 0:r.toLowerCase())&&("TB"===e.rankdir||"BT"===e.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}(r)}));try{n(" runLayout",(function(){hn(r,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void console.error("The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){t.nodes().forEach((function(n){var r,i=t.node(n),o=e.node(n);i&&(i.x=o.x,i.y=o.y,i._order=o.order,i._rank=o.rank,(null===(r=e.children(n))||void 0===r?void 0:r.length)&&(i.width=o.width,i.height=o.height))})),t.edges().forEach((function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,i.hasOwnProperty("x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)}))}))},util:{time:te,notime:ee}};var Pn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gn=function(t){function n(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return Pn(n,t),n.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},n.prototype.execute=function(){var t=this,n=this,r=n.nodes,a=n.nodeSize,u=n.rankdir,s=n.combos,c=n.begin,l=n.radial;if(r){var d,p=n.edges||[],v=new Mn.graphlib.Graph({multigraph:!0,compound:!0});d=a?i(a)?function(){return a}:function(){return[a,a]}:function(t){return t.size?i(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var g=b(n.ranksep,50,n.ranksepFunc),y=b(n.nodesep,50,n.nodesepFunc),m=y,_=g;"LR"!==u&&"RL"!==u||(m=g,_=y),v.setDefaultEdgeLabel((function(){return{}})),v.setGraph(n);var w={};r.filter((function(t){return!1!==t.layout})).forEach((function(e){var n=d(e),r=_(e),i=m(e),a=n[0]+2*i,u=n[1]+2*r,s=e.layer;o(s)?v.setNode(e.id,{width:a,height:u,layer:s}):v.setNode(e.id,{width:a,height:u}),t.sortByCombo&&e.comboId&&(w[e.comboId]||(w[e.comboId]=!0,v.setNode(e.comboId,{})),v.setParent(e.id,e.comboId))})),this.sortByCombo&&s&&s.forEach((function(t){t.parentId&&(w[t.parentId]||(w[t.parentId]=!0,v.setNode(t.parentId,{})),v.setParent(t.id,t.parentId))})),p.forEach((function(e){var n=h(e,"source"),r=h(e,"target");t.layoutNode(n)&&t.layoutNode(r)&&v.setEdge(n,r,{weight:e.weight||1})}));var x=void 0;n.preset&&(x=new Mn.graphlib.Graph({multigraph:!0,compound:!0}),n.preset.nodes.forEach((function(t){null==x||x.setNode(t.id,t)}))),Mn.layout(v,{prevGraph:x,edgeLabelSpace:n.edgeLabelSpace,keepNodeOrder:Boolean(!!n.nodeOrder),nodeOrder:n.nodeOrder});var E=[0,0];if(c){var S=1/0,A=1/0;v.nodes().forEach((function(t){var e=v.node(t);S>e.x&&(S=e.x),A>e.y&&(A=e.y)})),v.edges().forEach((function(t){v.edge(t).points.forEach((function(t){S>t.x&&(S=t.x),A>t.y&&(A=t.y)}))})),E[0]=c[0]-S,E[1]=c[1]-A}if(l){var T=this,I=T.focusNode,N=T.ranksep,k=T.getRadialPos,C=e(I)?I:null==I?void 0:I.id,O=C?v.node(C)._rank:0,D=[],R="LR"===u||"RL"===u,M=R?"y":"x",P=R?"height":"width",G=1/0,L=-1/0;v.nodes().forEach((function(t){var e=v.node(t),n=r.findIndex((function(e){return e.id===t}));if(r[n]){var i=y(r[n]);if(0===O)D[e._rank]||(D[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),D[e._rank].nodes.push(t),D[e._rank].totalWidth+=2*i+e[P],D[e._rank].maxSize<Math.max(e.width,e.height)&&(D[e._rank].maxSize=Math.max(e.width,e.height));else{var o=e._rank-O;if(0===o)D[o]||(D[o]={nodes:[],totalWidth:0,maxSize:-1/0}),D[o].nodes.push(t),D[o].totalWidth+=2*i+e[P],D[o].maxSize<Math.max(e.width,e.height)&&(D[o].maxSize=Math.max(e.width,e.height));else{var a=Math.abs(o);D[a]||(D[a]={left:[],right:[],totalWidth:0,maxSize:-1/0}),D[a].totalWidth+=2*i+e[P],D[a].maxSize<Math.max(e.width,e.height)&&(D[a].maxSize=Math.max(e.width,e.height)),o<0?D[a].left.push(t):D[a].right.push(t)}}var u=e[M]-e[P]/2-i,s=e[M]+e[P]/2+i;u<G&&(G=u),s>L&&(L=s)}}));var j=N||50,U={},B=(L-G)/.9,z=[.5*(G+L-B),.5*(G+L+B)],F=function(t,e,n,i){void 0===n&&(n=-1/0),void 0===i&&(i=[0,1]);var o=n;return t.forEach((function(t){var n=v.node(t);U[t]=e;var a=k(n[M],z,B,e,i),u=a.x,s=a.y,c=r.findIndex((function(e){return e.id===t}));if(r[c]){r[c].x=u+E[0],r[c].y=s+E[1],r[c]._order=n._order;var f=g(r[c]);o<f&&(o=f)}})),o},W=!0;D.forEach((function(t){var e,n,i,o,a,u,s;if((null===(e=null==t?void 0:t.nodes)||void 0===e?void 0:e.length)||(null===(n=null==t?void 0:t.left)||void 0===n?void 0:n.length)||(null===(i=null==t?void 0:t.right)||void 0===i?void 0:i.length)){if(W&&1===t.nodes.length){var c=r.findIndex((function(e){return e.id===t.nodes[0]}));return r[c].x=E[0],r[c].y=E[1],U[t.nodes[0]]=0,j=g(r[c]),void(W=!1)}j=Math.max(j,t.totalWidth/(2*Math.PI));var f=-1/0;if(0===O||(null===(o=t.nodes)||void 0===o?void 0:o.length))f=F(t.nodes,j,f,[0,1]);else{var l=(null===(a=t.left)||void 0===a?void 0:a.length)/((null===(u=t.left)||void 0===u?void 0:u.length)+(null===(s=t.right)||void 0===s?void 0:s.length));f=F(t.left,j,f,[0,l]),f=F(t.right,j,f,[l+.05,1])}j+=f,W=!1,t.maxSize}})),v.edges().forEach((function(t){var e,r,i=v.edge(t),o=p.findIndex((function(e){var n=h(e,"source"),r=h(e,"target");return n===t.v&&r===t.w}));if(n.edgeLabelSpace&&n.controlPoints&&"loop"!==p[o].type){var a="x"===M?"y":"x",u=i.points.slice(1,i.points.length-1),s=[],c=null===(e=v.node(t.v))||void 0===e?void 0:e[a],f=c-(null===(r=v.node(t.w))||void 0===r?void 0:r[a]),l=U[t.v],d=l-U[t.w];u.forEach((function(t){var e=(t[a]-c)/f*d+l,n=k(t[M],z,B,e);s.push({x:n.x+E[0],y:n.y+E[1]})})),p[o].controlPoints=s}}))}else v.nodes().forEach((function(t){var e=v.node(t),n=r.findIndex((function(e){return e.id===t}));r[n]&&(r[n].x=e.x+E[0],r[n].y=e.y+E[1],r[n]._order=e._order)})),v.edges().forEach((function(t){var e=v.edge(t),r=p.findIndex((function(e){var n=h(e,"source"),r=h(e,"target");return n===t.v&&r===t.w}));n.edgeLabelSpace&&n.controlPoints&&"loop"!==p[r].type&&(p[r].controlPoints=e.points.slice(1,e.points.length-1),p[r].controlPoints.forEach((function(t){t.x+=E[0],t.y+=E[1]})))}));return n.onLayoutEnd&&n.onLayoutEnd(),{nodes:r,edges:p}}},n.prototype.getRadialPos=function(t,e,n,r,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/n,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*r,y:Math.sin(a)*r}},n.prototype.getType=function(){return"dagre"},n}(t);const Ln={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function jn(t={},e=Ln){var n,r,i,o;const a=JSON.parse(JSON.stringify(e)),u=(null===(n=null==t?void 0:t.graph)||void 0===n?void 0:n.meta)||{},s=(null===(r=null==t?void 0:t.subScene)||void 0===r?void 0:r.meta)||{},c=(null===(i=null==t?void 0:t.nodeSize)||void 0===i?void 0:i.meta)||{},f=(null===(o=null==t?void 0:t.nodeSize)||void 0===o?void 0:o.node)||{},l=a.nodeSize.bridge;return{graph:{meta:Object.assign(a.graph.meta,u)},subScene:{meta:Object.assign(a.subScene.meta,s)},nodeSize:{meta:Object.assign(a.nodeSize.meta,c),node:Object.assign(a.nodeSize.node,f),bridge:l}}}function Un(t){return`◬${t}◬`}const Bn=Un("ROOT"),zn=Un("BRIDGE_GRAPH");var Fn,Wn,Vn,Hn;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(Fn||(Fn={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(Wn||(Wn={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(Vn||(Vn={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(Hn||(Hn={}));var Xn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function qn(t,e){return t(e={exports:{}},e.exports),e.exports}var Yn=function(t,e){return t===e||t!=t&&e!=e},Kn=function(t,e){for(var n=t.length;n--;)if(Yn(t[n][0],e))return n;return-1},$n=Array.prototype.splice;function Zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Zn.prototype.clear=function(){this.__data__=[],this.size=0},Zn.prototype.delete=function(t){var e=this.__data__,n=Kn(e,t);return!(n<0||(n==e.length-1?e.pop():$n.call(e,n,1),--this.size,0))},Zn.prototype.get=function(t){var e=this.__data__,n=Kn(e,t);return n<0?void 0:e[n][1]},Zn.prototype.has=function(t){return Kn(this.__data__,t)>-1},Zn.prototype.set=function(t,e){var n=this.__data__,r=Kn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Jn,Qn=Zn,tr="object"==typeof Xn&&Xn&&Xn.Object===Object&&Xn,er="object"==typeof self&&self&&self.Object===Object&&self,nr=tr||er||Function("return this")(),rr=nr.Symbol,ir=Object.prototype,or=ir.hasOwnProperty,ar=ir.toString,ur=rr?rr.toStringTag:void 0,sr=Object.prototype.toString,cr=rr?rr.toStringTag:void 0,fr=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":cr&&cr in Object(t)?function(t){var e=or.call(t,ur),n=t[ur];try{t[ur]=void 0;var r=!0}catch(t){}var i=ar.call(t);return r&&(e?t[ur]=n:delete t[ur]),i}(t):function(t){return sr.call(t)}(t)},lr=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},hr=function(t){if(!lr(t))return!1;var e=fr(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},dr=nr["__core-js_shared__"],pr=(Jn=/[^.]+$/.exec(dr&&dr.keys&&dr.keys.IE_PROTO||""))?"Symbol(src)_1."+Jn:"",vr=Function.prototype.toString,gr=function(t){if(null!=t){try{return vr.call(t)}catch(t){}try{return t+""}catch(t){}}return""},yr=/^\[object .+?Constructor\]$/,mr=Function.prototype,br=Object.prototype,_r=mr.toString,wr=br.hasOwnProperty,xr=RegExp("^"+_r.call(wr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Er=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!lr(t)||function(t){return!!pr&&pr in t}(t))&&(hr(t)?xr:yr).test(gr(t))}(n)?n:void 0},Sr=Er(nr,"Map"),Ar=Er(Object,"create"),Tr=Object.prototype.hasOwnProperty,Ir=Object.prototype.hasOwnProperty;function Nr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Nr.prototype.clear=function(){this.__data__=Ar?Ar(null):{},this.size=0},Nr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Nr.prototype.get=function(t){var e=this.__data__;if(Ar){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Tr.call(e,t)?e[t]:void 0},Nr.prototype.has=function(t){var e=this.__data__;return Ar?void 0!==e[t]:Ir.call(e,t)},Nr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ar&&void 0===e?"__lodash_hash_undefined__":e,this};var kr=Nr,Cr=function(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map};function Or(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Or.prototype.clear=function(){this.size=0,this.__data__={hash:new kr,map:new(Sr||Qn),string:new kr}},Or.prototype.delete=function(t){var e=Cr(this,t).delete(t);return this.size-=e?1:0,e},Or.prototype.get=function(t){return Cr(this,t).get(t)},Or.prototype.has=function(t){return Cr(this,t).has(t)},Or.prototype.set=function(t,e){var n=Cr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Dr=Or;function Rr(t){var e=this.__data__=new Qn(t);this.size=e.size}Rr.prototype.clear=function(){this.__data__=new Qn,this.size=0},Rr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Rr.prototype.get=function(t){return this.__data__.get(t)},Rr.prototype.has=function(t){return this.__data__.has(t)},Rr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Qn){var r=n.__data__;if(!Sr||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Dr(r)}return n.set(t,e),this.size=n.size,this};var Mr=Rr,Pr=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},Gr=function(){try{var t=Er(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Lr=function(t,e,n){"__proto__"==e&&Gr?Gr(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},jr=Object.prototype.hasOwnProperty,Ur=function(t,e,n){var r=t[e];jr.call(t,e)&&Yn(r,n)&&(void 0!==n||e in t)||Lr(t,e,n)},Br=function(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var u=e[o],s=r?r(n[u],t[u],u,n,t):void 0;void 0===s&&(s=t[u]),i?Lr(n,u,s):Ur(n,u,s)}return n},zr=function(t){return null!=t&&"object"==typeof t},Fr=function(t){return zr(t)&&"[object Arguments]"==fr(t)},Wr=Object.prototype,Vr=Wr.hasOwnProperty,Hr=Wr.propertyIsEnumerable,Xr=Fr(function(){return arguments}())?Fr:function(t){return zr(t)&&Vr.call(t,"callee")&&!Hr.call(t,"callee")},qr=Array.isArray,Yr=function(){return!1},Kr=qn((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n?nr.Buffer:void 0,o=(i?i.isBuffer:void 0)||Yr;t.exports=o})),$r=/^(?:0|[1-9]\d*)$/,Zr=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&$r.test(t))&&t>-1&&t%1==0&&t<e},Jr=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Qr={};Qr["[object Float32Array]"]=Qr["[object Float64Array]"]=Qr["[object Int8Array]"]=Qr["[object Int16Array]"]=Qr["[object Int32Array]"]=Qr["[object Uint8Array]"]=Qr["[object Uint8ClampedArray]"]=Qr["[object Uint16Array]"]=Qr["[object Uint32Array]"]=!0,Qr["[object Arguments]"]=Qr["[object Array]"]=Qr["[object ArrayBuffer]"]=Qr["[object Boolean]"]=Qr["[object DataView]"]=Qr["[object Date]"]=Qr["[object Error]"]=Qr["[object Function]"]=Qr["[object Map]"]=Qr["[object Number]"]=Qr["[object Object]"]=Qr["[object RegExp]"]=Qr["[object Set]"]=Qr["[object String]"]=Qr["[object WeakMap]"]=!1;var ti=function(t){return function(e){return t(e)}},ei=qn((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n&&tr.process,o=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o})),ni=ei&&ei.isTypedArray,ri=ni?ti(ni):function(t){return zr(t)&&Jr(t.length)&&!!Qr[fr(t)]},ii=Object.prototype.hasOwnProperty,oi=function(t,e){var n=qr(t),r=!n&&Xr(t),i=!n&&!r&&Kr(t),o=!n&&!r&&!i&&ri(t),a=n||r||i||o,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],s=u.length;for(var c in t)!e&&!ii.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Zr(c,s))||u.push(c);return u},ai=Object.prototype,ui=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ai)},si=function(t,e){return function(n){return t(e(n))}},ci=si(Object.keys,Object),fi=Object.prototype.hasOwnProperty,li=function(t){if(!ui(t))return ci(t);var e=[];for(var n in Object(t))fi.call(t,n)&&"constructor"!=n&&e.push(n);return e},hi=function(t){return null!=t&&Jr(t.length)&&!hr(t)},di=function(t){return hi(t)?oi(t):li(t)},pi=Object.prototype.hasOwnProperty,vi=function(t){return hi(t)?oi(t,!0):function(t){if(!lr(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=ui(t),n=[];for(var r in t)("constructor"!=r||!e&&pi.call(t,r))&&n.push(r);return n}(t)},gi=qn((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n?nr.Buffer:void 0,o=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=o?o(n):new t.constructor(n);return t.copy(r),r}})),yi=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e},mi=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o},bi=function(){return[]},_i=Object.prototype.propertyIsEnumerable,wi=Object.getOwnPropertySymbols,xi=wi?function(t){return null==t?[]:(t=Object(t),mi(wi(t),(function(e){return _i.call(t,e)})))}:bi,Ei=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t},Si=si(Object.getPrototypeOf,Object),Ai=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Ei(e,xi(t)),t=Si(t);return e}:bi,Ti=function(t,e,n){var r=e(t);return qr(t)?r:Ei(r,n(t))},Ii=function(t){return Ti(t,di,xi)},Ni=function(t){return Ti(t,vi,Ai)},ki=Er(nr,"DataView"),Ci=Er(nr,"Promise"),Oi=Er(nr,"Set"),Di=Er(nr,"WeakMap"),Ri=gr(ki),Mi=gr(Sr),Pi=gr(Ci),Gi=gr(Oi),Li=gr(Di),ji=fr;(ki&&"[object DataView]"!=ji(new ki(new ArrayBuffer(1)))||Sr&&"[object Map]"!=ji(new Sr)||Ci&&"[object Promise]"!=ji(Ci.resolve())||Oi&&"[object Set]"!=ji(new Oi)||Di&&"[object WeakMap]"!=ji(new Di))&&(ji=function(t){var e=fr(t),n="[object Object]"==e?t.constructor:void 0,r=n?gr(n):"";if(r)switch(r){case Ri:return"[object DataView]";case Mi:return"[object Map]";case Pi:return"[object Promise]";case Gi:return"[object Set]";case Li:return"[object WeakMap]"}return e});var Ui=ji,Bi=Object.prototype.hasOwnProperty,zi=nr.Uint8Array,Fi=function(t){var e=new t.constructor(t.byteLength);return new zi(e).set(new zi(t)),e},Wi=/\w*$/,Vi=rr?rr.prototype:void 0,Hi=Vi?Vi.valueOf:void 0,Xi=function(t,e){var n=e?Fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},qi=Object.create,Yi=function(){function t(){}return function(e){if(!lr(e))return{};if(qi)return qi(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),Ki=function(t){return"function"!=typeof t.constructor||ui(t)?{}:Yi(Si(t))},$i=ei&&ei.isMap,Zi=$i?ti($i):function(t){return zr(t)&&"[object Map]"==Ui(t)},Ji=ei&&ei.isSet,Qi=Ji?ti(Ji):function(t){return zr(t)&&"[object Set]"==Ui(t)},to={};to["[object Arguments]"]=to["[object Array]"]=to["[object ArrayBuffer]"]=to["[object DataView]"]=to["[object Boolean]"]=to["[object Date]"]=to["[object Float32Array]"]=to["[object Float64Array]"]=to["[object Int8Array]"]=to["[object Int16Array]"]=to["[object Int32Array]"]=to["[object Map]"]=to["[object Number]"]=to["[object Object]"]=to["[object RegExp]"]=to["[object Set]"]=to["[object String]"]=to["[object Symbol]"]=to["[object Uint8Array]"]=to["[object Uint8ClampedArray]"]=to["[object Uint16Array]"]=to["[object Uint32Array]"]=!0,to["[object Error]"]=to["[object Function]"]=to["[object WeakMap]"]=!1;var eo=function t(e,n,r,i,o,a){var u,s=1&n,c=2&n,f=4&n;if(r&&(u=o?r(e,i,o,a):r(e)),void 0!==u)return u;if(!lr(e))return e;var l=qr(e);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Bi.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!s)return yi(e,u)}else{var h=Ui(e),d="[object Function]"==h||"[object GeneratorFunction]"==h;if(Kr(e))return gi(e,s);if("[object Object]"==h||"[object Arguments]"==h||d&&!o){if(u=c||d?{}:Ki(e),!s)return c?function(t,e){return Br(t,Ai(t),e)}(e,function(t,e){return t&&Br(e,vi(e),t)}(u,e)):function(t,e){return Br(t,xi(t),e)}(e,function(t,e){return t&&Br(e,di(e),t)}(u,e))}else{if(!to[h])return o?e:{};u=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return Fi(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?Fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Xi(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,Wi.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return Hi?Object(Hi.call(t)):{}}(t)}}(e,h,s)}}a||(a=new Mr);var p=a.get(e);if(p)return p;a.set(e,u),Qi(e)?e.forEach((function(i){u.add(t(i,n,r,i,e,a))})):Zi(e)&&e.forEach((function(i,o){u.set(o,t(i,n,r,o,e,a))}));var v=l?void 0:(f?c?Ni:Ii:c?vi:di)(e);return Pr(v||e,(function(i,o){v&&(i=e[o=i]),Ur(u,o,t(i,n,r,o,e,a))})),u},no=function(t){return function(){return t}},ro=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),a=o.length;a--;){var u=o[++r];if(!1===e(i[u],u,i))break}return t},io=function(t,e){return t&&ro(t,e,di)},oo=function(t,e){return function(e,n){if(null==e)return e;if(!hi(e))return t(e,n);for(var r=e.length,i=-1,o=Object(e);++i<r&&!1!==n(o[i],i,o););return e}}(io),ao=function(t){return t},uo=function(t){return"function"==typeof t?t:ao},so=function(t,e){return(qr(t)?Pr:oo)(t,uo(e))},co=so,fo=function(t,e){var n=[];return oo(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n};function lo(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Dr;++e<n;)this.add(t[e])}lo.prototype.add=lo.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},lo.prototype.has=function(t){return this.__data__.has(t)};var ho=lo,po=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},vo=function(t,e){return t.has(e)},go=function(t,e,n,r,i,o){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var l=-1,h=!0,d=2&n?new ho:void 0;for(o.set(t,e),o.set(e,t);++l<u;){var p=t[l],v=e[l];if(r)var g=a?r(v,p,l,e,t,o):r(p,v,l,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!po(e,(function(t,e){if(!vo(d,e)&&(p===t||i(p,t,n,r,o)))return d.push(e)}))){h=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){h=!1;break}}return o.delete(t),o.delete(e),h},yo=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},mo=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},bo=rr?rr.prototype:void 0,_o=bo?bo.valueOf:void 0,wo=function(t,e,n,r,i,o,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new zi(t),new zi(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Yn(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=yo;case"[object Set]":var s=1&r;if(u||(u=mo),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=go(u(t),u(e),r,i,o,a);return a.delete(t),f;case"[object Symbol]":if(_o)return _o.call(t)==_o.call(e)}return!1},xo=Object.prototype.hasOwnProperty,Eo=Object.prototype.hasOwnProperty,So=function t(e,n,r,i,o){return e===n||(null==e||null==n||!zr(e)&&!zr(n)?e!=e&&n!=n:function(t,e,n,r,i,o){var a=qr(t),u=qr(e),s=a?"[object Array]":Ui(t),c=u?"[object Array]":Ui(e),f="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s),l="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),h=s==c;if(h&&Kr(t)){if(!Kr(e))return!1;a=!0,f=!1}if(h&&!f)return o||(o=new Mr),a||ri(t)?go(t,e,n,r,i,o):wo(t,e,s,n,r,i,o);if(!(1&n)){var d=f&&Eo.call(t,"__wrapped__"),p=l&&Eo.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new Mr),i(v,g,n,r,o)}}return!!h&&(o||(o=new Mr),function(t,e,n,r,i,o){var a=1&n,u=Ii(t),s=u.length;if(s!=Ii(e).length&&!a)return!1;for(var c=s;c--;){var f=u[c];if(!(a?f in e:xo.call(e,f)))return!1}var l=o.get(t),h=o.get(e);if(l&&h)return l==e&&h==t;var d=!0;o.set(t,e),o.set(e,t);for(var p=a;++c<s;){var v=t[f=u[c]],g=e[f];if(r)var y=a?r(g,v,f,e,t,o):r(v,g,f,t,e,o);if(!(void 0===y?v===g||i(v,g,n,r,o):y)){d=!1;break}p||(p="constructor"==f)}if(d&&!p){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o))}(e,n,r,i,t,o))},Ao=function(t){return t==t&&!lr(t)},To=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},Io=function(t){return"symbol"==typeof t||zr(t)&&"[object Symbol]"==fr(t)},No=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ko=/^\w*$/,Co=function(t,e){if(qr(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Io(t))||ko.test(t)||!No.test(t)||null!=e&&t in Object(e)};function Oo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Oo.Cache||Dr),n}Oo.Cache=Dr;var Do,Ro=Oo,Mo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Po=/\\(\\)?/g,Go=function(t){var e=Ro((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Mo,(function(t,n,r,i){e.push(r?i.replace(Po,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),Lo=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i},jo=rr?rr.prototype:void 0,Uo=jo?jo.toString:void 0,Bo=function t(e){if("string"==typeof e)return e;if(qr(e))return Lo(e,t)+"";if(Io(e))return Uo?Uo.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},zo=function(t){return null==t?"":Bo(t)},Fo=function(t,e){return qr(t)?t:Co(t,e)?[t]:Go(zo(t))},Wo=function(t){if("string"==typeof t||Io(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},Vo=function(t,e){for(var n=0,r=(e=Fo(e,t)).length;null!=t&&n<r;)t=t[Wo(e[n++])];return n&&n==r?t:void 0},Ho=function(t,e){return null!=t&&e in Object(t)},Xo=function(t,e,n){for(var r=-1,i=(e=Fo(e,t)).length,o=!1;++r<i;){var a=Wo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Jr(i)&&Zr(a,i)&&(qr(t)||Xr(t))},qo=function(t,e){return null!=t&&Xo(t,e,Ho)},Yo=function(t){return function(e){return null==e?void 0:e[t]}},Ko=function(t){return"function"==typeof t?t:null==t?ao:"object"==typeof t?qr(t)?function(t,e){return Co(t)&&Ao(e)?To(Wo(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:Vo(t,e);return void 0===r?void 0:r}(n,t);return void 0===r&&r===e?qo(n,t):So(e,r,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=di(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Ao(i)]}return e}(t);return 1==e.length&&e[0][2]?To(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var u=(a=n[i])[0],s=t[u],c=a[1];if(a[2]){if(void 0===s&&!(u in t))return!1}else{var f,l=new Mr;if(!(void 0===f?So(c,s,3,r,l):f))return!1}}return!0}(n,0,e)}}(t):function(t){return Co(t)?Yo(Wo(t)):function(t){return function(e){return Vo(e,t)}}(t)}(t)},$o=function(t,e){return(qr(t)?mi:fo)(t,Ko(e))},Zo=Object.prototype.hasOwnProperty,Jo=function(t,e){return null!=t&&Zo.call(t,e)},Qo=function(t,e){return null!=t&&Xo(t,e,Jo)},ta=Object.prototype.hasOwnProperty,ea=function(t){return void 0===t},na=function(t,e){var n=-1,r=hi(t)?Array(t.length):[];return oo(t,(function(t,i,o){r[++n]=e(t,i,o)})),r},ra=function(t,e){return(qr(t)?Lo:na)(t,Ko(e))},ia=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n},oa=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n},aa=function(t,e,n){var r=qr(t)?ia:oa,i=arguments.length<3;return r(t,Ko(e),n,i,oo)},ua=Yo("length"),sa=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),ca="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",fa="\\ud83c[\\udffb-\\udfff]",la="[^\\ud800-\\udfff]",ha="(?:\\ud83c[\\udde6-\\uddff]){2}",da="[\\ud800-\\udbff][\\udc00-\\udfff]",pa="(?:"+ca+"|"+fa+")?",va="[\\ufe0e\\ufe0f]?"+pa+"(?:\\u200d(?:"+[la,ha,da].join("|")+")[\\ufe0e\\ufe0f]?"+pa+")*",ga="(?:"+[la+ca+"?",ca,ha,da,"[\\ud800-\\udfff]"].join("|")+")",ya=RegExp(fa+"(?="+fa+")|"+ga+va,"g"),ma=rr?rr.isConcatSpreadable:void 0,ba=function(t){return qr(t)||Xr(t)||!!(ma&&t&&t[ma])},_a=function t(e,n,r,i,o){var a=-1,u=e.length;for(r||(r=ba),o||(o=[]);++a<u;){var s=e[a];n>0&&r(s)?n>1?t(s,n-1,r,i,o):Ei(o,s):i||(o[o.length]=s)}return o},wa=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},xa=Math.max,Ea=function(t,e,n){return e=xa(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=xa(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=r[i];return u[e]=n(a),wa(t,this,u)}},Sa=Gr?function(t,e){return Gr(t,"toString",{configurable:!0,enumerable:!1,value:no(e),writable:!0})}:ao,Aa=Date.now,Ta=function(t){var e=0,n=0;return function(){var r=Aa(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Sa),Ia=function(t,e){return Ta(Ea(t,e,ao),t+"")},Na=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1},ka=function(t){return t!=t},Ca=function(t,e){return!(null==t||!t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var r=-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e):Na(t,ka,0)}(t,e)>-1},Oa=Oi&&1/mo(new Oi([,-0]))[1]==1/0?function(t){return new Oi(t)}:function(){},Da=function(t){return zr(t)&&hi(t)},Ra=Ia((function(t){return function(t,e,n){var r=-1,i=Ca,o=t.length,a=!0,u=[],s=u;if(o>=200){var c=Oa(t);if(c)return mo(c);a=!1,i=vo,s=new ho}else s=u;t:for(;++r<o;){var f=t[r],l=f;if(f=0!==f?f:0,a&&l==l){for(var h=s.length;h--;)if(s[h]===l)continue t;u.push(f)}else i(s,l,n)||(s!==u&&s.push(l),u.push(f))}return u}(_a(t,1,Da,!0))})),Ma=function(t){return null==t?[]:function(t,e){return Lo(e,(function(e){return t[e]}))}(t,di(t))};try{Do={clone:function(t){return eo(t,4)},constant:no,each:co,filter:$o,has:Qo,isArray:qr,isEmpty:function(t){if(null==t)return!0;if(hi(t)&&(qr(t)||"string"==typeof t||"function"==typeof t.splice||Kr(t)||ri(t)||Xr(t)))return!t.length;var e=Ui(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(ui(t))return!li(t).length;for(var n in t)if(ta.call(t,n))return!1;return!0},isFunction:hr,isUndefined:ea,keys:di,map:ra,reduce:aa,size:function(t){if(null==t)return 0;if(hi(t))return function(t){return"string"==typeof t||!qr(t)&&zr(t)&&"[object String]"==fr(t)}(t)?function(t){return function(t){return sa.test(t)}(t)?function(t){for(var e=ya.lastIndex=0;ya.test(t);)++e;return e}(t):ua(t)}(t):t.length;var e=Ui(t);return"[object Map]"==e||"[object Set]"==e?t.size:li(t).length},transform:function(t,e,n){var r=qr(t),i=r||Kr(t)||ri(t);if(e=Ko(e),null==n){var o=t&&t.constructor;n=i?r?new o:[]:lr(t)&&hr(o)?Yi(Si(t)):{}}return(i?Pr:io)(t,(function(t,r,i){return e(n,t,r,i)})),n},union:Ra,values:Ma}}catch(Ln){}Do||(Do=window._);var Pa=Do,Ga=La;function La(t){this._isDirected=!Pa.has(t,"directed")||t.directed,this._isMultigraph=!!Pa.has(t,"multigraph")&&t.multigraph,this._isCompound=!!Pa.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=Pa.constant(void 0),this._defaultEdgeLabelFn=Pa.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function ja(t,e){t[e]?t[e]++:t[e]=1}function Ua(t,e){--t[e]||delete t[e]}function Ba(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}return i+""+o+""+(Pa.isUndefined(r)?"\0":r)}function za(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var u={v:i,w:o};return r&&(u.name=r),u}function Fa(t,e){return Ba(t,e.v,e.w,e.name)}La.prototype._nodeCount=0,La.prototype._edgeCount=0,La.prototype.isDirected=function(){return this._isDirected},La.prototype.isMultigraph=function(){return this._isMultigraph},La.prototype.isCompound=function(){return this._isCompound},La.prototype.setGraph=function(t){return this._label=t,this},La.prototype.graph=function(){return this._label},La.prototype.setDefaultNodeLabel=function(t){return Pa.isFunction(t)||(t=Pa.constant(t)),this._defaultNodeLabelFn=t,this},La.prototype.nodeCount=function(){return this._nodeCount},La.prototype.nodes=function(){return Pa.keys(this._nodes)},La.prototype.sources=function(){var t=this;return Pa.filter(this.nodes(),(function(e){return Pa.isEmpty(t._in[e])}))},La.prototype.sinks=function(){var t=this;return Pa.filter(this.nodes(),(function(e){return Pa.isEmpty(t._out[e])}))},La.prototype.setNodes=function(t,e){var n=arguments,r=this;return Pa.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},La.prototype.setNode=function(t,e){return Pa.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},La.prototype.node=function(t){return this._nodes[t]},La.prototype.hasNode=function(t){return Pa.has(this._nodes,t)},La.prototype.removeNode=function(t){var e=this;if(Pa.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Pa.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),Pa.each(Pa.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],Pa.each(Pa.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},La.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Pa.isUndefined(e))e="\0";else{for(var n=e+="";!Pa.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},La.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},La.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},La.prototype.children=function(t){if(Pa.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return Pa.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},La.prototype.predecessors=function(t){var e=this._preds[t];if(e)return Pa.keys(e)},La.prototype.successors=function(t){var e=this._sucs[t];if(e)return Pa.keys(e)},La.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return Pa.union(e,this.successors(t))},La.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},La.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Pa.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),Pa.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var o=n.parent(t);return void 0===o||e.hasNode(o)?(r[t]=o,o):o in r?r[o]:i(o)}return this._isCompound&&Pa.each(e.nodes(),(function(t){e.setParent(t,i(t))})),e},La.prototype.setDefaultEdgeLabel=function(t){return Pa.isFunction(t)||(t=Pa.constant(t)),this._defaultEdgeLabelFn=t,this},La.prototype.edgeCount=function(){return this._edgeCount},La.prototype.edges=function(){return Pa.values(this._edgeObjs)},La.prototype.setPath=function(t,e){var n=this,r=arguments;return Pa.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},La.prototype.setEdge=function(){var t,e,n,r,i=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(t=o.v,e=o.w,n=o.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=o,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,Pa.isUndefined(n)||(n=""+n);var a=Ba(this._isDirected,t,e,n);if(Pa.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=r),this;if(!Pa.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?r:this._defaultEdgeLabelFn(t,e,n);var u=za(this._isDirected,t,e,n);return t=u.v,e=u.w,Object.freeze(u),this._edgeObjs[a]=u,ja(this._preds[e],t),ja(this._sucs[t],e),this._in[e][a]=u,this._out[t][a]=u,this._edgeCount++,this},La.prototype.edge=function(t,e,n){var r=1===arguments.length?Fa(this._isDirected,arguments[0]):Ba(this._isDirected,t,e,n);return this._edgeLabels[r]},La.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?Fa(this._isDirected,arguments[0]):Ba(this._isDirected,t,e,n);return Pa.has(this._edgeLabels,r)},La.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?Fa(this._isDirected,arguments[0]):Ba(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],Ua(this._preds[e],t),Ua(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},La.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=Pa.values(n);return e?Pa.filter(r,(function(t){return t.v===e})):r}},La.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=Pa.values(n);return e?Pa.filter(r,(function(t){return t.w===e})):r}},La.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var Wa={Graph:Ga,version:"2.1.8"},Va={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Ha(t),edges:Xa(t)};return Pa.isUndefined(t.graph())||(e.value=Pa.clone(t.graph())),e},read:function(t){var e=new Ga(t.options).setGraph(t.value);return Pa.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),Pa.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function Ha(t){return Pa.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return Pa.isUndefined(n)||(i.value=n),Pa.isUndefined(r)||(i.parent=r),i}))}function Xa(t){return Pa.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return Pa.isUndefined(e.name)||(r.name=e.name),Pa.isUndefined(n)||(r.value=n),r}))}var qa=Ya;function Ya(){this._arr=[],this._keyIndices={}}Ya.prototype.size=function(){return this._arr.length},Ya.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},Ya.prototype.has=function(t){return Pa.has(this._keyIndices,t)},Ya.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},Ya.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Ya.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!Pa.has(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1},Ya.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},Ya.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},Ya.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},Ya.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},Ya.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e};var Ka=function(t,e,n,r){return function(t,e,n,r){var i,o,a={},u=new qa,s=function(t){var e=t.v!==i?t.v:t.w,r=a[e],s=n(t),c=o.distance+s;if(s<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+s);c<r.distance&&(r.distance=c,r.predecessor=i,u.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;a[t]={distance:n},u.add(t,n)}));u.size()>0&&(i=u.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(s);return a}(t,String(e),n||$a,r||function(e){return t.outEdges(e)})},$a=Pa.constant(1),Za=function(t){var e=0,n=[],r={},i=[];function o(a){var u=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){Pa.has(r,t)?r[t].onStack&&(u.lowlink=Math.min(u.lowlink,r[t].index)):(o(t),u.lowlink=Math.min(u.lowlink,r[t].lowlink))})),u.lowlink===u.index){var s,c=[];do{s=n.pop(),r[s].onStack=!1,c.push(s)}while(a!==s);i.push(c)}}return t.nodes().forEach((function(t){Pa.has(r,t)||o(t)})),i},Ja=Pa.constant(1),Qa=tu;function tu(t){var e={},n={},r=[];if(Pa.each(t.sinks(),(function i(o){if(Pa.has(n,o))throw new eu;Pa.has(e,o)||(n[o]=!0,e[o]=!0,Pa.each(t.predecessors(o),i),delete n[o],r.push(o))})),Pa.size(e)!==t.nodeCount())throw new eu;return r}function eu(){}tu.CycleException=eu,eu.prototype=new Error;var nu=function(t,e,n){Pa.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],o={};return Pa.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);ru(t,e,"post"===n,o,r,i)})),i};function ru(t,e,n,r,i,o){Pa.has(r,e)||(r[e]=!0,n||o.push(e),Pa.each(i(e),(function(e){ru(t,e,n,r,i,o)})),n&&o.push(e))}var iu,ou={Graph:Wa.Graph,json:Va,alg:{components:function(t){var e,n={},r=[];function i(r){Pa.has(n,r)||(n[r]=!0,e.push(r),Pa.each(t.successors(r),i),Pa.each(t.predecessors(r),i))}return Pa.each(t.nodes(),(function(t){e=[],i(t),e.length&&r.push(e)})),r},dijkstra:Ka,dijkstraAll:function(t,e,n){return Pa.transform(t.nodes(),(function(r,i){r[i]=Ka(t,i,e,n)}),{})},findCycles:function(t){return Pa.filter(Za(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))},floydWarshall:function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],u=r.distance+i.distance;u<a.distance&&(a.distance=u,a.predecessor=i.predecessor)}))}))})),r}(t,e||Ja,n||function(e){return t.outEdges(e)})},isAcyclic:function(t){try{Qa(t)}catch(t){if(t instanceof Qa.CycleException)return!1;throw t}return!0},postorder:function(t,e){return nu(t,e,"post")},preorder:function(t,e){return nu(t,e,"pre")},prim:function(t,e){var n,r=new Ga,i={},o=new qa;function a(t){var r=t.v===n?t.w:t.v,a=o.priority(r);if(void 0!==a){var u=e(t);u<a&&(i[r]=n,o.decrease(r,u))}}if(0===t.nodeCount())return r;Pa.each(t.nodes(),(function(t){o.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),o.decrease(t.nodes()[0],0);for(var u=!1;o.size()>0;){if(n=o.removeMin(),Pa.has(i,n))r.setEdge(n,i[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(a)}return r},tarjan:Za,topsort:Qa},version:Wa.version};try{iu=ou}catch(Ln){}iu||(iu=window.graphlib);var au,uu=iu,su=function(t,e,n){if(!lr(n))return!1;var r=typeof e;return!!("number"==r?hi(n)&&Zr(e,n.length):"string"==r&&e in n)&&Yn(n[e],t)},cu=Object.prototype,fu=cu.hasOwnProperty,lu=Ia((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&su(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=vi(o),u=-1,s=a.length;++u<s;){var c=a[u],f=t[c];(void 0===f||Yn(f,cu[c])&&!fu.call(t,c))&&(t[c]=o[c])}return t})),hu=/^\s+|\s+$/g,du=/^[-+]0x[0-9a-f]+$/i,pu=/^0b[01]+$/i,vu=/^0o[0-7]+$/i,gu=parseInt,yu=function(t){return t?1/0===(t=function(t){if("number"==typeof t)return t;if(Io(t))return NaN;if(lr(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=lr(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(hu,"");var n=pu.test(t);return n||vu.test(t)?gu(t.slice(2),n?2:8):du.test(t)?NaN:+t}(t))||-1/0===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},mu=Math.max,bu=function(t,e,n){var r=Object(t);if(!hi(t)){var i=Ko(e);t=di(t),e=function(t){return i(r[t],t,r)}}var o=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:function(t){var e=yu(t),n=e%1;return e==e?n?e-n:e:0}(n);return i<0&&(i=mu(r+i,0)),Na(t,Ko(e),i)}(t,e,n);return o>-1?r[i?t[o]:o]:void 0},_u=function(t){return null!=t&&t.length?_a(t,1):[]},wu=function(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(null!=a&&(void 0===u?a==a&&!Io(a):n(a,u)))var u=a,s=o}return s},xu=function(t,e){return t>e},Eu=function(t,e,n){(void 0!==n&&!Yn(t[e],n)||void 0===n&&!(e in t))&&Lr(t,e,n)},Su=Function.prototype,Au=Object.prototype,Tu=Su.toString,Iu=Au.hasOwnProperty,Nu=Tu.call(Object),ku=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},Cu=function t(e,n,r,i,o){e!==n&&ro(n,(function(a,u){if(o||(o=new Mr),lr(a))!function(t,e,n,r,i,o,a){var u=ku(t,n),s=ku(e,n),c=a.get(s);if(c)Eu(t,n,c);else{var f=o?o(u,s,n+"",t,e,a):void 0,l=void 0===f;if(l){var h=qr(s),d=!h&&Kr(s),p=!h&&!d&&ri(s);f=s,h||d||p?qr(u)?f=u:Da(u)?f=yi(u):d?(l=!1,f=gi(s,!0)):p?(l=!1,f=Xi(s,!0)):f=[]:function(t){if(!zr(t)||"[object Object]"!=fr(t))return!1;var e=Si(t);if(null===e)return!0;var n=Iu.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Tu.call(n)==Nu}(s)||Xr(s)?(f=u,Xr(u)?f=function(t){return Br(t,vi(t))}(u):lr(u)&&!hr(u)||(f=Ki(s))):l=!1}l&&(a.set(s,f),i(f,s,r,o,a),a.delete(s)),Eu(t,n,f)}}(e,n,u,r,t,i,o);else{var s=i?i(ku(e,u),a,u+"",e,n,o):void 0;void 0===s&&(s=a),Eu(e,u,s)}}),vi)},Ou=function(t){return Ia((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&su(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r)}return e}))}((function(t,e,n){Cu(t,e,n)})),Du=function(t,e){return t<e},Ru=function(t,e,n,r){if(!lr(t))return t;for(var i=-1,o=(e=Fo(e,t)).length,a=o-1,u=t;null!=u&&++i<o;){var s=Wo(e[i]),c=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return t;if(i!=a){var f=u[s];void 0===(c=r?r(f,s,u):void 0)&&(c=lr(f)?f:Zr(e[i+1])?[]:{})}Ur(u,s,c),u=u[s]}return t},Mu=function(t){return Ta(Ea(t,void 0,_u),t+"")}((function(t,e){return null==t?{}:function(t,e){return function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],u=Vo(t,a);n(0,a)&&Ru(o,Fo(a,t),u)}return o}(t,e,(function(e,n){return qo(t,n)}))}(t,e)})),Pu=Math.ceil,Gu=Math.max,Lu=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Io(t),a=void 0!==e,u=null===e,s=e==e,c=Io(e);if(!u&&!c&&!o&&t>e||o&&a&&s&&!u&&!c||r&&a&&s||!n&&s||!i)return 1;if(!r&&!o&&!c&&t<e||c&&n&&i&&!r&&!o||u&&n&&i||!a&&i||!s)return-1}return 0},ju=Ia((function(t,e){if(null==t)return[];var n=e.length;return n>1&&su(t,e[0],e[1])?e=[]:n>2&&su(e[0],e[1],e[2])&&(e=[e[0]]),function(t,e,n){e=e.length?Lo(e,(function(t){return qr(t)?function(e){return Vo(e,1===t.length?t[0]:t)}:t})):[ao];var r=-1;e=Lo(e,ti(Ko));var i=na(t,(function(t,n,i){return{criteria:Lo(e,(function(e){return e(t)})),index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,u=n.length;++r<a;){var s=Lu(i[r],o[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}(t,_a(e,1),[])})),Uu=0;try{au={cloneDeep:function(t){return eo(t,5)},constant:no,defaults:lu,each:co,filter:$o,find:bu,flatten:_u,forEach:so,forIn:function(t,e){return null==t?t:ro(t,uo(e),vi)},has:Qo,isUndefined:ea,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:ra,mapValues:function(t,e){var n={};return e=Ko(e),io(t,(function(t,r,i){Lr(n,r,e(t,r,i))})),n},max:function(t){return t&&t.length?wu(t,ao,xu):void 0},merge:Ou,min:function(t){return t&&t.length?wu(t,ao,Du):void 0},minBy:function(t,e){return t&&t.length?wu(t,Ko(e),Du):void 0},now:function(){return nr.Date.now()},pick:Mu,range:function(t,e,n){return n&&"number"!=typeof n&&su(t,e,n)&&(e=n=void 0),t=yu(t),void 0===e?(e=t,t=0):e=yu(e),function(t,e,n,r){for(var i=-1,o=Gu(Pu((e-t)/(n||1)),0),a=Array(o);o--;)a[++i]=t,t+=n;return a}(t,e,n=void 0===n?t<e?1:-1:yu(n))},reduce:aa,sortBy:ju,uniqueId:function(t){var e=++Uu;return zo(t)+e},values:Ma,zipObject:function(t,e){return function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var u=r<o?e[r]:void 0;n(a,t[r],u)}return a}(t||[],e||[],Ur)}}}catch(Ln){}au||(au=window._);var Bu=au,zu=Fu;function Fu(){var t={};t._next=t._prev=t,this._sentinel=t}function Wu(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Vu(t,e){if("_next"!==t&&"_prev"!==t)return e}Fu.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return Wu(e),e},Fu.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&Wu(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},Fu.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,Vu)),n=n._prev;return"["+t.join(", ")+"]"};var Hu=uu.Graph,Xu=Bu.constant(1);function qu(t,e,n,r,i){var o=i?[]:void 0;return Bu.forEach(t.inEdges(r.v),(function(r){var a=t.edge(r),u=t.node(r.v);i&&o.push({v:r.v,w:r.w}),u.out-=a,Yu(e,n,u)})),Bu.forEach(t.outEdges(r.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,Yu(e,n,a)})),t.removeNode(r.v),o}function Yu(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var Ku=uu.Graph,$u={addDummyNode:Zu,simplify:function(t){var e=(new Ku).setGraph(t.graph());return Bu.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),Bu.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new Ku({multigraph:t.isMultigraph()}).setGraph(t.graph());return Bu.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),Bu.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=Bu.map(t.nodes(),(function(e){var n={};return Bu.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return Bu.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=Bu.map(t.nodes(),(function(e){var n={};return Bu.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return Bu.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,u=e.y-o,s=t.width/2,c=t.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=Bu.map(Bu.range(Ju(t)+1),(function(){return[]}));return Bu.forEach(t.nodes(),(function(n){var r=t.node(n),i=r.rank;Bu.isUndefined(i)||(e[i][r.order]=n)})),e},normalizeRanks:function(t){var e=Bu.min(Bu.map(t.nodes(),(function(e){return t.node(e).rank})));Bu.forEach(t.nodes(),(function(n){var r=t.node(n);Bu.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=Bu.min(Bu.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];Bu.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var r=0,i=t.graph().nodeRankFactor;Bu.forEach(n,(function(e,n){Bu.isUndefined(e)&&n%i!=0?--r:r&&Bu.forEach(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Zu(t,"border",i,e)},maxRank:Ju,partition:function(t,e){var n={lhs:[],rhs:[]};return Bu.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=Bu.now();try{return e()}finally{console.log(t+" time: "+(Bu.now()-n)+"ms")}},notime:function(t,e){return e()}};function Zu(t,e,n,r){var i;do{i=Bu.uniqueId(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function Ju(t){return Bu.max(Bu.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!Bu.isUndefined(n))return n})))}var Qu=function(t){var e={};Bu.forEach(t.sources(),(function n(r){var i=t.node(r);if(Bu.has(e,r))return i.rank;e[r]=!0;var o=Bu.min(Bu.map(t.outEdges(r),(function(e){return n(e.w)-t.edge(e).minlen})));return o!==Number.POSITIVE_INFINITY&&null!=o||(o=0),i.rank=o}))},ts=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},es=uu.Graph,ns=ts,rs=function(t){var e,n,r=new es({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});is(r,t)<o;)e=os(r,t),n=r.hasNode(e.v)?ns(t,e):-ns(t,e),as(r,t,n);return r};function is(t,e){return Bu.forEach(t.nodes(),(function n(r){Bu.forEach(e.nodeEdges(r),(function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||ns(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()}function os(t,e){return Bu.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return ns(e,n)}))}function as(t,e,n){Bu.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}var us=ts,ss=Qu,cs=uu.alg.preorder,fs=uu.alg.postorder,ls=$u.simplify,hs=ds;function ds(t){t=ls(t),ss(t);var e,n=rs(t);for(gs(n),ps(n,t);e=ms(n);)_s(n,t,e,bs(n,t,e))}function ps(t,e){var n=fs(t,t.nodes());n=n.slice(0,n.length-1),Bu.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=vs(t,e,n)}(t,e,n)}))}function vs(t,e,n){var r=t.node(n).parent,i=!0,o=e.edge(n,r),a=0;return o||(i=!1,o=e.edge(r,n)),a=o.weight,Bu.forEach(e.nodeEdges(n),(function(o){var u,s,c=o.v===n,f=c?o.w:o.v;if(f!==r){var l=c===i,h=e.edge(o).weight;if(a+=l?h:-h,u=n,s=f,t.hasEdge(u,s)){var d=t.edge(n,f).cutvalue;a+=l?-d:d}}})),a}function gs(t,e){arguments.length<2&&(e=t.nodes()[0]),ys(t,{},1,e)}function ys(t,e,n,r,i){var o=n,a=t.node(r);return e[r]=!0,Bu.forEach(t.neighbors(r),(function(i){Bu.has(e,i)||(n=ys(t,e,n,i,r))})),a.low=o,a.lim=n++,i?a.parent=i:delete a.parent,n}function ms(t){return Bu.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function bs(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var o=t.node(r),a=t.node(i),u=o,s=!1;o.lim>a.lim&&(u=a,s=!0);var c=Bu.filter(e.edges(),(function(e){return s===ws(0,t.node(e.v),u)&&s!==ws(0,t.node(e.w),u)}));return Bu.minBy(c,(function(t){return us(e,t)}))}function _s(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),gs(t),ps(t,e),function(t,e){var n=Bu.find(t.nodes(),(function(t){return!e.node(t).parent})),r=cs(t,n);r=r.slice(1),Bu.forEach(r,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function ws(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}ds.initLowLimValues=gs,ds.initCutValues=ps,ds.calcCutValue=vs,ds.leaveEdge=ms,ds.enterEdge=bs,ds.exchangeEdges=_s;var xs=Qu,Es=xs;var Ss=function(t){var e=$u.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var o=t.children(r);o&&o.length&&Bu.forEach(o,(function(t){n(t,i+1)})),e[r]=i}return Bu.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=Bu.max(Bu.values(n))-1,i=2*r+1;t.graph().nestingRoot=e,Bu.forEach(t.edges(),(function(e){t.edge(e).minlen*=i}));var o=function(t){return Bu.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;Bu.forEach(t.children(),(function(a){As(t,e,i,o,r,n,a)})),t.graph().nodeRankFactor=i};function As(t,e,n,r,i,o,a){var u=t.children(a);if(u.length){var s=$u.addBorderNode(t,"_bt"),c=$u.addBorderNode(t,"_bb"),f=t.node(a);t.setParent(s,a),f.borderTop=s,t.setParent(c,a),f.borderBottom=c,Bu.forEach(u,(function(u){As(t,e,n,r,i,o,u);var f=t.node(u),l=f.borderTop?f.borderTop:u,h=f.borderBottom?f.borderBottom:u,d=f.borderTop?r:2*r,p=l!==h?1:i-o[a]+1;t.setEdge(s,l,{weight:d,minlen:p,nestingEdge:!0}),t.setEdge(h,c,{weight:d,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,s,{weight:0,minlen:i+o[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}function Ts(t,e,n,r,i,o){var a={width:0,height:0,rank:o,borderType:e},u=i[e][o-1],s=$u.addDummyNode(t,"border",a,n);i[e][o]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})}function Is(t){Bu.forEach(t.nodes(),(function(e){Ns(t.node(e))})),Bu.forEach(t.edges(),(function(e){Ns(t.edge(e))}))}function Ns(t){var e=t.width;t.width=t.height,t.height=e}function ks(t){t.y=-t.y}function Cs(t){var e=t.x;t.x=t.y,t.y=e}var Os=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=Ds(t,e[r-1],e[r]);return n};function Ds(t,e,n){for(var r=Bu.zipObject(n,Bu.map(n,(function(t,e){return e}))),i=Bu.flatten(Bu.map(e,(function(e){return Bu.sortBy(Bu.map(t.outEdges(e),(function(e){return{pos:r[e.w],weight:t.edge(e).weight}})),"pos")})),!0),o=1;o<n.length;)o<<=1;var a=2*o-1;o-=1;var u=Bu.map(new Array(a),(function(){return 0})),s=0;return Bu.forEach(i.forEach((function(t){var e=t.pos+o;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;s+=t.weight*n}))),s}function Rs(t,e,n){for(var r;e.length&&(r=Bu.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var Ms=function t(e,n,r,i){var o=e.children(n),a=e.node(n),u=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};u&&(o=Bu.filter(o,(function(t){return t!==u&&t!==s})));var f=function(t,e){return Bu.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=Bu.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,o);Bu.forEach(f,(function(n){if(e.children(n.v).length){var o=t(e,n.v,r,i);c[n.v]=o,Bu.has(o,"barycenter")&&(a=n,u=o,Bu.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u}));var l=function(t,e){var n={};return Bu.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};Bu.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),Bu.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];Bu.isUndefined(e)||Bu.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(Bu.isUndefined(e.barycenter)||Bu.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var i=t.pop();e.push(i),Bu.forEach(i.in.reverse(),n(i)),Bu.forEach(i.out,r(i))}return Bu.map(Bu.filter(e,(function(t){return!t.merged})),(function(t){return Bu.pick(t,["vs","i","barycenter","weight"])}))}(Bu.filter(n,(function(t){return!t.indegree})))}(f,r);!function(t,e){Bu.forEach(t,(function(t){t.vs=Bu.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(l,c);var h=function(t,e){var n,r=$u.partition(t,(function(t){return Bu.has(t,"barycenter")})),i=r.lhs,o=Bu.sortBy(r.rhs,(function(t){return-t.i})),a=[],u=0,s=0,c=0;i.sort((n=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:n?e.i-t.i:t.i-e.i})),c=Rs(a,o,c),Bu.forEach(i,(function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=Rs(a,o,c)}));var f={vs:Bu.flatten(a,!0)};return s&&(f.barycenter=u/s,f.weight=s),f}(l,i);if(u&&(h.vs=Bu.flatten([u,h.vs,s],!0),e.predecessors(u).length)){var d=e.node(e.predecessors(u)[0]),p=e.node(e.predecessors(s)[0]);Bu.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+d.order+p.order)/(h.weight+2),h.weight+=2}return h},Ps=uu.Graph,Gs=uu.Graph;function Ls(t,e,n){return Bu.map(e,(function(e){return function(t,e,n){var r=function(t){for(var e;t.hasNode(e=Bu.uniqueId("_root")););return e}(t),i=new Ps({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return Bu.forEach(t.nodes(),(function(o){var a=t.node(o),u=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||r),Bu.forEach(t[n](o),(function(e){var n=e.v===o?e.w:e.v,r=i.edge(n,o),a=Bu.isUndefined(r)?0:r.weight;i.setEdge(n,o,{weight:t.edge(e).weight+a})})),Bu.has(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),i}(t,e,n)}))}function js(t,e){var n=new Gs;Bu.forEach(t,(function(t){var r=t.graph().root,i=Ms(t,r,n,e);Bu.forEach(i.vs,(function(e,n){t.node(e).order=n})),function(t,e,n){var r,i={};Bu.forEach(n,(function(n){for(var o,a,u=t.parent(n);u;){if((o=t.parent(u))?(a=i[o],i[o]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=o}}))}(t,n,i.vs)}))}function Us(t,e){Bu.forEach(e,(function(e){Bu.forEach(e,(function(e,n){t.node(e).order=n}))}))}var Bs=uu.Graph;function zs(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function Fs(t,e,n){if(e>n){var r=e;e=n,n=r}return Bu.has(t[e],n)}var Ws=$u.normalizeRanks,Vs=$u.removeEmptyRanks,Hs=$u,Xs=uu.Graph,qs=["nodesep","edgesep","ranksep","marginx","marginy"],Ys={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ks=["acyclicer","ranker","rankdir","align"],$s=["width","height"],Zs={width:0,height:0},Js=["minlen","weight","width","height","labeloffset"],Qs={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},tc=["labelpos"];function ec(t,e){return Bu.mapValues(Bu.pick(t,e),Number)}function nc(t){var e={};return Bu.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}var rc=uu.Graph,ic={graphlib:uu,layout:function(t,e){var n=e&&e.debugTiming?Hs.time:Hs.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new Xs({multigraph:!0,compound:!0}),n=nc(t.graph());return e.setGraph(Bu.merge({},Ys,ec(n,qs),Bu.pick(n,Ks))),Bu.forEach(t.nodes(),(function(n){var r=nc(t.node(n));e.setNode(n,Bu.defaults(ec(r,$s),Zs)),e.setParent(n,t.parent(n))})),Bu.forEach(t.edges(),(function(n){var r=nc(t.edge(n));e.setEdge(n,Bu.merge({},Qs,ec(r,Js),Bu.pick(r,tc)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,Bu.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){Bu.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new Hu,r=0,i=0;Bu.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),Bu.forEach(t.edges(),(function(t){var o=n.edge(t.v,t.w)||0,a=e(t),u=o+a;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));var o=Bu.range(i+r+3).map((function(){return new zu})),a=r+1;return Bu.forEach(n.nodes(),(function(t){Yu(o,a,n.node(t))})),{graph:n,buckets:o,zeroIdx:a}}(t,e||Xu),r=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)qu(t,e,n,r);for(;r=o.dequeue();)qu(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(qu(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return Bu.flatten(Bu.map(r,(function(e){return t.outEdges(e.v,e.w)})),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return Bu.forEach(t.nodes(),(function i(o){Bu.has(r,o)||(r[o]=!0,n[o]=!0,Bu.forEach(t.outEdges(o),(function(t){Bu.has(n,t.w)?e.push(t):i(t.w)})),delete n[o])})),e}(t);Bu.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,Bu.uniqueId("rev"))}))}(t)})),e(" nestingGraph.run",(function(){Ss(t)})),e(" rank",(function(){!function(t){switch(t.graph().ranker){default:!function(t){hs(t)}(t);break;case"tight-tree":!function(t){xs(t),rs(t)}(t);break;case"longest-path":Es(t)}}(Hs.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){Bu.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};Hs.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){Vs(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Bu.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){Ws(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;Bu.forEach(t.nodes(),(function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Bu.max(e,r.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){Bu.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){!function(t){t.graph().dummyChains=[],Bu.forEach(t.edges(),(function(e){!function(t,e){var n,r,i,o=e.v,a=t.node(o).rank,u=e.w,s=t.node(u).rank,c=e.name,f=t.edge(e),l=f.labelRank;if(s!==a+1){for(t.removeEdge(e),i=0,++a;a<s;++i,++a)f.points=[],r={width:0,height:0,edgeLabel:f,edgeObj:e,rank:a},n=$u.addDummyNode(t,"edge",r,"_d"),a===l&&(r.width=f.width,r.height=f.height,r.dummy="edge-label",r.labelpos=f.labelpos),t.setEdge(o,n,{weight:f.weight},c),0===i&&t.graph().dummyChains.push(n),o=n;t.setEdge(o,u,{weight:f.weight},c)}}(t,e)}))}(t)})),e(" parentDummyChains",(function(){!function(t){var e=function(t){var e={},n=0;return Bu.forEach(t.children(),(function r(i){var o=n;Bu.forEach(t.children(i),r),e[i]={low:o,lim:n++}})),e}(t);Bu.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>s||c>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)u.push(i);return{path:a.concat(u.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,u=o.lca,s=0,c=a[s],f=!0;n!==i.w;){if(r=t.node(n),f){for(;(c=a[s])!==u&&t.node(c).maxRank<r.rank;)s++;c===u&&(f=!1)}if(!f){for(;s<a.length-1&&t.node(c=a[s+1]).minRank<=r.rank;)s++;c=a[s]}t.setParent(n,c),n=t.successors(n)[0]}}))}(t)})),e(" addBorderSegments",(function(){!function(t){Bu.forEach(t.children(),(function e(n){var r=t.children(n),i=t.node(n);if(r.length&&Bu.forEach(r,e),Bu.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)Ts(t,"borderLeft","_bl",n,i,o),Ts(t,"borderRight","_br",n,i,o)}}))}(t)})),e(" order",(function(){!function(t){var e=$u.maxRank(t),n=Ls(t,Bu.range(1,e+1),"inEdges"),r=Ls(t,Bu.range(e-1,-1,-1),"outEdges"),i=function(t){var e={},n=Bu.filter(t.nodes(),(function(e){return!t.children(e).length})),r=Bu.max(Bu.map(n,(function(e){return t.node(e).rank}))),i=Bu.map(Bu.range(r+1),(function(){return[]})),o=Bu.sortBy(n,(function(e){return t.node(e).rank}));return Bu.forEach(o,(function n(r){if(!Bu.has(e,r)){e[r]=!0;var o=t.node(r);i[o.rank].push(r),Bu.forEach(t.successors(r),n)}})),i}(t);Us(t,i);for(var o,a=Number.POSITIVE_INFINITY,u=0,s=0;s<4;++u,++s){js(u%2?n:r,u%4>=2),i=$u.buildLayerMatrix(t);var c=Os(t,i);c<a&&(s=0,o=Bu.cloneDeep(i),a=c)}Us(t,o)}(t)})),e(" insertSelfEdges",(function(){!function(t){var e=Hs.buildLayerMatrix(t);Bu.forEach(e,(function(e){var n=0;Bu.forEach(e,(function(e,r){var i=t.node(e);i.order=r+n,Bu.forEach(i.selfEdges,(function(e){Hs.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Is(t)}(t)})),e(" position",(function(){!function(t){(function(t){var e=$u.buildLayerMatrix(t),n=t.graph().ranksep,r=0;Bu.forEach(e,(function(e){var i=Bu.max(Bu.map(e,(function(e){return t.node(e).height})));Bu.forEach(e,(function(e){t.node(e).y=r+i/2})),r+=i+n}))})(t=$u.asNonCompoundGraph(t)),Bu.forEach(function(t){var e,n=$u.buildLayerMatrix(t),r=Bu.merge(function(t,e){var n={};return Bu.reduce(e,(function(e,r){var i=0,o=0,a=e.length,u=Bu.last(r);return Bu.forEach(r,(function(e,s){var c=function(t,e){if(t.node(e).dummy)return Bu.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=c?t.node(c).order:a;(c||e===u)&&(Bu.forEach(r.slice(o,s+1),(function(e){Bu.forEach(t.predecessors(e),(function(r){var o=t.node(r),a=o.order;!(a<i||f<a)||o.dummy&&t.node(e).dummy||zs(n,r,e)}))})),o=s+1,i=f)})),r})),n}(t,n),function(t,e){var n={};function r(e,r,i,o,a){var u;Bu.forEach(Bu.range(r,i),(function(r){u=e[r],t.node(u).dummy&&Bu.forEach(t.predecessors(u),(function(e){var r=t.node(e);r.dummy&&(r.order<o||r.order>a)&&zs(n,e,u)}))}))}return Bu.reduce(e,(function(e,n){var i,o=-1,a=0;return Bu.forEach(n,(function(u,s){if("border"===t.node(u).dummy){var c=t.predecessors(u);c.length&&(i=t.node(c[0]).order,r(n,a,s,o,i),a=s,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,n)),i={};Bu.forEach(["u","d"],(function(o){e="u"===o?n:Bu.values(n).reverse(),Bu.forEach(["l","r"],(function(n){"r"===n&&(e=Bu.map(e,(function(t){return Bu.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var i={},o={},a={};return Bu.forEach(e,(function(t){Bu.forEach(t,(function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),Bu.forEach(e,(function(t){var e=-1;Bu.forEach(t,(function(t){var u=r(t);if(u.length)for(var s=((u=Bu.sortBy(u,(function(t){return a[t]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];o[t]===t&&e<a[l]&&!Fs(n,t,l)&&(o[l]=t,o[t]=i[t]=i[l],e=a[l])}}))})),{root:i,align:o}}(0,e,r,a),s=function(t,e,n,r,i){var o={},a=function(t,e,n,r){var i=new Bs,o=t.graph(),a=function(t,e,n){return function(r,i,o){var a,u=r.node(i),s=r.node(o),c=0;if(c+=u.width/2,Bu.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,Bu.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}}(o.nodesep,o.edgesep,r);return Bu.forEach(e,(function(e){var r;Bu.forEach(e,(function(e){var o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edge(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e}))})),i}(t,e,n,i),u=i?"borderLeft":"borderRight";function s(t,e){for(var n=a.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return s((function(t){o[t]=a.inEdges(t).reduce((function(t,e){return Math.max(t,o[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),s((function(e){var n=a.outEdges(e).reduce((function(t,e){return Math.min(t,o[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(o[e]=Math.max(o[e],n))}),a.successors.bind(a)),Bu.forEach(r,(function(t){o[t]=o[n[t]]})),o}(t,e,u.root,u.align,"r"===n);"r"===n&&(s=Bu.mapValues(s,(function(t){return-t}))),i[o+n]=s}))}));var o=function(t,e){return Bu.minBy(Bu.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Bu.forIn(e,(function(e,i){var o=function(t,e){return t.node(e).width}(t,i)/2;n=Math.max(e+o,n),r=Math.min(e-o,r)})),n-r}))}(t,i);return function(t,e){var n=Bu.values(e),r=Bu.min(n),i=Bu.max(n);Bu.forEach(["u","d"],(function(n){Bu.forEach(["l","r"],(function(o){var a,u=n+o,s=t[u];if(s!==e){var c=Bu.values(s);(a="l"===o?r-Bu.min(c):i-Bu.max(c))&&(t[u]=Bu.mapValues(s,(function(t){return t+a})))}}))}))}(i,o),function(t,e){return Bu.mapValues(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var i=Bu.sortBy(Bu.map(t,r));return(i[1]+i[2])/2}))}(i,t.graph().align)}(t),(function(e,n){t.node(n).x=e}))}(t)})),e(" positionSelfEdges",(function(){!function(t){Bu.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){Bu.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),o=t.node(Bu.last(n.borderLeft)),a=t.node(Bu.last(n.borderRight));n.width=Math.abs(a.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}})),Bu.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){!function(t){Bu.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){Bu.forEach(t.edges(),(function(e){var n=t.edge(e);if(Bu.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){Bu.forEach(t.nodes(),(function(e){ks(t.node(e))})),Bu.forEach(t.edges(),(function(e){var n=t.edge(e);Bu.forEach(n.points,ks),Bu.has(n,"y")&&ks(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){Bu.forEach(t.nodes(),(function(e){Cs(t.node(e))})),Bu.forEach(t.edges(),(function(e){var n=t.edge(e);Bu.forEach(n.points,Cs),Bu.has(n,"x")&&Cs(n)}))}(t),Is(t))}(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=t.graph(),a=o.marginx||0,u=o.marginy||0;function s(t){var o=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,o-u/2),n=Math.max(n,o+u/2),r=Math.min(r,a-s/2),i=Math.max(i,a+s/2)}Bu.forEach(t.nodes(),(function(e){s(t.node(e))})),Bu.forEach(t.edges(),(function(e){var n=t.edge(e);Bu.has(n,"x")&&s(n)})),e-=a,r-=u,Bu.forEach(t.nodes(),(function(n){var i=t.node(n);i.x-=e,i.y-=r})),Bu.forEach(t.edges(),(function(n){var i=t.edge(n);Bu.forEach(i.points,(function(t){t.x-=e,t.y-=r})),Bu.has(i,"x")&&(i.x-=e),Bu.has(i,"y")&&(i.y-=r)})),o.width=n-e+a,o.height=i-r+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){Bu.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(Hs.intersectRect(o,n)),i.points.push(Hs.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){Bu.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){!function(t){Bu.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){Bu.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),Bu.forEach(t.edges(),(function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,Bu.has(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))},debug:{debugOrdering:function(t){var e=$u.buildLayerMatrix(t),n=new rc({compound:!0,multigraph:!0}).setGraph({});return Bu.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),Bu.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),Bu.forEach(e,(function(t,e){var r="layer"+e;n.setNode(r,{rank:"same"}),Bu.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}},util:{time:$u.time,notime:$u.notime},version:"0.8.5"},oc=ic.graphlib,ac=ic.layout;class uc{constructor(t){this.cardinality=1,this.include=Wn.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=Fn.NODE,this.name=t.name,this.attr=t.attr||{},this.inputs=t.inputs,this.path=t.path||[],this.width=t.width,this.height=t.height}}class sc{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}class cc{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=Wn.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=Fn.META,this.path=[],this.name=t,this.metaGraph=dc(t,Vn.META,e)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map((t=>this.metaGraph.node(t)))}leaves(){let t,e=[],n=[this];for(;n.length;){let r=n.shift();r.isGroupNode?(t=r.metaGraph,t.nodes().forEach((e=>n.push(t.node(e))))):e.push(r.name)}return e}}class fc{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function lc(t,e={}){return new cc(t,e)}function hc(t,e){return new fc(t,e)}function dc(t,e,n){const r=n||{},i=new oc.Graph(r);return i.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),i}class pc{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=lc(Bn,this.graphOptions),this.index[Bn]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const r=dc(zn,Vn.BRIDGE,this.graphOptions);if(n.bridgeGraph=r,!e.parentNode||!("metaGraph"in e.parentNode))return r;const i=e.parentNode;return[i.metaGraph,this.getBridgeGraph(i.name)].forEach((e=>{e.edges().filter((e=>e.v===t||e.w===t)).forEach((n=>{const i=n.w===t;e.edge(n).baseEdgeList.forEach((e=>{const[o,a]=i?[e.w,n.v]:[e.v,n.w],u=this.getChildName(t,o),s={v:i?a:u,w:i?u:a};let c=r.edge(s);c||(c=hc(s.v,s.w),c.inbound=i,r.setEdge(s.v,s.w,c)),c.addBaseEdge(e,this)}))}))})),r}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const r=t.parentNode,i=r.metaGraph,o=this.getBridgeGraph(r.name);return vc(i,t,e,n),vc(o,t,e,n),n}}function vc(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class gc{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new bc(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==Fn.META)return;const n=e,r=n.node.metaGraph,i=n.coreGraph;r.nodes().forEach((t=>{const e=this.getOrCreateRenderNodeByName(t);i.setNode(t,e)})),r.edges().forEach((t=>{const e=r.edge(t),n=new mc(e);i.setEdge(t.v,t.w,n)}));const o=n.node.parentNode;if(!o)return;const a=this.getRenderNodeByName(o.name),u=(t,...e)=>e.concat([t?"IN":"OUT"]).join("~~"),s=this.hierarchy.getBridgeGraph(t);s.edges().forEach((e=>{const n=s.edge(e),c=!!r.node(e.w),[f,l]=c?[e.w,e.v]:[e.v,e.w],h=e=>{const n=c?{v:e,w:t}:{v:t,w:e};return a.coreGraph.edge(n)};let d=h(l);d||(d=h(u(c,l,o.name)));const p=u(c,t),v=u(c,l,t);let g=i.node(v);if(!g){let t=i.node(p);if(!t){const e={name:p,type:Fn.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:Wn.UNSPECIFIED,inbound:c,attr:{}};t=new yc(e),this.index[p]=t,i.setNode(p,t)}const e={name:v,type:Fn.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:Wn.UNSPECIFIED,inbound:c,attr:{}};g=new yc(e),this.index[v]=g,i.setNode(v,g),i.setParent(v,p),t.node.cardinality++}const y=new mc(n);y.adjoiningMetaEdge=d,c?i.setEdge(v,f,y):i.setEdge(f,v,y)}))}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new bc(e,this.hierarchy.graphOptions):new yc(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class yc{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class mc{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class bc extends yc{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=dc(n.name,Vn.CORE,e)}}function _c(t,e){t.node.isGroupNode&&function(t,e){const n=jn(e);t.coreGraph.nodes().map((e=>t.coreGraph.node(e))).forEach((t=>{var r,i,o,a,u,s;const{height:c,width:f}=t;switch(t.node.type){case Fn.NODE:Object.assign(t,n.nodeSize.node),t.height=c||n.nodeSize.node.height,t.width=f||n.nodeSize.node.width;break;case Fn.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case Fn.META:t.expanded?_c(t,e):(Object.assign(t,n.nodeSize.meta),t.height=n.nodeSize.meta.height,t.width=n.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+t.node.type)}if(!t.expanded){const n=t.attr;!function(t,e=!1){if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){const e=`${t.displayName}`.length,n=3;t.width=Math.max(t.coreBox.width,e*n)}}(t,e&&(0===t.node.type&&!!(null===(i=null===(r=null==e?void 0:e.nodeSize)||void 0===r?void 0:r.meta)||void 0===i?void 0:i.width)||1===t.node.type&&(!!(null===(a=null===(o=null==e?void 0:e.nodeSize)||void 0===o?void 0:o.node)||void 0===a?void 0:a.width)||!!n.width)||2===t.node.type&&!!(null===(s=null===(u=null==e?void 0:e.nodeSize)||void 0===u?void 0:u.bridge)||void 0===s?void 0:s.width)))}}))}(t,e),t.node.type===Fn.META&&function(t,e){const n=jn(e),r=n.subScene.meta;Object.assign(t,r);const{nodeSep:i,rankSep:o,edgeSep:a,align:u}=n.graph.meta,s={nodesep:i,ranksep:o,edgesep:a,align:u};Object.assign(t.coreBox,function(t,e){const{ranksep:n,nodesep:r,edgesep:i,align:o}=e;Object.assign(t.graph(),{ranksep:n,nodesep:r,edgesep:i,align:o});const a=[];if(t.nodes().forEach((e=>{t.node(e).node.type!==Fn.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};ac(t);let u=1/0,s=1/0,c=-1/0,f=-1/0;return a.forEach((e=>{const n=t.node(e),r=.5*n.width,i=n.x-r,o=n.x+r;u=i<u?i:u,c=o>c?o:c;const a=.5*n.height,l=n.y-a,h=n.y+a;s=l<s?l:s,f=h>f?h:f})),t.edges().forEach((e=>{const n=t.edge(e),r=t.node(n.metaEdge.v),i=t.node(n.metaEdge.w);if(3===n.points.length&&function(t){let e=wc(t[0],t[1]);for(let n=1;n<t.length-1;n++){const r=wc(t[n],t[n+1]);if(Math.abs(r-e)>1)return!1;e=r}return!0}(n.points)){if(null!=r){const t=r.expanded?r.x:xc(r);n.points[0].x=t}if(null!=i){const t=i.expanded?i.x:xc(i);n.points[2].x=t}n.points=[n.points[0],n.points[1]]}const o=n.points[n.points.length-2];null!=i&&(n.points[n.points.length-1]=Ec(o,i));const a=n.points[1];null!=r&&(n.points[0]=Ec(a,r)),n.points.forEach((t=>{u=t.x<u?t.x:u,c=t.x>c?t.x:c,s=t.y<s?t.y:s,f=t.y>f?t.y:f}))})),t.nodes().forEach((e=>{const n=t.node(e);n.x-=u,n.y-=s})),t.edges().forEach((e=>{t.edge(e).points.forEach((t=>{t.x-=u,t.y-=s}))})),{width:c-u,height:f-s}}(t.coreGraph,s));let c=0;t.coreGraph.nodeCount()>0&&c++;const f=c<=1?0:c;t.coreBox.width+=f+f,t.coreBox.height=r.labelHeight+t.coreBox.height,t.width=t.coreBox.width+r.paddingLeft+r.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function wc(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function xc(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function Ec(t,e){const n=e.expanded?e.x:xc(e),r=e.y,i=t.x-n,o=t.y-r;let a,u,s=e.expanded?e.width:e.coreBox.width,c=e.expanded?e.height:e.coreBox.height;return Math.abs(o)*s/2>Math.abs(i)*c/2?(o<0&&(c=-c),a=0===o?0:c/2*i/o,u=c/2):(i<0&&(s=-s),a=s/2,u=0===i?0:s/2*o/i),{x:n+a,y:r+u}}function Sc(t,e,n){var r,i,o,a;const u=t.nodes.filter(((t,e,n)=>n.findIndex((e=>e.id===t.id))!==e)).map((t=>t.id));if(u.length)throw new Error(`Duplicated ids found: ${u.join(", ")}`);const s=function(t){const e={nodes:[]},n=t.compound,r=Object.keys(n||{}),i=new Map,o=(t,e=[])=>{if(i.has(t))return i.get(t);for(let i=0;i<r.length;i++){let a=r[i];if(n&&-1!==n[a].indexOf(t))return e.unshift(a),o(a,e)}return 0===e.length&&i.set(t,e),e},a=e=>t.edges.filter((t=>t.w===e)).map((t=>({name:t.v})));return t.nodes.forEach((t=>{const n=t.id,r=[...o(n),n];let i=a(n);e.nodes.push({name:n,path:r,inputs:i,width:t.width,height:t.height,attr:Object.assign({},t)})})),e}(t),c=function(t,e){const n=(t,e)=>{for(let n of e.values())if(n.includes(t))return!0;return!1},r=(t,e=[])=>{if(0===Object.keys(t).length)return[...new Set(e)];const i=new Map(Object.keys(t).map((e=>[e,t[e]]))),o={};for(let[t,r]of i)n(t,i)?o[t]=r:e=e.concat(t,r);return r(o,e)};return r(t).filter((t=>e.includes(t)))}(t.compound||{},(null==e?void 0:e.expanded)||[]),f=function(t,e){return function(t){return new gc(t)}(function(t,e){const{rankDirection:n,align:r}=e,i=new pc({rankdir:n,align:r});return function(t,e){Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n],i=r.path;let o=t.root;o.depth=Math.max(i.length,o.depth);for(let e=0;e<i.length&&(o.depth=Math.max(o.depth,i.length-e),o.cardinality+=r.cardinality,e!==i.length-1);e++){const n=i[e];let a=t.node(n);a||(a=lc(n,t.graphOptions),a.path=r.path.slice(0,e+1),a.parentNode=o,t.setNode(n,a),o.metaGraph.setNode(n,a)),o=a}t.setNode(r.name,r),r.parentNode=o,o.metaGraph.setNode(r.name,r)}))}(i,t),function(t,e){const n=t.getNodeMap();let r=[],i=[];const o=(t,e)=>{let n=0;for(;t;)e[n++]=t.name,t=t.parentNode;return n-1};e.edges.forEach((a=>{r=[],i=[];let u=o(e.nodes[a.v],r),s=o(e.nodes[a.w],i);for(;r[u]===i[s];)if(u--,s--,u<0||s<0)throw Error("No difference found between ancestor paths.");const c=n[r[u+1]],f=r[u],l=i[s];let h=c.metaGraph.edge(f,l);h||(h=hc(f,l),c.metaGraph.setEdge(f,l,h)),h.addBaseEdge(a,t)}))}(i,t),i}(function(t){const e=new sc;return t.nodes.map((t=>new uc(t))).forEach((t=>{e.nodes[t.name]=t,t.inputs.forEach((n=>{!function(t,e,n){n.name!==e.name&&t.edges.push(Object.assign(Object.assign({},n.attr),{v:n.name,w:e.name}))}(e,t,n)}))})),e}(t),e))}(s,{rankDirection:(null===(i=null===(r=null==n?void 0:n.graph)||void 0===r?void 0:r.meta)||void 0===i?void 0:i.rankDir)||(null==e?void 0:e.rankDirection)||Ln.graph.meta.rankDir,align:(null===(a=null===(o=null==n?void 0:n.graph)||void 0===o?void 0:o.meta)||void 0===a?void 0:a.align)||Ln.graph.meta.align});return function(t,e){e.forEach((e=>{const n=t.getRenderInfoNodes().find((t=>t.displayName===e));let r=n&&n.node&&n.node.name||"";const i=t.getRenderNodeByName(r);if(!i)throw new Error(`No nodes found: ${r}`);i.expanded=!0,t.buildSubHierarchy(r)}))}(f,c),_c(f.root,n),Tc(f.root)}function Ac(t,e,n,r){var i,o;let a=[];const u=(null===(i=n.find((e=>e.id===t)))||void 0===i?void 0:i.path)||[],s=(null===(o=n.find((t=>t.id===e)))||void 0===o?void 0:o.path)||[],c=[Bn,...u].slice(0,u.length).reverse(),f=[Bn,...s].slice(0,s.length);return c.forEach((i=>{const o=n.find((t=>t.id===i));a=a.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),f.filter((t=>!c.includes(t))).forEach((i=>{const o=n.find((t=>t.id===i));a=a.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),a}function Tc(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},Ic(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===Fn.META?Tc(t):Ic(t)))):[],edges:t.expanded?Nc(t):[]});var n}function Ic(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}function Nc(t){return t.coreGraph.edges().map((e=>({renderInfoEdge:t.coreGraph.edge(e),edge:e}))).filter((({renderInfoEdge:t})=>t.metaEdge)).map((({edge:e,renderInfoEdge:n})=>{const r=function(t,e){const n=e.points.map((t=>Object.assign({},t)));if(e.adjoiningMetaEdge){const r=e.adjoiningMetaEdge.points,i=e.metaEdge.inbound,o=i?r[r.length-1]:r[0],a=n[i?0:n.length-1],u=t.x-t.width/2,s=t.y-t.height/2,c=o.x-u,f=o.y-s,l=-t.paddingLeft,h=-(t.paddingTop+t.labelHeight);a.x=c+l,a.y=f+h}return n}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}}))}var kc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cc=function(){return Cc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Cc.apply(this,arguments)},Oc=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},Dc=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.edgesep=5,n.ranksep=50,n.controlPoints=!0,n.anchorPoint=!0,n.nodes=[],n.edges=[],n.combos=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return kc(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},e.prototype.init=function(t){var e=t.hiddenNodes||[],n=t.hiddenEdges||[],r=t.hiddenCombos||[];this.nodes=this.getDataByOrder((t.nodes||[]).concat(e)),this.edges=this.getDataByOrder((t.edges||[]).concat(n)),this.combos=(t.combos||[]).concat(r.map((function(t){return Cc(Cc({},t),{collapsed:!0})})))},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;if(e){var r=t.getLayoutConfig(),i=function(t,e=!1){const n=JSON.parse(JSON.stringify(t)),r={nodes:[n],edges:[...n.edges]};return n.nodes.forEach((function t(e){(0===e.type||1===e.type)&&r.nodes.push(e),0===e.type&&(r.edges=r.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)})),e&&r.nodes.forEach((t=>{const e=r.nodes.find((e=>e.id===t.parentNodeName));if(e){const n=e.x-e.width/2+e.paddingLeft,r=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==Bn&&(t.x+=n,t.y+=r),0===t.type&&t.edges.forEach((e=>{e.points.forEach((e=>{e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop}))}))}})),r}(Sc(r.graphDef,r.graphOption,r.graphSettings),!0);return this.updatePosition(i),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}},e.prototype.getNodePath=function(t){var e=this.nodes,n=this.combos,r=e.find((function(e){return e.id===t}));return r&&r.comboId?function t(e,r){void 0===r&&(r=[]);var i=n.find((function(t){return t.id===e}));return i?(r.unshift(e),i.parentId?t(i.parentId,r):r):r}(r.comboId,[t]):[t]},e.prototype.getLayoutConfig=function(){var t,e,n,r,o=this,a=o.nodes,u=o.edges,s=o.combos,c=o.nodeSize,l=o.rankdir,h=o.align,d=o.edgesep,p=o.nodesep,v=o.ranksep,g=o.settings,y=(s||[]).reduce((function(t,e){var n=a.filter((function(t){return t.comboId===e.id})).map((function(t){return t.id})),r=(s||[]).filter((function(t){return t.parentId===e.id})).map((function(t){return t.id}));return(n.length||r.length)&&(t[e.id]=Oc(Oc([],n,!0),r,!0)),t}),{});r=c?i(c)?function(){return c}:function(){return[c,c]}:function(t){return t&&t.size?i(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var m=function(t){return t&&t.size?i(t.size)?t.size:[t.size,t.size]:[80,40]}(null==s?void 0:s[0]),b=m[0],_=m[1],w=null===(e=null===(t=o.graphSettings)||void 0===t?void 0:t.subScene)||void 0===e?void 0:e.meta,x=(null===(n=s.find((function(t){return!t.collapsed})))||void 0===n?void 0:n.padding)||[20,20,20,20],E=x[0],S=x[1],A=x[2],T=x[3],I={compound:y,nodes:Oc([],(a||[]).map((function(t){var e=r(t),n=e[0],i=e[1];return Cc(Cc({},t),{width:n,height:i})})),!0),edges:Oc([],(u||[]).map((function(t){return Cc(Cc({},t),{v:t.source,w:t.target})})),!0)},N={expanded:(s||[]).filter((function(t){return!t.collapsed})).map((function(t){return t.id}))},k={graph:{meta:{align:h,rankDir:l,nodeSep:p,edgeSep:d,rankSep:v}},subScene:{meta:{paddingTop:E||(null==w?void 0:w.paddingTop)||20,paddingRight:S||(null==w?void 0:w.paddingRight)||20,paddingBottom:A||(null==w?void 0:w.paddingBottom)||20,paddingLeft:T||(null==w?void 0:w.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:b,height:_}}},C=jn(g,Cc({},jn(k,Ln)));return o.graphSettings=C,{graphDef:I,graphOption:N,graphSettings:C}},e.prototype.updatePosition=function(t){var e=t.nodes,n=t.edges;this.updateNodePosition(e,n),this.updateEdgePosition(e,n)},e.prototype.getBegin=function(t,e){var n=this.begin,r=[0,0];if(n){var i=1/0,o=1/0;t.forEach((function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)})),e.forEach((function(t){t.points.forEach((function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)}))})),r[0]=n[0]-i,r[1]=n[1]-o}return r},e.prototype.updateNodePosition=function(t,e){var n=this,r=n.combos,i=n.nodes,o=n.edges,a=n.anchorPoint,u=n.graphSettings,s=this.getBegin(t,e);t.forEach((function(t){var n,c=t.x,f=t.y,l=t.id,h=t.type,d=t.coreBox;if(h===Hn.META&&l!==Bn){var p=r.findIndex((function(t){return t.id===l})),v=null===(n=null==u?void 0:u.subScene)||void 0===n?void 0:n.meta;r[p].offsetX=c+s[0],r[p].offsetY=f+s[1],r[p].fixSize=[d.width,d.height],r[p].fixCollapseSize=[d.width,d.height],t.expanded?r[p].padding=[null==v?void 0:v.paddingTop,null==v?void 0:v.paddingRight,null==v?void 0:v.paddingBottom,null==v?void 0:v.paddingLeft]:r[p].padding=[0,0,0,0]}else if(h===Hn.OP&&(p=i.findIndex((function(t){return t.id===l})),i[p].x=c+s[0],i[p].y=f+s[1],a)){var g=[],y=e.filter((function(t){return t.v===l})),m=e.filter((function(t){return t.w===l}));y.length>0&&y.forEach((function(e){var n=e.points[0],r=(n.x-c)/t.width+.5,i=(n.y-f)/t.height+.5;g.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.sourceAnchor=g.length-1)}))})),m.length>0&&m.forEach((function(e){var n=e.points[e.points.length-1],r=(n.x-c)/t.width+.5,i=(n.y-f)/t.height+.5;g.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.targetAnchor=g.length-1)}))})),i[p].anchorPoints=g.length>0?g:i[p].anchorPoints||[]}}))},e.prototype.updateEdgePosition=function(t,e){var n=this,r=n.combos,i=n.edges,o=n.controlPoints,a=this.getBegin(t,e);o&&(r.forEach((function(t){t.inEdges=[],t.outEdges=[]})),i.forEach((function(e){var i,o,u,s,c=t.find((function(t){return t.id===e.source})),f=t.find((function(t){return t.id===e.target})),l=[],h=[];if(c&&f)h=Ac(null==c?void 0:c.id,null==f?void 0:f.id,t);else if(!c||!f){var d=n.getNodePath(e.source),p=n.getNodePath(e.target),v=d.reverse().slice(c?0:1).find((function(e){return t.find((function(t){return t.id===e}))})),g=p.reverse().slice(f?0:1).find((function(e){return t.find((function(t){return t.id===e}))}));c=t.find((function(t){return t.id===v})),f=t.find((function(t){return t.id===g})),h=Ac(null==c?void 0:c.id,null==f?void 0:f.id,t,{v:e.source,w:e.target})}if(l=(l=h.reduce((function(t,e){return Oc(Oc([],t,!0),e.points.map((function(t){return Cc(Cc({},t),{x:t.x+a[0],y:t.y+a[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=l,(null==f?void 0:f.type)===Fn.META){var y=r.findIndex((function(t){return t.id===(null==f?void 0:f.id)}));if(!r[y]||(null===(i=r[y].inEdges)||void 0===i?void 0:i.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(o=r[y].inEdges)||void 0===o||o.push({source:c.id,target:f.id,controlPoints:l})}if((null==c?void 0:c.type)===Fn.META){if(y=r.findIndex((function(t){return t.id===(null==c?void 0:c.id)})),!r[y]||(null===(u=r[y].outEdges)||void 0===u?void 0:u.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(s=r[y].outEdges)||void 0===s||s.push({source:c.id,target:f.id,controlPoints:l})}})))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every((function(t){return void 0!==t.layoutOrder}))||t.forEach((function(t,e){t.layoutOrder=e})),t.sort((function(t,e){return t.layoutOrder-e.layoutOrder}))},e}(t);const Rc=Object.prototype.toString;function Mc(t){return Rc.call(t).endsWith("Array]")}const Pc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Mc(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]>a&&(a=t[u]);return a},Gc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Mc(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]<a&&(a=t[u]);return a};function Lc(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Mc(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!Mc(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=Gc(t),i=Pc(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=n.min,a=void 0===o?n.autoMinMax?r:0:o,u=n.max,s=void 0===u?n.autoMinMax?i:1:u;if(a>=s)throw new RangeError("min option must be smaller than max option");for(var c=(s-a)/(i-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e}const jc=" ".repeat(2),Uc=" ".repeat(4);function Bc(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${t.constructor.name} {\n${jc}[\n${Uc}${function(t,e,n,r){const{rows:i,columns:o}=t,a=Math.min(i,e),u=Math.min(o,n),s=[];for(let e=0;e<a;e++){let n=[];for(let i=0;i<u;i++)n.push(zc(t.get(e,i),r));s.push(`${n.join(" ")}`)}return u!==o&&(s[s.length-1]+=` ... ${o-n} more columns`),a!==i&&s.push(`... ${i-e} more rows`),s.join(`\n${Uc}`)}(t,n,r,i)}\n${jc}]\n${jc}rows: ${t.rows}\n${jc}columns: ${t.columns}\n}`}function zc(t,e){const n=String(t);if(n.length<=e)return n.padEnd(e," ");const r=t.toPrecision(e-2);if(r.length<=e)return r;const i=t.toExponential(e-2),o=i.indexOf("e"),a=i.slice(o);return i.slice(0,e-a.length)+a}function Fc(t,e,n){let r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function Wc(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function Vc(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Hc(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Xc(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");let n=e.some((e=>e<0||e>=t.rows));if(n)throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function qc(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some((e=>e<0||e>=t.columns)))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Yc(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if($c("startRow",e),$c("endRow",n),$c("startColumn",r),$c("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Kc(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function $c(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function Zc(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class Jc{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new tf(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)r.set(i,t,n[i*e+t]);return r}static rowVector(t){let e=new tf(1,t.length);for(let n=0;n<t.length;n++)e.set(0,n,t[n]);return e}static columnVector(t){let e=new tf(t.length,1);for(let n=0;n<t.length;n++)e.set(n,0,t[n]);return e}static zeros(t,e){return new tf(t,e)}static ones(t,e){return new tf(t,e).fill(1)}static rand(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{random:r=Math.random}=n;let i=new tf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.set(n,t,r());return i}static randInt(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{min:r=0,max:i=1e3,random:o=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(r>=i)throw new RangeError("min must be smaller than max");let a=i-r,u=new tf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(o()*a);u.set(n,t,e)}return u}static eye(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);let r=Math.min(t,e),i=this.zeros(t,e);for(let t=0;t<r;t++)i.set(t,t,n);return i}static diag(t,e,n){let r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);let i=Math.min(r,e,n),o=this.zeros(e,n);for(let e=0;e<i;e++)o.set(e,e,t[e]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new tf(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.min(t.get(o,n),e.get(o,n)));return i}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new this(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.max(t.get(o,n),e.get(o,n)));return i}static checkMatrix(t){return Jc.isMatrix(t)?t:new tf(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.call(this,e,n);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.push(this.get(e,n));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);for(let n=e+1;n<this.rows;n++)0!==this.get(t,n)&&(r=!1);t++}return r}echelonForm(){let t=this.clone(),e=0,n=0;for(;e<t.rows&&n<t.columns;){let r=e;for(let i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let i=t.get(e,n);for(let r=n;r<t.columns;r++)t.set(e,r,t.get(e,r)/i);for(let r=e+1;r<t.rows;r++){let i=t.get(r,n)/t.get(e,n);t.set(r,n,0);for(let o=n+1;o<t.columns;o++)t.set(r,o,t.get(r,o)-t.get(e,o)*i)}e++,n++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;for(;r>=0;)if(0===t.maxRow(r))r--;else{let i=0,o=!1;for(;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(let n=0;n<r;n++){let o=t.get(n,i);for(let a=i;a<e;a++){let e=t.get(n,a)-o*t.get(r,a);t.set(n,a,e)}}r--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:n=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let r=new tf(this.rows*e,this.columns*n);for(let t=0;t<e;t++)for(let e=0;e<n;e++)r.setSubMatrix(this,this.rows*t,this.columns*e);return r}fill(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,t);return this}neg(){return this.mulS(-1)}getRow(t){Fc(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return tf.rowVector(this.getRow(t))}setRow(t,e){Fc(this,t),e=Vc(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){Fc(this,t),Fc(this,e);for(let n=0;n<this.columns;n++){let r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}getColumn(t){Wc(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return tf.columnVector(this.getColumn(t))}setColumn(t,e){Wc(this,t),e=Hc(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){Wc(this,t),Wc(this,e);for(let n=0;n<this.rows;n++){let r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}addRowVector(t){t=Vc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}subRowVector(t){t=Vc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}mulRowVector(t){t=Vc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}divRowVector(t){t=Vc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}addColumnVector(t){t=Hc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}subColumnVector(t){t=Hc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}mulColumnVector(t){t=Hc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}divColumnVector(t){t=Hc(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}mulRow(t,e){Fc(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){Wc(this,t);for(let n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}max(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}maxIndex(){Zc(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}minIndex(){Zc(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}maxRow(t){if(Fc(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}maxRowIndex(t){Fc(this,t),Zc(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}minRow(t){if(Fc(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}minRowIndex(t){Fc(this,t),Zc(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}maxColumn(t){if(Wc(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}maxColumnIndex(t){Wc(this,t),Zc(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){if(Wc(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}minColumnIndex(t){Wc(this,t),Zc(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let n=0;n<t;n++)e.push(this.get(n,n));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e+=this.get(t,n)*this.get(t,n);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}dot(t){Jc.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}mmul(t){t=tf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,i=new tf(e,r),o=new Float64Array(n);for(let a=0;a<r;a++){for(let e=0;e<n;e++)o[e]=t.get(e,a);for(let t=0;t<e;t++){let e=0;for(let r=0;r<n;r++)e+=this.get(t,r)*o[r];i.set(t,a,e)}}return i}strassen2x2(t){t=tf.checkMatrix(t);let e=new tf(2,2);const n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),u=t.get(1,0),s=this.get(1,1),c=t.get(1,1),f=(n+s)*(r+c),l=(a+s)*r,h=n*(o-c),d=s*(u-r),p=(n+i)*c,v=f+d-p+(i-s)*(u+c),g=h+p,y=l+d,m=f-l+h+(a-n)*(r+o);return e.set(0,0,v),e.set(0,1,g),e.set(1,0,y),e.set(1,1,m),e}strassen3x3(t){t=tf.checkMatrix(t);let e=new tf(3,3);const n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),u=this.get(1,2),s=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),h=t.get(0,1),d=t.get(0,2),p=t.get(1,0),v=t.get(1,1),g=t.get(1,2),y=t.get(2,0),m=t.get(2,1),b=t.get(2,2),_=(n-o)*(-h+v),w=(-n+o+a)*(l-h+v),x=(o+a)*(-l+h),E=n*l,S=(-n+s+c)*(l-d+g),A=(-n+s)*(d-g),T=(s+c)*(-l+d),I=(-i+c+f)*(v+y-m),N=(i-f)*(v-m),k=i*y,C=(c+f)*(-y+m),O=(-i+a+u)*(g+y-b),D=(i-u)*(g-b),R=(a+u)*(-y+b),M=E+k+r*p,P=(n+r+i-o-a-c-f)*v+w+x+E+I+k+C,G=E+S+T+(n+r+i-a-u-s-c)*g+k+O+R,L=_+a*(-l+h+p-v-g-y+b)+w+E+k+O+D,j=_+w+x+E+u*m,U=k+O+D+R+o*d,B=E+S+A+c*(-l+d+p-v-g-y+m)+I+N+k,z=I+N+k+C+s*h,F=E+S+A+T+f*b;return e.set(0,0,M),e.set(0,1,P),e.set(0,2,G),e.set(1,0,L),e.set(1,1,j),e.set(1,2,U),e.set(2,0,B),e.set(2,1,z),e.set(2,2,F),e}mmulStrassen(t){t=tf.checkMatrix(t);let e=this.clone(),n=e.rows,r=e.columns,i=t.rows,o=t.columns;function a(t,e,n){let r=t.rows,i=t.columns;if(r===e&&i===n)return t;{let r=Jc.zeros(e,n);return r=r.setSubMatrix(t,0,0),r}}r!==i&&console.warn(`Multiplying ${n} x ${r} and ${i} x ${o} matrix: dimensions do not match.`);let u=Math.max(n,i),s=Math.max(r,o);return e=a(e,u,s),function t(e,n,r,i){if(r<=512||i<=512)return e.mmul(n);r%2==1&&i%2==1?(e=a(e,r+1,i+1),n=a(n,r+1,i+1)):r%2==1?(e=a(e,r+1,i),n=a(n,r+1,i)):i%2==1&&(e=a(e,r,i+1),n=a(n,r,i+1));let o=parseInt(e.rows/2,10),u=parseInt(e.columns/2,10),s=e.subMatrix(0,o-1,0,u-1),c=n.subMatrix(0,o-1,0,u-1),f=e.subMatrix(0,o-1,u,e.columns-1),l=n.subMatrix(0,o-1,u,n.columns-1),h=e.subMatrix(o,e.rows-1,0,u-1),d=n.subMatrix(o,n.rows-1,0,u-1),p=e.subMatrix(o,e.rows-1,u,e.columns-1),v=n.subMatrix(o,n.rows-1,u,n.columns-1),g=t(Jc.add(s,p),Jc.add(c,v),o,u),y=t(Jc.add(h,p),c,o,u),m=t(s,Jc.sub(l,v),o,u),b=t(p,Jc.sub(d,c),o,u),_=t(Jc.add(s,f),v,o,u),w=t(Jc.sub(h,s),Jc.add(c,l),o,u),x=t(Jc.sub(f,p),Jc.add(d,v),o,u),E=Jc.add(g,b);E.sub(_),E.add(x);let S=Jc.add(m,_),A=Jc.add(y,b),T=Jc.sub(g,y);T.add(m),T.add(w);let I=Jc.zeros(2*E.rows,2*E.columns);return I=I.setSubMatrix(E,0,0),I=I.setSubMatrix(S,E.rows,0),I=I.setSubMatrix(A,0,E.columns),I=I.setSubMatrix(T,E.rows,E.columns),I.subMatrix(0,r-1,0,i-1)}(e,t=a(t,u,s),u,s)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new tf(this.rows,this.columns);for(let t=0;t<this.rows;t++){const i=this.getRow(t);i.length>0&&Lc(i,{min:e,max:n,output:i}),r.setRow(t,i)}return r}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new tf(this.rows,this.columns);for(let t=0;t<this.columns;t++){const i=this.getColumn(t);i.length&&Lc(i,{min:e,max:n,output:i}),r.setColumn(t,i)}return r}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let n=0;n<t;n++){let t=this.get(e,n),r=this.get(e,this.columns-1-n);this.set(e,n,r),this.set(e,this.columns-1-n,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let n=0;n<t;n++){let t=this.get(n,e),r=this.get(this.rows-1-n,e);this.set(n,e,r),this.set(this.rows-1-n,e,t)}return this}kroneckerProduct(t){t=tf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new tf(e*r,n*i);for(let a=0;a<e;a++)for(let e=0;e<n;e++)for(let n=0;n<r;n++)for(let u=0;u<i;u++)o.set(r*a+n,i*e+u,this.get(a,e)*t.get(n,u));return o}kroneckerSum(t){if(t=tf.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let e=this.rows,n=t.rows,r=this.kroneckerProduct(tf.eye(n,n)),i=tf.eye(e,e).kroneckerProduct(t);return r.add(i)}transpose(){let t=new tf(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}sortRows(t=Qc){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=Qc){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){Yc(this,t,e,n,r);let i=new tf(e-t+1,r-n+1);for(let o=t;o<=e;o++)for(let e=n;e<=r;e++)i.set(o-t,e-n,this.get(o,e));return i}subMatrixRow(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new tf(t.length,n-e+1);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);r.set(i,o-e,this.get(t[i],o))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new tf(n-e+1,t.length);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);r.set(o-e,i,this.get(o,t[i]))}return r}setSubMatrix(t,e,n){if((t=tf.checkMatrix(t)).isEmpty())return this;Yc(this,e,e+t.rows-1,n,n+t.columns-1);for(let r=0;r<t.rows;r++)for(let i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}selection(t,e){let n=function(t,e,n){return{row:Xc(t,e),column:qc(t,n)}}(this,t,e),r=new tf(t.length,e.length);for(let t=0;t<n.row.length;t++){let e=n.row[t];for(let i=0;i<n.column.length;i++){let o=n.column[i];r.set(t,i,this.get(e,o))}}return r}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let n=0;n<t;n++)e+=this.get(n,n);return e}clone(){let t=new tf(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}sum(t){switch(t){case"row":return function(t){let e=Kc(t.rows);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){let e=Kc(t.columns);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){let e=0;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return function(t){let e=Kc(t.rows,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){let e=Kc(t.columns,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){let e=1;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:n=!0,mean:r=this.mean(t)}=e;if("boolean"!=typeof n)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<r;a++){let r=0,u=0,s=0;for(let e=0;e<i;e++)s=t.get(a,e)-n[a],r+=s,u+=s*s;e?o.push((u-r*r/i)/(i-1)):o.push((u-r*r/i)/i)}return o}(this,n,r);case"column":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<i;a++){let i=0,u=0,s=0;for(let e=0;e<r;e++)s=t.get(e,a)-n[a],i+=s,u+=s*s;e?o.push((u-i*i/r)/(r-1)):o.push((u-i*i/r)/r)}return o}(this,n,r);case void 0:if("number"!=typeof r)throw new TypeError("mean must be a number");return function(t,e,n){const r=t.rows,i=t.columns,o=r*i;let a=0,u=0,s=0;for(let e=0;e<r;e++)for(let r=0;r<i;r++)s=t.get(e,r)-n,a+=s,u+=s*s;return e?(u-a*a/o)/(o-1):(u-a*a/o)/o}(this,n,r);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(let t=0;t<n.length;t++)n[t]=Math.sqrt(n[t]);return n}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:n=this.mean(t)}=e;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}(this,n),this;case"column":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}(this,n),this;case void 0:if("number"!=typeof n)throw new TypeError("center must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let n=e.scale;switch(t){case"row":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.rows;n++){let r=0;for(let e=0;e<t.columns;e++)r+=Math.pow(t.get(n,e),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}(this,n),this;case"column":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.columns;n++){let r=0;for(let e=0;e<t.rows;e++)r+=Math.pow(t.get(e,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}(this,n),this;case void 0:if(void 0===n)n=function(t){const e=t.size-1;let n=0;for(let r=0;r<t.columns;r++)for(let i=0;i<t.rows;i++)n+=Math.pow(t.get(i,r),2)/e;return Math.sqrt(n)}(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}toString(t){return Bc(this,t)}}function Qc(t,e){return t-e}Jc.prototype.klass="Matrix","undefined"!=typeof Symbol&&(Jc.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return Bc(this)}),Jc.random=Jc.rand,Jc.randomInt=Jc.randInt,Jc.diagonal=Jc.diag,Jc.prototype.diagonal=Jc.prototype.diag,Jc.identity=Jc.eye,Jc.prototype.negate=Jc.prototype.neg,Jc.prototype.tensorProduct=Jc.prototype.kroneckerProduct;class tf extends Jc{constructor(t,e){if(super(),tf.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>=0){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n<t;n++)this.data.push(new Float64Array(e))}else{if(!Array.isArray(t))throw new TypeError("First argument must be a positive number or an array");{const n=t;if("number"!=typeof(e=(t=n.length)?n[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let r=0;r<t;r++){if(n[r].length!==e)throw new RangeError("Inconsistent array dimensions");this.data.push(Float64Array.from(n[r]))}}}this.rows=t,this.columns=e}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}removeRow(t){return Fc(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),Fc(this,t,!0),e=Float64Array.from(Vc(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){Wc(this,t);for(let e=0;e<this.rows;e++){const n=new Float64Array(this.columns-1);for(let r=0;r<t;r++)n[r]=this.data[e][r];for(let r=t+1;r<this.columns;r++)n[r-1]=this.data[e][r];this.data[e]=n}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),Wc(this,t,!0),e=Hc(this,e);for(let n=0;n<this.rows;n++){const r=new Float64Array(this.columns+1);let i=0;for(;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},t.add=function(t,n){return new e(t).add(n)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},t.sub=function(t,n){return new e(t).sub(n)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},t.mul=function(t,n){return new e(t).mul(n)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},t.div=function(t,n){return new e(t).div(n)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},t.mod=function(t,n){return new e(t).mod(n)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},t.and=function(t,n){return new e(t).and(n)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},t.or=function(t,n){return new e(t).or(n)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},t.xor=function(t,n){return new e(t).xor(n)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},t.leftShift=function(t,n){return new e(t).leftShift(n)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,n){return new e(t).pow(n)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this}}(Jc,tf);class ef extends Jc{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}}function nf(t,e){let n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class rf{constructor(t,e={}){if((t=ef.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let n=t.rows,r=t.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:o=!0,autoTranspose:a=!1}=e;let u,s=Boolean(i),c=Boolean(o),f=!1;if(n<r)if(a){u=t.transpose(),n=u.rows,r=u.columns,f=!0;let e=s;s=c,c=e}else u=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else u=t.clone();let l=Math.min(n,r),h=Math.min(n+1,r),d=new Float64Array(h),p=new tf(n,l),v=new tf(r,r),g=new Float64Array(r),y=new Float64Array(n),m=new Float64Array(h);for(let t=0;t<h;t++)m[t]=t;let b=Math.min(n-1,r),_=Math.max(0,Math.min(r-2,n)),w=Math.max(b,_);for(let t=0;t<w;t++){if(t<b){d[t]=0;for(let e=t;e<n;e++)d[t]=nf(d[t],u.get(e,t));if(0!==d[t]){u.get(t,t)<0&&(d[t]=-d[t]);for(let e=t;e<n;e++)u.set(e,t,u.get(e,t)/d[t]);u.set(t,t,u.get(t,t)+1)}d[t]=-d[t]}for(let e=t+1;e<r;e++){if(t<b&&0!==d[t]){let r=0;for(let i=t;i<n;i++)r+=u.get(i,t)*u.get(i,e);r=-r/u.get(t,t);for(let i=t;i<n;i++)u.set(i,e,u.get(i,e)+r*u.get(i,t))}g[e]=u.get(t,e)}if(s&&t<b)for(let e=t;e<n;e++)p.set(e,t,u.get(e,t));if(t<_){g[t]=0;for(let e=t+1;e<r;e++)g[t]=nf(g[t],g[e]);if(0!==g[t]){g[t+1]<0&&(g[t]=0-g[t]);for(let e=t+1;e<r;e++)g[e]/=g[t];g[t+1]+=1}if(g[t]=-g[t],t+1<n&&0!==g[t]){for(let e=t+1;e<n;e++)y[e]=0;for(let e=t+1;e<n;e++)for(let n=t+1;n<r;n++)y[e]+=g[n]*u.get(e,n);for(let e=t+1;e<r;e++){let r=-g[e]/g[t+1];for(let i=t+1;i<n;i++)u.set(i,e,u.get(i,e)+r*y[i])}}if(c)for(let e=t+1;e<r;e++)v.set(e,t,g[e])}}let x=Math.min(r,n+1);if(b<r&&(d[b]=u.get(b,b)),n<x&&(d[x-1]=0),_+1<x&&(g[_]=u.get(_,x-1)),g[x-1]=0,s){for(let t=b;t<l;t++){for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}for(let t=b-1;t>=0;t--)if(0!==d[t]){for(let e=t+1;e<l;e++){let r=0;for(let i=t;i<n;i++)r+=p.get(i,t)*p.get(i,e);r=-r/p.get(t,t);for(let i=t;i<n;i++)p.set(i,e,p.get(i,e)+r*p.get(i,t))}for(let e=t;e<n;e++)p.set(e,t,-p.get(e,t));p.set(t,t,1+p.get(t,t));for(let e=0;e<t-1;e++)p.set(e,t,0)}else{for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}}if(c)for(let t=r-1;t>=0;t--){if(t<_&&0!==g[t])for(let e=t+1;e<r;e++){let n=0;for(let i=t+1;i<r;i++)n+=v.get(i,t)*v.get(i,e);n=-n/v.get(t+1,t);for(let i=t+1;i<r;i++)v.set(i,e,v.get(i,e)+n*v.get(i,t))}for(let e=0;e<r;e++)v.set(e,t,0);v.set(t,t,1)}let E=x-1,S=0,A=Number.EPSILON;for(;x>0;){let t,e;for(t=x-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(d[t]+Math.abs(d[t+1]));if(Math.abs(g[t])<=e||Number.isNaN(g[t])){g[t]=0;break}}if(t===x-2)e=4;else{let n;for(n=x-1;n>=t&&n!==t;n--){let e=(n!==x?Math.abs(g[n]):0)+(n!==t+1?Math.abs(g[n-1]):0);if(Math.abs(d[n])<=A*e){d[n]=0;break}}n===t?e=3:n===x-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=g[x-2];g[x-2]=0;for(let n=x-2;n>=t;n--){let i=nf(d[n],e),o=d[n]/i,a=e/i;if(d[n]=i,n!==t&&(e=-a*g[n-1],g[n-1]=o*g[n-1]),c)for(let t=0;t<r;t++)i=o*v.get(t,n)+a*v.get(t,x-1),v.set(t,x-1,-a*v.get(t,n)+o*v.get(t,x-1)),v.set(t,n,i)}break}case 2:{let e=g[t-1];g[t-1]=0;for(let r=t;r<x;r++){let i=nf(d[r],e),o=d[r]/i,a=e/i;if(d[r]=i,e=-a*g[r],g[r]=o*g[r],s)for(let e=0;e<n;e++)i=o*p.get(e,r)+a*p.get(e,t-1),p.set(e,t-1,-a*p.get(e,r)+o*p.get(e,t-1)),p.set(e,r,i)}break}case 3:{const e=Math.max(Math.abs(d[x-1]),Math.abs(d[x-2]),Math.abs(g[x-2]),Math.abs(d[t]),Math.abs(g[t])),i=d[x-1]/e,o=d[x-2]/e,a=g[x-2]/e,u=d[t]/e,f=g[t]/e,l=((o+i)*(o-i)+a*a)/2,h=i*a*(i*a);let y=0;0===l&&0===h||(y=l<0?0-Math.sqrt(l*l+h):Math.sqrt(l*l+h),y=h/(l+y));let m=(u+i)*(u-i)+y,b=u*f;for(let e=t;e<x-1;e++){let i=nf(m,b);0===i&&(i=Number.MIN_VALUE);let o=m/i,a=b/i;if(e!==t&&(g[e-1]=i),m=o*d[e]+a*g[e],g[e]=o*g[e]-a*d[e],b=a*d[e+1],d[e+1]=o*d[e+1],c)for(let t=0;t<r;t++)i=o*v.get(t,e)+a*v.get(t,e+1),v.set(t,e+1,-a*v.get(t,e)+o*v.get(t,e+1)),v.set(t,e,i);if(i=nf(m,b),0===i&&(i=Number.MIN_VALUE),o=m/i,a=b/i,d[e]=i,m=o*g[e]+a*d[e+1],d[e+1]=-a*g[e]+o*d[e+1],b=a*g[e+1],g[e+1]=o*g[e+1],s&&e<n-1)for(let t=0;t<n;t++)i=o*p.get(t,e)+a*p.get(t,e+1),p.set(t,e+1,-a*p.get(t,e)+o*p.get(t,e+1)),p.set(t,e,i)}g[x-2]=m,S+=1;break}case 4:if(d[t]<=0&&(d[t]=d[t]<0?-d[t]:0,c))for(let e=0;e<=E;e++)v.set(e,t,-v.get(e,t));for(;t<E&&!(d[t]>=d[t+1]);){let e=d[t];if(d[t]=d[t+1],d[t+1]=e,c&&t<r-1)for(let n=0;n<r;n++)e=v.get(n,t+1),v.set(n,t+1,v.get(n,t)),v.set(n,t,e);if(s&&t<n-1)for(let r=0;r<n;r++)e=p.get(r,t+1),p.set(r,t+1,p.get(r,t)),p.set(r,t,e);t++}S=0,x--}}if(f){let t=v;v=p,p=t}this.m=n,this.n=r,this.s=d,this.U=p,this.V=v}solve(t){let e=t,n=this.threshold,r=this.s.length,i=tf.zeros(r,r);for(let t=0;t<r;t++)Math.abs(this.s[t])<=n?i.set(t,t,0):i.set(t,t,1/this.s[t]);let o=this.U,a=this.rightSingularVectors,u=a.mmul(i),s=a.rows,c=o.rows,f=tf.zeros(s,c);for(let t=0;t<s;t++)for(let e=0;e<c;e++){let n=0;for(let i=0;i<r;i++)n+=u.get(t,i)*o.get(e,i);f.set(t,e,n)}return f.mmul(e)}solveForDiagonal(t){return this.solve(tf.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new tf(n,this.s.length);for(let o=0;o<n;o++)for(let n=0;n<r;n++)Math.abs(this.s[n])>e&&i.set(o,n,t.get(o,n)/this.s[n]);let o=this.U,a=o.rows,u=o.columns,s=new tf(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<u;r++)n+=i.get(t,r)*o.get(e,r);s.set(t,e,n)}return s}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s;for(let r=0,i=n.length;r<i;r++)n[r]>t&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return tf.diag(this.s)}}var of=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,r=t.linkDistance;try{var i=tf.mul(tf.pow(n,2),-.5),o=i.mean("row"),a=i.mean("column"),u=i.mean();i.add(u).subRowVector(o).subColumnVector(a);var s=new rf(i),c=tf.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return tf.mul([t],[c]).toJSON()[0].splice(0,e)}))}catch(t){for(var f=[],l=0;l<n.length;l++){var h=Math.random()*r,d=Math.random()*r;f.push([h,d])}return f}},t}();const af=of;var uf=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,i=t.width/10;t.maxDisplace=i,t.disp=n;for(var o=0;o<r;o++)e.forEach((function(t,e){n[e]={x:0,y:0}})),t.getRepulsion(),t.updatePositions();return e},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,i=t.k,o=t.radii||[];e.forEach((function(a,u){r[u]={x:0,y:0},e.forEach((function(e,s){if(u!==s&&o[u]===o[s]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var h=u>s?1:-1;c=.01*h,f=.01*h}if(l<t.nodeSizeFunc(n[u])/2+t.nodeSizeFunc(n[s])/2){var d=i*i/l;r[u].x+=c/l*d,r[u].y+=f/l*d}}}))}))},t.prototype.updatePositions=function(){var t=this,e=t.positions,n=t.disp,r=t.speed,i=t.strictRadial,o=t.focusID,a=t.maxDisplace||t.width/10;i&&n.forEach((function(t,n){var r=e[n][0]-e[o][0],i=e[n][1]-e[o][1],a=Math.sqrt(r*r+i*i),u=i/a,s=-r/a,c=Math.sqrt(t.x*t.x+t.y*t.y),f=Math.acos((u*t.x+s*t.y)/c);f>Math.PI/2&&(f-=Math.PI/2,u*=-1,s*=-1);var l=Math.cos(f)*c;t.x=u*l,t.y=s*l}));var u=t.radii;e.forEach((function(t,s){if(s!==o){var c=Math.sqrt(n[s].x*n[s].x+n[s].y*n[s].y);if(c>0&&s!==o){var f=Math.min(a*(r/800),c);if(t[0]+=n[s].x/c*f,t[1]+=n[s].y/c*f,i){var l=t[0]-e[o][0],h=t[1]-e[o][1],d=Math.sqrt(l*l+h*h);l=l/d*u[s],h=h/d*u[s],t[0]=e[o][0]+l,t[1]=e[o][1]+h}}}}))},t}();const sf=uf;var cf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function ff(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var lf=function(t){function n(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.focusNode=null,n.unitRadius=null,n.linkDistance=50,n.preventOverlap=!1,n.strictRadial=!0,n.maxPreventOverlapIteration=200,n.sortStrength=10,n.nodes=[],n.edges=[],n.updateCfg(e),n}return cf(n,t),n.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges||[];if(n&&0!==n.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var u=t.center;if(1===n.length)return n[0].x=u[0],n[0].y=u[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s=t.linkDistance,c=null;if(e(t.focusNode)){for(var l=!1,h=0;h<n.length;h++)n[h].id===t.focusNode&&(c=n[h],t.focusNode=c,l=!0,h=n.length);l||(c=null)}else c=t.focusNode;c||(c=n[0],t.focusNode=c);var d=function(t,e){var n=-1;return t.forEach((function(t,r){t.id===e&&(n=r)})),n}(n,c.id);d<0&&(d=0),t.focusIndex=d;var g=v({nodes:n,edges:r},!1),y=p(g),b=t.maxToFocus(y,d);t.handleInfinity(y,d,b+1),t.distances=y;var _=y[d],w=t.width||500,x=t.height||500,E=w-u[0]>u[0]?u[0]:w-u[0],S=x-u[1]>u[1]?u[1]:x-u[1];0===E&&(E=w/2),0===S&&(S=x/2);var A=S>E?E:S,T=Math.max.apply(Math,_),I=[];_.forEach((function(e,n){t.unitRadius||(t.unitRadius=A/T),I[n]=e*t.unitRadius})),t.radii=I;var N=t.eIdealDisMatrix();t.eIdealDistances=N;var k=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;i<e;i++){for(var o=[],a=0;a<n;a++)0!==t[i][a]?o.push(1/(t[i][a]*t[i][a])):o.push(0);r.push(o)}return r}(N);t.weights=k;var C=new af({linkDistance:s,distances:N}).layout();C.forEach((function(t){a(t[0])&&(t[0]=Math.random()*s),a(t[1])&&(t[1]=Math.random()*s)})),t.positions=C,C.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),C.forEach((function(t){t[0]-=C[d][0],t[1]-=C[d][1]})),t.run();var O,D=t.preventOverlap,R=t.nodeSize,M=t.strictRadial;if(D){var P,G=t.nodeSpacing;P=o(G)?function(){return G}:m(G)?G:function(){return 0},O=R?i(R)?function(t){return(R[0]>R[1]?R[0]:R[1])+P(t)}:function(t){return R+P(t)}:function(t){return t.size?i(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+P(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+P(t):t.size+P(t):10+P(t)};var L={nodes:n,nodeSizeFunc:O,adjMatrix:g,positions:C,radii:I,height:x,width:w,strictRadial:M,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:C.length/4.5},j=new sf(L);C=j.layout()}return C.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],i=t.eIdealDistances||[],o=t.radii||[],a=0;a<=e;a++){var u=a/e;t.oneIteration(u,n,o,i,r)}},n.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(u,s){var c=ff(u,[0,0]),f=0===c?0:1/c;if(s!==a){var l=0,h=0,d=0;e.forEach((function(t,e){if(s!==e){var n=ff(u,t),o=0===n?0:1/n,a=r[e][s];d+=i[s][e],l+=i[s][e]*(t[0]+a*(u[0]-t[0])*o),h+=i[s][e]*(t[1]+a*(u[1]-t[1])*o)}}));var p=0===n[s]?0:1/n[s];d*=o,d+=t*p*p,l*=o,l+=t*p*u[0]*f,u[0]=l/d,h*=o,h+=t*p*u[1]*f,u[1]=h/d}}))},n.prototype.eIdealDisMatrix=function(){var t=this,n=t.nodes;if(!n)return[];var r=t.distances,i=t.linkDistance,o=t.radii||[],a=t.unitRadius||50,u=[];return r&&r.forEach((function(r,s){var c=[];r.forEach((function(r,u){if(s===u)c.push(0);else if(o[s]===o[u])if("data"===t.sortBy)c.push(r*(Math.abs(s-u)*t.sortStrength)/(o[s]/a));else if(t.sortBy){var f=n[s][t.sortBy]||0,l=n[u][t.sortBy]||0;e(f)&&(f=f.charCodeAt(0)),e(l)&&(l=l.charCodeAt(0)),c.push(r*(Math.abs(f-l)*t.sortStrength)/(o[s]/a))}else c.push(r*i/(o[s]/a));else{var h=(i+a)/2;c.push(r*h)}})),u.push(c)})),u},n.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(var o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(i=0;i<r;i++)if(i!==e)for(o=0;o<r;o++)if(t[i][o]===1/0){var a=Math.abs(t[e][i]-t[e][o]);a=0===a?1:a,t[i][o]=a}},n.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},n.prototype.getType=function(){return"radial"},n}(t),hf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),df=function(t){function n(e){var n=t.call(this)||this;return n.nodeSize=30,n.minNodeSpacing=10,n.nodeSpacing=10,n.preventOverlap=!1,n.equidistant=!1,n.startAngle=1.5*Math.PI,n.clockwise=!0,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.onLayoutEnd=function(){},n.updateCfg(e),n}return hf(n,t),n.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},n.prototype.execute=function(){var t,n,r=this,a=r.nodes,u=r.edges,s=a.length;if(0!==s){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var c=r.center;if(1===s)return a[0].x=c[0],a[0].y=c[1],void(null===(n=r.onLayoutEnd)||void 0===n||n.call(r));var l,h=r.nodeSize,p=r.nodeSpacing,v=[],g=0;l=i(h)?Math.max(h[0],h[1]):h,i(p)?g=Math.max(p[0],p[1]):o(p)&&(g=p),a.forEach((function(t){v.push(t);var e=l;i(t.size)?e=Math.max(t.size[0],t.size[1]):o(t.size)?e=t.size:f(t.size)&&(e=Math.max(t.size.width,t.size.height)),l=Math.max(l,e),m(p)&&(g=Math.max(p(t),g))})),r.clockwise=void 0!==r.counterclockwise?!r.counterclockwise:r.clockwise;var y={},b={};if(v.forEach((function(t,e){y[t.id]=t,b[t.id]=e})),!("degree"!==r.sortBy&&e(r.sortBy)&&void 0!==v[0][r.sortBy]||(r.sortBy="degree",o(a[0].degree)))){var _=d(a.length,b,u);v.forEach((function(t,e){t.degree=_[e]}))}v.sort((function(t,e){return e[r.sortBy]-t[r.sortBy]})),r.maxValueNode=v[0],r.maxLevelDiff=r.maxLevelDiff||r.maxValueNode[r.sortBy]/4;var w=[[]],x=w[0];v.forEach((function(t){if(x.length>0){var e=Math.abs(x[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(x=[],w.push(x))}x.push(t)}));var E=l+(g||r.minNodeSpacing);if(!r.preventOverlap){var S=w.length>0&&w[0].length>1,A=(Math.min(r.width,r.height)/2-E)/(w.length+(S?1:0));E=Math.min(E,A)}var T=0;if(w.forEach((function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var i=Math.cos(n)-Math.cos(0),o=Math.sin(n)-Math.sin(0),a=Math.sqrt(E*E/(i*i+o*o));T=Math.max(a,T)}t.r=T,T+=E})),r.equidistant){for(var I=0,N=0,k=0;k<w.length;k++){var C=w[k].r-N;I=Math.max(I,C)}N=0,w.forEach((function(t,e){0===e&&(N=t.r),t.r=N,N+=I}))}return w.forEach((function(t){var e=t.dTheta,n=t.r;t.forEach((function(t,i){var o=r.startAngle+(r.clockwise?1:-1)*e*i;t.x=c[0]+n*Math.cos(o),t.y=c[1]+n*Math.sin(o)}))})),r.onLayoutEnd&&r.onLayoutEnd(),{nodes:a,edges:u}}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},n.prototype.getType=function(){return"concentric"},n}(t),pf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vf=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.linkDistance=50,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return pf(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=void 0===n?[]:n,i=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var o=t.linkDistance,a=v({nodes:e,edges:r},!1),u=p(a);t.handleInfinity(u);var s,c,f=(s=o,c=[],u.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*s)})),c.push(e)})),c);t.scaledDistances=f;var l=t.runMDS();return t.positions=l,l.forEach((function(t,n){e[n].x=t[0]+i[0],e[n].y=t[1]+i[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.runMDS=function(){var t=this.scaledDistances,e=tf.mul(tf.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);var o=new rf(e),a=tf.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return tf.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,i){n===1/0&&(t[r][i]=e)}))}))},e.prototype.getType=function(){return"mds"},e}(t),gf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yf=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.animate=!0,n.updateCfg(e),n}return gf(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=this,i=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),i&&0!==i.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var a=r.center;if(1===i.length)return i[0].x=a[0],i[0].y=a[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var u={},s={};return i.forEach((function(t,e){o(t.x)||(t.x=Math.random()*n.width),o(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),r.nodeMap=u,r.nodeIdxMap=s,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,u=e.animate,s={};if(a&&n.forEach((function(t){void 0===s[t.cluster]&&(s[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})})),o||!u){for(var c=0;c<i;c++)e.runOneStep(s);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var f=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(s),++f>=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var i=n.edges,a=n.center,u=n.gravity,s=n.speed,c=n.clustering,f=n.height*n.width,l=Math.sqrt(f)/10,h=f/(r.length+1),d=Math.sqrt(h),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,i,p,d,h),c){for(var v in t)t[v].cx=0,t[v].cy=0,t[v].count=0;for(var v in r.forEach((function(e){var n=t[e.cluster];o(e.x)&&(n.cx+=e.x),o(e.y)&&(n.cy+=e.y),n.count++})),t)t[v].cx/=t[v].count,t[v].cy/=t[v].count;var g=n.clusterGravity||u;r.forEach((function(e,n){if(o(e.x)&&o(e.y)){var r=t[e.cluster],i=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),a=d*g;p[n].x-=a*(e.x-r.cx)/i,p[n].y-=a*(e.y-r.cy)/i}}))}r.forEach((function(t,e){if(o(t.x)&&o(t.y)){var n=.01*d*u;p[e].x-=n*(t.x-a[0]),p[e].y-=n*(t.y-a[1])}})),r.forEach((function(t,e){if(o(t.fx)&&o(t.fy))return t.x=t.fx,void(t.y=t.fy);if(o(t.x)&&o(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(l*(s/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,a){if(i!==a&&o(r.x)&&o(t.x)&&o(r.y)&&o(t.y)){var u=r.x-t.x,s=r.y-t.y,c=u*u+s*s;if(0===c){c=1;var f=i>a?1:-1;u=.01*f,s=.01*f}var l=n/c;e[i].x+=u*l,e[i].y+=s*l}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var i=h(t,"source"),a=h(t,"target");if(i&&a){var u=r.nodeIdxMap[i],s=r.nodeIdxMap[a];if(u!==s){var c=r.nodeMap[i],f=r.nodeMap[a];if(o(f.x)&&o(c.x)&&o(f.y)&&o(c.y)){var l=f.x-c.x,d=f.y-c.y,p=Math.sqrt(l*l+d*d),v=p*p/n;e[s].x-=l/p*v,e[s].y-=d/p*v,e[u].x+=l/p*v,e[u].y+=d/p*v}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(t);function mf(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function bf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function wf(t,e,n){return e&&_f(t.prototype,e),n&&_f(t,n),t}function xf(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}n(8892);var Ef=n(122),Sf=n.n(Ef);function Af(t,e,n,r,i,o,a){try{var u=t[o](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,i)}function Tf(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Af(o,r,i,a,u,"next",t)}function u(t){Af(o,r,i,a,u,"throw",t)}a(void 0)}))}}var If=1;function Nf(){return If++}var kf=function t(e){bf(this,t)},Cf=function(){function t(e){bf(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return wf(t,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,e){this.lookup[t]=this.components.length;var n=new this.clazz(e||{});return this.components.push(n),this.entities.push(t),n}},{key:"remove",value:function(t){var e=this.lookup[t];e>-1&&e<this.components.length-1&&(this.components[e]=this.components[this.components.length-1],this.entities[e]=this.entities[this.entities.length-1],this.lookup[this.entities[e]]=e),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var e=this.lookup[t];if(e>-1){var n=this.entities[e];if(e<this.components.length-1){for(var r=e+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=e+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(t,e){if(t!==e){for(var n=this.components[t],r=this.entities[t],i=t<e?1:-1,o=t;o!==e;o+=i){var a=o+i;this.components[o]=this.components[a],this.entities[o]=this.entities[a],this.lookup[this.entities[o]]=o}this.components[e]=n,this.entities[e]=r,this.lookup[r]=e}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var e=this.lookup[t];return e>-1?this.components[e]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r);if(this.lookup[i]===t)return i}return-1}},{key:"find",value:function(t){for(var e=0;e<this.getCount();e++){var n=this.getComponent(e);if(t(n,e))return n}return null}},{key:"findIndex",value:function(t){for(var e=0;e<this.getCount();e++)if(t(this.getComponent(e),e))return e;return-1}},{key:"forEach",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r),o=this.lookup[i];t(i,this.getComponent(o))}}},{key:"forEachAsync",value:(e=Tf(Sf().mark((function t(e){var n,r,i,o,a;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.lookup);case 1:if(!(n<r.length)){t.next=10;break}return i=r[n],o=Number(i),a=this.lookup[o],t.next=7,e(o,this.getComponent(a));case 7:n++,t.next=1;break;case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"map",value:function(t){for(var e=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],o=Number(i),a=this.lookup[o];e.push(t(o,this.getComponent(a)))}return e}}]),t}();function Of(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Df(t,e){if(t){if("string"==typeof t)return Of(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Of(t,e):void 0}}function Rf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){u=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}}(t,e)||Df(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Mf=n(9311),Pf={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),Geometry:Symbol("Geometry"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),Material:Symbol("Material"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter"),Light:Symbol("Light")},Gf=function t(){bf(this,t),this.index=void 0},Lf=function t(){bf(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},jf=function(){function t(){bf(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return wf(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){var n=this.writes.find((function(t){return t.index===e.index}));if(n)return e;var r=t.getResourceNode(e);r.resource.version++,r.resource.imported&&(this.hasSideEffect=!0);var i=t.createResourceNode(r.resource);return t.getResourceNode(i).writer=this,this.writes.push(i),i}}]),t}();function Uf(t,e){return Uf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Uf(t,e)}function Bf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uf(t,e)}function zf(t){return zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zf(t)}function Ff(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wf(t,e){if(e&&("object"===zf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ff(t)}function Vf(t){return Vf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vf(t)}var Hf,Xf,qf,Yf,Kf,$f,Zf=function(t){Bf(i,(function t(){bf(this,t),this.first=void 0,this.last=void 0}));var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){var t;bf(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=r.call.apply(r,[this].concat(n))).version=0,t.refs=0,t.name=void 0,t.imported=void 0,t.priority=void 0,t.discardStart=!0,t.discardEnd=!1,t.descriptor=void 0,t.resource=void 0,t}return wf(i,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){this.imported}}]),i}(),Jf=function t(){bf(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function Qf(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return tl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function tl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var el=(Hf=(0,Mf.b2)(),Xf=(0,Mf.f3)(Pf.RenderEngine),Hf(($f=function(){function t(){bf(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],mf(this,"engine",Kf,this)}var e,n;return wf(t,[{key:"execute",value:(n=Tf(Sf().mark((function t(e){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.compile(),t.next=3,this.executePassNodes(e);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.frameGraphPasses.forEach((function(t){t.tearDown&&t.tearDown()})),this.reset()}},{key:"addPass",value:function(t,e,n,r){var i=new Lf;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new jf;return o.name=t,this.passNodes.push(o),this.frameGraphPasses.push(i),e(this,o,i),i}},{key:"getPass",value:function(t){return this.frameGraphPasses.find((function(e){return e.name===t}))}},{key:"compile",value:function(){var t,e=this,n=Qf(this.passNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.refCount=r.writes.length+(r.hasSideEffect?1:0),r.reads.forEach((function(t){e.resourceNodes[t.index].readerCount++}))}}catch(t){n.e(t)}finally{n.f()}var i,o=[],a=Qf(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var u=i.value;0===u.readerCount&&o.push(u)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var s=o.pop(),c=s&&s.writer;if(c&&0==--c.refCount){var f,l=Qf(c.reads);try{for(l.s();!(f=l.n()).done;){var h=f.value,d=this.resourceNodes[h.index];0==--d.readerCount&&o.push(d)}}catch(t){l.e(t)}finally{l.f()}}}this.resourceNodes.forEach((function(t){t.resource.refs+=t.readerCount}));var p,v=Qf(this.passNodes);try{for(v.s();!(p=v.n()).done;){var g=p.value;if(g.refCount){var y,m=Qf(g.reads);try{for(m.s();!(y=m.n()).done;){var b=y.value,_=this.resourceNodes[b.index].resource;_.first=_.first?_.first:g,_.last=g}}catch(t){m.e(t)}finally{m.f()}var w,x=Qf(g.writes);try{for(x.s();!(w=x.n()).done;){var E=w.value,S=this.resourceNodes[E.index].resource;S.first=S.first?S.first:g,S.last=g}}catch(t){x.e(t)}finally{x.f()}}}}catch(t){v.e(t)}finally{v.f()}for(var A=0;A<2;A++){var T,I=Qf(this.resourceNodes);try{for(I.s();!(T=I.n()).done;){var N=T.value.resource;if(N.priority===A&&N.refs){var k=N.first,C=N.last;k&&C&&(k.devirtualize.push(N),C.destroy.push(N))}}}catch(t){I.e(t)}finally{I.f()}}}},{key:"executePassNodes",value:(e=Tf(Sf().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Qf(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=Rf(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}u=Qf(a.devirtualize);try{for(u.s();!(s=u.n()).done;)s.value.preExecuteDevirtualize(this.engine)}catch(t){u.e(t)}finally{u.f()}c=Qf(a.destroy);try{for(c.s();!(f=c.n()).done;)f.value.preExecuteDestroy(this.engine)}catch(t){c.e(t)}finally{c.f()}return t.next=12,this.frameGraphPasses[o].execute(this,this.frameGraphPasses[o],e);case 12:l=Qf(a.devirtualize);try{for(l.s();!(h=l.n()).done;)h.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}d=Qf(a.destroy);try{for(d.s();!(p=d.n()).done;)p.value.postExecuteDestroy(this.engine)}catch(t){d.e(t)}finally{d.f()}case 16:t.next=3;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:this.reset();case 27:case"end":return t.stop()}}),t,this,[[1,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var e=new Jf;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new Gf;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new Zf;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new Zf;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"present",value:function(t){this.addPass("Present",(function(e,n){n.read(t),n.hasSideEffect=!0}),Tf(Sf().mark((function t(){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),Kf=xf((Yf=$f).prototype,"engine",[Xf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qf=Yf))||qf);function nl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var rl=1e-6,il="undefined"!=typeof Float32Array?Float32Array:Array;function ol(){var t=new il(4);return il!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function al(t,e,n,r){var i=new il(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ul(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function sl(){var t=new il(9);return il!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function cl(){var t=new il(3);return il!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function fl(t){var e=new il(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ll(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function hl(t,e,n){var r=new il(3);return r[0]=t,r[1]=e,r[2]=n,r}function dl(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function pl(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function vl(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function gl(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function yl(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function ml(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function bl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _l(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function wl(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function xl(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),ol();var El=gl,Sl=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},Al=ll,Tl=(cl(),9007199254740991),Il={};Il["[object Float32Array]"]=Il["[object Float64Array]"]=Il["[object Int8Array]"]=Il["[object Int16Array]"]=Il["[object Int32Array]"]=Il["[object Uint8Array]"]=Il["[object Uint8ClampedArray]"]=Il["[object Uint16Array]"]=Il["[object Uint32Array]"]=!0,Il["[object Arguments]"]=Il["[object Array]"]=Il["[object ArrayBuffer]"]=Il["[object Boolean]"]=Il["[object DataView]"]=Il["[object Date]"]=Il["[object Error]"]=Il["[object Function]"]=Il["[object Map]"]=Il["[object Number]"]=Il["[object Object]"]=Il["[object RegExp]"]=Il["[object Set]"]=Il["[object String]"]=Il["[object WeakMap]"]=!1;var Nl=Object.prototype.toString,kl=function(t){return function(t){return!!t&&"object"===zf(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Tl}(t.length)&&!!Il[Nl.call(t)]};function Cl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ol(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cl(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Dl,Rl,Ml,Pl,Gl,Ll,jl,Ul,Bl,zl=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(t){var e;return bf(this,i),(e=r.call(this,t)).dirty=!0,e.attributes=[],e.indices=void 0,e.indicesBuffer=void 0,e.vertexCount=0,e.maxInstancedCount=void 0,e.aabb=void 0,e.entity=void 0,Object.assign(Ff(e),t),e}return wf(i,[{key:"setAttribute",value:function(t,e,n,r){var i=this.attributes.find((function(e){return e.name===t}));return i?(i.data=e,i.dirty=!0):this.attributes.push(Ol(Ol({dirty:!0,name:t,data:e},n),{},{bufferGetter:r})),this.dirty=!0,this}},{key:"setIndex",value:function(t){return this.indices=new Uint32Array(t.buffer?t.buffer:t),this.dirty=!0,this}},{key:"applyMatrix",value:function(t){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,w,x,E,S,A,T,I,N,k,C,O,D=this.attributes.find((function(t){return"position"===t.name})),R=this.attributes.find((function(t){return"normal"===t.name}));if(D&&(D.dirty=!0,D.data&&D.data.length))for(var M=0;M<D.data.length;M+=3){var P=al(D.data[M],D.data[M+1],D.data[M+2],1);ul(P,P,t),kl(D.data)?D.data.set([P[0],P[1],P[2]],M):(D.data[M]=P[0],D.data[M+1]=P[1],D.data[M+2]=P[2])}if(R){var G=(e=sl(),r=(n=t)[0],i=n[1],o=n[2],a=n[3],u=n[4],s=n[5],c=n[6],f=n[7],l=n[8],h=n[9],d=n[10],p=n[11],v=n[12],g=n[13],y=n[14],m=n[15],(O=(b=r*s-i*u)*(C=d*m-p*y)-(_=r*c-o*u)*(k=h*m-p*g)+(w=r*f-a*u)*(N=h*y-d*g)+(x=i*c-o*s)*(I=l*m-p*v)-(E=i*f-a*s)*(T=l*y-d*v)+(S=o*f-a*c)*(A=l*g-h*v))?(O=1/O,e[0]=(s*C-c*k+f*N)*O,e[1]=(c*I-u*C-f*T)*O,e[2]=(u*k-s*I+f*A)*O,e[3]=(o*k-i*C-a*N)*O,e[4]=(r*C-o*I+a*T)*O,e[5]=(i*I-r*k-a*A)*O,e[6]=(g*S-y*E+m*x)*O,e[7]=(y*w-v*S-m*_)*O,e[8]=(v*E-g*w+m*b)*O,e):null);if(R.data&&R.data.length)for(var L=0;L<R.data.length;L+=3){var j=hl(R.data[L],R.data[L+1],R.data[L+2]);xl(j,j,G),ml(j,j),kl(R.data)?R.data.set([j[0],j[1],j[2]],L):(R.data[L]=j[0],R.data[L+1]=j[1],R.data[L+2]=j[2])}}}}]),i}(kf);!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(Dl||(Dl={}));var Fl=(Rl=(0,Mf.b2)(),Ml=(0,Mf.f3)(Pf.GeometryComponentManager),Pl=(0,Mf.f3)(Pf.RenderEngine),Rl((Bl=function(){function t(){bf(this,t),mf(this,"geometry",jl,this),mf(this,"engine",Ul,this)}var e;return wf(t,[{key:"execute",value:(e=Tf(Sf().mark((function t(){var e=this;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.geometry.forEach((function(t,n){n.dirty&&(n.attributes.forEach((function(t){var n;t.dirty&&t.data&&(t.buffer?null===(n=t.buffer)||void 0===n||n.subData({data:t.data,offset:0}):t.buffer=e.engine.createBuffer({data:t.data,type:Dl.FLOAT}),t.dirty=!1)})),n.indices&&(n.indicesBuffer?n.indicesBuffer.subData({data:n.indices,offset:0}):n.indicesBuffer=e.engine.createElements({data:n.indices,count:n.indices.length,type:Dl.UNSIGNED_INT,usage:Dl.STATIC_DRAW})),n.dirty=!1)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(t,e){e.indicesBuffer&&e.indicesBuffer.destroy(),e.attributes.forEach((function(t){t.buffer&&t.buffer.destroy()}))})),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=Nf();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Nf();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),jl=xf((Ll=Bl).prototype,"geometry",[Ml],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ul=xf(Ll.prototype,"engine",[Pl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gl=Ll))||Gl);function Wl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wl(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Hl,Xl,ql,Yl,Kl,$l,Zl,Jl,Ql,th,eh=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(t){var e;return bf(this,i),(e=r.call(this,t)).vertexShaderGLSL=void 0,e.fragmentShaderGLSL=void 0,e.defines={},e.dirty=!0,e.uniforms=[],e.cull={enable:!0,face:Dl.BACK},e.depth={enable:!0},e.blend=void 0,e.entity=void 0,e.type=void 0,Object.assign(Ff(e),t),e}return wf(i,[{key:"setDefines",value:function(t){return this.defines=Vl(Vl({},this.defines),t),this}},{key:"setCull",value:function(t){return this.cull=t,this}},{key:"setDepth",value:function(t){return this.depth=t,this}},{key:"setBlend",value:function(t){return this.blend=t,this}},{key:"setUniform",value:function(t,e){var n=this;if("string"!=typeof t)return Object.keys(t).forEach((function(e){return n.setUniform(e,t[e])})),this;var r=this.uniforms.find((function(e){return e.name===t}));return r?(r.dirty=!0,r.data=e):this.uniforms.push({name:t,dirty:!0,data:e}),this.dirty=!0,this}}]),i}(kf);function nh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function rh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nh(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ih,oh=(Hl=(0,Mf.b2)(),Xl=(0,Mf.f3)(Pf.MaterialComponentManager),ql=(0,Mf.f3)(Pf.RenderEngine),Yl=(0,Mf.f3)(Pf.ShaderModuleService),Hl((th=function(){function t(){bf(this,t),mf(this,"material",Zl,this),mf(this,"engine",Jl,this),mf(this,"shaderModule",Ql,this)}var e;return wf(t,[{key:"execute",value:(e=Tf(Sf().mark((function t(){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createShaderMaterial",value:function(t){var e=Nf(),n=t.vertexShader,r=t.fragmentShader,i=[];if(!this.engine.supportWebGPU){var o="material-".concat(e);this.shaderModule.registerModule(o,{vs:t.vertexShader,fs:t.fragmentShader});var a=this.shaderModule.getModule(o);n=a.vs,r=a.fs,a.uniforms&&(i=Object.keys(a.uniforms).map((function(t){return{dirty:!0,name:t,data:a.uniforms[t]}})))}return this.material.create(e,rh(rh({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),Zl=xf(($l=th).prototype,"material",[Xl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jl=xf($l.prototype,"engine",[ql],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ql=xf($l.prototype,"shaderModule",[Yl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kl=$l))||Kl);!function(t){t[t.Standard=0]="Standard"}(ih||(ih={}));var ah=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(t){var e;return bf(this,i),(e=r.call(this,t)).strategy=ih.Standard,e.visibilityPlaneMask=0,e.visible=!1,Object.assign(Ff(e),t),e}return i}(kf),uh=function(){function t(e,n){bf(this,t),this.center=void 0,this.halfExtents=void 0,this.min=cl(),this.max=cl(),this.update(e,n)}return wf(t,[{key:"update",value:function(t,e){this.center=t||cl(),this.halfExtents=e||hl(.5,.5,.5),this.min=El(this.min,this.center,this.halfExtents),this.max=vl(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){vl(this.center,e,t),yl(this.center,this.center,.5),El(this.halfExtents,e,t),yl(this.halfExtents,this.halfExtents,.5),dl(this.min,t),dl(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],u=o[1],s=o[2],c=n-a,f=n+a,l=r-u,h=r+u,d=i-s,p=i+s,v=t.center,g=v[0],y=v[1],m=v[2],b=t.halfExtents,_=b[0],w=b[1],x=b[2],E=g-_,S=g+_,A=y-w,T=y+w,I=m-x,N=m+x;E<c&&(c=E),S>f&&(f=S),A<l&&(l=A),T>h&&(h=T),I<d&&(d=I),N>p&&(p=N),e[0]=.5*(c+f),e[1]=.5*(l+h),e[2]=.5*(d+p),o[0]=.5*(f-c),o[1]=.5*(h-l),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=l,this.min[2]=d,this.max[0]=f,this.max[1]=h,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?dl(cl(),this.min):272===t.pnVertexFlag?hl(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?hl(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?hl(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?hl(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?hl(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?hl(this.max[0],this.max[1],this.min[2]):hl(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?dl(cl(),this.max):272===t.pnVertexFlag?hl(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?hl(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?hl(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?hl(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?hl(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?hl(this.min[0],this.min[1],this.max[2]):hl(this.min[0],this.min[1],this.min[2])}}]),t}();var sh,ch=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(t){var e;return bf(this,i),(e=r.call(this,t)).material=void 0,e.geometry=void 0,e.aabb=new uh,e.aabbDirty=!0,e.model=void 0,e.visible=!0,e.children=[],Object.assign(Ff(e),t),e}return i}(kf),fh=function(){function t(e,n){bf(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||hl(0,1,0),this.updatePNVertexFlag()}return wf(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return bl(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Al(this.normal);yl(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&_l(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(sh||(sh={}));var lh,hh,dh,ph,vh,gh,yh,mh,bh,_h,wh,xh,Eh,Sh,Ah=function(){function t(e){if(bf(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new fh)}return wf(t,[{key:"extractFromVPMatrix",value:function(t){var e=Rf(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],g=e[14],y=e[15];pl(this.planes[0].normal,o-n,c-a,d-f),this.planes[0].distance=-(y-p),pl(this.planes[1].normal,o+n,c+a,d+f),this.planes[1].distance=-(y+p),pl(this.planes[2].normal,o+r,c+u,d+l),this.planes[2].distance=-(y+v),pl(this.planes[3].normal,o-r,c-u,d-l),this.planes[3].distance=-(y-v),pl(this.planes[4].normal,o-i,c-s,d-h),this.planes[4].distance=-(y-g),pl(this.planes[5].normal,o+i,c+s,d+h),this.planes[5].distance=-(y+g),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}();function Th(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ih(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ih(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ih(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Nh=(lh=(0,Mf.b2)(),hh=(0,Mf.f3)(Pf.MeshComponentManager),dh=(0,Mf.f3)(Pf.CullableComponentManager),ph=(0,Mf.f3)(Pf.GeometryComponentManager),vh=(0,Mf.f3)(Pf.HierarchyComponentManager),gh=(0,Mf.f3)(Pf.TransformComponentManager),lh((Sh=function(){function t(){bf(this,t),mf(this,"mesh",bh,this),mf(this,"cullable",_h,this),mf(this,"geometry",wh,this),mf(this,"hierarchy",xh,this),mf(this,"transform",Eh,this),this.planes=void 0}var e;return wf(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=Tf(Sf().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,w,x;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Th(e);try{for(n.s();!(r=n.n()).done;){i=r.value,o=i.getScene(),a=i.getCamera(),u=Th(o.getEntities());try{for(u.s();!(s=u.n()).done;)c=s.value,(f=this.mesh.getComponentByEntity(c))&&(l=this.hierarchy.getComponentByEntity(c),h=this.cullable.getComponentByEntity(c),d=f.geometry,p=this.transform.getComponentByEntity(c),d&&d.aabb&&p&&f.aabbDirty&&(v=p.worldTransform,g=d.aabb,y=g.center,m=g.halfExtents,b=wl(cl(),y,v),E=v,(S=sl())[0]=E[0],S[1]=E[1],S[2]=E[2],S[3]=E[4],S[4]=E[5],S[5]=E[6],S[6]=E[8],S[7]=E[9],S[8]=E[10],_=S,w=xl(cl(),m,_),f.aabb.update(b,w),f.aabbDirty=!1),h&&d&&(x=this.cullable.getComponentByEntity((null==l?void 0:l.parentID)||-1),h.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(f.aabb,(null==x?void 0:x.visibilityPlaneMask)||sh.INDETERMINATE,this.planes||a.getFrustum().planes),h.visible=h.visibilityPlaneMask!==sh.OUTSIDE))}catch(t){u.e(t)}finally{u.f()}}}catch(t){n.e(t)}finally{n.f()}case 2:case"end":return t.stop()}var E,S}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n){if(e===sh.OUTSIDE||e===sh.INSIDE)return e;for(var r=sh.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var u=n[i],s=u.normal,c=u.distance;if(bl(s,t.getNegativeFarPoint(n[i]))+c>0)return sh.OUTSIDE;bl(s,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),bh=xf((mh=Sh).prototype,"mesh",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_h=xf(mh.prototype,"cullable",[dh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wh=xf(mh.prototype,"geometry",[ph],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xh=xf(mh.prototype,"hierarchy",[vh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eh=xf(mh.prototype,"transform",[gh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yh=mh))||yh);function kh(){var t=new il(16);return il!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Ch(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Oh(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Dh(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],g=e[14],y=e[15],m=n*u-r*a,b=n*s-i*a,_=n*c-o*a,w=r*s-i*u,x=r*c-o*u,E=i*c-o*s,S=f*v-l*p,A=f*g-h*p,T=f*y-d*p,I=l*g-h*v,N=l*y-d*v,k=h*y-d*g,C=m*k-b*N+_*I+w*T-x*A+E*S;return C?(C=1/C,t[0]=(u*k-s*N+c*I)*C,t[1]=(i*N-r*k-o*I)*C,t[2]=(v*E-g*x+y*w)*C,t[3]=(h*x-l*E-d*w)*C,t[4]=(s*T-a*k-c*A)*C,t[5]=(n*k-i*T+o*A)*C,t[6]=(g*_-p*E-y*b)*C,t[7]=(f*E-h*_+d*b)*C,t[8]=(a*N-u*T+c*S)*C,t[9]=(r*T-n*N-o*S)*C,t[10]=(p*x-v*_+y*m)*C,t[11]=(l*_-f*x-d*m)*C,t[12]=(u*A-a*I-s*S)*C,t[13]=(n*I-r*A+i*S)*C,t[14]=(v*b-p*w-g*m)*C,t[15]=(f*w-l*b+h*m)*C,t):null}function Rh(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],_=n[1],w=n[2],x=n[3];return t[0]=b*r+_*u+w*l+x*v,t[1]=b*i+_*s+w*h+x*g,t[2]=b*o+_*c+w*d+x*y,t[3]=b*a+_*f+w*p+x*m,b=n[4],_=n[5],w=n[6],x=n[7],t[4]=b*r+_*u+w*l+x*v,t[5]=b*i+_*s+w*h+x*g,t[6]=b*o+_*c+w*d+x*y,t[7]=b*a+_*f+w*p+x*m,b=n[8],_=n[9],w=n[10],x=n[11],t[8]=b*r+_*u+w*l+x*v,t[9]=b*i+_*s+w*h+x*g,t[10]=b*o+_*c+w*d+x*y,t[11]=b*a+_*f+w*p+x*m,b=n[12],_=n[13],w=n[14],x=n[15],t[12]=b*r+_*u+w*l+x*v,t[13]=b*i+_*s+w*h+x*g,t[14]=b*o+_*c+w*d+x*y,t[15]=b*a+_*f+w*p+x*m,t}function Mh(t,e,n){var r,i,o,a,u,s,c,f,l,h,d,p,v=n[0],g=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*y+e[12],t[13]=e[1]*v+e[5]*g+e[9]*y+e[13],t[14]=e[2]*v+e[6]*g+e[10]*y+e[14],t[15]=e[3]*v+e[7]*g+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=c,t[7]=f,t[8]=l,t[9]=h,t[10]=d,t[11]=p,t[12]=r*v+u*g+l*y+e[12],t[13]=i*v+s*g+h*y+e[13],t[14]=o*v+c*g+d*y+e[14],t[15]=a*v+f*g+p*y+e[15]),t}function Ph(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Gh(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],u=e[6],s=e[8],c=e[9],f=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,u),t[2]=Math.hypot(s,c,f),t}function Lh(t,e){var n=new il(3);Gh(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,u=e[1]*i,s=e[2]*o,c=e[4]*r,f=e[5]*i,l=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,v=a+f+p,g=0;return v>0?(g=2*Math.sqrt(v+1),t[3]=.25*g,t[0]=(l-d)/g,t[1]=(h-s)/g,t[2]=(u-c)/g):a>f&&a>p?(g=2*Math.sqrt(1+a-f-p),t[3]=(l-d)/g,t[0]=.25*g,t[1]=(u+c)/g,t[2]=(h+s)/g):f>p?(g=2*Math.sqrt(1+f-a-p),t[3]=(h-s)/g,t[0]=(u+c)/g,t[1]=.25*g,t[2]=(l+d)/g):(g=2*Math.sqrt(1+p-a-f),t[3]=(u-c)/g,t[0]=(h+s)/g,t[1]=(l+d)/g,t[2]=.25*g),t}function jh(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,c=n*a,f=r*a,l=r*u,h=i*a,d=i*u,p=i*s,v=o*a,g=o*u,y=o*s;return t[0]=1-l-p,t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+g,t[9]=d-v,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}var Uh,Bh,zh,Fh,Wh,Vh,Hh,Xh,qh,Yh,Kh,$h,Zh,Jh,Qh,td,ed,nd,rd,id,od,ad,ud,sd;function cd(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return fd(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fd(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function fd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ld,hd,dd,pd,vd,gd,yd,md,bd,_d,wd,xd,Ed,Sd=(Uh=(0,Mf.b2)(),Bh=(0,Mf.f3)(Pf.MeshComponentManager),zh=(0,Mf.f3)(Pf.GeometryComponentManager),Fh=(0,Mf.f3)(Pf.MaterialComponentManager),Wh=(0,Mf.f3)(Pf.CullableComponentManager),Vh=(0,Mf.f3)(Pf.TransformComponentManager),Hh=(0,Mf.f3)(Pf.HierarchyComponentManager),Xh=(0,Mf.f3)(Pf.Systems),qh=(0,Mf.t6)(Pf.FrameGraphSystem),Yh=(0,Mf.f3)(Pf.RenderEngine),Kh=(0,Mf.f3)(Pf.ResourcePool),Uh((sd=ud=function(){function t(){var e=this;bf(this,t),mf(this,"mesh",Jh,this),mf(this,"geometry",Qh,this),mf(this,"material",td,this),mf(this,"cullable",ed,this),mf(this,"transform",nd,this),mf(this,"hierarchy",rd,this),mf(this,"frameGraphSystem",id,this),mf(this,"engine",od,this),mf(this,"resourcePool",ad,this),this.modelCache={},this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Dl.RENDER_ATTACHMENT|Dl.SAMPLED|Dl.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=Tf(Sf().mark((function t(n,r,i){var o,a,u,s,c,f;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),u=cd(i),t.prev=3,u.s();case 5:if((s=u.n()).done){t.next=11;break}return c=s.value,t.next=9,e.initView(c);case 9:t.next=5;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),u.e(t.t0);case 16:return t.prev=16,u.f(),t.finish(16);case 19:f=e.engine.getCanvas(),a.resize({width:f.width,height:f.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:a,color:i[0].getClearColor(),depth:1}),e.engine.useFramebuffer(a,(function(){var t,n=cd(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.renderView(r)}}catch(t){n.e(t)}finally{n.f()}}));case 24:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,n,r){return t.apply(this,arguments)}}()}var e,n;return wf(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=Rh(kh(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,u=o.y,s=o.width,c=o.height;this.engine.viewport({x:a,y:u,width:s,height:c});var f,l=cd(e.getEntities());try{for(l.s();!(f=l.n()).done;){var h=f.value;this.renderMesh(h,{camera:n,view:t,viewMatrix:r})}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderMesh",value:function(t,e){var n=e.camera,r=e.view,i=e.viewMatrix,o=this.mesh.getComponentByEntity(t);if(o&&o.visible){var a=o.material,u=o.geometry;if(u&&!u.dirty&&a){var s=this.transform.getComponentByEntity(t),c=Rh(kh(),i,s.worldTransform),f=r.getViewport(),l=f.width,h=f.height;a.setUniform({projectionMatrix:n.getPerspective(),modelViewMatrix:c,modelMatrix:s.worldTransform,viewMatrix:i,cameraPosition:n.getPosition(),u_viewport:[l,h]}),o.model&&(o.model.draw({uniforms:a.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{})}),a.uniforms.forEach((function(t){t.dirty=!1})),a.dirty=!1)}}}},{key:"initMesh",value:(n=Tf(Sf().mark((function t(e,n){var r,i,o,a,u,s,c,f;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.mesh.getComponentByEntity(e)){t.next=3;break}return t.abrupt("return");case 3:if(i=r.material,(o=r.geometry)&&!o.dirty&&i){t.next=7;break}return t.abrupt("return");case 7:if(r.model){t.next=24;break}if(a="m-".concat(i.entity,"-g-").concat(o.entity),!this.modelCache[a]){t.next=12;break}return r.model=this.modelCache[a],t.abrupt("return");case 12:return i.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),u=this.engine,s=u.createModel,c=u.createAttribute,f={vs:i.vertexShaderGLSL,fs:i.fragmentShaderGLSL,defines:i.defines,attributes:o.attributes.reduce((function(t,e){return e.data&&e.buffer&&(t[e.name]=c({buffer:e.buffer,attributes:e.attributes,arrayStride:e.arrayStride,stepMode:e.stepMode,divisor:"vertex"===e.stepMode?0:1})),t}),{}),uniforms:i.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{}),scissor:{enable:!0,box:function(){return n.getViewport()}}},i.cull&&(f.cull=i.cull),i.depth&&(f.depth=i.depth),i.blend&&(f.blend=i.blend),o.indicesBuffer&&(f.elements=o.indicesBuffer),o.maxInstancedCount&&(f.instances=o.maxInstancedCount,f.count=o.vertexCount||3),t.next=22,s(f);case 22:r.model=t.sent,this.modelCache[a]=r.model;case 24:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"initView",value:(e=Tf(Sf().mark((function t(e){var n,r,i,o;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=cd(n.getEntities()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=i.value,t.next=8,this.initMesh(o,e);case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[2,12,15,18]])}))),function(t){return e.apply(this,arguments)})}]),t}(),ud.IDENTIFIER="Render Pass",Jh=xf((Zh=sd).prototype,"mesh",[Bh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qh=xf(Zh.prototype,"geometry",[zh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),td=xf(Zh.prototype,"material",[Fh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ed=xf(Zh.prototype,"cullable",[Wh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nd=xf(Zh.prototype,"transform",[Vh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rd=xf(Zh.prototype,"hierarchy",[Hh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),id=xf(Zh.prototype,"frameGraphSystem",[Xh,qh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),od=xf(Zh.prototype,"engine",[Yh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ad=xf(Zh.prototype,"resourcePool",[Kh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$h=Zh))||$h);function Ad(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Td(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Td(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Td(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Id,Nd,kd,Cd,Od,Dd,Rd,Md,Pd,Gd,Ld,jd,Ud,Bd,zd,Fd,Wd,Vd,Hd,Xd,qd,Yd,Kd=(ld=(0,Mf.b2)(),hd=(0,Mf.f3)(Pf.RenderEngine),dd=(0,Mf.f3)(Pf.ResourcePool),pd=(0,Mf.f3)(Pf.RenderPassFactory),vd=(0,Mf.f3)(Pf.MeshComponentManager),ld((Ed=xd=function(){function t(){var e=this;bf(this,t),mf(this,"engine",md,this),mf(this,"resourcePool",bd,this),mf(this,"renderPassFactory",_d,this),mf(this,"mesh",wd,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,e,n){var r=t.createRenderTarget(e,"picking fbo",{width:1,height:1});n.data={output:e.write(t,r)},e.hasSideEffect=!0},this.execute=function(){var t=Tf(Sf().mark((function t(n,r,i){var o,a,u;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views=i,!e.alreadyInRendering){t.next=3;break}return t.abrupt("return");case 3:o=Ad(i);try{for(u=function(){var t=a.value,i=t.getViewport(),o=i.width,u=i.height;e.alreadyInRendering=!0;var s=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(s.resource),e.pickingFBO.resize({width:o,height:u}),e.engine.useFramebuffer(e.pickingFBO,(function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n,r=e.renderPassFactory(Sd.IDENTIFIER),i=[],o=Ad(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,u=e.mesh.getComponentByEntity(a);u.material.setUniform("u_PickingStage",1),i.push(u)}}catch(t){o.e(t)}finally{o.f()}r.renderView(t),i.forEach((function(t){t.material.setUniform("u_PickingStage",2)})),e.alreadyInRendering=!1}))},o.s();!(a=o.n()).done;)u()}catch(t){o.e(t)}finally{o.f()}case 5:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),this.pick=function(t,n){var r,i,o=t.x,a=t.y,u=e.engine,s=u.readPixels,c=u.useFramebuffer,f=n.getViewport(),l=f.width,h=f.height,d=o*window.devicePixelRatio,p=a*window.devicePixelRatio;if(!(d>l||d<0||p>h||p<0))return c(e.pickingFBO,(function(){var t;0===(r=s({x:Math.round(d),y:Math.round(h-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(t=Rf(r,3),i=t[0]+256*t[1]+65536*t[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return wf(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=Ad(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",2),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),xd.IDENTIFIER="PixelPicking Pass",md=xf((yd=Ed).prototype,"engine",[hd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bd=xf(yd.prototype,"resourcePool",[dd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_d=xf(yd.prototype,"renderPassFactory",[pd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wd=xf(yd.prototype,"mesh",[vd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gd=yd))||gd),$d=(Id=(0,Mf.b2)(),Nd=(0,Mf.f3)(Pf.RenderEngine),kd=(0,Mf.f3)(Pf.ResourcePool),Id((Pd=Md=function t(){var e=this;bf(this,t),mf(this,"engine",Dd,this),mf(this,"resourcePool",Rd,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Sd.IDENTIFIER);if(r){var i=t.createRenderTarget(e,"render to screen",{width:1,height:1});n.data={input:e.read(r.data.output),output:e.write(t,i)}}},this.execute=function(){var t=Tf(Sf().mark((function t(n,r){var i,o,a,u,s,c,f;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,u=i.createBuffer,e.model){t.next=6;break}return t.next=4,o({vs:e.engine.supportWebGPU?"layout(location = 0) in vec2 a_Position;\nlayout(location = 0) out vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}":"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\n\nlayout(location = 0) in vec2 v_UV;\nlayout(location = 0) out vec4 outColor;\n\nvoid main() {\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\n}":"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}",attributes:{a_Position:a({buffer:u({data:[-4,-4,4,-4,0,4],type:Dl.FLOAT}),size:2,arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:s=t.sent,e.model=s;case 6:c=n.getResourceNode(r.data.input),f=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,(function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:f}})}));case 9:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},Md.IDENTIFIER="Copy Pass",Dd=xf((Od=Pd).prototype,"engine",[Nd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rd=xf(Od.prototype,"resourcePool",[kd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cd=Od))||Cd),Zd=(Gd=(0,Mf.b2)(),Ld=(0,Mf.f3)(Pf.Systems),jd=(0,Mf.t6)(Pf.FrameGraphSystem),Ud=(0,Mf.f3)(Pf.RenderPassFactory),Bd=(0,Mf.f3)(Pf.ConfigService),zd=(0,Mf.f3)(Pf.ResourcePool),Gd((Yd=function(){function t(){bf(this,t),mf(this,"frameGraphSystem",Vd,this),mf(this,"renderPassFactory",Hd,this),mf(this,"configService",Xd,this),mf(this,"resourcePool",qd,this)}var e;return wf(t,[{key:"execute",value:(e=Tf(Sf().mark((function t(e){var n,r,i,o,a,u,s,c;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Sd.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Sd.IDENTIFIER,r,i),o=this.renderPassFactory($d.IDENTIFIER),a=o.setup,u=o.execute,s=o.tearDown,c=this.frameGraphSystem.addPass($d.IDENTIFIER,a,u,s),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(Kd.IDENTIFIER).pick(t,e)}}]),t}(),Vd=xf((Wd=Yd).prototype,"frameGraphSystem",[Ld,jd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hd=xf(Wd.prototype,"renderPassFactory",[Ud],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xd=xf(Wd.prototype,"configService",[Bd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qd=xf(Wd.prototype,"resourcePool",[zd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fd=Wd))||Fd);var Jd,Qd,tp,ep,np,rp,ip,op,ap,up,sp=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(t){var e;return bf(this,i),(e=r.call(this,t)).parentID=void 0,Object.assign(Ff(e),t),e}return i}(kf),cp=(Jd=(0,Mf.b2)(),Qd=(0,Mf.f3)(Pf.HierarchyComponentManager),tp=(0,Mf.f3)(Pf.TransformComponentManager),ep=(0,Mf.f3)(Pf.MeshComponentManager),Jd((up=function(){function t(){bf(this,t),mf(this,"hierarchy",ip,this),mf(this,"transform",op,this),mf(this,"mesh",ap,this)}var e;return wf(t,[{key:"execute",value:(e=Tf(Sf().mark((function t(){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){(n.isDirty()||n.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(e)),n.updateTransform())}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e});var r=this.mesh.getComponentByEntity(e);if(this.setMeshAABBDirty(r),r&&-1===r.children.indexOf(t)&&r.children.push(t),this.hierarchy.getCount()>1)for(var i=this.hierarchy.getCount()-1;i>0;--i)for(var o=this.hierarchy.getEntity(i),a=0;a<i;++a)if(this.hierarchy.getComponent(a).parentID===o){this.hierarchy.moveItem(i,a),++i;break}this.hierarchy.getComponentByEntity(t);var u=this.transform.getComponentByEntity(e);null===u&&(u=this.transform.create(e));var s=this.transform.getComponentByEntity(t);null===s&&(s=this.transform.create(t),u=this.transform.getComponentByEntity(e)),s.parent=u,!n&&u&&(s.matrixTransform(Dh(kh(),u.worldTransform)),s.updateTransform()),u&&s.updateTransformWithParent(u)}},{key:"detach",value:function(t){var e=this.hierarchy.getComponentByEntity(t);if(null!==e){var n=this.transform.getComponentByEntity(t);null!==n&&(n.parent=null,n.applyTransform()),this.hierarchy.removeKeepSorted(t);var r=this.mesh.getComponentByEntity(e.parentID);if(r){var i=r.children.indexOf(t);r.children.splice(i,1)}this.setMeshAABBDirty(r)}}},{key:"detachChildren",value:function(t){var e=this.mesh.getComponentByEntity(t);e&&(e.children=[]);for(var n=0;n<this.hierarchy.getCount();){var r;if((null===(r=this.hierarchy.getComponent(n))||void 0===r?void 0:r.parentID)===t){var i=this.hierarchy.getEntity(n);this.detach(i)}else++n}}},{key:"setMeshAABBDirty",value:function(t){t&&(t.aabbDirty=!0)}}]),t}(),ip=xf((rp=up).prototype,"hierarchy",[Qd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),op=xf(rp.prototype,"transform",[tp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ap=xf(rp.prototype,"mesh",[ep],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),np=rp))||np);function fp(){var t=new il(4);return il!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function lp(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function hp(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],s=n[1],c=n[2],f=n[3];return t[0]=r*f+a*u+i*c-o*s,t[1]=i*f+a*s+o*u-r*c,t[2]=o*f+a*c+r*s-i*u,t[3]=a*f-r*u-i*s-o*c,t}function dp(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,u=a?1/a:0;return t[0]=-n*u,t[1]=-r*u,t[2]=-i*u,t[3]=o*u,t}function pp(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),u=Math.sin(n),s=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=o*s*f-a*u*c,t[1]=a*u*f+o*s*c,t[2]=a*s*c-o*u*f,t[3]=a*s*f+o*u*c,t}var vp=al,gp=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},yp=hp,mp=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};cl(),hl(1,0,0),hl(0,1,0),fp(),fp(),sl();var bp=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(t){var e,n,o,a,u,s,c,f,l,h,d,p,v,g,y;return bf(this,i),(e=r.call(this,t)).dirtyFlag=void 0,e.localDirtyFlag=void 0,e.parent=null,e.localPosition=hl(0,0,0),e.localRotation=vp(0,0,0,1),e.localScale=hl(1,1,1),e.localTransform=kh(),e.position=hl(0,0,0),e.rotation=vp(0,0,0,1),e.scaling=hl(1,1,1),e.worldTransform=kh(),e.matrixTransform=(n=kh(),function(t){Rh(n,e.getLocalTransform(),t),Gh(e.localScale,n),Ph(e.localPosition,n),Lh(e.localRotation,n)}),e.rotateRollPitchYaw=(o=fp(),a=fp(),u=fp(),function(t,n,r){e.setDirty(),pp(o,t,0,0),pp(a,0,n,0),pp(u,0,0,r),hp(e.localRotation,o,e.localRotation),hp(e.localRotation,e.localRotation,a),hp(e.localRotation,u,e.localRotation),mp(e.localRotation,e.localRotation)}),e.lerp=(s=cl(),c=fp(),f=cl(),l=cl(),h=fp(),d=cl(),function(t,n,r){e.setDirty(),Gh(s,t.worldTransform),Ph(f,t.worldTransform),Lh(c,t.worldTransform),Gh(l,n.worldTransform),Ph(d,n.worldTransform),Lh(h,n.worldTransform),_l(e.localScale,s,l,r),function(t,e,n,r){var i,o,a,u,s,c=e[0],f=e[1],l=e[2],h=e[3],d=n[0],p=n[1],v=n[2],g=n[3];(o=c*d+f*p+l*v+h*g)<0&&(o=-o,d=-d,p=-p,v=-v,g=-g),1-o>rl?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(u=1-r,s=r),t[0]=u*c+s*d,t[1]=u*f+s*p,t[2]=u*l+s*v,t[3]=u*h+s*g}(e.localRotation,c,h,r),_l(e.localPosition,f,d,r)}),e.translate=(y=cl(),function(t){return vl(y,e.getPosition(),t),e.setPosition(y),e.setDirty(!0),Ff(e)}),e.translateLocal=function(t){return function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],s=e[1],c=e[2],f=i*c-o*s,l=o*u-r*c,h=r*s-i*u,d=i*h-o*l,p=o*f-r*h,v=r*l-i*f,g=2*a;f*=g,l*=g,h*=g,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=s+l+p,t[2]=c+h+v}(t,t,e.localRotation),vl(e.localPosition,e.localPosition,t),e.setLocalDirty(!0),Ff(e)},e.setPosition=(p=kh(),function(t){return e.position=t,e.setLocalDirty(!0),null===e.parent?dl(e.localPosition,t):(Ch(p,e.parent.worldTransform),Dh(p,p),wl(e.localPosition,t,p)),Ff(e)}),e.rotate=(v=fp(),function(t){if(null===e.parent)hp(e.localRotation,e.localRotation,t),mp(e.localRotation,e.localRotation);else{var n=e.getRotation(),r=e.parent.getRotation();gp(v,r),dp(v,v),hp(v,v,t),hp(e.localRotation,t,n),mp(e.localRotation,e.localRotation)}return e.setLocalDirty(),Ff(e)}),e.rotateLocal=function(t){return hp(e.localRotation,e.localRotation,t),mp(e.localRotation,e.localRotation),e.setLocalDirty(!0),Ff(e)},e.setRotation=(g=fp(),function(t){return null===e.parent?gp(e.localRotation,t):(gp(g,e.parent.getRotation()),dp(g,g),gp(e.localRotation,g),yp(e.localRotation,e.localRotation,t)),e.setLocalDirty(!0),Ff(e)}),e}return wf(i,[{key:"setLocalPosition",value:function(t){dl(this.localPosition,t),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(t){dl(this.localScale,t),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(t){return gp(this.localRotation,t),this.setLocalDirty(!0),this}},{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=i.DIRTY:this.dirtyFlag&=~i.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?(this.localDirtyFlag|=i.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~i.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&null===this.parent&&(Ch(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){Rh(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),Gh(this.localScale,this.worldTransform),Ph(this.localPosition,this.worldTransform),Lh(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=hl(0,0,0),this.localRotation=vp(0,0,0,1),this.localScale=hl(1,1,1)}},{key:"scaleLocal",value:function(t){return this.setLocalDirty(),e=this.localScale,n=this.localScale,r=t,e[0]=n[0]*r[0],e[1]=n[1]*r[1],e[2]=n[2]*r[2],this;var e,n,r}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(function(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=e[3],s=i+i,c=o+o,f=a+a,l=i*s,h=i*c,d=i*f,p=o*c,v=o*f,g=a*f,y=u*s,m=u*c,b=u*f,_=r[0],w=r[1],x=r[2];t[0]=(1-(p+g))*_,t[1]=(h+b)*_,t[2]=(d-m)*_,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(l+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(d+m)*x,t[9]=(v-y)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1}(this.localTransform,this.localRotation,this.localPosition,this.localScale),this.setLocalDirty(!1)),this.localTransform}},{key:"getWorldTransform",value:function(){return this.isLocalDirty()||this.isDirty()?(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform):this.worldTransform}},{key:"getPosition",value:function(){return Ph(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return Lh(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return Gh(this.scaling,this.worldTransform),this.scaling}}]),i}(kf);bp.DIRTY=1;var _p,wp,xp,Ep,Sp,Ap,Tp=n(1922),Ip=(_p=(0,Mf.b2)(),wp=(0,Mf.f3)(Pf.RenderEngine),_p((Ap=function(){function t(){bf(this,t),mf(this,"engine",Sp,this),this.resourcePool={}}return wf(t,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var e=t.descriptor,n=e.width,r=e.height,i=e.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:n,height:r,wrapS:Dl.CLAMP_TO_EDGE,wrapT:Dl.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),Sp=xf((Ep=Ap).prototype,"engine",[wp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xp=Ep))||xp);var Np,kp,Cp,Op,Dp=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(t){var e;return bf(this,i),(e=r.call(this,t)).name=void 0,e.name=t.name||"",e}return i}(kf),Rp=(0,Mf.b2)()((kp=function(){function t(){bf(this,t),this.config=void 0}return wf(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}(),Np=kp))||Np;!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(Op||(Op={}));var Mp,Pp,Gp=(0,Mf.b2)()(Cp=function(){function t(){bf(this,t)}return wf(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||Cp,Lp=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function jp(t){var e={};return{content:t=t.replace(Lp,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:e}}function Up(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Up(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Up(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var zp=/precision\s+(high|low|medium)p\s+float/,Fp=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,Wp=(0,Mf.b2)()((Pp=function(){function t(){bf(this,t),this.moduleCache={},this.rawContentCache={}}return wf(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n // compares only in highlight stage\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color) {\n bool selected = bool(v_PickingResult.a);\n\n if (selected) {\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(resultRGB, color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n return filterPickingColor(filterHighlightColor(color));\n}\n"}),this.registerModule("sdf2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=void 0===n?"":n,i=e.fs,o=void 0===i?"":i,a=e.uniforms,u=jp(r),s=u.content,c=u.uniforms,f=jp(o),l=f.content,h=f.uniforms;this.rawContentCache[t]={fs:l,uniforms:Bp(Bp(Bp({},c),h),a),vs:s}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n,r=this.rawContentCache[t].vs||"",i=this.rawContentCache[t].fs||"",o=this.processModule(r,[],"vs"),a=o.content,u=o.includeList,s=this.processModule(i,[],"fs"),c=s.content,f=s.includeList,l=c,h=(n=u.concat(f).concat(t),n.filter((function(t,e,n){return n.indexOf(t)===e}))).reduce((function(t,n){return Bp(Bp({},t),e.rawContentCache[n].uniforms)}),{});return zp.test(c)||(l="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+c),this.moduleCache[t]={fs:l.trim(),uniforms:h,vs:a.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(Fp,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a||"",e,n).content})),includeList:e}}}]),t}(),Mp=Pp))||Mp,Vp=new Mf.W2;function Hp(){var t=new Mf.W2;return t.parent=Vp,t.bind(Pf.Systems).to(cp).inSingletonScope().whenTargetNamed(Pf.SceneGraphSystem),t.bind(Pf.Systems).to(el).inSingletonScope().whenTargetNamed(Pf.FrameGraphSystem),t.bind(Pf.Systems).to(Nh).inSingletonScope().whenTargetNamed(Pf.MeshSystem),t.bind(Pf.Systems).to(Fl).inSingletonScope().whenTargetNamed(Pf.GeometrySystem),t.bind(Pf.Systems).to(oh).inSingletonScope().whenTargetNamed(Pf.MaterialSystem),t.bind(Pf.Systems).to(Zd).inSingletonScope().whenTargetNamed(Pf.RendererSystem),t.bind(Pf.ResourcePool).to(Ip).inSingletonScope(),t.bind(Pf.ConfigService).to(Rp).inSingletonScope(),t.bind(Pf.InteractorService).to(Gp).inSingletonScope(),t.bind(Pf.RenderPass).to(Sd).inSingletonScope().whenTargetNamed(Sd.IDENTIFIER),t.bind(Pf.RenderPass).to($d).inSingletonScope().whenTargetNamed($d.IDENTIFIER),t.bind(Pf.RenderPass).to(Kd).inSingletonScope().whenTargetNamed(Kd.IDENTIFIER),t.bind(Pf.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(Pf.RenderPass,e)}})),t}function Xp(t){for(var e=new uh,n=hl(t[0],t[1],t[2]),r=hl(t[0],t[1],t[2]),i=3;i<t.length;){var o=t[i++],a=t[i++],u=t[i++];o<n[0]&&(n[0]=o),a<n[1]&&(n[1]=a),u<n[2]&&(n[2]=u),o>r[0]&&(r[0]=o),a>r[1]&&(r[1]=a),u>r[2]&&(r[2]=u)}return e.setMinMax(n,r),e}(0,Tp.Z)(Vp,!1),Vp.bind(Pf.ShaderModuleService).to(Wp).inSingletonScope(),Vp.bind(Pf.NameComponentManager).toConstantValue(new Cf(Dp)),Vp.bind(Pf.HierarchyComponentManager).toConstantValue(new Cf(sp)),Vp.bind(Pf.TransformComponentManager).toConstantValue(new Cf(bp)),Vp.bind(Pf.MeshComponentManager).toConstantValue(new Cf(ch)),Vp.bind(Pf.CullableComponentManager).toConstantValue(new Cf(ah)),Vp.bind(Pf.GeometryComponentManager).toConstantValue(new Cf(zl)),Vp.bind(Pf.MaterialComponentManager).toConstantValue(new Cf(eh));var qp,Yp,Kp,$p,Zp,Jp="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);function Qp(t){return"number"==typeof t}function tv(t){return void 0===t?0:t>360||t<-360?t%360:t}function ev(t,e,n){return Qp(t)?hl(t,e,n):3===t.length?fl(t):hl(t[0],t[1],t[2])}cl(),cl(),cl(),cl(),cl(),cl(),n(2697),n(1894),n(1186),n(5275),n(2862),n(9633),function(t){t.Normal="normal",t.PostProcessing="post-processing"}(qp||(qp={})),n(7222),n(5965),n(2391),n(3945),n(7294),n(9586),function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(Yp||(Yp={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(Kp||(Kp={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}($p||($p={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(Zp||(Zp={}));var nv,rv,iv,ov,av,uv,sv,cv,fv,lv,hv=function(){function t(e,n){var r,i;bf(this,t),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=(r=n.matrix,(i=new il(16))[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i),this.right=fl(n.right),this.up=fl(n.up),this.forward=fl(n.forward),this.position=fl(n.position),this.focalPoint=fl(n.focalPoint),this.distanceVector=fl(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return wf(t,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=Ch(t.matrix,this.matrix),t.right=dl(t.right,this.right),t.up=dl(t.up,this.up),t.forward=dl(t.forward,this.forward),t.position=dl(t.position,this.position),t.focalPoint=dl(t.focalPoint,this.focalPoint),t.distanceVector=dl(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),t}();!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(cv||(cv={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(fv||(fv={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(lv||(lv={}));var dv,pv,vv,gv,yv,mv,bv,_v=Math.PI/180,wv=180/Math.PI,xv=(nv=(0,Mf.b2)(),rv=(0,Mf.f3)(Pf.InteractorService),nv((sv=uv=function(){function t(){bf(this,t),this.matrix=kh(),this.right=hl(1,0,0),this.up=hl(0,1,0),this.forward=hl(0,0,1),this.position=hl(0,0,1),this.focalPoint=hl(0,0,0),this.distanceVector=hl(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.rotateWorld=!1,mf(this,"interactor",av,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=kh(),this.view=void 0,this.following=void 0,this.type=cv.EXPLORING,this.trackingMode=fv.DEFAULT,this.projectionMode=lv.PERSPECTIVE,this.frustum=new Ah,this.landmarks=[],this.landmarkAnimationID=void 0}return wf(t,[{key:"clone",value:function(){var e=new t;return e.setType(this.type,void 0),e.interactor=this.interactor,e}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,e){return this.type=t,this.type===cv.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===cv.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==cv.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return Dh(kh(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===lv.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===lv.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,e,n,r){return this.projectionMode=lv.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,function(t,e,n,r,i){var o,a=1/Math.tan(e/2);t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r)}(this.perspective,this.fov*_v,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=lv.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var a=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),s=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,f=s-a,l=s+a,h=c+u,d=c-u;if(void 0!==this.view&&this.view.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l=(f+=p*this.view.offsetX)+p*this.view.width,d=(h-=v*this.view.offsetY)-v*this.view.height}return function(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),c=1/(o-a);t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*s,t[14]=(a+o)*c,t[15]=1}(this.perspective,f,l,h,d,i,o),this}},{key:"setPosition",value:function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,e,n){var r=hl(0,1,0);if(this.focalPoint=ev(t,e,n),this.trackingMode===fv.CINEMATIC){var i=gl(cl(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=ll(i),a=Math.asin(e/o)*wv,u=90+Math.atan2(n,t)*wv,s=kh();!function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],c=e[8],f=e[9],l=e[10],h=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-f*r,t[2]=u*i-l*r,t[3]=s*i-h*r,t[8]=o*r+c*i,t[9]=a*r+f*i,t[10]=u*r+l*i,t[11]=s*r+h*i}(s,s,u*_v),function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],u=e[6],s=e[7],c=e[8],f=e[9],l=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+f*r,t[6]=u*i+l*r,t[7]=s*i+h*r,t[8]=c*i-o*r,t[9]=f*i-a*r,t[10]=l*i-u*r,t[11]=h*i-s*r}(s,s,a*_v),r=wl(cl(),[0,1,0],s)}return Dh(this.matrix,function(t,e,n,r){var i,o,a,u,s,c,f,l,h,d,p=e[0],v=e[1],g=e[2],y=r[0],m=r[1],b=r[2],_=n[0],w=n[1],x=n[2];return Math.abs(p-_)<rl&&Math.abs(v-w)<rl&&Math.abs(g-x)<rl?Oh(t):(f=p-_,l=v-w,h=g-x,i=m*(h*=d=1/Math.hypot(f,l,h))-b*(l*=d),o=b*(f*=d)-y*h,a=y*l-m*f,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),u=l*a-h*o,s=h*i-f*a,c=f*o-l*i,(d=Math.hypot(u,s,c))?(u*=d=1/d,s*=d,c*=d):(u=0,s=0,c=0),t[0]=i,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=s,t[6]=l,t[7]=0,t[8]=a,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*g),t[13]=-(u*p+s*v+c*g),t[14]=-(f*p+l*v+h*g),t[15]=1,t)}(kh(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var e=cl();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this}}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=tv(t),this.computeMatrix(),this._getAxes(),this.type===cv.ORBITING||this.type===cv.EXPLORING?this._getPosition():this.type===cv.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=tv(t),this.computeMatrix(),this._getAxes(),this.type===cv.ORBITING||this.type===cv.EXPLORING?this._getPosition():this.type===cv.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=tv(t),this.computeMatrix(),this._getAxes(),this.type===cv.ORBITING||this.type===cv.EXPLORING?this._getPosition():this.type===cv.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===cv.EXPLORING){t=tv(t),e=tv(e),n=tv(n);var r=lp(fp(),[1,0,0],(this.rotateWorld?1:-1)*e*_v),i=lp(fp(),[0,1,0],(this.rotateWorld?1:-1)*t*_v),o=lp(fp(),[0,0,1],n*_v),a=hp(fp(),i,r);a=hp(fp(),a,o);var u=jh(kh(),a);Mh(this.matrix,this.matrix,[0,0,-this.distance]),Rh(this.matrix,this.matrix,u),Mh(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=tv(e),this.relAzimuth=tv(t),this.relRoll=tv(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===cv.ORBITING||this.type===cv.EXPLORING?this._getPosition():this.type===cv.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=ev(t,e,0),r=fl(this.position);return vl(r,r,yl(cl(),this.right,n[0])),vl(r,r,yl(cl(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=fl(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===cv.ORBITING||this.type===cv.EXPLORING?this._getDistance():this.type===cv.TRACKING&&vl(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(t,e){var n=this.clone();n.setPosition(e.position),n.setFocalPoint(e.focalPoint),void 0!==e.roll&&n.setRoll(e.roll);var r=new hv(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new hv(t,this);return this.landmarks.push(e),this}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===n)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var i,o=r.getPosition(),a=r.getFocalPoint(),u=r.getRoll(),s=function t(r){void 0===i&&(i=r);var s,c=r-i,f=(1-Math.cos(c/n*Math.PI))/2,l=cl(),h=cl();if(_l(l,e.focalPoint,a,f),_l(h,e.position,o,f),s=e.roll*(1-f)+u*f,e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),!(Sl(l,a)+Sl(h,o)>.01))return e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(s)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=lp(fp(),[0,0,1],this.roll*_v);Oh(this.matrix),t=lp(fp(),[1,0,0],(this.rotateWorld&&this.type!==cv.TRACKING||this.type===cv.TRACKING?1:-1)*this.elevation*_v),e=lp(fp(),[0,1,0],(this.rotateWorld&&this.type!==cv.TRACKING||this.type===cv.TRACKING?1:-1)*this.azimuth*_v);var r=hp(fp(),e,t);r=hp(fp(),r,n);var i=jh(kh(),r);this.type===cv.ORBITING||this.type===cv.EXPLORING?(Mh(this.matrix,this.matrix,this.focalPoint),Rh(this.matrix,this.matrix,i),Mh(this.matrix,this.matrix,[0,0,this.distance])):this.type===cv.TRACKING&&(Mh(this.matrix,this.matrix,this.position),Rh(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=ev(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){dl(this.right,ev(ul(ol(),[1,0,0,0],this.matrix))),dl(this.up,ev(ul(ol(),[0,1,0,0],this.matrix))),dl(this.forward,ev(ul(ol(),[0,0,1,0],this.matrix))),ml(this.right,this.right),ml(this.up,this.up),ml(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=ll(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===cv.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*wv,this.azimuth=Math.atan2(-t,-n)*wv):(this.elevation=-Math.asin(e/r)*wv,this.azimuth=-Math.atan2(-t,-n)*wv)}},{key:"_getPosition",value:function(){dl(this.position,ev(ul(ol(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;xl(this.distanceVector,[0,0,-this.distance],(t=sl(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),vl(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=gl(cl(),this.focalPoint,this.position),this.distance=ll(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),uv.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},av=xf((ov=sv).prototype,"interactor",[rv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),iv=ov))||iv),Ev=(dv=(0,Mf.b2)(),pv=(0,Mf.f3)(Pf.GeometryComponentManager),dv((bv=mv=function(){function t(){bf(this,t),this.config=void 0,mf(this,"geometry",yv,this),this.entity=void 0,this.component=void 0}return wf(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.component=this.geometry.create(t),this.component.entity=t,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),mv.BOX="box",mv.SPHERE="sphere",mv.PLANE="plane",mv.MERGED="merged",yv=xf((gv=bv).prototype,"geometry",[pv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vv=gv))||vv),Sv=n(8344);function Av(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var Tv={}.toString;var Iv={};Iv["[object Float32Array]"]=Iv["[object Float64Array]"]=Iv["[object Int8Array]"]=Iv["[object Int16Array]"]=Iv["[object Int32Array]"]=Iv["[object Uint8Array]"]=Iv["[object Uint8ClampedArray]"]=Iv["[object Uint16Array]"]=Iv["[object Uint32Array]"]=!0,Iv["[object Arguments]"]=Iv["[object Array]"]=Iv["[object ArrayBuffer]"]=Iv["[object Boolean]"]=Iv["[object DataView]"]=Iv["[object Date]"]=Iv["[object Error]"]=Iv["[object Function]"]=Iv["[object Map]"]=Iv["[object Number]"]=Iv["[object Object]"]=Iv["[object RegExp]"]=Iv["[object Set]"]=Iv["[object String]"]=Iv["[object WeakMap]"]=!1;var Nv,kv,Cv,Ov,Dv,Rv,Mv,Pv,Gv=Object.prototype.toString,Lv=function(t){return function(t){return!!t&&"object"===zf(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Iv[Gv.call(t)]};function jv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Uv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jv(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Bv,zv,Fv,Wv,Vv,Hv,Xv,qv,Yv,Kv,$v,Zv,Jv,Qv,tg,eg,ng,rg,ig,og,ag,ug,sg,cg,fg,lg,hg,dg,pg,vg,gg,yg,mg,bg,_g,wg=(Nv=(0,Mf.b2)(),kv=(0,Mf.f3)(Pf.RenderEngine),Cv=(0,Mf.f3)(Pf.ConfigService),Nv((Pv=function(){function t(){bf(this,t),mf(this,"engine",Rv,this),mf(this,"configService",Mv,this),this.entity=Nf(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return wf(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(Uv({canvas:e||Av(),swapChainFormat:Sv.EV.BGRA8Unorm,antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n,r=this;if("string"==typeof t){var i=Qp(e)||Lv(e)||(n=e,Array.isArray?Array.isArray(n):function(t,e){return Tv.call(t)==="[object "+e+"]"}(n,"Array"));if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(o)return o.value=e,this;var a=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));a&&(i?(a.data=e,a.isReferer=!1,a.storageClass===$p.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(a.isReferer=!0,a.data=e))}}else Object.keys(t).forEach((function(e){r.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Tf(Sf().mark((function t(){var e,n,r=this,i=arguments;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=Tf(Sf().mark((function t(){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=Tf(Sf().mark((function t(){var e,n,r;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=Uv({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?Zp.WGSL:Zp.GLSL450:Zp.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===$p.StorageBuffer){var n=1;t.type===Yp.FloatArray?n=1:t.type===Yp.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Rv=xf((Dv=Pv).prototype,"engine",[kv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mv=xf(Dv.prototype,"configService",[Cv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ov=Dv))||Ov),xg=(Bv=(0,Mf.b2)(),zv=(0,Mf.f3)(Pf.MaterialComponentManager),Bv((Xv=Hv=function(){function t(){bf(this,t),this.config=void 0,mf(this,"material",Vv,this),this.entity=void 0,this.component=void 0}return wf(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t,e){this.entity=t,this.component=this.material.create(t),this.component.entity=t,this.component.type=e,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),Hv.BASIC="basic",Vv=xf((Wv=Xv).prototype,"material",[zv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fv=Wv))||Fv),Eg=(qv=(0,Mf.b2)(),Yv=(0,Mf.f3)(Pf.MeshComponentManager),Kv=(0,Mf.f3)(Pf.CullableComponentManager),$v=(0,Mf.f3)(Pf.TransformComponentManager),Zv=(0,Mf.f3)(Pf.Systems),Jv=(0,Mf.t6)(Pf.SceneGraphSystem),qv((ag=og=function(){function t(){bf(this,t),this.attributes={},this.config=void 0,mf(this,"mesh",eg,this),mf(this,"cullable",ng,this),mf(this,"transform",rg,this),mf(this,"sceneGraphSystem",ig,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return wf(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.onEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setAttributes",value:function(t){var e=this;Object.keys(t).forEach((function(n){void 0!==t[n]&&t[n]!==e.attributes[n]&&(e.onAttributeChanged({name:n,data:t[n]}),e.attributes[n]=t[n])}))}},{key:"setVisible",value:function(t){var e=this;return this.meshComponent.visible=t,this.meshComponent.children.forEach((function(n){var r=e.mesh.getComponentByEntity(n);r&&(r.visible=t)})),this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"onEntityCreated",value:function(){}},{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data;this.meshComponent&&this.meshComponent.material&&this.meshComponent.material.setUniform(this.convertAttributeName2UniformName(e),n)}},{key:"convertAttributeName2UniformName",value:function(t){return t}}]),t}(),og.POINT="point",og.LINE="line",og.GRID="grid",eg=xf((tg=ag).prototype,"mesh",[Yv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ng=xf(tg.prototype,"cullable",[Kv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rg=xf(tg.prototype,"transform",[$v],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ig=xf(tg.prototype,"sceneGraphSystem",[Zv,Jv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qv=tg))||Qv),Sg=n(6377),Ag=n.n(Sg),Tg=function(){function t(e,n){bf(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,u=n.size,s=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:s||0},u&&(this.attribute.size=u)}return wf(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Ig=(nl(ug={},Dl.POINTS,"points"),nl(ug,Dl.LINES,"lines"),nl(ug,Dl.LINE_LOOP,"line loop"),nl(ug,Dl.LINE_STRIP,"line strip"),nl(ug,Dl.TRIANGLES,"triangles"),nl(ug,Dl.TRIANGLE_FAN,"triangle fan"),nl(ug,Dl.TRIANGLE_STRIP,"triangle strip"),ug),Ng=(nl(sg={},Dl.STATIC_DRAW,"static"),nl(sg,Dl.DYNAMIC_DRAW,"dynamic"),nl(sg,Dl.STREAM_DRAW,"stream"),sg),kg=(nl(cg={},Dl.BYTE,"int8"),nl(cg,Dl.UNSIGNED_INT,"int16"),nl(cg,Dl.INT,"int32"),nl(cg,Dl.UNSIGNED_BYTE,"uint8"),nl(cg,Dl.UNSIGNED_SHORT,"uint16"),nl(cg,Dl.UNSIGNED_INT,"uint32"),nl(cg,Dl.FLOAT,"float"),cg),Cg=(nl(fg={},Dl.ALPHA,"alpha"),nl(fg,Dl.LUMINANCE,"luminance"),nl(fg,Dl.LUMINANCE_ALPHA,"luminance alpha"),nl(fg,Dl.RGB,"rgb"),nl(fg,Dl.RGBA,"rgba"),nl(fg,Dl.RGBA4,"rgba4"),nl(fg,Dl.RGB5_A1,"rgb5 a1"),nl(fg,Dl.RGB565,"rgb565"),nl(fg,Dl.DEPTH_COMPONENT,"depth"),nl(fg,Dl.DEPTH_STENCIL,"depth stencil"),fg),Og=(nl(lg={},Dl.DONT_CARE,"dont care"),nl(lg,Dl.NICEST,"nice"),nl(lg,Dl.FASTEST,"fast"),lg),Dg=(nl(hg={},Dl.NEAREST,"nearest"),nl(hg,Dl.LINEAR,"linear"),nl(hg,Dl.LINEAR_MIPMAP_LINEAR,"mipmap"),nl(hg,Dl.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),nl(hg,Dl.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),nl(hg,Dl.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),hg),Rg=(nl(dg={},Dl.REPEAT,"repeat"),nl(dg,Dl.CLAMP_TO_EDGE,"clamp"),nl(dg,Dl.MIRRORED_REPEAT,"mirror"),dg),Mg=(nl(pg={},Dl.NONE,"none"),nl(pg,Dl.BROWSER_DEFAULT_WEBGL,"browser"),pg),Pg=(nl(vg={},Dl.NEVER,"never"),nl(vg,Dl.ALWAYS,"always"),nl(vg,Dl.LESS,"less"),nl(vg,Dl.LEQUAL,"lequal"),nl(vg,Dl.GREATER,"greater"),nl(vg,Dl.GEQUAL,"gequal"),nl(vg,Dl.EQUAL,"equal"),nl(vg,Dl.NOTEQUAL,"notequal"),vg),Gg=(nl(gg={},Dl.FUNC_ADD,"add"),nl(gg,Dl.MIN_EXT,"min"),nl(gg,Dl.MAX_EXT,"max"),nl(gg,Dl.FUNC_SUBTRACT,"subtract"),nl(gg,Dl.FUNC_REVERSE_SUBTRACT,"reverse subtract"),gg),Lg=(nl(yg={},Dl.ZERO,"zero"),nl(yg,Dl.ONE,"one"),nl(yg,Dl.SRC_COLOR,"src color"),nl(yg,Dl.ONE_MINUS_SRC_COLOR,"one minus src color"),nl(yg,Dl.SRC_ALPHA,"src alpha"),nl(yg,Dl.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),nl(yg,Dl.DST_COLOR,"dst color"),nl(yg,Dl.ONE_MINUS_DST_COLOR,"one minus dst color"),nl(yg,Dl.DST_ALPHA,"dst alpha"),nl(yg,Dl.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),nl(yg,Dl.CONSTANT_COLOR,"constant color"),nl(yg,Dl.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),nl(yg,Dl.CONSTANT_ALPHA,"constant alpha"),nl(yg,Dl.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),nl(yg,Dl.SRC_ALPHA_SATURATE,"src alpha saturate"),yg),jg=(nl(mg={},Dl.NEVER,"never"),nl(mg,Dl.ALWAYS,"always"),nl(mg,Dl.LESS,"less"),nl(mg,Dl.LEQUAL,"lequal"),nl(mg,Dl.GREATER,"greater"),nl(mg,Dl.GEQUAL,"gequal"),nl(mg,Dl.EQUAL,"equal"),nl(mg,Dl.NOTEQUAL,"notequal"),mg),Ug=(nl(bg={},Dl.ZERO,"zero"),nl(bg,Dl.KEEP,"keep"),nl(bg,Dl.REPLACE,"replace"),nl(bg,Dl.INVERT,"invert"),nl(bg,Dl.INCR,"increment"),nl(bg,Dl.DECR,"decrement"),nl(bg,Dl.INCR_WRAP,"increment wrap"),nl(bg,Dl.DECR_WRAP,"decrement wrap"),bg),Bg=(nl(_g={},Dl.FRONT,"front"),nl(_g,Dl.BACK,"back"),_g),zg=function(){function t(e,n){bf(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Ng[i||Dl.STATIC_DRAW],type:kg[o||Dl.UNSIGNED_BYTE]})}return wf(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}();function Fg(t){return function(t){if(Array.isArray(t))return Of(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Df(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Wg={};Wg["[object Float32Array]"]=Wg["[object Float64Array]"]=Wg["[object Int8Array]"]=Wg["[object Int16Array]"]=Wg["[object Int32Array]"]=Wg["[object Uint8Array]"]=Wg["[object Uint8ClampedArray]"]=Wg["[object Uint16Array]"]=Wg["[object Uint32Array]"]=!0,Wg["[object Arguments]"]=Wg["[object Array]"]=Wg["[object ArrayBuffer]"]=Wg["[object Boolean]"]=Wg["[object DataView]"]=Wg["[object Date]"]=Wg["[object Error]"]=Wg["[object Function]"]=Wg["[object Map]"]=Wg["[object Number]"]=Wg["[object Object]"]=Wg["[object RegExp]"]=Wg["[object Set]"]=Wg["[object String]"]=Wg["[object WeakMap]"]=!1;var Vg=Object.prototype.toString,Hg=function(t){return function(t){return!!t&&"object"===zf(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Wg[Vg.call(t)]};function Xg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qg(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xg(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xg(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Yg=0,Kg=function(){function t(e,n){var r=this;bf(this,t),this.reGl=e,this.context=n,this.entity=Nf(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,o=t.data,a=t.isReferer,u=t.storageClass;if(u===$p.StorageBuffer){if(a)r.textureCache[e]={data:void 0},i["".concat(e,"Size")]=function(){return o.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,o);var s=r.textureCache[e],c=s.textureWidth,f=s.isOutput;i["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,o)))}i[e]=function(){return r.textureCache[e].texture}}else if(u===$p.Uniform){if(o&&(Array.isArray(o)||Hg(o))&&o.length>16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var o=this.getOuputDataTexture(),a=o.textureWidth,u=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=u,this.context.output.textureSize=[a,a];var s={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return wf(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Tf(Sf().mark((function t(){var e,n,r,i,o,a,u,s,c=this;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,u=[],4!==i)for(s=0;s<e.length;s+=4)1===i?u.push(e[s]):2===i?u.push(e[s],e[s+1]):u.push(e[s],e[s+1],e[s+2]);else u=e;return t.abrupt("return",new a(u.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),i=r.texture,o=r.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return qg(qg({},t),{},{id:Yg++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Yp.Vector4FloatArray&&(r=4);for(var i=[],o=0;o<n.length;o+=r)1===r?i.push(n[o],0,0,0):2===r?i.push(n[o],n[o+1],0,0):3===r?i.push(n[o],n[o+1],n[o+2],0):4===r&&i.push(n[o],n[o+1],n[o+2],n[o+3]);var a=n.length,u=Math.ceil(a/r),s=Math.ceil(Math.sqrt(u)),c=s*s;u<c&&i.push.apply(i,Fg(new Array(4*(c-u)).fill(0)));var f=this.reGl.texture({width:s,height:s,data:i,type:"float"});return{id:Yg++,data:i,originalDataLength:a,typedArrayConstructor:Hg(n)?n.constructor:void 0,textureWidth:s,texture:f,texelCount:u,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),$g=function(){function t(e,n){bf(this,t),this.elements=void 0;var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:Ng[i||Dl.STATIC_DRAW],type:kg[o||Dl.UNSIGNED_BYTE],count:a})}return wf(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),Zg=function(){function t(e,n){bf(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,u=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(u.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(u.color=o.get()),this.framebuffer=e.framebuffer(u)}return wf(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}();function Jg(t){var e={};return Object.keys(t).forEach((function(n){Qg(n,t[n],e,"")})),e}function Qg(t,e,n,r){var i,o;null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||Hg(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(o=zf(i=e),null==i||"object"!==o&&"function"!==o||Object.keys(e).forEach((function(i){Qg(i,e[i],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,i){Object.keys(e).forEach((function(o){Qg(o,e[o],n,"".concat(r&&r+".").concat(t,"[").concat(i,"]"))}))})))}function ty(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ey(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ty(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ty(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ny,ry,iy,oy=function(){function t(e,n){bf(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,i=n.fs,o=n.defines,a=n.attributes,u=n.uniforms,s=n.primitive,c=n.count,f=n.elements,l=n.depth,h=n.blend,d=n.stencil,p=n.cull,v=n.instances,g=n.scissor,y=n.viewport,m={};u&&(this.uniforms=Jg(u),Object.keys(u).forEach((function(t){m[t]=e.prop(t)})));var b={};Object.keys(a).forEach((function(t){b[t]=a[t].get()}));var _=o&&this.generateDefines(o)||"",w={attributes:b,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(_,"\n").concat(i),uniforms:m,vert:"\n".concat(_,"\n").concat(r),primitive:Ig[void 0===s?Dl.TRIANGLES:s]};v&&(w.instances=v),c&&(w.count=c),f&&(w.elements=f.get()),g&&(w.scissor=g),y&&(w.viewport=y),this.initDepthDrawParams({depth:l},w),this.initBlendDrawParams({blend:h},w),this.initStencilDrawParams({stencil:d},w),this.initCullDrawParams({cull:p},w),this.drawCommand=e(w)}return wf(t,[{key:"addUniforms",value:function(t){this.uniforms=ey(ey({},this.uniforms),Jg(t))}},{key:"draw",value:function(t){var e=ey(ey({},this.uniforms),Jg(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=zf(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:"string"===r||(n[t]=e[t].get())})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Pg[n.func||Dl.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,i=n.func,o=n.equation,a=n.color,u=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:Lg[i&&i.srcRGB||Dl.SRC_ALPHA],srcAlpha:Lg[i&&i.srcAlpha||Dl.SRC_ALPHA],dstRGB:Lg[i&&i.dstRGB||Dl.ONE_MINUS_SRC_ALPHA],dstAlpha:Lg[i&&i.dstAlpha||Dl.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Gg[o&&o.rgb||Dl.FUNC_ADD],alpha:Gg[o&&o.alpha||Dl.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,i=n.mask,o=void 0===i?-1:i,a=n.func,u=void 0===a?{cmp:Dl.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Dl.KEEP,zfail:Dl.KEEP,zpass:Dl.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Dl.KEEP,zfail:Dl.KEEP,zpass:Dl.KEEP}:f;e.stencil={enable:!!r,mask:o,func:ey(ey({},u),{},{cmp:jg[u.cmp]}),opFront:{fail:Ug[c.fail],zfail:Ug[c.zfail],zpass:Ug[c.zpass]},opBack:{fail:Ug[l.fail],zfail:Ug[l.zfail],zpass:Ug[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?Dl.BACK:i;e.cull={enable:!!r,face:Bg[o]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),ay=function(){function t(e,n){bf(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,i=n.type,o=void 0===i?Dl.UNSIGNED_BYTE:i,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Dl.RGBA:f,h=n.mipmap,d=void 0!==h&&h,p=n.wrapS,v=void 0===p?Dl.CLAMP_TO_EDGE:p,g=n.wrapT,y=void 0===g?Dl.CLAMP_TO_EDGE:g,m=n.aniso,b=void 0===m?0:m,_=n.alignment,w=void 0===_?1:_,x=n.premultiplyAlpha,E=void 0!==x&&x,S=n.mag,A=void 0===S?Dl.NEAREST:S,T=n.min,I=void 0===T?Dl.NEAREST:T,N=n.colorSpace,k=void 0===N?Dl.BROWSER_DEFAULT_WEBGL:N;this.width=a,this.height=u;var C={width:a,height:u,type:kg[o],format:Cg[l],wrapS:Rg[v],wrapT:Rg[y],mag:Dg[A],min:Dg[I],alignment:w,flipY:c,colorSpace:Mg[k],premultiplyAlpha:E,aniso:b};r&&(C.data=r),"number"==typeof d?C.mipmap=Og[d]:"boolean"==typeof d&&(C.mipmap=d),this.texture=e.texture(C)}return wf(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),uy=(0,Mf.b2)()((ry=function(){function t(){var e=this;bf(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Tf(Sf().mark((function t(n){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms){t.next=3;break}return t.next=3,Promise.all(Object.keys(n.uniforms).map(function(){var t=Tf(Sf().mark((function t(e){var r;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms[e]||void 0===n.uniforms[e].load){t.next=5;break}return t.next=3,n.uniforms[e].load();case 3:r=t.sent,n.uniforms[e]=r;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",new oy(e.gl,n));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Tg(e.gl,t)},this.createBuffer=function(t){return new zg(e.gl,t)},this.createElements=function(t){return new $g(e.gl,t)},this.createTexture2D=function(t){return new ay(e.gl,t)},this.createFramebuffer=function(t){return new Zg(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Tf(Sf().mark((function t(n){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Kg(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,u={color:n,depth:r,stencil:i};u.framebuffer=null===a?a:a.get(),e.gl.clear(u)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Dl.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Dl.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,i,o),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return wf(t,[{key:"init",value:(e=Tf(Sf().mark((function t(e){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){Ag()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}(),ny=ry))||ny;function sy(t,e){return new Promise((function(e,n){!function(t,e,n,r){if("undefined"!=typeof window){var i=document.getElementsByTagName("head")[0],o=document.createElement("script");o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),o.onload=function(){e&&e()},o.onerror=function(e){n&&n("Unable to load script '".concat(t,"'"),e)},i.appendChild(o)}}(t,(function(){e()}),(function(t,e){n(e)}))}))}function cy(){return fy.apply(this,arguments)}function fy(){return(fy=Tf(Sf().mark((function t(){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!iy){t.next=2;break}return t.abrupt("return",iy);case 2:return t.next=4,sy("https://preview.babylonjs.com/glslang/glslang.js");case 4:return iy=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",iy);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ly,hy,dy,py,vy,gy,yy,my=function(){function t(e,n){bf(this,t),this.engine=e,this.options=n,this.attribute=void 0,this.buffer=void 0;var r=n,i=r.buffer,o=r.offset,a=r.stride,u=r.normalized,s=r.size,c=r.divisor,f=r.arrayStride,l=r.attributes,h=r.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:o||0,stride:a||0,normalized:u||!1,divisor:c||0,arrayStride:f||0,attributes:l,stepMode:h||"vertex"},s&&(this.attribute.size=s)}return wf(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),by=function(){function t(e,n){bf(this,t),this.engine=e,this.options=n,this.buffer=void 0;var r=n,i=r.data,o=r.usage;r.type,this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,o||Sv.FB.Vertex|Sv.FB.CopyDst)}return wf(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.setSubData(this.buffer,n,e instanceof Array?new Float32Array(e):e)}},{key:"createBuffer",value:function(t,e){var n=t.byteLength%4,r={size:t.byteLength+n,usage:e},i=this.engine.device.createBuffer(r);return this.setSubData(i,0,t),i}},{key:"setSubData",value:function(t,e,n){(Jp?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),_y=function(){function t(e,n){bf(this,t),this.engine=e,this.context=n,this.entity=Nf(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}var e,n,r;return wf(t,[{key:"init",value:(r=Tf(Sf().mark((function t(){var e,n,r,i,o,a,u,s=this;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:e=t.sent,n=e.computeStage,r=this.context.uniforms.filter((function(t){return t.storageClass===$p.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===$p.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,u=[],i.forEach((function(t){if("number"==typeof t.data)s.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,u.push(t.data);else{var e,n=(null===(e=t.data)||void 0===e?void 0:e.length)||1;3===n&&(n=4,t.data.push(0));var r=a/4%4;if(r>0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,u.push(0)),u.push.apply(u,Fg(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,u.push(0);u.push.apply(u,Fg(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new by(this.engine,{data:u instanceof Array?new Float32Array(u):u,usage:Sv.FB.Uniform|Sv.FB.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;null!==t.data&&(t.type!==Yp.Vector4FloatArray&&t.type!==Yp.FloatArray||(t.name===s.context.output.name?(e=new by(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Sv.FB.Storage|Sv.FB.CopyDst|Sv.FB.CopySrc}),s.outputBuffer=e,s.context.output={name:t.name,length:isFinite(Number(t.data))?1:t.data.length,typedArrayConstructor:Float32Array,gpuBuffer:e.get()}):t.isReferer?t.data.model&&t.data.model.outputBuffer&&(e=t.data.model.outputBuffer):e=new by(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Sv.FB.Storage|Sv.FB.CopyDst|Sv.FB.CopySrc}),s.vertexBuffers[t.name]=e,s.bindGroupEntries.push({binding:o,resource:{name:t.name,refer:e?void 0:t.data,buffer:e?e.get():void 0}}),o++))})),this.computePipeline=this.engine.device.createComputePipeline({computeStage:n}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach((function(e){return t.vertexBuffers[e].destroy()}))}},{key:"readData",value:(n=Tf(Sf().mark((function t(){var e,n,r,i,o,a,u,s,c;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.context.output)){t.next=16;break}if(n=e.length,r=e.typedArrayConstructor,!(i=e.gpuBuffer)){t.next=16;break}return o=n*r.BYTES_PER_ELEMENT,a=this.engine.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),(u=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(Jp?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([u.finish()]),t.next=12,a.mapAsync(Sv.gc.Read);case 12:return s=a.getMappedRange(),c=new r(s.slice(0)),a.unmap(),t.abrupt("return",c);case 16:return t.abrupt("return",new Float32Array);case 17:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"run",value:function(){var t;this.engine.currentComputePass&&(this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,Fg(this.context.dispatch)))}},{key:"updateBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.vertexBuffers[t];r&&r.subData({data:e,offset:n})}},{key:"updateUniform",value:function(t,e){var n=this.uniformGPUBufferLayout.find((function(e){return e.name===t}));n&&this.uniformBuffer.subData({data:Number.isFinite(e)?new Float32Array([e]):new Float32Array(e),offset:n.offset})}},{key:"confirmInput",value:function(t,e){var n=this.vertexBuffers[e],r=t.outputBuffer;if(n&&r&&n!==r){var i=this.engine.device.createCommandEncoder(),o=t.context.output,a=o.length*o.typedArrayConstructor.BYTES_PER_ELEMENT;i.copyBufferToBuffer(r.get(),0,n.get(),0,a),(Jp?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([i.finish()])}}},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"compileComputePipelineStageDescriptor",value:(e=Tf(Sf().mark((function t(e){var n;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e,this.engine.options.useWGSL){t.next=6;break}return t.next=5,this.compileShaderToSpirV(e,"compute","#version 450\n");case 5:n=t.sent;case 6:return t.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:Jp}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),wy=function(){function t(e,n){bf(this,t),this.engine=e,this.options=n,this.indexCount=void 0,this.buffer=void 0;var r=n,i=r.data,o=(r.usage,r.type,r.count);this.indexCount=o||0,this.buffer=new by(e,{data:i instanceof Array?new Uint16Array(i):i,usage:Sv.FB.Index|Sv.FB.CopyDst})}return wf(t,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),xy=function(){function t(e,n){bf(this,t),this.engine=e,this.options=n,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var r=n,i=(r.width,r.height,r.color),o=(r.colors,r.depth);r.stencil,i&&(this.colorTexture=i),o&&(this.depthTexture=o)}return wf(t,[{key:"get",value:function(){var t,e;return{color:null===(t=this.colorTexture)||void 0===t?void 0:t.get(),depth:null===(e=this.depthTexture)||void 0===e?void 0:e.get()}}},{key:"destroy",value:function(){var t,e;null===(t=this.colorTexture)||void 0===t||t.destroy(),null===(e=this.depthTexture)||void 0===e||e.destroy()}},{key:"resize",value:function(t){var e,n,r=t.width,i=t.height;r===this.width&&i===this.height||(null===(e=this.colorTexture)||void 0===e||e.resize({width:r,height:i}),null===(n=this.depthTexture)||void 0===n||n.resize({width:r,height:i})),this.width=r,this.height=i}}]),t}(),Ey=(nl(ly={},Dl.POINTS,Sv.YV.PointList),nl(ly,Dl.LINES,Sv.YV.LineList),nl(ly,Dl.LINE_LOOP,Sv.YV.LineList),nl(ly,Dl.LINE_STRIP,Sv.YV.LineStrip),nl(ly,Dl.TRIANGLES,Sv.YV.TriangleList),nl(ly,Dl.TRIANGLE_FAN,Sv.YV.TriangleList),nl(ly,Dl.TRIANGLE_STRIP,Sv.YV.TriangleStrip),ly),Sy=(nl(hy={},Dl.NEVER,Sv.wb.Never),nl(hy,Dl.ALWAYS,Sv.wb.Always),nl(hy,Dl.LESS,Sv.wb.Less),nl(hy,Dl.LEQUAL,Sv.wb.LessEqual),nl(hy,Dl.GREATER,Sv.wb.Greater),nl(hy,Dl.GEQUAL,Sv.wb.GreaterEqual),nl(hy,Dl.EQUAL,Sv.wb.Equal),nl(hy,Dl.NOTEQUAL,Sv.wb.NotEqual),hy),Ay=(nl(dy={},Dl.FUNC_ADD,Sv.db.Add),nl(dy,Dl.MIN_EXT,Sv.db.Min),nl(dy,Dl.MAX_EXT,Sv.db.Max),nl(dy,Dl.FUNC_SUBTRACT,Sv.db.Subtract),nl(dy,Dl.FUNC_REVERSE_SUBTRACT,Sv.db.ReverseSubtract),dy),Ty=(nl(py={},Dl.ZERO,Sv.zi.Zero),nl(py,Dl.ONE,Sv.zi.One),nl(py,Dl.SRC_COLOR,Sv.zi.SrcColor),nl(py,Dl.ONE_MINUS_SRC_COLOR,Sv.zi.OneMinusSrcColor),nl(py,Dl.SRC_ALPHA,Sv.zi.SrcAlpha),nl(py,Dl.ONE_MINUS_SRC_ALPHA,Sv.zi.OneMinusSrcAlpha),nl(py,Dl.DST_COLOR,Sv.zi.DstColor),nl(py,Dl.ONE_MINUS_DST_COLOR,Sv.zi.OneMinusDstColor),nl(py,Dl.DST_ALPHA,Sv.zi.DstAlpha),nl(py,Dl.ONE_MINUS_DST_ALPHA,Sv.zi.OneMinusDstAlpha),nl(py,Dl.CONSTANT_COLOR,Sv.zi.BlendColor),nl(py,Dl.ONE_MINUS_CONSTANT_COLOR,Sv.zi.OneMinusBlendColor),nl(py,Dl.SRC_ALPHA_SATURATE,Sv.zi.SrcAlphaSaturated),py),Iy=(nl(vy={},Dl.ALPHA,"r8unorm"),nl(vy,Dl.RGBA,"rgba8unorm"),nl(vy,Dl.DEPTH_COMPONENT,"depth32float"),nl(vy,Dl.DEPTH_STENCIL,"depth24plus-stencil8"),vy),Ny=(nl(gy={},Dl.NEAREST,"nearest"),nl(gy,Dl.LINEAR,"linear"),gy),ky=(nl(yy={},Dl.REPEAT,"repeat"),nl(yy,Dl.CLAMP_TO_EDGE,"clamp-to-edge"),nl(yy,Dl.MIRRORED_REPEAT,"mirror-repeat"),yy);function Cy(t){var e=t.cull;return e&&e.enable?e.face?e.face===Dl.FRONT?Sv.Wf.Front:Sv.Wf.Back:void 0:Sv.Wf.None}function Oy(t){var e=t.depth,n=(t.stencil,{compare:Sv.wb.Always,depthFailOp:Sv.xS.Keep,failOp:Sv.xS.Keep,passOp:Sv.xS.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Sy[(null==e?void 0:e.func)||Dl.ALWAYS],format:Sv.EV.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function Dy(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:Ty[n&&n.func&&n.func.srcAlpha||Dl.ONE],dstFactor:Ty[n&&n.func&&n.func.dstAlpha||Dl.ZERO],operation:Ay[n&&n.equation&&n.equation.alpha||Dl.FUNC_ADD]},colorBlend:{srcFactor:Ty[n&&n.func&&n.func.srcRGB||Dl.ONE],dstFactor:Ty[n&&n.func&&n.func.dstRGB||Dl.ZERO],operation:Ay[n&&n.equation&&n.equation.rgb||Dl.FUNC_ADD]},writeMask:Sv.Yw.All}]}function Ry(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function My(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ry(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ry(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Py(t){for(var e=0,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=r;o<a.length;o++){var u=a[o];e+=u.length}for(var s=new t(e),c=0,f=0,l=r;f<l.length;f++){var h=l[f];s.set(h,c),c+=h.length}return s}var Gy,Ly,jy,Uy=function(){function t(e,n){bf(this,t),this.engine=e,this.options=n,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}var e,n;return wf(t,[{key:"init",value:(n=Tf(Sf().mark((function t(){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y=this;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options,n=e.vs,r=e.fs,i=e.attributes,o=e.uniforms,a=e.primitive,e.count,u=e.elements,s=e.depth,c=e.blend,f=e.stencil,l=e.cull,e.instances,t.next=3,this.compilePipelineStageDescriptor(n,r,null);case 3:h=t.sent,d=h.vertexStage,p=h.fragmentStage,o&&this.buildUniformBindGroup(o),u&&(this.indexBuffer=u.get(),this.indexCount=u.indexCount),v={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,u=r.attributes;return y.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:u}}))},g={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:Ey[a||Dl.TRIANGLES],rasterizationState:My(My({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:Cy({cull:l})}),depthStencilState:Oy({depth:s,stencil:f}),colorStates:Dy({blend:c},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:d,fragmentStage:p,vertexState:v},this.renderPipeline=this.engine.device.createRenderPipeline(g);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addUniforms",value:function(t){this.uniforms=My(My({},this.uniforms),Jg(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=My(My({},this.uniforms),Jg(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=zf(r[t]);if("boolean"===n||"number"===n||Array.isArray(r[t])||r[t].BYTES_PER_ELEMENT){var o,a=null===(o=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===o?void 0:o.offset;null!==a&&e.uniformBuffer.subData({data:r[t],offset:a})}else{var u,s=null===(u=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===u?void 0:u.offset;if(null!==s){var c=r[t].get(),f=c.color||c,l=f.texture,h=f.sampler;h&&(i.push({binding:s,resource:h}),s++),i.push({binding:s,resource:l.createView()})}}})),this.uniformBuffer&&(i[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:i}),this.renderPipeline&&n.setPipeline(this.renderPipeline),n.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&n.setIndexBuffer(this.indexBuffer.get(),Sv.iD.Uint32,0),Object.keys(this.attributeCache).forEach((function(t,r){n.setVertexBuffer(0+r,e.attributeCache[t].get().buffer,0)})),this.indexBuffer?n.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):n.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:(e=Tf(Sf().mark((function t(e,n,r){var i,o,a;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i="#version 450\n",o=e,a=n,this.engine.options.useWGSL){t.next=10;break}return t.next=6,this.compileShaderToSpirV(e,"vertex",i);case 6:return o=t.sent,t.next=9,this.compileShaderToSpirV(n,"fragment",i);case 9:a=t.sent;case 10:return t.abrupt("return",this.createPipelineStageDescriptor(o,a));case 11:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"createPipelineStageDescriptor",value:function(t,e){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:Jp}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:Jp}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:Sv.zX.CCW,cullMode:Sv.Wf.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=Py.apply(void 0,[Float32Array].concat(Fg(Object.keys(t).map((function(r){return t[r]?(e.uniformGPUBufferLayout.push({name:r,offset:n}),n+=4*(t[r].length||1),t[r]):[]}))))),i=[],o=!1;r.length&&(o=!0,i.push({binding:0,visibility:Sv.$X.Fragment|Sv.$X.Vertex,type:Sv.$l.UniformBuffer})),Object.keys(t).filter((function(e){return null===t[e]})).forEach((function(t,n){e.uniformGPUBufferLayout.push({name:t,offset:2*n+(o?1:0)}),i.push({binding:2*n+(o?1:0),visibility:Sv.$X.Fragment,type:Sv.$l.Sampler},{binding:2*n+(o?1:0)+1,visibility:Sv.$X.Fragment,type:Sv.$l.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new by(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:Sv.FB.Uniform|Sv.FB.CopyDst}))}}]),t}(),By=function(){function t(e,n){bf(this,t),this.engine=e,this.options=n,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return wf(t,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var e=t.width,n=t.height;e===this.width&&n===this.height||(this.destroy(),this.createTexture()),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,e=(void 0===(t.data,t.type)&&Dl.UNSIGNED_BYTE,t.width),n=t.height,r=(t.flipY,t.format),i=void 0===r?Dl.RGBA:r,o=(t.mipmap,t.wrapS),a=void 0===o?Dl.CLAMP_TO_EDGE:o,u=t.wrapT,s=void 0===u?Dl.CLAMP_TO_EDGE:u,c=t.aniso,f=void 0===c?0:c,l=(t.alignment,t.premultiplyAlpha,t.mag),h=void 0===l?Dl.NEAREST:l,d=t.min,p=void 0===d?Dl.NEAREST:d,v=(void 0===t.colorSpace&&Dl.BROWSER_DEFAULT_WEBGL,t.usage);this.width=e,this.height=n,this.texture=this.engine.device.createTexture({size:[e,n,1],mipLevelCount:1,sampleCount:1,dimension:Sv.kd.E2d,format:Iy[i],usage:v||Sv.v2.Sampled|Sv.v2.CopyDst}),(!v||v&Sv.v2.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:ky[a],addressModeV:ky[s],addressModeW:ky[a],magFilter:Ny[h],minFilter:Ny[p],maxAnisotropy:f}))}}]),t}(),zy=(0,Mf.b2)()((Ly=function(){function t(){var e=this;bf(this,t),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){t.framebuffer;var n=t.color,r=t.depth,i=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,n||null,!!r,!!i)):(e.mainColorAttachments[0].loadValue=n||Sv.Ws.Load,e.mainDepthAttachment.depthLoadValue=r||Sv.Ws.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:Sv.Ws.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=Tf(Sf().mark((function t(n){var r;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Uy(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new my(e,t)},this.createBuffer=function(t){return new by(e,t)},this.createElements=function(t){return new wy(e,t)},this.createTexture2D=function(t){return new By(e,t)},this.createFramebuffer=function(t){return new xy(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:Sv.p_.E2d,arrayLayerCount:1,aspect:Sv.H7.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=Tf(Sf().mark((function t(n){var r;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new _y(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.currentRenderPass?e.transientViewport.x!==1/0?e.getCurrentRenderPass().setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1):n===e.cachedViewport.x&&r===e.cachedViewport.y&&i===e.cachedViewport.width&&o===e.cachedViewport.height||(e.cachedViewport={x:n,y:r,width:i,height:o},e.getCurrentRenderPass().setViewport(n,r,i,o,0,1)):e.transientViewport={x:n,y:r,width:i,height:o}},this.readPixels=function(t){throw new Error("Method not implemented.")}}var e,n;return wf(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=Tf(Sf().mark((function t(e){return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e.canvas,this.options=e,this.useWGSL=!!e.useWGSL,this.mainPassSampleCount=e.antialiasing?this.defaultSampleCount:1,t.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"setScissor",value:function(t){throw new Error("Method not implemented.")}},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach((function(t){return t.destroy()})),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),Jp?this.device.getQueue().submit(this.commandBuffers.filter((function(t){return t}))):this.device.defaultQueue.submit(this.commandBuffers.filter((function(t){return t})))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:(e=Tf(Sf().mark((function t(){var e,n;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,cy();case 2:return this.glslang=t.sent,t.next=5,null===(e=navigator)||void 0===e||null===(n=e.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=t.sent,t.next=8,this.adapter.requestDevice();case 8:this.device=t.sent;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(Jp?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:Sv.v2.OutputAttachment|Sv.v2.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Sv.kd.E2d,format:Sv.EV.BGRA8Unorm,usage:Sv.v2.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:Jp?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:Sv.EG.Store}]}else this.mainColorAttachments=[{attachment:Jp?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:Sv.EG.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Sv.kd.E2d,format:Jp?"depth32float-stencil8":Sv.EV.Depth24PlusStencil8,usage:Sv.v2.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:Jp?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:Sv.EG.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:Sv.EG.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=Jp?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=Jp?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=null===(r=t.get().color)||void 0===r?void 0:r.texture;u&&(o=u.createView(this.currentRenderTargetViewDescriptor));var s,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(s=c.createView());var f=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:Sv.Ws.Load,storeOp:Sv.EG.Store}],depthStencilAttachment:c&&s?{attachment:s,depthLoadValue:n?this.clearDepthValue:Sv.Ws.Load,depthStoreOp:Sv.EG.Store,stencilLoadValue:a?this.clearStencilValue:Sv.Ws.Load,stencilStoreOp:Sv.EG.Store}:void 0});this.currentRenderPass=f,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&null!==this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),t}(),Gy=Ly))||Gy;var Fy,Wy=4/64,Vy=(0,Mf.b2)()(jy=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){return bf(this,i),r.apply(this,arguments)}return wf(i,[{key:"onEntityCreated",value:function(){var t=this.config,e=t.widthSegments,n=void 0===e?1:e,r=t.heightSegments,i=void 0===r?1:r,o=t.depthSegments,a=void 0===o?1:o,u=t.halfExtents,s=n,c=i,f=a,l=Rf(void 0===u?hl(.5,.5,.5):u,3),h=l[0],d=l[1],p=l[2],v=[hl(-h,-d,p),hl(h,-d,p),hl(h,d,p),hl(-h,d,p),hl(h,-d,-p),hl(-h,-d,-p),hl(-h,d,-p),hl(h,d,-p)],g=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],y=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],m=[],b=[],_=[],w=[],x=[],E=0,S=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var u=cl(),s=cl(),c=cl(),f=cl();_l(u,v[g[t][0]],v[g[t][1]],o/e),_l(s,v[g[t][0]],v[g[t][2]],a/n),El(c,s,v[g[t][0]]),vl(f,u,c),r=o/e,i=a/n,m.push(f[0],f[1],f[2]),b.push(y[t][0],y[t][1],y[t][2]),_.push(r,i),r=.875*(r/=3)+Wy,i=.875*(i/=3)+Wy,r+=t%3/3,i+=Math.floor(t/3)/3,w.push(r,i),o<e&&a<n&&(x.push(E+n+1,E+1,E),x.push(E+n+1,E+n+2,E+1)),E++}};S(0,s,c),S(1,s,c),S(2,s,f),S(3,s,f),S(4,f,c),S(5,f,c);var A=Xp(m),T=this.getComponent();T.indices=Uint32Array.from(x),T.aabb=A,T.vertexCount=E,T.attributes=[{dirty:!0,name:"position",data:Float32Array.from(m),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(b),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(_),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ev))||jy;var Hy,Xy=(0,Mf.b2)()(Fy=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){return bf(this,i),r.apply(this,arguments)}return wf(i,[{key:"onEntityCreated",value:function(){var t=this.config.geometries,e=void 0===t?[]:t,n=this.getComponent();n.aabb=new uh;var r=[],i=[],o=0;e.forEach((function(t){var e=t.aabb,a=t.indices,u=t.vertexCount,s=t.attributes;n.aabb.add(e),n.vertexCount+=u,a&&i.push.apply(i,Fg(a.map((function(t){return t+o})))),o+=u,s.forEach((function(t,e){r[e]?t.data&&(Qp(t.data)?r[e].push(t.data):Lv(t.data)?r[e].data=function(t,e){if(!t&&!e)throw new Error("Please specify valid arguments for parameters a and b.");if(!e||0===e.length)return t;if(!t||0===t.length)return e;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(e))throw new Error("The types of the two arguments passed for parameters a and b do not match.");var n=new t.constructor(t.length+e.length);return n.set(t),n.set(e,t.length),n}(r[e].data,t.data):r[e].data=r[e].data.concat(t.data)):(r[e]=t,r[e].dirty=!0)}))})),n.attributes=r,n.indices=Uint32Array.from(i),n.dirty=!0}}]),i}(Ev))||Fy;var qy,Yy=(0,Mf.b2)()(Hy=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){return bf(this,i),r.apply(this,arguments)}return wf(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.halfExtents,n=void 0===e?[.5,.5]:e,r=t.widthSegments,i=void 0===r?5:r,o=t.lengthSegments,a=void 0===o?5:o,u=[],s=[],c=[],f=[],l=0,h=0;h<=i;h++)for(var d=0;d<=a;d++){var p=-n[0]+2*n[0]*h/i,v=-(-n[1]+2*n[1]*d/a),g=h/i,y=d/a;u.push(p,0,v),s.push(0,1,0),c.push(g,y),h<i&&d<a&&(f.push(l+a+1,l+1,l),f.push(l+a+1,l+a+2,l+1)),l++}var m=Xp(u),b=this.getComponent();b.indices=Uint32Array.from(f),b.aabb=m,b.vertexCount=l,b.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ev))||Hy;var Ky,$y,Zy,Jy,Qy,tm,em,nm,rm=(0,Mf.b2)()(qy=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){return bf(this,i),r.apply(this,arguments)}return wf(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.radius,n=void 0===e?.5:e,r=t.latitudeBands,i=void 0===r?16:r,o=t.longitudeBands,a=void 0===o?16:o,u=[],s=[],c=[],f=[],l=0;l<=i;l++)for(var h=l*Math.PI/i,d=Math.sin(h),p=Math.cos(h),v=0;v<=a;v++){var g=2*v*Math.PI/a-Math.PI/2,y=Math.sin(g),m=Math.cos(g)*d,b=p,_=y*d,w=1-v/a,x=1-l/i;u.push(m*n,b*n,_*n),s.push(m,b,_),c.push(w,x)}for(var E=0;E<i;++E)for(var S=0;S<a;++S){var A=E*(a+1)+S,T=A+a+1;f.push(A+1,T,A),f.push(A+1,T+1,T)}var I=Xp(u),N=this.getComponent();N.indices=Uint32Array.from(f),N.aabb=I,N.vertexCount=u.length/3,N.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ev))||qy;var im,om,am,um,sm,cm,fm,lm,hm,dm,pm,vm,gm=(Ky=(0,Mf.b2)(),$y=(0,Mf.f3)(Pf.RenderEngine),Zy=(0,Mf.f3)(Pf.ShaderModuleService),Ky((nm=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){var t;bf(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mf(t=r.call.apply(r,[this].concat(n)),"engine",tm,Ff(t)),mf(t,"shaderModuleService",em,Ff(t)),t}return wf(i,[{key:"onEntityCreated",value:function(){var t=this.getComponent(),e=this.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform Uniforms {\n vec4 color;\n mat4 projectionMatrix;\n mat4 modelViewMatrix;\n} uniforms;\n\nlayout(location = 0) in vec3 position;\n// layout(location = 1) in vec3 barycentric;\n\nlayout(location = 0) out vec4 fragColor;\n// layout(location = 1) out vec3 v_Barycentric;\n\nvoid main() {\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\n fragColor = uniforms.color;\n // v_Barycentric = barycentric;\n}":'attribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform vec4 color;\n\nvarying vec4 fragColor;\n\n#pragma include "uv.vert.declaration"\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n fragColor = color;\n\n #pragma include "uv.vert.main"\n}',n=this.engine.supportWebGPU?"// layout(set = 0, binding = 1) uniform WireframeUniforms {\n// float lineWidth;\n// vec4 lineColor;\n// } wireframe;\n\nlayout(location = 0) in vec4 fragColor;\n// layout(location = 1) in vec3 v_Barycentric;\n\nlayout(location = 0) out vec4 outColor;\n\n// wireframe\n// float edgeFactor() {\n// vec3 d = fwidth(v_Barycentric);\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\n// return min(min(a3.x, a3.y), a3.z);\n// }\n\nvoid main() {\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\n outColor = fragColor;\n}":'varying vec4 fragColor;\n\n#pragma include "uv.frag.declaration"\n#pragma include "map.frag.declaration"\n\nvoid main() {\n vec4 diffuseColor = fragColor;\n\n #pragma include "map.frag.main"\n\n gl_FragColor = diffuseColor;\n}';this.shaderModuleService.registerModule("material-basic",{vs:e,fs:n});var r=this.shaderModuleService.getModule("material-basic"),i=r.vs,o=r.fs,a=r.uniforms;t.vertexShaderGLSL=i,t.fragmentShaderGLSL=o,t.setUniform(a),this.config.map&&(t.setDefines({USE_UV:1,USE_MAP:1}),t.setUniform({map:this.config.map,uvTransform:sl()}))}}]),i}(xg),tm=xf((Qy=nm).prototype,"engine",[$y],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),em=xf(Qy.prototype,"shaderModuleService",[Zy],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jy=Qy))||Jy);var ym,mm,bm,_m,wm,xm,Em,Sm,Am,Tm,Im,Nm,km=(im=(0,Mf.b2)(),om=(0,Mf.f3)(Pf.Systems),am=(0,Mf.t6)(Pf.MaterialSystem),um=(0,Mf.f3)(Pf.Systems),sm=(0,Mf.t6)(Pf.GeometrySystem),cm=(0,Mf.f3)(Pf.ShaderModuleService),im((vm=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){var t;bf(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mf(t=r.call.apply(r,[this].concat(n)),"materialSystem",hm,Ff(t)),mf(t,"geometrySystem",dm,Ff(t)),mf(t,"shaderModuleService",pm,Ff(t)),t}return wf(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("gridColor"===e?(r.material.setUniform("u_GridColor",n),r.material.setUniform("u_GridColor2",n)):"gridSize"===e&&(r.material.setUniform("u_GridSize",n),r.material.setUniform("u_GridSize2",n)))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:"attribute vec3 a_Position;\n\nvarying vec3 v_Position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvoid main() {\n v_Position = a_Position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.);\n}",fs:"// generate grid, borrow from clay.gl viewer\n// @see https://github.com/pissang/clay-viewer/blob/master/src/graphic/ground.glsl\n#extension GL_OES_standard_derivatives : enable\n\nvarying vec3 v_Position;\n// varying vec3 v_Normal;\n\nuniform float u_GridSize : 5;\nuniform float u_GridSize2 : .5;\nuniform vec4 u_GridColor : [0, 0, 0, 1];\nuniform vec4 u_GridColor2 : [0.3, 0.3, 0.3, 1];\nuniform bool u_GridEnabled : true;\n\n// uniform vec3 u_LightDirection;\n// uniform vec3 u_LightColor;\n// uniform vec3 u_Camera;\n\nvoid main() {\n // vec3 n = v_Normal;\n // vec3 l = normalize(u_LightDirection);\n // float NdotL = clamp(dot(n, l), 0.001, 1.0);\n\n gl_FragColor = vec4(1.);\n\n if (u_GridEnabled) {\n float wx = v_Position.x;\n float wz = v_Position.z;\n // float x0 = abs(fract(wx / u_GridSize - 0.5) - 0.5) / fwidth(wx) * u_GridSize / 2.0;\n // float z0 = abs(fract(wz / u_GridSize - 0.5) - 0.5) / fwidth(wz) * u_GridSize / 2.0;\n\n float x1 = abs(fract(wx / u_GridSize2 - 0.5) - 0.5) / fwidth(wx) * u_GridSize2;\n float z1 = abs(fract(wz / u_GridSize2 - 0.5) - 0.5) / fwidth(wz) * u_GridSize2;\n\n // float v0 = 1.0 - clamp(min(x0, z0), 0.0, 1.0);\n float v1 = 1.0 - clamp(min(x1, z1), 0.0, 1.0);\n // if (v0 > 0.1) {\n // gl_FragColor = mix(gl_FragColor, u_GridColor, v0);\n // }\n // else {\n gl_FragColor = mix(gl_FragColor, u_GridColor2, v1);\n // }\n }\n\n // float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n);\n // vec3 diffuseColor = u_LightColor * NdotL * shadowFactor;\n\n // gl_FragColor.rgb *= diffuseColor;\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n});this.setMaterial(i);var o=this.geometrySystem.createBufferGeometry({vertexCount:4});this.setGeometry(o),i.setCull({enable:!1,face:Dl.BACK}).setDepth({enable:!0,func:Dl.LESS}),i.setUniform(r),this.setAttributes({gridColor:this.config.gridColor,gridSize:this.config.gridSize}),o.setIndex([0,3,2,2,1,0]),o.setAttribute("a_Position",Float32Array.from([-4,-1,-4,4,-1,-4,4,-1,4,-4,-1,4]),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})}}]),i}(Eg),hm=xf((lm=vm).prototype,"materialSystem",[om,am],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dm=xf(lm.prototype,"geometrySystem",[um,sm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pm=xf(lm.prototype,"shaderModuleService",[cm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fm=lm))||fm),Cm=n(7801),Om=n(1739);function Dm(t,e,n,r,i){Rm(e,r,-i),Rm(e,r,i),t.push(n),t.push(n)}function Rm(t,e,n){t.push([[e[0],e[1]],n])}var Mm,Pm,Gm,Lm,jm,Um,Bm,zm,Fm,Wm,Vm,Hm,Xm=(ym=(0,Mf.b2)(),mm=(0,Mf.f3)(Pf.Systems),bm=(0,Mf.t6)(Pf.MaterialSystem),_m=(0,Mf.f3)(Pf.Systems),wm=(0,Mf.t6)(Pf.GeometrySystem),xm=(0,Mf.f3)(Pf.ShaderModuleService),ym((Nm=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){var t;bf(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mf(t=r.call.apply(r,[this].concat(n)),"materialSystem",Am,Ff(t)),mf(t,"geometrySystem",Tm,Ff(t)),mf(t,"shaderModuleService",Im,Ff(t)),t.vertexCount=void 0,t}return wf(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();if(r&&r.material)switch(e){case"dashArray":r.material.setUniform("u_dash_array",n);break;case"dashOffset":r.material.setUniform("u_dash_offset",n);break;case"dashRatio":r.material.setUniform("u_dash_ratio",n);break;case"thickness":r.material.setUniform("u_thickness",n);break;case"color":var i=new Array(this.vertexCount).fill(void 0).map((function(){return n})).reduce((function(t,e){return[].concat(Fg(t),Fg(e))}),[]);r.geometry.setAttribute("a_color",Float32Array.from(i),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]})}}},{key:"onEntityCreated",value:function(){var t=this;this.shaderModuleService.registerModule("line",{vs:"attribute vec2 a_pos;\nattribute vec4 a_color;\nattribute float a_line_miter;\nattribute vec2 a_line_normal;\nattribute float a_counters;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float u_thickness : 0.02;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n v_color = a_color;\n v_counters = a_counters;\n\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\n\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\n\n v_normal = vec2(normal * sign(a_line_miter));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\n}\n",fs:"uniform float u_dash_array : 0.02;\nuniform float u_dash_offset : 0;\nuniform float u_dash_ratio : 0;\nuniform float u_thickness : 0.02;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\n\n gl_FragColor = v_color;\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\n}"});var e=this.shaderModuleService.getModule("line"),n=e.vs,r=e.fs,i=e.uniforms,o=this.materialSystem.createShaderMaterial({vertexShader:n,fragmentShader:r}),a=function(t,e,n){for(var r=[0,0],i=[0,0],o=[0,0],a=[0,0],u=-1,s=!1,c=null,f=(0,Cm.create)(),l=0,h=[],d=[],p=[],v=[0,0],g=t.length,y=1;y<g;y++){var m=l,b=t[y-1],_=t[y],w=y<t.length-1?t[y+1]:null;if(v.push(y/g,y/g),(0,Om.o7)(r,_,b),c||(c=[0,0],(0,Om.mJ)(c,r)),s||(s=!0,Dm(d,h,b,c,1)),p.push([m+0,m+1,m+2]),w){(0,Om.o7)(i,w,_);var x=(0,Om.x7)(o,a,r,i,1),E=(0,Cm.dot)(o,c)<0?-1:1,S=x>3;if(!isFinite(x)){(0,Om.mJ)(c,r),Dm(d,h,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2,u=E;continue}S?(x=3,v.push(y/g),Rm(h,c,-E),d.push(_),Rm(h,a,x*E),d.push(_),p.push(u!==-E?[m,m+2,m+3]:[m+2,m+1,m+3]),p.push([m+2,m+3,m+4]),(0,Om.mJ)(f,i),(0,Cm.copy)(c,f),Rm(h,c,-E),d.push(_),l+=3):(Dm(d,h,_,a,x),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),E=-1,(0,Cm.copy)(c,a),l+=2),u=E}else(0,Om.mJ)(c,r),Dm(d,h,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2}return{normals:h,attrIndex:p,attrPos:d,attrCounters:v}}(this.config.points),u=a.normals,s=a.attrIndex,c=a.attrPos,f=a.attrCounters,l=c.length;this.vertexCount=l;var h=this.geometrySystem.createBufferGeometry({vertexCount:l});this.setMaterial(o),this.setGeometry(h),o.setCull({enable:!1,face:Dl.BACK}).setUniform(i),this.setAttributes({dashArray:this.config.dashArray,dashOffset:this.config.dashOffset,dashRatio:this.config.dashRatio,thickness:this.config.thickness});var d=[],p=[];u.forEach((function(t){var e=t[0],n=t[1];d.push([e[0],e[1]]),p.push(n)})),h.setIndex(s.reduce((function(t,e){return[].concat(Fg(t),Fg(e))}),[])),h.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(Fg(t),Fg(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var v=new Array(l).fill(void 0).map((function(){return Fg(t.config.color)})).reduce((function(t,e){return[].concat(Fg(t),Fg(e))}),[]);h.setAttribute("a_color",Float32Array.from(v),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),h.setAttribute("a_line_miter",Float32Array.from(p),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),h.setAttribute("a_line_normal",Float32Array.from(d.reduce((function(t,e){return[].concat(Fg(t),Fg(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),h.setAttribute("a_counters",Float32Array.from(f),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]})}}]),i}(Eg),Am=xf((Sm=Nm).prototype,"materialSystem",[mm,bm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tm=xf(Sm.prototype,"geometrySystem",[_m,wm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Im=xf(Sm.prototype,"shaderModuleService",[xm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Em=Sm))||Em);function qm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Ym,Km,$m,Zm,Jm,Qm,tb,eb,nb,rb,ib=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],ob=(Mm=(0,Mf.b2)(),Pm=(0,Mf.f3)(Pf.Systems),Gm=(0,Mf.t6)(Pf.MaterialSystem),Lm=(0,Mf.f3)(Pf.Systems),jm=(0,Mf.t6)(Pf.GeometrySystem),Um=(0,Mf.f3)(Pf.ShaderModuleService),Mm((Hm=function(t){Bf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vf(e);if(n){var i=Vf(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wf(this,t)});function i(){var t;bf(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mf(t=r.call.apply(r,[this].concat(n)),"materialSystem",Fm,Ff(t)),mf(t,"geometrySystem",Wm,Ff(t)),mf(t,"shaderModuleService",Vm,Ff(t)),t}return wf(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("strokeWidth"===e?r.material.setUniform("u_stroke_width",n):"strokeColor"===e?r.material.setUniform("u_stroke_color",n):"strokeOpacity"===e?r.material.setUniform("u_stroke_opacity",n):"opacity"===e?r.material.setUniform("u_opacity",n):"blur"===e&&r.material.setUniform("u_blur",n))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:'attribute vec2 position;\nattribute vec4 color;\nattribute float shape;\nattribute vec2 offset;\nattribute float size;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nuniform float u_stroke_width : 0.01;\nuniform float u_device_pixel_ratio;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include "picking"\n\nvoid main() {\n v_color = color;\n v_radius = size;\n\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\n\n // construct point coords\n v_data = vec4(position, antialiasblur, shape);\n\n gl_Position = projectionMatrix * modelViewMatrix\n * vec4(position * size + offset, 0.0, 1.0);\n\n setPickingColor(a_PickingColor);\n}',fs:"uniform float u_blur : 0.05;\nuniform float u_opacity : 0.7;\nuniform float u_stroke_width : 0.01;\nuniform vec4 u_stroke_color : [0, 0, 0, 0];\nuniform float u_stroke_opacity : 1;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include \"sdf2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n float antialiasblur = v_data.z;\n float antialiased_blur = -max(u_blur, antialiasblur);\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n // if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n // } else if (shape == 1) {\n // outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n // inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n // } else if (shape == 2) {\n // outer_df = sdBox(v_data.xy, vec2(1.));\n // inner_df = sdBox(v_data.xy, vec2(r));\n // } else if (shape == 3) {\n // outer_df = sdPentagon(v_data.xy, 0.8);\n // inner_df = sdPentagon(v_data.xy, r * 0.8);\n // } else if (shape == 4) {\n // outer_df = sdHexagon(v_data.xy, 0.8);\n // inner_df = sdHexagon(v_data.xy, r * 0.8);\n // } else if (shape == 5) {\n // outer_df = sdOctogon(v_data.xy, 1.0);\n // inner_df = sdOctogon(v_data.xy, r);\n // } else if (shape == 6) {\n // outer_df = sdHexagram(v_data.xy, 0.52);\n // inner_df = sdHexagram(v_data.xy, r * 0.52);\n // } else if (shape == 7) {\n // outer_df = sdRhombus(v_data.xy, vec2(1.0));\n // inner_df = sdRhombus(v_data.xy, vec2(r));\n // } else if (shape == 8) {\n // outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n // inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n // }\n\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n inner_df\n );\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\n\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\n gl_FragColor.a = gl_FragColor.a * opacity_t;\n\n gl_FragColor = filterColor(gl_FragColor);\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n,cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Dl.SRC_ALPHA,dstRGB:Dl.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});i.setUniform(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qm(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qm(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({u_device_pixel_ratio:window.devicePixelRatio},r));var o=this.buildAttributes(),a=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:o.instancedOffsets.length/2,vertexCount:6});a.setIndex([0,2,1,0,3,2]),a.setAttribute("position",Float32Array.from(o.positions),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),a.setAttribute("offset",Float32Array.from(o.instancedOffsets),{arrayStride:8,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),a.setAttribute("color",Float32Array.from(o.instancedColors),{arrayStride:16,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),a.setAttribute("size",Float32Array.from(o.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),a.setAttribute("shape",Float32Array.from(o.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),a.setAttribute("a_PickingColor",Float32Array.from(o.instancedPickingColors),{arrayStride:12,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(i),this.setGeometry(a)}},{key:"buildAttribute",value:function(t,e,n){var r,i,o,a,u;(r=e.instancedPickingColors).push.apply(r,Fg([(u=t.id||n)+1&255,u+1>>8&255,u+1>>8>>8&255])),e.instancedShapes.push(ib.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,Fg(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,Fg(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,Fg(t.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var t=this,e={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach((function(n,r){t.buildAttribute(n,e,r)})):this.buildAttribute(this.config,e,0),e}}]),i}(Eg),Fm=xf((zm=Hm).prototype,"materialSystem",[Pm,Gm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wm=xf(zm.prototype,"geometrySystem",[Lm,jm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vm=xf(zm.prototype,"shaderModuleService",[Um],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bm=zm))||Bm);function ab(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ub(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ub(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ub(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var sb,cb,fb,lb,hb,db,pb,vb,gb,yb,mb,bb,_b=(Ym=(0,Mf.b2)(),Km=(0,Mf.f3)(Pf.RenderEngine),$m=(0,Mf.f3)(Pf.ShaderModuleService),Zm=(0,Mf.f3)(Pf.ConfigService),Ym((rb=function(){function t(){bf(this,t),this.container=void 0,mf(this,"engine",tb,this),mf(this,"shaderModule",eb,this),mf(this,"configService",nb,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}var e,n;return wf(t,[{key:"init",value:(n=Tf(Sf().mark((function t(){var e,n,r,i,o;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shaderModule.registerBuiltinModules(),this.shaderModule.registerModule("uv.vert.declaration",{vs:"#ifdef USE_UV\n attribute vec2 uv;\n\t#ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif"}),this.shaderModule.registerModule("uv.vert.main",{vs:"#ifdef USE_UV\n vUv = (uvTransform * vec3(uv, 1)).xy;\n#endif"}),this.shaderModule.registerModule("uv.frag.declaration",{fs:"#if (defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ))\n varying vec2 vUv;\n#endif"}),this.shaderModule.registerModule("map.frag.declaration",{fs:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif"}),this.shaderModule.registerModule("map.frag.main",{fs:"#ifdef USE_MAP\n vec4 texelColor = texture2D(map, vUv);\n // texelColor = mapTexelToLinear(texelColor);\n diffuseColor *= texelColor;\n#endif"}),e=this.container.getAll(Pf.Systems),!(n=this.configService.get()).canvas){t.next=30;break}return t.next=11,this.engine.init({canvas:n.canvas,swapChainFormat:Sv.EV.BGRA8Unorm,antialiasing:!1});case 11:r=ab(e),t.prev=12,r.s();case 14:if((i=r.n()).done){t.next=21;break}if(!(o=i.value).initialize){t.next=19;break}return t.next=19,o.initialize();case 19:t.next=14;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(12),r.e(t.t0);case 26:return t.prev=26,r.f(),t.finish(26);case 29:this.inited=!0;case 30:case"end":return t.stop()}}),t,this,[[12,23,26,29]])}))),function(){return n.apply(this,arguments)})},{key:"render",value:(e=Tf(Sf().mark((function t(){var e,n,r,i,o,a,u,s=arguments;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.inited&&!this.rendering){t.next=2;break}return t.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach((function(t){t()})),this.rendering=!0,this.engine.beginFrame(),e=this.container.getAll(Pf.Systems),n=s.length,r=new Array(n),i=0;i<n;i++)r[i]=s[i];o=ab(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(u=a.value).execute){t.next=15;break}return t.next=15,u.execute(r);case 15:t.next=10;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(8),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return t.stop()}}),t,this,[[8,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"clear",value:function(t){var e=this;return this.inited?this.engine.clear(t):this.pendings.unshift((function(){e.engine.clear(t),e.pendings.shift()})),this}},{key:"setSize",value:function(t){var e=t.width,n=t.height,r=this.engine.getCanvas();return this.size={width:e,height:n},r.width=e,r.height=n,this}},{key:"getSize",value:function(){return this.size}}]),t}(),tb=xf((Qm=rb).prototype,"engine",[Km],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),eb=xf(Qm.prototype,"shaderModule",[$m],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nb=xf(Qm.prototype,"configService",[Zm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jm=Qm))||Jm),wb=(0,Mf.b2)()((cb=function(){function t(){bf(this,t),this.entities=[]}return wf(t,[{key:"getEntities",value:function(){return this.entities}},{key:"addRenderable",value:function(t){return this.addEntity(t.getEntity()),this}},{key:"removeRenderable",value:function(t){return this.removeEntity(t.getEntity()),this}},{key:"addLight",value:function(){}},{key:"addEntity",value:function(t){return-1===this.entities.indexOf(t)&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var e=this.entities.indexOf(t);return this.entities.splice(e,1),this}}]),t}(),sb=cb))||sb,xb=(0,Mf.b2)()((lb=function(){function t(){bf(this,t),this.cache={}}return wf(t,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,e){this.cache[t]=e}}]),t}(),fb=lb))||fb;function Eb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Sb(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Eb(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Eb(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ab,Tb,Ib,Nb,kb,Cb,Ob,Db,Rb,Mb,Pb,Gb,Lb,jb=(hb=(0,Mf.b2)(),db=(0,Mf.f3)(xb),pb=(0,Mf.f3)(Pf.RenderEngine),hb((bb=function(){function t(){bf(this,t),mf(this,"textureCache",yb,this),mf(this,"engine",mb,this),this.config=void 0,this.loaded=!1,this.texture=void 0}var e;return wf(t,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:(e=Tf(Sf().mark((function t(){var e=this;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.config.url){t.next=4;break}return t.abrupt("return",new Promise((function(t,n){var r=e.textureCache.get(e.config.url);if(r)t(r);else{var i=new Image;i.crossOrigin="Anonymous",i.src=e.config.url,i.onload=function(){var n=e.engine.createTexture2D(Sb(Sb({},e.config),{},{data:i,width:i.width,height:i.height,flipY:!0}));e.textureCache.set(e.config.url,n),e.texture=n,e.loaded=!0,t(n)},i.onerror=function(){n()}}})));case 4:return this.loaded=!0,this.texture=this.engine.createTexture2D(this.config),t.abrupt("return",this.texture);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),yb=xf((gb=bb).prototype,"textureCache",[db],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mb=xf(gb.prototype,"engine",[pb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vb=gb))||vb),Ub=(Ab=(0,Mf.b2)(),Tb=(0,Mf.f3)(Pf.Systems),Ib=(0,Mf.t6)(Pf.RendererSystem),Ab((Ob=function(){function t(){bf(this,t),mf(this,"rendererSystem",Cb,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return wf(t,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),t}(),Cb=xf((kb=Ob).prototype,"rendererSystem",[Tb,Ib],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nb=kb))||Nb);function Bb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zb(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bb(Object(n),!0).forEach((function(e){nl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bb(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Fb=(Db=(0,Mf.b2)(),Rb=(0,Mf.f3)(Pf.ConfigService),Db((Lb=function(){function t(){bf(this,t),mf(this,"configService",Gb,this),this.container=void 0}var e;return wf(t,[{key:"getEngine",value:(e=Tf(Sf().mark((function t(){var e,n,r,i;return Sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(Pf.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(zb({canvas:r||Av(),swapChainFormat:Sv.EV.BGRA8Unorm,antialiasing:!1},i));case 4:return t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTransformComponent",value:function(t){return this.container.get(Pf.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(Pf.MeshComponentManager).getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return Nf()}},{key:"createScene",value:function(){return this.container.get(wb)}},{key:"createCamera",value:function(){return this.container.get(xv)}},{key:"createView",value:function(){return this.container.get(Ub)}},{key:"createRenderable",value:function(t,e){var n=t?this.container.getNamed(Pf.Renderable,t):this.container.get(Eg),r=Nf();return n.setConfig(e||{}),n.setEntity(r),n}},{key:"createGeometry",value:function(t,e){var n=this.container.getNamed(Pf.Geometry,t),r=Nf();return n.setConfig(e||{}),n.setEntity(r),n.getComponent()}},{key:"createMaterial",value:function(t,e){var n=this.container.getNamed(Pf.Material,t),r=Nf();return n.setConfig(e||{}),n.setEntity(r,t),n.getComponent()}},{key:"createTexture2D",value:function(t){var e=this.container.get(jb);return e.setConfig(t),e}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(Pf.Systems,Pf.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(Pf.Systems,Pf.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(Pf.Systems,Pf.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(wg);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(_b);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(Pf.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(Pf.RenderEngine).destroy(),this.container.get(Pf.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Hp(),r=navigator.gpu?zy:uy;n.isBound(Pf.RenderEngine)||n.bind(Pf.RenderEngine).to(r).inSingletonScope(),n.bind(_b).toSelf(),n.bind(wg).toSelf(),n.bind(Eg).toSelf(),n.bind(Ub).toSelf(),n.bind(xv).toSelf(),n.bind(wb).toSelf(),n.bind(t).toSelf(),n.bind(xb).toSelf(),n.bind(jb).toSelf(),n.bind(Pf.Geometry).to(Vy).whenTargetNamed(Ev.BOX),n.bind(Pf.Geometry).to(rm).whenTargetNamed(Ev.SPHERE),n.bind(Pf.Geometry).to(Yy).whenTargetNamed(Ev.PLANE),n.bind(Pf.Geometry).to(Xy).whenTargetNamed(Ev.MERGED),n.bind(Pf.Material).to(gm).whenTargetNamed(xg.BASIC),n.bind(Pf.Renderable).to(ob).whenTargetNamed(Eg.POINT),n.bind(Pf.Renderable).to(Xm).whenTargetNamed(Eg.LINE),n.bind(Pf.Renderable).to(km).whenTargetNamed(Eg.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),Gb=xf((Pb=Lb).prototype,"configService",[Rb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mb=Pb))||Mb),Wb=function(t,e){return t?o(t)?function(){return t}:t:function(){return e||1}},Vb=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},Hb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xb=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},qb=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},Yb=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.gravity=10,n.speed=1,n.clustering=!1,n.clusterField="cluster",n.clusterGravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return Hb(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return Xb(this,void 0,void 0,(function(){var t,e,n,r,i,a=this;return qb(this,(function(u){switch(u.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(t,e){o(t.x)||(t.x=Math.random()*a.width),o(t.y)||(t.y=Math.random()*a.height),r[t.id]=t,i[t.id]=e})),t.nodeMap=r,t.nodeIdxMap=i,[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return u.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){return Xb(this,void 0,void 0,(function(){var n,r,i,a,u,s=this;return qb(this,(function(c){switch(c.label){case 0:return r=(n=this).nodes,i=n.center,r&&0!==r.length?1===r.length?(r[0].x=i[0],r[0].y=i[1],[2]):(a={},u={},r.forEach((function(t,e){o(t.x)||(t.x=Math.random()*s.width),o(t.y)||(t.y=Math.random()*s.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,[4,n.run(t,e)]):[2];case 1:return c.sent(),[2]}}))}))},e.prototype.run=function(t,e){return Xb(this,void 0,void 0,(function(){var n,r,i,a,u,s,c,f,l,d,p,v,g,y,m,b,_,w,x,E,S,A,T,I,N,k,C=this;return qb(this,(function(O){switch(O.label){case 0:for(r=(n=this).nodes,i=n.edges,a=n.maxIteration,u=n.center,s=n.height*n.width,c=Math.sqrt(s)/10,f=s/(r.length+1),l=Math.sqrt(f),d=n.speed,p=n.clustering,D=[n.clusterField],R=r,M=[],P=D.length,G={},R.forEach((function(t){D.forEach((function(e,n){if(void 0===G[t[e]]&&(G[t[e]]=Object.keys(G).length),M.push(G[t[e]]),n===P-1)for(;M.length%4!=0;)M.push(0)}))})),v={array:new Float32Array(M),count:Object.keys(G).length},g=v.array,y=v.count,r.forEach((function(t,e){var n=0,r=0;o(t.fx)&&o(t.fy)&&(n=t.fx||.001,r=t.fy||.001),g[4*e+1]=n,g[4*e+2]=r})),m=r.length,b=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var u=e[o],s=h(u,"source"),c=h(u,"target");r[i[s]].push(i[c]),r[i[c]].push(i[s])}var f=0;for(o=0;o<t.length;o++){var l=n.length,d=r[o],p=d.length;n[4*o+2]=l,n[4*o+3]=d.length,f=Math.max(f,d.length);for(var v=0;v<p;++v){var g=d[v];n.push(+g)}}for(;n.length%4!=0;)n.push(0);return{maxEdgePerVetex:f,array:new Float32Array(n)}}(r,i),_=b.maxEdgePerVetex,w=b.array,x=n.workerEnabled,E=x?Fb.create({canvas:t,engineOptions:{supportCompute:!0}}):Fb.create({engineOptions:{supportCompute:!0}}),S=n.onLayoutEnd,A=[],T=0;T<y;T++)A.push(0,0,0,0);return I=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2<f32>;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\ndx = dx + param * std::sign;\\ndy = dy + param * std::sign;}}}}\\nreturn vec2<f32>(dx, dy);}\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2<f32>(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\ndx = dx - std::sign * attractiveF;\\ndy = dy - std::sign * attractiveF;}}}\\nreturn vec2<f32>(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([m,1,1]).setBinding({u_Data:w,u_K:l,u_K2:f,u_Gravity:n.gravity,u_ClusterGravity:n.clusterGravity||n.gravity||1,u_Speed:d,u_MaxDisplace:c,u_Clustering:p?1:0,u_Center:u,u_AttributeArray:g,u_ClusterCenters:A,MAX_EDGE_PER_VERTEX:_,VERTEX_COUNT:m}),p&&(N=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([y,1,1]).setBinding({u_Data:w,u_NodeAttributes:g,u_ClusterCenters:A,VERTEX_COUNT:m,CLUSTER_COUNT:y})),k=function(){return Xb(C,void 0,void 0,(function(){var n,i;return qb(this,(function(o){switch(o.label){case 0:n=0,o.label=1;case 1:return n<a?[4,I.execute()]:[3,6];case 2:return o.sent(),p?(N.setBinding({u_Data:I}),[4,N.execute()]):[3,4];case 3:o.sent(),I.setBinding({u_ClusterCenters:N}),o.label=4;case 4:I.setBinding({u_MaxDisplace:c*=.99}),o.label=5;case 5:return n++,[3,1];case 6:return[4,I.getOutput()];case 7:return i=o.sent(),t?e.postMessage({type:Nt,vertexEdgeData:i}):r.forEach((function(t,e){var n=i[4*e],r=i[4*e+1];t.x=n,t.y=r})),S&&S(),[2]}}))}))},[4,k()];case 1:return O.sent(),[2]}var D,R,M,P,G}))}))},e.prototype.getType=function(){return"fruchterman-gpu"},e}(t),Kb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$b=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},Zb=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},Jb=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return Kb(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return $b(this,void 0,void 0,(function(){var t,e,n,r,i;return Zb(this,(function(a){switch(a.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(e,n){o(e.x)||(e.x=Math.random()*t.width),o(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=i,t.nodeStrength=Wb(t.nodeStrength,1),t.edgeStrength=Wb(t.edgeStrength,1),[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return a.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){var n=this,r=n.nodes,i=n.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=i[0],void(r[0].y=i[1]);var a={},u={};r.forEach((function(t,e){o(t.x)||(t.x=Math.random()*n.width),o(t.y)||(t.y=Math.random()*n.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,n.nodeStrength=Wb(n.nodeStrength,1),n.edgeStrength=Wb(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return $b(this,void 0,void 0,(function(){var n,r,i,a,u,s,c,f,l,p,v,g,y,m,b,_,w,x,E,S,A,T,I,N,k,C,O,D=this;return Zb(this,(function(R){switch(R.label){case 0:for(r=(n=this).nodes,i=n.edges,a=n.maxIteration,n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),u=r.length,n.linkDistance=Wb(n.linkDistance),n.edgeStrength=Wb(n.edgeStrength),s=function(t,e,n,r){var i=[],o=[],a={},u=0;for(u=0;u<t.length;u++){var s=t[u];a[s.id]=u,i.push(s.x),i.push(s.y),i.push(0),i.push(0),o.push([])}for(u=0;u<e.length;u++){var c=e[u],f=h(c,"source"),l=h(c,"target");o[a[f]].push(a[l]),o[a[f]].push(n(c)),o[a[f]].push(r(c)),o[a[f]].push(0),o[a[l]].push(a[f]),o[a[l]].push(n(c)),o[a[l]].push(r(c)),o[a[l]].push(0)}var d=0;for(u=0;u<t.length;u++){var p=i.length,v=o[u],g=v.length;i[4*u+2]=p+1048576*g/4,i[4*u+3]=0,d=Math.max(d,g/4);for(var y=0;y<g;++y){var m=v[y];i.push(+m)}}for(;i.length%4!=0;)i.push(0);return{maxEdgePerVetex:d,array:new Float32Array(i)}}(r,i,n.linkDistance,n.edgeStrength),c=s.maxEdgePerVetex,f=s.array,n.degrees=d(r.length,n.nodeIdxMap,i),l=[],p=[],v=[],g=[],y=[],m=[],b=[],n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),_=n.gravity,w=n.center,r.forEach((function(t,e){l.push(n.getMass(t)),p.push(n.nodeStrength(t)),n.degrees[e]||(n.degrees[e]=0);var r=[w[0],w[1],_];if(n.getCenter){var i=n.getCenter(t,n.degrees[e]);i&&o(i[0])&&o(i[1])&&o(i[2])&&(r=i)}v.push(r[0]),g.push(r[1]),y.push(r[2]),o(t.fx)&&o(t.fy)?(m.push(t.fx||.001),b.push(t.fy||.001)):(m.push(0),b.push(0))})),x=Vb([l,n.degrees,p,m]),E=Vb([v,g,y,b]),S=n.workerEnabled,A=S?Fb.create({canvas:t,engineOptions:{supportCompute:!0}}):Fb.create({engineOptions:{supportCompute:!0}}),T=n.onLayoutEnd,I=[],f.forEach((function(t){I.push(t)})),N=0;N<4;N++)I.push(0);return k=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2<f32>(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.z;\\nvar ay : f32 = vy * attributes2.z;\\nreturn vec2<f32>(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2<f32>(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([u,1,1]).setBinding({u_Data:f,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:x,u_NodeAttributeArray2:E,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:u,u_AveMovement:I,u_interval:n.interval}),C=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([1,1,1]).setBinding({u_Data:f,VERTEX_COUNT:u,u_AveMovement:[0,0,0,0]}),O=function(){return $b(D,void 0,void 0,(function(){var i,o,u;return Zb(this,(function(s){switch(s.label){case 0:i=0,s.label=1;case 1:return i<a?[4,k.execute()]:[3,5];case 2:return s.sent(),C.setBinding({u_Data:k}),[4,C.execute()];case 3:s.sent(),o=Math.max(.02,n.interval-.002*i),k.setBinding({u_interval:o,u_AveMovement:C}),s.label=4;case 4:return i++,[3,1];case 5:return[4,k.getOutput()];case 6:return u=s.sent(),t?e.postMessage({type:Nt,vertexEdgeData:u}):r.forEach((function(t,e){var n=u[4*e],r=u[4*e+1];t.x=n,t.y=r})),T&&T(),[2]}}))}))},[4,O()];case 1:return R.sent(),[2]}}))}))},e.prototype.getType=function(){return"gForce-gpu"},e}(t),Qb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t_=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return Qb(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,i=t.velocityDecay,a=t.comboMap;t.previousLayouted||t.initPos(a);for(var u=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){o(t.x)&&o(t.y)&&(t.x+=r[e].x*i,t.y+=r[e].y*i)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)u();var c=[0,0];e.forEach((function(t){o(t.x)&&o(t.y)&&(c[0]+=t.x,c[1]+=t.y)})),c[0]/=e.length,c[1]/=e.length;var f=[r[0]-c[0],r[1]-c[1]];e.forEach((function(t,e){o(t.x)&&o(t.y)&&(t.x+=f[0],t.y+=f[1])})),t.combos.forEach((function(t){var e=a[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this,e=t.edges,n=t.nodes,r=t.combos,a={},u={},s={};n.forEach((function(t,e){u[t.id]=t,s[t.id]=e})),t.nodeMap=u,t.indexMap=s;var c={};r.forEach((function(t){c[t.id]=t})),t.oriComboMap=c,t.comboMap=t.getComboMap();var l=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||l,t.preventNodeOverlap=t.preventNodeOverlap||l;var d=t.collideStrength;d&&(t.comboCollideStrength=d,t.nodeCollideStrength=d),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(var p=0;p<e.length;++p){var v=h(e[p],"source"),g=h(e[p],"target");a[v]?a[v]++:a[v]=1,a[g]?a[g]++:a[g]=1}var y=[];for(p=0;p<e.length;++p)v=h(e[p],"source"),g=h(e[p],"target"),y[p]=a[v]/(a[v]+a[g]);this.bias=y;var b,_,w=t.nodeSize,x=t.nodeSpacing;if(_=o(x)?function(){return x}:m(x)?x:function(){return 0},this.nodeSpacing=_,w)if(m(w))b=function(t){return w(t)};else if(i(w)){var E=(w[0]>w[1]?w[0]:w[1])/2;b=function(t){return E}}else{var S=w/2;b=function(t){return S}}else b=function(t){return t.size?i(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=b;var A,T=t.comboSpacing;A=o(T)?function(){return T}:m(T)?T:function(){return 0},this.comboSpacing=A;var I,N=t.comboPadding;I=o(N)?function(){return N}:i(N)?function(){return Math.max.apply(null,N)}:m(N)?N:function(){return 0},this.comboPadding=I;var k,C=this.linkDistance;C||(C=10),k=o(C)?function(t){return C}:C,this.linkDistance=k;var O,D=this.edgeStrength;D||(D=1),O=o(D)?function(t){return D}:D,this.edgeStrength=O;var R,M=this.nodeStrength;M||(M=30),R=o(M)?function(t){return M}:M,this.nodeStrength=R},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,i=t[r];r&&i?(e.x=i.cx+100/(n+1),e.y=i.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,i={};return(n||[]).forEach((function(n){var a=[];y(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===i[n.id]){var u={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};i[n.id]=u}var s=n.children;s&&s.forEach((function(t){if(!i[t.id]&&!e[t.id])return!0;a.push(t)}));var c=i[n.id];if(c.cx=0,c.cy=0,0===a.length){c.empty=!0;var f=r[n.id];c.cx=f.x,c.cy=f.y}return a.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=i[t.id];return o(n.cx)&&(c.cx+=n.cx),void(o(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(o(r.x)&&(c.cx+=r.x),o(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=a,!0}))})),i},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,i=this.alpha,a=e.comboTrees,u=e.indexMap,s=e.nodeMap,c=e.comboMap;(a||[]).forEach((function(e){y(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],a=(n.depth+1)/10*.5,f=n.cx,l=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var h=c[e.id];return h&&o(h.cx)&&(n.cx+=h.cx),void(h&&o(h.cy)&&(n.cy+=h.cy))}var d=s[e.id],p=d.x-f||.005,v=d.y-l||.005,g=Math.sqrt(p*p+v*v),y=u[d.id],m=r*i/g*a;t[y].x-=p*m,t[y].y-=v*m,o(d.x)&&(n.cx+=d.x),o(d.y)&&(n.cy+=d.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,i={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(e<r)){var o=t.x-n.x||.005,a=t.y-n.y||.005,u=o*o+a*a,s=Math.sqrt(u);u<1&&(u=s),i[t.id+"-"+n.id]={vx:o,vy:a,vl2:u,vl:s},i[n.id+"-"+t.id]={vl2:u,vl:s,vx:-o,vy:-a}}}))})),e.updateComboSizes(n),e.calRepulsive(t,i),e.calAttractive(t,i),e.preventComboOverlap&&e.comboNonOverlapping(t,n)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,r=e.nodeMap,o=e.nodeSize,a=e.comboSpacing,u=e.comboPadding;(n||[]).forEach((function(n){var s=[];y(n,(function(n){if("node"===n.itemType)return!0;var c=t[n.id];if(!c)return!1;var f=n.children;f&&f.forEach((function(e){(t[e.id]||r[e.id])&&s.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=r[t.id];if(!e)return!0;var n=o(e),i=e.x-n,a=e.y-n,u=e.x+n,s=e.y+n;c.minX>i&&(c.minX=i),c.minY>a&&(c.minY=a),c.maxX<u&&(c.maxX=u),c.maxY<s&&(c.maxY=s)}));var l=e.oriComboMap[n.id].size||10;i(l)&&(l=l[0]);var h=Math.max(c.maxX-c.minX,c.maxY-c.minY,l);return c.r=h/2+a(c)/2+u(c),!0}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this,r=n.comboTree,i=n.comboCollideStrength,o=n.indexMap,a=n.nodeMap;y(r,(function(n){if(!e[n.id]&&!a[n.id]&&"comboTreeRoot"!==n.id)return!1;var r=n.children;return r&&r.length>1&&r.forEach((function(n,u){if("node"===n.itemType)return!1;var s=e[n.id];s&&r.forEach((function(r,c){if(u<=c)return!1;if("node"===r.itemType)return!1;var f=e[r.id];if(!f)return!1;var l=s.cx-f.cx||.005,h=s.cy-f.cy||.005,d=l*l+h*h,p=s.r||1,v=f.r||1,g=p+v,y=v*v,m=p*p;if(d<g*g){var b=n.children;if(!b||0===b.length)return!1;var _=r.children;if(!_||0===_.length)return!1;var w=Math.sqrt(d),x=(g-w)/w*i,E=l*x,S=h*x,A=y/(m+y),T=1-A;b.forEach((function(e){if("node"!==e.itemType)return!1;if(a[e.id]){var n=o[e.id];_.forEach((function(e){if("node"!==e.itemType)return!1;if(!a[e.id])return!1;var r=o[e.id];t[n].x+=E*A,t[n].y+=S*A,t[r].x-=E*T,t[r].y-=S*T}))}}))}}))})),!0}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,i=n.width*n.optimizeRangeFactor,o=n.nodeStrength,a=n.alpha,u=n.nodeCollideStrength,s=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,h=n.center;r.forEach((function(d,p){if(d.x&&d.y){if(h){var v=n.gravity,g=d.x-h[0]||.005,y=d.y-h[1]||.005,m=Math.sqrt(g*g+y*y);t[p].x-=g*v*a/m,t[p].y-=y*v*a/m}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var h=e[d.id+"-"+n.id],v=h.vl2,g=h.vl;if(!(g>i)){var y=e[d.id+"-"+n.id],m=y.vx,b=y.vy,_=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;_=_<1?1:_,n.comboId!==d.comboId&&(_+=1);var w=_?Math.pow(l,_):1,x=o(n)*a/v*w;if(t[p].x+=m*x,t[p].y+=b*x,p<r&&s){var E=c(d)+f(d)||1,S=c(n)+f(n)||1,A=E+S;if(v<A*A){var T=(A-g)/g*u,I=S*S,N=I/(E*E+I),k=m*T,C=b*T;t[p].x+=k*N,t[p].y+=C*N,N=1-N,t[r].x-=k*N,t[r].y-=C*N}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.edges,i=n.linkDistance,a=n.alpha,u=n.edgeStrength,s=n.bias,c=n.depthAttractiveForceScale;r.forEach((function(r,f){var l=h(r,"source"),d=h(r,"target");if(l&&d&&l!==d){var p=n.indexMap[l],v=n.indexMap[d],g=n.nodeMap[l],y=n.nodeMap[d];if(g&&y){var m=g.depth===y.depth?0:Math.log(Math.abs(g.depth-y.depth)/10);g.comboId===y.comboId&&(m/=2);var b=m?Math.pow(c,m):1;if(g.comboId!==y.comboId&&1===b?b=c/2:g.comboId===y.comboId&&(b=2),o(y.x)&&o(g.x)&&o(y.y)&&o(g.y)){var _=e[d+"-"+l],w=_.vl,x=_.vx,E=_.vy,S=(w-i(r))/w*a*u(r)*b,A=x*S,T=E*S,I=s[f];t[v].x-=A*I,t[v].y-=T*I,t[p].x+=A*(1-I),t[p].y+=T*(1-I)}}}}))},e.prototype.getType=function(){return"comboForce"},e}(t),e_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),n_=function(){return n_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n_.apply(this,arguments)},r_=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodes=[],n.edges=[],n.combos=[],n.comboEdges=[],n.comboPadding=10,n.comboTrees=[],n.updateCfg(e),n}return e_(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t,e=this,n=e.nodes,r=e.edges,i=e.combos,o=e.comboEdges,a=e.center,u=e.getInnerGraphs(),s={};n.forEach((function(t){s[t.id]=t}));var c={};i.forEach((function(t){c[t.id]=t}));var f=[],l=[],h={},d=!0;this.comboTrees.forEach((function(t){var e=u[t.id],n={id:t.id,x:e.x||c[t.id].x,y:e.y||c[t.id].y,fx:e.fx||c[t.id].fx,fy:e.fy||c[t.id].fy,mass:e.mass||c[t.id].mass,size:e.size};l.push(n),isNaN(n.x)||0===n.x||isNaN(n.y)||0===n.y?(n.x=100*Math.random(),n.y=100*Math.random()):d=!1,f.push(t.id),y(t,(function(e){return e.id!==t.id&&(h[e.id]=t.id),!0}))})),n.forEach((function(t){if(!t.comboId||!c[t.comboId]){var e={id:t.id,x:t.x,y:t.y,fx:t.fx,fy:t.fy,mass:t.mass,size:t.size};l.push(e),isNaN(e.x)||0===e.x||isNaN(e.y)||0===e.y?(e.x=100*Math.random(),e.y=100*Math.random()):d=!1,f.push(t.id)}}));var p=[];if(r.concat(o).forEach((function(t){var e=h[t.source]||t.source,n=h[t.target]||t.target;e!==n&&f.includes(e)&&f.includes(n)&&p.push({source:e,target:n})})),null==l?void 0:l.length){if(1===l.length)l[0].x=a[0],l[0].y=a[1];else{var v={nodes:l,edges:p},g=this.outerLayout||new D({gravity:1,factor:2,linkDistance:function(t,e,n){var r,i,o=(((null===(r=e.size)||void 0===r?void 0:r[0])||30)+((null===(i=n.size)||void 0===i?void 0:i[0])||30))/2;return Math.min(1.5*o,700)}}),m=null===(t=g.getType)||void 0===t?void 0:t.call(g);g.updateCfg({center:a,kg:5,preventOverlap:!0,animate:!1}),d&&kt[m]&&(l.length<100?new vf:new I).layout(v),g.layout(v)}l.forEach((function(t){var e=u[t.id];if(e)e.visited=!0,e.x=t.x,e.y=t.y,e.nodes.forEach((function(e){e.x+=t.x,e.y+=t.y}));else{var n=s[t.id];n&&(n.x=t.x,n.y=t.y)}}))}for(var b=Object.keys(u),_=function(t){var e=b[t],n=u[e];if(!n)return"continue";n.nodes.forEach((function(t){n.visited||(t.x+=n.x||0,t.y+=n.y||0),s[t.id]&&(s[t.id].x=t.x,s[t.id].y=t.y)})),c[e]&&(c[e].x=n.x,c[e].y=n.y)},w=b.length-1;w>=0;w--)_(w);return{nodes:n,edges:r,combos:i,comboEdges:o}},e.prototype.getInnerGraphs=function(){var t=this,e=t.comboTrees,n=t.nodeSize,r=t.edges,a=t.comboPadding,u=t.spacing,s={},c=this.innerLayout||new df({sortBy:"id"});return c.center=[0,0],c.preventOverlap=!0,c.nodeSpacing=u,(e||[]).forEach((function(t){y(t,(function(t){var e,u=(null==a?void 0:a(t))||10;if(i(u)&&(u=Math.max.apply(Math,u)),null===(e=t.children)||void 0===e?void 0:e.length){var f=t.children.map((function(t){return"combo"===t.itemType?s[t.id]:n_({},t)})),l=f.map((function(t){return t.id})),h={nodes:f,edges:r.filter((function(t){return l.includes(t.source)&&l.includes(t.target)}))},d=1/0;f.forEach((function(t){var e;t.size||(t.size=(null===(e=s[t.id])||void 0===e?void 0:e.size)||(null==n?void 0:n(t))||[30,30]),o(t.size)&&(t.size=[t.size,t.size]),d>t.size[0]&&(d=t.size[0]),d>t.size[1]&&(d=t.size[1])})),c.layout(h);var p=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;return t.forEach((function(t){e>t.x&&(e=t.x),n>t.y&&(n=t.y),r<t.x&&(r=t.x),i<t.y&&(i=t.y)})),{minX:e,minY:n,maxX:r,maxY:i}}(f),v=p.minX,g=p.minY,y=p.maxX,m=p.maxY,b=Math.max(y-v,m-g,d)+2*u;s[t.id]={id:t.id,nodes:f,size:[b,b]}}else if("combo"===t.itemType){var _=u?[2*u,2*u]:[30,30];s[t.id]={id:t.id,nodes:[],size:_}}return!0}))})),s},e.prototype.initVals=function(){var t,e,n=this,r=n.nodeSize,a=n.spacing;if(e=o(a)?function(){return a}:m(a)?a:function(){return 0},this.spacing=e,r)if(m(r))t=function(t){var n=r(t),o=e(t);return i(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+o)/2:((n||10)+o)/2};else if(i(r)){var u=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return u+e(t)/2}}else{var s=r/2;t=function(t){return s+e(t)/2}}else t=function(t){var n=e(t);return t.size?i(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+n)/2:f(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+n)/2:(t.size+n)/2:10+n/2};this.nodeSize=t;var c,l=n.comboPadding;c=o(l)?function(){return l}:i(l)?function(){return Math.max.apply(null,l)}:m(l)?l:function(){return 0},this.comboPadding=c},e.prototype.getType=function(){return"comboCombined"},e}(t),i_=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();const o_=i_;const a_=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();var u_=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t)))},t}();const s_=u_;var c_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f_=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return c_(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,a=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var u=[],s=e.length,c=0;c<s;c+=1){var l=e[c],h=10,d=10;o(l.size)&&(h=l.size,d=l.size),i(l.size)?(isNaN(l.size[0])||(h=l.size[0]),isNaN(l.size[1])||(d=l.size[1])):f(l.size)&&(h=l.size.width,d=l.size.height),t.getWidth&&!isNaN(t.getWidth(l))&&(d=t.getWidth(l)),t.getHeight&&!isNaN(t.getHeight(l))&&(h=t.getHeight(l));var p=Math.max(h,d);u.push(p)}void 0===t.barnesHut&&s>250&&(t.barnesHut=!0),void 0===t.prune&&s>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(a=100,s<=200&&s>100?a=500:s>200&&(a=950),this.maxIteration=a):(a=250,s<=200&&s>100?a=1e3:s>200&&(a=1200),this.maxIteration=a),t.kr||(t.kr=50,s>100&&s<=500?t.kr=20:s>500&&(t.kr=1)),t.kg||(t.kg=20,s>100&&s<=500?t.kg=10:s>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(u),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,i=e.nodes,o=n.filter((function(t){return h(t,"source")!==h(t,"target")})),a=i.length,u=o.length,s=[],c={},f={},l=[],d=0;d<a;d+=1)c[i[d].id]=d,s[d]=0,(void 0===i[d].x||isNaN(i[d].x))&&(i[d].x=1e3*Math.random()),(void 0===i[d].y||isNaN(i[d].y))&&(i[d].y=1e3*Math.random()),l.push({x:i[d].x,y:i[d].y});for(d=0;d<u;d+=1){for(var p=void 0,v=void 0,g=0,y=0,m=0;m<a;m+=1){var b=h(o[d],"source"),_=h(o[d],"target");i[m].id===b?(p=i[m],g=m):i[m].id===_&&(v=i[m],y=m),f[d]={sourceIdx:g,targetIdx:y}}p&&(s[c[p.id]]+=1),v&&(s[c[v.id]]+=1)}var w=r;if(i=this.iterate(w,c,f,u,s,t),e.prune){for(m=0;m<u;m+=1)s[f[m].sourceIdx]<=1?(i[f[m].sourceIdx].x=i[f[m].targetIdx].x,i[f[m].sourceIdx].y=i[f[m].targetIdx].y):s[f[m].targetIdx]<=1&&(i[f[m].targetIdx].x=i[f[m].sourceIdx].x,i[f[m].targetIdx].y=i[f[m].sourceIdx].y);e.prune=!1,e.barnesHut=!1,w=100,i=this.iterate(w,c,f,u,s,t)}return i},e.prototype.iterate=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.kr,c=a.preventOverlap,f=a.barnesHut,l=u.length,h=0,d=t,p=[],v=[],g=[],y=0;y<l;y+=1)if(p[2*y]=0,p[2*y+1]=0,f){var m={id:y,rx:u[y].x,ry:u[y].y,mass:1,g:s,degree:i[y]};g[y]=new o_(m)}for(;d>0;){for(y=0;y<l;y+=1)v[2*y]=p[2*y],v[2*y+1]=p[2*y+1],p[2*y]=0,p[2*y+1]=0;p=this.getAttrForces(d,50,r,e,n,i,o,p),p=f&&(c&&d>50||!c)?this.getOptRepGraForces(p,g,i):this.getRepGraForces(d,50,p,100,o,i);var b=this.updatePos(p,v,h,i);u=b.nodes,h=b.sg,d--,a.tick&&a.tick()}return u},e.prototype.getAttrForces=function(t,e,n,r,i,o,a,u){for(var s=this,c=s.nodes,f=s.preventOverlap,l=s.dissuadeHubs,h=s.mode,d=s.prune,p=0;p<n;p+=1){var v=c[i[p].sourceIdx],g=i[p].sourceIdx,y=c[i[p].targetIdx],m=i[p].targetIdx;if(!d||!(o[g]<=1||o[m]<=1)){var b=[y.x-v.x,y.y-v.y],_=Math.hypot(b[0],b[1]);_=_<1e-4?1e-4:_,b[0]=b[0]/_,b[1]=b[1]/_,f&&t<e&&(_=_-a[g]-a[m]);var w=_,x=w;"linlog"===h&&(x=w=Math.log(1+_)),l&&(w=_/o[g],x=_/o[m]),f&&t<e&&_<=0?(w=0,x=0):f&&t<e&&_>0&&(w=_,x=_),u[2*r[v.id]]+=w*b[0],u[2*r[y.id]]-=x*b[0],u[2*r[v.id]+1]+=w*b[1],u[2*r[y.id]+1]-=x*b[1]}}return u},e.prototype.getRepGraForces=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.preventOverlap,c=a.kr,f=a.kg,l=a.center,h=a.prune,d=u.length,p=0;p<d;p+=1){for(var v=p+1;v<d;v+=1)if(!h||!(o[p]<=1||o[v]<=1)){var g=[u[v].x-u[p].x,u[v].y-u[p].y],y=Math.hypot(g[0],g[1]);y=y<1e-4?1e-4:y,g[0]=g[0]/y,g[1]=g[1]/y,s&&t<e&&(y=y-i[p]-i[v]);var m=c*(o[p]+1)*(o[v]+1)/y;s&&t<e&&y<0?m=r*(o[p]+1)*(o[v]+1):s&&t<e&&0===y?m=0:s&&t<e&&y>0&&(m=c*(o[p]+1)*(o[v]+1)/y),n[2*p]-=m*g[0],n[2*v]+=m*g[0],n[2*p+1]-=m*g[1],n[2*v+1]+=m*g[1]}var b=[u[p].x-l[0],u[p].y-l[1]],_=Math.hypot(b[0],b[1]);b[0]=b[0]/_,b[1]=b[1]/_;var w=f*(o[p]+1);n[2*p]-=w*b[0],n[2*p+1]-=w*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,i=r.nodes,o=r.kg,a=r.center,u=r.prune,s=i.length,c=9e10,f=-9e10,l=9e10,h=-9e10,d=0;d<s;d+=1)u&&n[d]<=1||(e[d].setPos(i[d].x,i[d].y),i[d].x>=f&&(f=i[d].x),i[d].x<=c&&(c=i[d].x),i[d].y>=h&&(h=i[d].y),i[d].y<=l&&(l=i[d].y));var p=Math.max(f-c,h-l),v=new a_({xmid:(f+c)/2,ymid:(h+l)/2,length:p,massCenter:a,mass:s}),g=new s_(v);for(d=0;d<s;d+=1)u&&n[d]<=1||e[d].in(v)&&g.insert(e[d]);for(d=0;d<s;d+=1)if(!(u&&n[d]<=1)){e[d].resetForce(),g.updateForce(e[d]),t[2*d]-=e[d].fx,t[2*d+1]-=e[d].fy;var y=[i[d].x-a[0],i[d].y-a[1]],m=Math.hypot(y[0],y[1]);m=m<1e-4?1e-4:m,y[0]=y[0]/m,y[1]=y[1]/m;var b=o*(n[d]+1);t[2*d]-=b*y[0],t[2*d+1]-=b*y[1]}return t},e.prototype.updatePos=function(t,e,n,r){for(var i=this,o=i.nodes,a=i.ks,u=i.tao,s=i.prune,c=i.ksmax,f=o.length,l=[],h=[],d=0,p=0,v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var g=[t[2*v]-e[2*v],t[2*v+1]-e[2*v+1]],y=Math.hypot(g[0],g[1]),m=[t[2*v]+e[2*v],t[2*v+1]+e[2*v+1]],b=Math.hypot(m[0],m[1]);l[v]=y,h[v]=b/2,d+=(r[v]+1)*l[v],p+=(r[v]+1)*h[v]}var _=n;for(n=u*p/d,0!==_&&(n=n>1.5*_?1.5*_:n),v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var w=a*n/(1+n*Math.sqrt(l[v])),x=Math.hypot(t[2*v],t[2*v+1]),E=c/(x=x<1e-4?1e-4:x),S=(w=w>E?E:w)*t[2*v],A=w*t[2*v+1];o[v].x+=S,o[v].y+=A}return{nodes:o,sg:n}},e}(t),l_=function(){return l_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},l_.apply(this,arguments)},h_=function(){function t(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return t.prototype.init=function(e,n,r){this.cells=[],this.CELL_W=r.CELL_W||t.DEFAULT_CELL_W,this.CELL_H=r.CELL_H||t.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(n/this.CELL_H),t.MIN_DIST=Math.pow(e,2)+Math.pow(n,2);for(var i=0;i<this.columnNum;i++){for(var o=[],a=0;a<this.rowNum;a++){var u={dx:i,dy:a,x:i*this.CELL_W,y:a*this.CELL_H,occupied:!1};o.push(u)}this.cells.push(o)}},t.prototype.findGridByNodeId=function(t){for(var e,n,r=0;r<this.columnNum;r++)for(var i=0;i<this.rowNum;i++)if(this.cells[r][i].node&&(null===(n=null===(e=this.cells[r][i])||void 0===e?void 0:e.node)||void 0===n?void 0:n.id)===t)return{column:r,row:i};return null},t.prototype.sqdist=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},t.prototype.occupyNearest=function(e){for(var n,r=t.MIN_DIST,i=null,o=0;o<this.columnNum;o++)for(var a=0;a<this.rowNum;a++)!this.cells[o][a].occupied&&(n=this.sqdist(e,this.cells[o][a]))<r&&(r=n,i=this.cells[o][a]);return i&&(i.occupied=!0),i},t.prototype.insertColumn=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++){this.cells[n+this.columnNum]=[];for(var r=0;r<this.rowNum;r++)this.cells[n+this.columnNum][r]={dx:n,dy:r,x:n*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null}}for(n=this.columnNum-1;n>t;n--)for(r=0;r<this.rowNum;r++)this.cells[n+e][r]=l_(l_({},this.cells[n][r]),{x:(n+e)*this.CELL_W,y:r*this.CELL_H}),this.cells[n][r]={x:n*this.CELL_W,y:r*this.CELL_H,occupied:!0,node:null};for(r=0;r<this.additionColumn.length;r++)this.additionColumn[r]>=t&&(this.additionColumn[r]+=e);for(n=0;n<e;n++)this.additionColumn.push(t+n+1);this.columnNum+=e}},t.prototype.insertRow=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++)for(var r=0;r<this.columnNum;r++)this.cells[r][n+this.rowNum]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(r=0;r<this.columnNum;r++)for(n=this.rowNum-1;n>t;n--)this.cells[r][n+e]=l_(l_({},this.cells[r][n]),{dx:r,dy:n+e,x:r*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[r][n]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n<this.additionRow.length;n++)this.additionRow[n]>=t&&(this.additionRow[n]+=e);for(r=0;r<e;r++)this.additionRow.push(t+r+1);this.rowNum+=e}},t.prototype.getNodes=function(){for(var t=[],e=0;e<this.columnNum;e++)for(var n=0;n<this.rowNum;n++)this.cells[e][n].node&&t.push(this.cells[e][n]);return t},t.MIN_DIST=50,t.DEFAULT_CELL_W=80,t.DEFAULT_CELL_H=80,t}();const d_=h_;var p_=1e7,v_=1.5707963267948966,g_=new Map,y_=.8;function m_(t,e){var n=(g_.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],i=e.size[0]*e.size[1],o=r>i?e:t,a=r>i?t:e,u=o.x-o.size[0]/2,s=o.y-o.size[1]/2,c=o.x+o.size[0]/2,f=o.y+o.size[1]/2,l=a.x-a.size[0]/2,h=a.y-a.size[1]/2,d=a.x+a.size[0]/2,p=a.y+a.size[1]/2,v=o.x,g=o.y,y=a.x,m=a.y,b=0,_=0;if(c>=l&&d>=u&&f>=h&&p>=s)0===(_=Math.sqrt(Math.pow(y-v,2)+Math.pow(m-g,2)))&&(_=1e-7),b=10/_*100+((c<d?c:d)-(u>l?u:l))*((f<p?f:p)-(s>h?s:h)),b*=p_;else{var w=!1,x=function(t,e,n){var r=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,u=e.x-e.size[0]/2,s=e.y-e.size[1]/2,c=e.x+e.size[0]/2,f=e.y+e.size[1]/2,l=t.x,h=t.y,d=e.x,p=e.y,v=d-l,g=Math.atan2(v,p-h),y=0,m=0,b=0,_=0;g>v_?(m=i-f,y=u-o,b=parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)),_=parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2))):b=_=0<g&&g<=v_?(m=s-a)>(y=u-o)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):g<-v_?(m=i-f)>(y=-(c-r))?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):(m=s-a)>(y=Math.abs(v)>(o-r)/2?r-c:v)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y&&0!==g?(y/Math.sin(g)).toFixed(2):m.toFixed(2));var w=parseFloat(g.toFixed(2)),x=n;return n&&(x=1.1780972450961724<w&&w<1.9634954084936207),{distance:Math.abs(b<_?b:_),isHoriz:x}}(o,a,w);_=x.distance,w=x.isHoriz,_<=10?b+=0!==_?n?10+1e7/_:10+1e8/_:p_:(b+=_,n&&(b+=_*_))}return b}function b_(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];(r.x<0||r.y<0||r.x>1200||r.y>800)&&(e+=1e12);for(var i=n+1;i<t.length;i++)e+=m_(r,t[i])}return e}function __(t,e,n,r){var i=new Map;n.forEach((function(t,e){i.set(t.id,t)}));var o=r.filter((function(e){return e.source===t.id||e.target===t.id}))||[],a=[];o.forEach((function(e){var n=e.source===t.id?e.target:e.source,r=i.get(n);r&&a.push(r)}));for(var u=!0,s=0;s<a.length;s++){var c=a[s],f=180*Math.atan((t.y-c.y)/(c.x-t.y)),l=180*Math.atan((e.y-c.y)/(c.x-e.y)),h=f>70&&f<110,d=l>70&&l<110;if((f<30||f>150)&&!(l<30||l>150)||f*l<0){u=!1;break}if(h&&!d||f*l<0){u=!1;break}if((c.x-t.x)*(c.x-e.x)<0){u=!1;break}if((c.y-t.y)*(c.y-e.y)<0){u=!1;break}}return u}function w_(t,e){for(var n=!1,r=[10,-10,0,0],i=[0,0,10,-10],o=0;o<t.length;++o)for(var a=t[o],u=x_(a,t),s=0;s<r.length;s++)if(__(a,{x:a.x+r[s],y:a.y+i[s]},t,e)){a.x+=r[s],a.y+=i[s];var c=x_(a,t),f=Math.random();c<u||f<y_&&f>.1?(u=c,n=!0):(a.x-=r[s],a.y-=i[s])}return y_>.1&&(y_*=.5),n?b_(t):0}function x_(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>1200||t.y+t.size[1]+20>800)&&(n+=1e12);for(var r=0;r<e.length;++r)t.id!==e[r].id&&(n+=m_(t,e[r]));return n}var E_=function(){return E_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},E_.apply(this,arguments)};function S_(t,e){var n=t.nodes,r=t.edges,i=e.width,o=e.height;if(!(null==n?void 0:n.length))return Promise.resolve();var a=[];n.forEach((function(t){if(r.filter((function(e){return e.source===t.id||e.target===t.id})).length>1){var e=E_({},t);delete e.size,a.push(e)}}));var u=[];r.forEach((function(t){var e=a.find((function(e){return e.id===t.source})),n=a.find((function(e){return e.id===t.target}));e&&n&&u.push(t)}));var s=new Gn({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:a,edges:u}).nodes;n.forEach((function(t){var e=(s||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||i/2,t.y=(null==e?void 0:e.y)||o/2}));var c=JSON.parse(JSON.stringify(n)),f=JSON.parse(JSON.stringify(r)),l=yt().nodes(c).force("link",xt(f).id((function(t){return t.id})).distance((function(t){return u.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",mt()).force("center",bt(i/2,o/2)).force("x",Tt(i/2)).force("y",It(o/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),h=new Promise((function(t){l.on("end",(function(){n.forEach((function(t){var e=c.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var a=Math.min.apply(Math,n.map((function(t){return t.x}))),u=Math.max.apply(Math,n.map((function(t){return t.x}))),s=Math.min.apply(Math,n.map((function(t){return t.y}))),f=Math.max.apply(Math,n.map((function(t){return t.y}))),l=i/(u-a),h=o/(f-s);n.forEach((function(t){void 0!==t.x&&l<1&&(t.x=(t.x-a)*l),void 0!==t.y&&h<1&&(t.y=(t.y-s)*h)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),function(t,e){if(0===t.length)return{nodes:t,edges:e};t.forEach((function(t){var n=e.filter((function(e){return e.source===t.id||e.target===t.id}));g_.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=g_.get(t.id))||void 0===n?void 0:n.length)-(null===(r=g_.get(e.id))||void 0===r?void 0:r.length)}));for(var n=b_(t),r=20,i=1,o=0,a=0;r>0&&!(++a>=50);){var u=w_(t,e);0!==u&&(o=u),i=o-n,n=o,0===i?--r:r=20}t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}))}(n,r),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,i=e.nodeMinGap,o=1e4,a=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;o=Math.min(e,o),a=Math.min(n,a)}));var u=new d_;u.init(n,r,{CELL_H:a,CELL_W:o}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var s=0;s<t.nodes.length;s++){var c=t.nodes[s],f=u.findGridByNodeId(c.id);if(!f)throw new Error("can not find node cell");var l=f.column,h=f.row;if(c.size[0]+i>o){for(var d=v=Math.ceil((c.size[0]+i)/o)-1,p=0;p<v&&u.additionColumn.indexOf(l+p+1)>-1&&!u.cells[l+p+1][h].node;p++)d--;u.insertColumn(l,d)}if(c.size[1]+i>a){var v;for(d=v=Math.ceil((c.size[1]+i)/a)-1,p=0;p<v&&u.additionRow.indexOf(h+p+1)>-1&&!u.cells[l][h+p+1].node;p++)d--;u.insertRow(h,d)}}for(s=0;s<u.columnNum;s++){var g=function(e){var n=u.cells[s][e];if(n.node){var r=t.nodes.find((function(t){var e;return t.id===(null===(e=null==n?void 0:n.node)||void 0===e?void 0:e.id)}));r&&(r.x=n.x+r.size[0]/2,r.y=n.y+r.size[1]/2)}};for(p=0;p<u.rowNum;p++)g(p)}}({nodes:n,edges:r},e),t()}))}));return h}var A_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T_=function(t){function e(e){var n=t.call(this)||this;return n.width=300,n.height=300,n.nodeMinGap=50,n.onLayoutEnd=function(){},e&&n.updateCfg(e),n}return A_(e,t),e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;return null==e||e.forEach((function(t){t.size||(t.size=[50,50])})),S_({nodes:e,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then((function(){t.onLayoutEnd&&t.onLayoutEnd()}))},e.prototype.getType=function(){return"er"},e}(t),I_=function(){function t(t){var e=A(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.layoutInstance.init(t)},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}(),N_={force:Ot,fruchterman:yf,forceAtlas2:f_,gForce:D,dagre:Gn,dagreCompound:Dc,circular:Pt,radial:lf,concentric:df,grid:I,mds:vf,comboForce:t_,comboCombined:r_,random:k,"gForce-gpu":Jb,"fruchterman-gpu":Yb,er:T_}})(),r})()}));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.layout=e():t.layout=e()}(self,(function(){return(()=>{var t={7294:()=>{},9586:()=>{},2697:()=>{},1894:()=>{},1186:()=>{},5275:()=>{},2862:()=>{},9633:()=>{},7222:()=>{},5965:()=>{},2391:()=>{},3945:()=>{},9216:(t,e,n)=>{"use strict";n(9504),n(3982),n(721),n(5778),n(3898),n(7536),n(5834),n(6945),n(547),n(5967),n(3515),n(3042),n(4962),n(405)},2087:(t,e,n)=>{t.exports=n(405)},8344:(t,e)=>{"use strict";var n,r,i,o,a,u,s,c,f,l,d,h,p,v,g,y,m,b,_,x,w,E,S,A,T;(e.UX||(e.UX={})).TextureCompressionBC="texture-compression-bc",(T=e.OB||(e.OB={})).ClampToEdge="clamp-to-edge",T.Repeat="repeat",T.MirrorRepeat="mirror-repeat",(A=e.$l||(e.$l={})).UniformBuffer="uniform-buffer",A.StorageBuffer="storage-buffer",A.ReadonlyStorageBuffer="readonly-storage-buffer",A.Sampler="sampler",A.ComparisonSampler="comparison-sampler",A.SampledTexture="sampled-texture",A.ReadonlyStorageTexture="readonly-storage-texture",A.WriteonlyStorageTexture="writeonly-storage-texture",(S=e.zi||(e.zi={})).Zero="zero",S.One="one",S.SrcColor="src-color",S.OneMinusSrcColor="one-minus-src-color",S.SrcAlpha="src-alpha",S.OneMinusSrcAlpha="one-minus-src-alpha",S.DstColor="dst-color",S.OneMinusDstColor="one-minus-dst-color",S.DstAlpha="dst-alpha",S.OneMinusDstAlpha="one-minus-dst-alpha",S.SrcAlphaSaturated="src-alpha-saturated",S.BlendColor="blend-color",S.OneMinusBlendColor="one-minus-blend-color",(E=e.db||(e.db={})).Add="add",E.Subtract="subtract",E.ReverseSubtract="reverse-subtract",E.Min="min",E.Max="max",(w=e.wb||(e.wb={})).Never="never",w.Less="less",w.Equal="equal",w.LessEqual="less-equal",w.Greater="greater",w.NotEqual="not-equal",w.GreaterEqual="greater-equal",w.Always="always",(x=e.Wf||(e.Wf={})).None="none",x.Front="front",x.Back="back",(_=e.X9||(e.X9={})).Nearest="nearest",_.Linear="linear",(b=e.zX||(e.zX={})).CCW="ccw",b.CW="cw",(m=e.iD||(e.iD={})).Uint16="uint16",m.Uint32="uint32",(y=e.V||(e.V={})).Vertex="vertex",y.Instance="instance",(e.Ws||(e.Ws={})).Load="load",(g=e.YV||(e.YV={})).PointList="point-list",g.LineList="line-list",g.LineStrip="line-strip",g.TriangleList="triangle-list",g.TriangleStrip="triangle-strip",(v=e.xS||(e.xS={})).Keep="keep",v.Zero="zero",v.Replace="replace",v.Invert="invert",v.IncrementClamp="increment-clamp",v.DecrementClamp="decrement-clamp",v.IncrementWrap="increment-wrap",v.DecrementWrap="decrement-wrap",(p=e.EG||(e.EG={})).Store="store",p.Clear="clear",(h=e.kd||(e.kd={})).E1d="1d",h.E2d="2d",h.E3d="3d",(d=e.EV||(e.EV={})).R8Unorm="r8unorm",d.R8Snorm="r8snorm",d.R8Uint="r8uint",d.R8Sint="r8sint",d.R16Uint="r16uint",d.R16Sint="r16sint",d.R16Float="r16float",d.RG8Unorm="rg8unorm",d.RG8Snorm="rg8snorm",d.RG8Uint="rg8uint",d.RG8Sint="rg8sint",d.R32Uint="r32uint",d.R32Sint="r32sint",d.R32Float="r32float",d.RG16Uint="rg16uint",d.RG16Sint="rg16sint",d.RG16Float="rg16float",d.RGBA8Unorm="rgba8unorm",d.RGBA8UnormSRGB="rgba8unorm-srgb",d.RGBA8Snorm="rgba8snorm",d.RGBA8Uint="rgba8uint",d.RGBA8Sint="rgba8sint",d.BGRA8Unorm="bgra8unorm",d.BGRA8UnormSRGB="bgra8unorm-srgb",d.RGB10A2Unorm="rgb10a2unorm",d.RG11B10Float="rg11b10float",d.RG32Uint="rg32uint",d.RG32Sint="rg32sint",d.RG32Float="rg32float",d.RGBA16Uint="rgba16uint",d.RGBA16Sint="rgba16sint",d.RGBA16Float="rgba16float",d.RGBA32Uint="rgba32uint",d.RGBA32Sint="rgba32sint",d.RGBA32Float="rgba32float",d.Depth32Float="depth32float",d.Depth24Plus="depth24plus",d.Depth24PlusStencil8="depth24plus-stencil8",(l=e.Ek||(e.Ek={})).Float="float",l.Sint="sint",l.Uint="uint",(f=e.p_||(e.p_={})).E1d="1d",f.E2d="2d",f.E2dArray="2d-array",f.Cube="cube",f.CubeArray="cube-array",f.E3d="3d",(c=e.gB||(e.gB={})).Uchar2="uchar2",c.Uchar4="uchar4",c.Char2="char2",c.Char4="char4",c.Uchar2Norm="uchar2norm",c.Uchar4Norm="uchar4norm",c.Char2Norm="char2norm",c.Char4Norm="char4norm",c.Ushort2="ushort2",c.Ushort4="ushort4",c.Short2="short2",c.Short4="short4",c.Ushort2Norm="ushort2norm",c.Ushort4Norm="ushort4norm",c.Short2Norm="short2norm",c.Short4Norm="short4norm",c.Half2="half2",c.Half4="half4",c.Float="float",c.Float2="float2",c.Float3="float3",c.Float4="float4",c.Uint="uint",c.Uint2="uint2",c.Uint3="uint3",c.Uint4="uint4",c.Int="int",c.Int2="int2",c.Int3="int3",c.Int4="int4",(s=e.H7||(e.H7={})).All="all",s.StencilOnly="stencil-only",s.DepthOnly="depth-only",(u=e.mj||(e.mj={})).Error="error",u.Warning="warning",u.Info="info",(e.xL||(e.xL={})).Occlusion="occlusion",(a=e.FB||(e.FB={}))[a.MapRead=1]="MapRead",a[a.MapWrite=2]="MapWrite",a[a.CopySrc=4]="CopySrc",a[a.CopyDst=8]="CopyDst",a[a.Index=16]="Index",a[a.Vertex=32]="Vertex",a[a.Uniform=64]="Uniform",a[a.Storage=128]="Storage",a[a.Indirect=256]="Indirect",a[a.QueryResolve=512]="QueryResolve",(o=e.Yw||(e.Yw={}))[o.Red=1]="Red",o[o.Green=2]="Green",o[o.Blue=4]="Blue",o[o.Alpha=8]="Alpha",o[o.All=15]="All",(i=e.$X||(e.$X={}))[i.Vertex=1]="Vertex",i[i.Fragment=2]="Fragment",i[i.Compute=4]="Compute",(r=e.v2||(e.v2={}))[r.CopySrc=1]="CopySrc",r[r.CopyDst=2]="CopyDst",r[r.Sampled=4]="Sampled",r[r.Storage=8]="Storage",r[r.OutputAttachment=16]="OutputAttachment",(n=e.gc||(e.gc={}))[n.Read=1]="Read",n[n.Write=2]="Write"},9504:(t,e,n)=>{n(2825),n(6051),n(2640),n(9518),n(8201),n(470),n(5723),n(7525),n(9788),n(1498),n(7577),n(6129),n(2802),n(7940),n(5261),n(9340),n(1584),n(7298),n(1765),n(5747),n(7451),n(2784),n(2809),n(7454),n(3053),n(8032),n(7551),n(2929),n(215),n(6183),n(8190),n(476),n(948),n(942),n(2870),n(2212),n(4230),n(9754),n(2811),n(3998),n(1769),n(8789),n(2848),n(1762),n(1323),n(6063),n(3282),n(6816),n(1854),n(3303),n(4421),n(2203),n(1028),n(6818),n(5557),n(7938),n(8316),n(7937),n(637),n(8219),n(9029),n(3157),n(9791),n(2296),n(4555),n(6505),n(4722),n(9713),n(7392),n(4687),n(3684),n(3339),n(4148),n(7754),n(4094),n(8781),n(5013),n(3735),n(8723),n(2247),n(9689),n(9003),n(9026),n(4088),n(535),n(5788),n(7878),n(5119),n(3135),n(5015),n(8059),n(646),n(5377),n(9879),n(5305),n(6341),n(5915),n(4488),n(9281),n(163),n(6668),n(7139),n(6408),n(8686),n(5480),n(9121),n(914),n(7742),n(7843),n(6441),n(429),n(2214),n(498),n(6349),n(3742),n(9604),n(2592),n(9290),n(9363),n(3871),n(8632),n(1838),n(3421),n(6144),n(8275),n(2552),n(3077),n(1031),n(8916),n(8978),n(8531),n(7323),n(3704),n(3153),n(8812),n(2636),n(1602),n(377),t.exports=n(2845)},721:(t,e,n)=>{n(7744),t.exports=n(2845).Array.flatMap},3982:(t,e,n)=>{n(5448),t.exports=n(2845).Array.includes},3515:(t,e,n)=>{n(8938),t.exports=n(2845).Object.entries},547:(t,e,n)=>{n(7819),t.exports=n(2845).Object.getOwnPropertyDescriptors},5967:(t,e,n)=>{n(6572),t.exports=n(2845).Object.values},3042:(t,e,n)=>{"use strict";n(7843),n(8228),t.exports=n(2845).Promise.finally},3898:(t,e,n)=>{n(3336),t.exports=n(2845).String.padEnd},5778:(t,e,n)=>{n(3718),t.exports=n(2845).String.padStart},5834:(t,e,n)=>{n(6642),t.exports=n(2845).String.trimRight},7536:(t,e,n)=>{n(7831),t.exports=n(2845).String.trimLeft},6945:(t,e,n)=>{n(9956),t.exports=n(7686).f("asyncIterator")},2680:(t,e,n)=>{n(8358),t.exports=n(3142).global},3749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8891:(t,e,n)=>{var r=n(2799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},3142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},5526:(t,e,n)=>{var r=n(3749);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},7498:(t,e,n)=>{t.exports=!n(9880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2004:(t,e,n)=>{var r=n(2799),i=n(5505).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},2069:(t,e,n)=>{var r=n(5505),i=n(3142),o=n(5526),a=n(5954),u=n(9761),s=function(t,e,n){var c,f,l,d=t&s.F,h=t&s.G,p=t&s.S,v=t&s.P,g=t&s.B,y=t&s.W,m=h?i:i[e]||(i[e]={}),b=m.prototype,_=h?r:p?r[e]:(r[e]||{}).prototype;for(c in h&&(n=e),n)(f=!d&&_&&void 0!==_[c])&&u(m,c)||(l=f?_[c]:n[c],m[c]=h&&"function"!=typeof _[c]?n[c]:g&&f?o(l,r):y&&_[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&s.R&&b&&!b[c]&&a(b,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},9880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},5505:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},9761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},5954:(t,e,n)=>{var r=n(5584),i=n(5734);t.exports=n(7498)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},4053:(t,e,n)=>{t.exports=!n(7498)&&!n(9880)((function(){return 7!=Object.defineProperty(n(2004)("div"),"a",{get:function(){return 7}}).a}))},2799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5584:(t,e,n)=>{var r=n(8891),i=n(4053),o=n(923),a=Object.defineProperty;e.f=n(7498)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},5734:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},923:(t,e,n)=>{var r=n(2799);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},8358:(t,e,n)=>{var r=n(2069);r(r.G,{global:n(5505)})},1464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8347:(t,e,n)=>{var r=n(1669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},4691:(t,e,n)=>{var r=n(341)("unscopables"),i=Array.prototype;null==i[r]&&n(913)(i,r,{}),t.exports=function(t){i[r][t]=!0}},178:(t,e,n)=>{"use strict";var r=n(8016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},6903:t=>{t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},486:(t,e,n)=>{var r=n(1255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1064:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=[].copyWithin||function(t,e){var n=r(this),a=o(n.length),u=i(t,a),s=i(e,a),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?a:i(c,a))-s,a-u),l=1;for(s<u&&u<s+f&&(l=-1,s+=f-1,u+=f-1);f-- >0;)s in n?n[u]=n[s]:delete n[u],u+=l,s+=l;return n}},8676:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=function(t){for(var e=r(this),n=o(e.length),a=arguments.length,u=i(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,c=void 0===s?n:i(s,n);c>u;)e[u++]=t;return e}},4538:(t,e,n)=>{var r=n(8182),i=n(8087),o=n(9260);t.exports=function(t){return function(e,n,a){var u,s=r(e),c=i(s.length),f=o(a,c);if(t&&n!=n){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},7622:(t,e,n)=>{var r=n(994),i=n(8579),o=n(7583),a=n(8087),u=n(6699);t.exports=function(t,e){var n=1==t,s=2==t,c=3==t,f=4==t,l=6==t,d=5==t||l,h=e||u;return function(e,u,p){for(var v,g,y=o(e),m=i(y),b=r(u,p,3),_=a(m.length),x=0,w=n?h(e,_):s?h(e,0):void 0;_>x;x++)if((d||x in m)&&(g=b(v=m[x],x,y),t))if(n)w[x]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return x;case 2:w.push(v)}else if(f)return!1;return l?-1:c||f?f:w}}},5336:(t,e,n)=>{var r=n(1464),i=n(7583),o=n(8579),a=n(8087);t.exports=function(t,e,n,u,s){r(e);var c=i(t),f=o(c),l=a(c.length),d=s?l-1:0,h=s?-1:1;if(n<2)for(;;){if(d in f){u=f[d],d+=h;break}if(d+=h,s?d<0:l<=d)throw TypeError("Reduce of empty array with no initial value")}for(;s?d>=0:l>d;d+=h)d in f&&(u=e(u,f[d],d,c));return u}},7600:(t,e,n)=>{var r=n(1255),i=n(7183),o=n(341)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},6699:(t,e,n)=>{var r=n(7600);t.exports=function(t,e){return new(r(t))(e)}},8366:(t,e,n)=>{"use strict";var r=n(1464),i=n(1255),o=n(8262),a=[].slice,u={},s=function(t,e,n){if(!(e in u)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";u[e]=Function("F,a","return new F("+r.join(",")+")")}return u[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?s(e,r.length,r):o(e,r,t)};return i(e.prototype)&&(u.prototype=e.prototype),u}},4939:(t,e,n)=>{var r=n(1669),i=n(341)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},1669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},3050:(t,e,n)=>{"use strict";var r=n(3886).f,i=n(9055),o=n(8565),a=n(994),u=n(6903),s=n(9822),c=n(966),f=n(8782),l=n(4412),d=n(1216),h=n(4278).fastKey,p=n(4664),v=d?"_s":"size",g=function(t,e){var n,r=h(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var f=t((function(t,r){u(t,f,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&s(r,n,t[c],t)}));return o(f.prototype,{clear:function(){for(var t=p(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=p(this,e),r=g(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(t){p(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(p(this,e),t)}}),d&&r(f.prototype,"size",{get:function(){return p(this,e)[v]}}),f},def:function(t,e,n){var r,i,o=g(t,e);return o?o.v=n:(t._l=o={i:i=h(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[v]++,"F"!==i&&(t._i[i]=o)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=p(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?f(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,f(1))}),n?"entries":"values",!n,!0),l(e)}}},1990:(t,e,n)=>{"use strict";var r=n(8565),i=n(4278).getWeak,o=n(486),a=n(1255),u=n(6903),s=n(9822),c=n(7622),f=n(7384),l=n(4664),d=c(5),h=c(6),p=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},y=function(t,e){return d(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=h(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var c=t((function(t,r){u(t,c,e,"_i"),t._t=e,t._i=p++,t._l=void 0,null!=r&&s(r,n,t[o],t)}));return r(c.prototype,{delete:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).has(t):n&&f(n,this._i)}}),c},def:function(t,e,n){var r=i(o(e),!0);return!0===r?v(t).set(e,n):r[t._i]=n,t},ufstore:v}},859:(t,e,n)=>{"use strict";var r=n(7571),i=n(7044),o=n(6476),a=n(8565),u=n(4278),s=n(9822),c=n(6903),f=n(1255),l=n(5338),d=n(2803),h=n(5837),p=n(116);t.exports=function(t,e,n,v,g,y){var m=r[t],b=m,_=g?"set":"add",x=b&&b.prototype,w={},E=function(t){var e=x[t];o(x,t,"delete"==t||"has"==t?function(t){return!(y&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(y||x.forEach&&!l((function(){(new b).entries().next()})))){var S=new b,A=S[_](y?{}:-0,1)!=S,T=l((function(){S.has(1)})),I=d((function(t){new b(t)})),N=!y&&l((function(){for(var t=new b,e=5;e--;)t[_](e,e);return!t.has(-0)}));I||((b=e((function(e,n){c(e,b,t);var r=p(new m,e,b);return null!=n&&s(n,g,r[_],r),r}))).prototype=x,x.constructor=b),(T||N)&&(E("delete"),E("has"),g&&E("get")),(N||A)&&E(_),y&&x.clear&&delete x.clear}else b=v.getConstructor(e,t,g,_),a(b.prototype,n),u.NEED=!0;return h(b,t),w[t]=b,i(i.G+i.W+i.F*(b!=m),w),y||v.setStrong(b,t,g),b}},2845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},1395:(t,e,n)=>{"use strict";var r=n(3886),i=n(8328);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},994:(t,e,n)=>{var r=n(1464);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},4506:(t,e,n)=>{"use strict";var r=n(5338),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},9514:(t,e,n)=>{"use strict";var r=n(486),i=n(4467),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),t!=o)}},5091:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},1216:(t,e,n)=>{t.exports=!n(5338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(1255),i=n(7571).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},9824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},6397:(t,e,n)=>{var r=n(9804),i=n(3844),o=n(4179);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,u=n(t),s=o.f,c=0;u.length>c;)s.call(t,a=u[c++])&&e.push(a);return e}},7044:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(913),a=n(6476),u=n(994),s=function(t,e,n){var c,f,l,d,h=t&s.F,p=t&s.G,v=t&s.S,g=t&s.P,y=t&s.B,m=p?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=p?i:i[e]||(i[e]={}),_=b.prototype||(b.prototype={});for(c in p&&(n=e),n)l=((f=!h&&m&&void 0!==m[c])?m:n)[c],d=y&&f?u(l,r):g&&"function"==typeof l?u(Function.call,l):l,m&&a(m,c,l,t&s.U),b[c]!=l&&o(b,c,d),g&&_[c]!=l&&(_[c]=l)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},2910:(t,e,n)=>{var r=n(341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},5338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(7139);var r=n(6476),i=n(913),o=n(5338),a=n(5091),u=n(341),s=n(9020),c=u("species"),f=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=u(t),h=!o((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=h?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!e})):void 0;if(!h||!p||"replace"===t&&!f||"split"===t&&!l){var v=/./[d],g=n(a,d,""[t],(function(t,e,n,r,i){return e.exec===s?h&&!i?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),y=g[0],m=g[1];r(String.prototype,t,y),i(RegExp.prototype,d,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},3649:(t,e,n)=>{"use strict";var r=n(486);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},6806:(t,e,n)=>{"use strict";var r=n(7183),i=n(1255),o=n(8087),a=n(994),u=n(341)("isConcatSpreadable");t.exports=function t(e,n,s,c,f,l,d,h){for(var p,v,g=f,y=0,m=!!d&&a(d,h,3);y<c;){if(y in s){if(p=m?m(s[y],y,n):s[y],v=!1,i(p)&&(v=void 0!==(v=p[u])?!!v:r(p)),v&&l>0)g=t(e,n,p,o(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}y++}return g}},9822:(t,e,n)=>{var r=n(994),i=n(4902),o=n(9981),a=n(486),u=n(8087),s=n(9685),c={},f={},l=t.exports=function(t,e,n,l,d){var h,p,v,g,y=d?function(){return t}:s(t),m=r(n,l,e?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(h=u(t.length);h>b;b++)if((g=e?m(a(p=t[b])[0],p[1]):m(t[b]))===c||g===f)return g}else for(v=y.call(t);!(p=v.next()).done;)if((g=i(v,m,p.value,e))===c||g===f)return g};l.BREAK=c,l.RETURN=f},8454:(t,e,n)=>{t.exports=n(5570)("native-function-to-string",Function.toString)},7571:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},7384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},913:(t,e,n)=>{var r=n(3886),i=n(8328);t.exports=n(1216)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},7680:(t,e,n)=>{var r=n(7571).document;t.exports=r&&r.documentElement},6252:(t,e,n)=>{t.exports=!n(1216)&&!n(5338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},116:(t,e,n)=>{var r=n(1255),i=n(473).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},8262:t=>{t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},8579:(t,e,n)=>{var r=n(1669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},9981:(t,e,n)=>{var r=n(9740),i=n(341)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},7183:(t,e,n)=>{var r=n(1669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},1272:(t,e,n)=>{var r=n(1255),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},1255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},8990:(t,e,n)=>{var r=n(1255),i=n(1669),o=n(341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},4902:(t,e,n)=>{var r=n(486);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},4529:(t,e,n)=>{"use strict";var r=n(9055),i=n(8328),o=n(5837),a={};n(913)(a,n(341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},966:(t,e,n)=>{"use strict";var r=n(2725),i=n(7044),o=n(6476),a=n(913),u=n(9740),s=n(4529),c=n(5837),f=n(9881),l=n(341)("iterator"),d=!([].keys&&"next"in[].keys()),h="keys",p="values",v=function(){return this};t.exports=function(t,e,n,g,y,m,b){s(n,e,g);var _,x,w,E=function(t){if(!d&&t in I)return I[t];switch(t){case h:case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=y==p,T=!1,I=t.prototype,N=I[l]||I["@@iterator"]||y&&I[y],O=N||E(y),C=y?A?E("entries"):O:void 0,k="Array"==e&&I.entries||N;if(k&&(w=f(k.call(new t)))!==Object.prototype&&w.next&&(c(w,S,!0),r||"function"==typeof w[l]||a(w,l,v)),A&&N&&N.name!==p&&(T=!0,O=function(){return N.call(this)}),r&&!b||!d&&!T&&I[l]||a(I,l,O),u[e]=O,u[S]=v,y)if(_={values:A?O:E(p),keys:m?O:E(h),entries:C},b)for(x in _)x in I||o(I,x,_[x]);else i(i.P+i.F*(d||T),e,_);return _}},2803:(t,e,n)=>{var r=n(341)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},8782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},9740:t=>{t.exports={}},2725:t=>{t.exports=!1},959:t=>{var e=Math.expm1;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},7682:(t,e,n)=>{var r=n(2987),i=Math.pow,o=i(2,-52),a=i(2,-23),u=i(2,127)*(2-a),s=i(2,-126);t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),c=r(t);return i<s?c*(i/s/a+1/o-1/o)*s*a:(n=(e=(1+a/o)*i)-(e-i))>u||n!=n?c*(1/0):c*n}},1618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},2987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4278:(t,e,n)=>{var r=n(4316)("meta"),i=n(1255),o=n(7384),a=n(3886).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(5338)((function(){return s(Object.preventExtensions({}))})),f=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!o(t,r)&&f(t),t}}},7485:(t,e,n)=>{var r=n(7571),i=n(7225).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(1669)(a);t.exports=function(){var t,e,n,c=function(){var r,i;for(s&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var f=u.resolve(void 0);n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),n=function(){d.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},449:(t,e,n)=>{"use strict";var r=n(1464);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},4643:(t,e,n)=>{"use strict";var r=n(1216),i=n(9804),o=n(3844),a=n(4179),u=n(7583),s=n(8579),c=Object.assign;t.exports=!c||n(5338)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=u(t),c=arguments.length,f=1,l=o.f,d=a.f;c>f;)for(var h,p=s(arguments[f++]),v=l?i(p).concat(l(p)):i(p),g=v.length,y=0;g>y;)h=v[y++],r&&!d.call(p,h)||(n[h]=p[h]);return n}:c},9055:(t,e,n)=>{var r=n(486),i=n(6283),o=n(9824),a=n(3574)("IE_PROTO"),u=function(){},s=function(){var t,e=n(3438)("iframe"),r=o.length;for(e.style.display="none",n(7680).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[o[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(u.prototype=r(t),n=new u,u.prototype=null,n[a]=t):n=s(),void 0===e?n:i(n,e)}},3886:(t,e,n)=>{var r=n(486),i=n(6252),o=n(4467),a=Object.defineProperty;e.f=n(1216)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},6283:(t,e,n)=>{var r=n(3886),i=n(486),o=n(9804);t.exports=n(1216)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),u=a.length,s=0;u>s;)r.f(t,n=a[s++],e[n]);return t}},5385:(t,e,n)=>{var r=n(4179),i=n(8328),o=n(8182),a=n(4467),u=n(7384),s=n(6252),c=Object.getOwnPropertyDescriptor;e.f=n(1216)?c:function(t,e){if(t=o(t),e=a(e,!0),s)try{return c(t,e)}catch(t){}if(u(t,e))return i(!r.f.call(t,e),t[e])}},3473:(t,e,n)=>{var r=n(8182),i=n(6907).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(r(t))}},6907:(t,e,n)=>{var r=n(946),i=n(9824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},3844:(t,e)=>{e.f=Object.getOwnPropertySymbols},9881:(t,e,n)=>{var r=n(7384),i=n(7583),o=n(3574)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},946:(t,e,n)=>{var r=n(7384),i=n(8182),o=n(4538)(!1),a=n(3574)("IE_PROTO");t.exports=function(t,e){var n,u=i(t),s=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~o(c,n)||c.push(n));return c}},9804:(t,e,n)=>{var r=n(946),i=n(9824);t.exports=Object.keys||function(t){return r(t,i)}},4179:(t,e)=>{e.f={}.propertyIsEnumerable},381:(t,e,n)=>{var r=n(7044),i=n(2845),o=n(5338);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},6460:(t,e,n)=>{var r=n(1216),i=n(9804),o=n(8182),a=n(4179).f;t.exports=function(t){return function(e){for(var n,u=o(e),s=i(u),c=s.length,f=0,l=[];c>f;)n=s[f++],r&&!a.call(u,n)||l.push(t?[n,u[n]]:u[n]);return l}}},8125:(t,e,n)=>{var r=n(6907),i=n(3844),o=n(486),a=n(7571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},1885:(t,e,n)=>{var r=n(7571).parseFloat,i=n(4961).trim;t.exports=1/r(n(1644)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},343:(t,e,n)=>{var r=n(7571).parseInt,i=n(4961).trim,o=n(1644),a=/^[-+]?0[xX]/;t.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(t,e){var n=i(String(t),3);return r(n,e>>>0||(a.test(n)?16:10))}:r},9696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},909:(t,e,n)=>{var r=n(486),i=n(1255),o=n(449);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},8328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8565:(t,e,n)=>{var r=n(6476);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},6476:(t,e,n)=>{var r=n(7571),i=n(913),o=n(7384),a=n(4316)("src"),u=n(8454),s="toString",c=(""+u).split(s);n(2845).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(s&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||u.call(this)}))},2968:(t,e,n)=>{"use strict";var r=n(4939),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},9020:(t,e,n)=>{"use strict";var r,i,o=n(3649),a=RegExp.prototype.exec,u=String.prototype.replace,s=a,c=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),f=void 0!==/()??/.exec("")[1];(c||f)&&(s=function(t){var e,n,r,i,s=this;return f&&(n=new RegExp("^"+s.source+"$(?!\\s)",o.call(s))),c&&(e=s.lastIndex),r=a.call(s,t),c&&r&&(s.lastIndex=s.global?r.index+r[0].length:e),f&&r&&r.length>1&&u.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=s},6962:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},473:(t,e,n)=>{var r=n(1255),i=n(486),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(994)(Function.call,n(5385).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},4412:(t,e,n)=>{"use strict";var r=n(7571),i=n(3886),o=n(1216),a=n(341)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},5837:(t,e,n)=>{var r=n(3886).f,i=n(7384),o=n(341)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},3574:(t,e,n)=>{var r=n(5570)("keys"),i=n(4316);t.exports=function(t){return r[t]||(r[t]=i(t))}},5570:(t,e,n)=>{var r=n(2845),i=n(7571),o="__core-js_shared__",a=i[o]||(i[o]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(2725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8713:(t,e,n)=>{var r=n(486),i=n(1464),o=n(341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},5296:(t,e,n)=>{"use strict";var r=n(5338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},8016:(t,e,n)=>{var r=n(5845),i=n(5091);t.exports=function(t){return function(e,n){var o,a,u=String(i(e)),s=r(n),c=u.length;return s<0||s>=c?t?"":void 0:(o=u.charCodeAt(s))<55296||o>56319||s+1===c||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):o:t?u.slice(s,s+2):a-56320+(o-55296<<10)+65536}}},5692:(t,e,n)=>{var r=n(8990),i=n(5091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},5264:(t,e,n)=>{var r=n(7044),i=n(5338),o=n(5091),a=/"/g,u=function(t,e,n,r){var i=String(o(t)),u="<"+e;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,"&quot;")+'"'),u+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(u),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},8261:(t,e,n)=>{var r=n(8087),i=n(5458),o=n(5091);t.exports=function(t,e,n,a){var u=String(o(t)),s=u.length,c=void 0===n?" ":String(n),f=r(e);if(f<=s||""==c)return u;var l=f-s,d=i.call(c,Math.ceil(l/c.length));return d.length>l&&(d=d.slice(0,l)),a?d+u:u+d}},5458:(t,e,n)=>{"use strict";var r=n(5845),i=n(5091);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},4961:(t,e,n)=>{var r=n(7044),i=n(5091),o=n(5338),a=n(1644),u="["+a+"]",s=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),f=function(t,e,n){var i={},u=o((function(){return!!a[t]()||"​…"!="​…"[t]()})),s=i[t]=u?e(l):a[t];n&&(i[n]=s),r(r.P+r.F*u,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},1644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},7225:(t,e,n)=>{var r,i,o,a=n(994),u=n(8262),s=n(7680),c=n(3438),f=n(7571),l=f.process,d=f.setImmediate,h=f.clearImmediate,p=f.MessageChannel,v=f.Dispatch,g=0,y={},m=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){m.call(t.data)};d&&h||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++g]=function(){u("function"==typeof t?t:Function(t),e)},r(g),g},h=function(t){delete y[t]},"process"==n(1669)(l)?r=function(t){l.nextTick(a(m,t,1))}:v&&v.now?r=function(t){v.now(a(m,t,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(t){s.appendChild(c("script")).onreadystatechange=function(){s.removeChild(this),m.call(t)}}:function(t){setTimeout(a(m,t,1),0)}),t.exports={set:d,clear:h}},9260:(t,e,n)=>{var r=n(5845),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},5e3:(t,e,n)=>{var r=n(5845),i=n(8087);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},5845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},8182:(t,e,n)=>{var r=n(8579),i=n(5091);t.exports=function(t){return r(i(t))}},8087:(t,e,n)=>{var r=n(5845),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},7583:(t,e,n)=>{var r=n(5091);t.exports=function(t){return Object(r(t))}},4467:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},1063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(2725),i=n(7571),o=n(5338),a=n(7044),u=n(604),s=n(1541),c=n(994),f=n(6903),l=n(8328),d=n(913),h=n(8565),p=n(5845),v=n(8087),g=n(5e3),y=n(9260),m=n(4467),b=n(7384),_=n(4939),x=n(1255),w=n(7583),E=n(9981),S=n(9055),A=n(9881),T=n(6907).f,I=n(9685),N=n(4316),O=n(341),C=n(7622),k=n(4538),D=n(8713),M=n(163),R=n(9740),P=n(2803),G=n(4412),L=n(8676),j=n(1064),U=n(3886),F=n(5385),B=U.f,z=F.f,V=i.RangeError,W=i.TypeError,H=i.Uint8Array,X="ArrayBuffer",q="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",K=Array.prototype,Z=s.ArrayBuffer,$=s.DataView,J=C(0),Q=C(2),tt=C(3),et=C(4),nt=C(5),rt=C(6),it=k(!0),ot=k(!1),at=M.values,ut=M.keys,st=M.entries,ct=K.lastIndexOf,ft=K.reduce,lt=K.reduceRight,dt=K.join,ht=K.sort,pt=K.slice,vt=K.toString,gt=K.toLocaleString,yt=O("iterator"),mt=O("toStringTag"),bt=N("typed_constructor"),_t=N("def_constructor"),xt=u.CONSTR,wt=u.TYPED,Et=u.VIEW,St="Wrong length!",At=C(1,(function(t,e){return Ct(D(t,t[_t]),e)})),Tt=o((function(){return 1===new H(new Uint16Array([1]).buffer)[0]})),It=!!H&&!!H.prototype.set&&o((function(){new H(1).set({})})),Nt=function(t,e){var n=p(t);if(n<0||n%e)throw V("Wrong offset!");return n},Ot=function(t){if(x(t)&&wt in t)return t;throw W(t+" is not a typed array!")},Ct=function(t,e){if(!x(t)||!(bt in t))throw W("It is not a typed array constructor!");return new t(e)},kt=function(t,e){return Dt(D(t,t[_t]),e)},Dt=function(t,e){for(var n=0,r=e.length,i=Ct(t,r);r>n;)i[n]=e[n++];return i},Mt=function(t,e,n){B(t,e,{get:function(){return this._d[n]}})},Rt=function(t){var e,n,r,i,o,a,u=w(t),s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,d=I(u);if(null!=d&&!E(d)){for(a=d.call(u),r=[],e=0;!(o=a.next()).done;e++)r.push(o.value);u=r}for(l&&s>2&&(f=c(f,arguments[2],2)),e=0,n=v(u.length),i=Ct(this,n);n>e;e++)i[e]=l?f(u[e],e):u[e];return i},Pt=function(){for(var t=0,e=arguments.length,n=Ct(this,e);e>t;)n[t]=arguments[t++];return n},Gt=!!H&&o((function(){gt.call(new H(1))})),Lt=function(){return gt.apply(Gt?pt.call(Ot(this)):Ot(this),arguments)},jt={copyWithin:function(t,e){return j.call(Ot(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return et(Ot(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(Ot(this),arguments)},filter:function(t){return kt(this,Q(Ot(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(Ot(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return rt(Ot(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Ot(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return ot(Ot(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Ot(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return dt.apply(Ot(this),arguments)},lastIndexOf:function(t){return ct.apply(Ot(this),arguments)},map:function(t){return At(Ot(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ft.apply(Ot(this),arguments)},reduceRight:function(t){return lt.apply(Ot(this),arguments)},reverse:function(){for(var t,e=this,n=Ot(e).length,r=Math.floor(n/2),i=0;i<r;)t=e[i],e[i++]=e[--n],e[n]=t;return e},some:function(t){return tt(Ot(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return ht.call(Ot(this),t)},subarray:function(t,e){var n=Ot(this),r=n.length,i=y(t,r);return new(D(n,n[_t]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:y(e,r))-i))}},Ut=function(t,e){return kt(this,pt.call(Ot(this),t,e))},Ft=function(t){Ot(this);var e=Nt(arguments[1],1),n=this.length,r=w(t),i=v(r.length),o=0;if(i+e>n)throw V(St);for(;o<i;)this[e+o]=r[o++]},Bt={entries:function(){return st.call(Ot(this))},keys:function(){return ut.call(Ot(this))},values:function(){return at.call(Ot(this))}},zt=function(t,e){return x(t)&&t[wt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Vt=function(t,e){return zt(t,e=m(e,!0))?l(2,t[e]):z(t,e)},Wt=function(t,e,n){return!(zt(t,e=m(e,!0))&&x(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?B(t,e,n):(t[e]=n.value,t)};xt||(F.f=Vt,U.f=Wt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Vt,defineProperty:Wt}),o((function(){vt.call({})}))&&(vt=gt=function(){return dt.call(this)});var Ht=h({},jt);h(Ht,Bt),d(Ht,yt,Bt.values),h(Ht,{slice:Ut,set:Ft,constructor:function(){},toString:vt,toLocaleString:Lt}),Mt(Ht,"buffer","b"),Mt(Ht,"byteOffset","o"),Mt(Ht,"byteLength","l"),Mt(Ht,"length","e"),B(Ht,mt,{get:function(){return this[wt]}}),t.exports=function(t,e,n,s){var c=t+((s=!!s)?"Clamped":"")+"Array",l="get"+t,h="set"+t,p=i[c],y=p||{},m=p&&A(p),b=!p||!u.ABV,w={},E=p&&p.prototype,I=function(t,n){B(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[l](n*e+r.o,Tt)}(this,n)},set:function(t){return function(t,n,r){var i=t._d;s&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[h](n*e+i.o,r,Tt)}(this,n,t)},enumerable:!0})};b?(p=n((function(t,n,r,i){f(t,p,c,"_d");var o,a,u,s,l=0,h=0;if(x(n)){if(!(n instanceof Z||(s=_(n))==X||s==q))return wt in n?Dt(p,n):Rt.call(p,n);o=n,h=Nt(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw V(St);if((a=y-h)<0)throw V(St)}else if((a=v(i)*e)+h>y)throw V(St);u=a/e}else u=g(n),o=new Z(a=u*e);for(d(t,"_d",{b:o,o:h,l:a,e:u,v:new $(o)});l<u;)I(t,l++)})),E=p.prototype=S(Ht),d(E,"constructor",p)):o((function(){p(1)}))&&o((function(){new p(-1)}))&&P((function(t){new p,new p(null),new p(1.5),new p(t)}),!0)||(p=n((function(t,n,r,i){var o;return f(t,p,c),x(n)?n instanceof Z||(o=_(n))==X||o==q?void 0!==i?new y(n,Nt(r,e),i):void 0!==r?new y(n,Nt(r,e)):new y(n):wt in n?Dt(p,n):Rt.call(p,n):new y(g(n))})),J(m!==Function.prototype?T(y).concat(T(m)):T(y),(function(t){t in p||d(p,t,y[t])})),p.prototype=E,r||(E.constructor=p));var N=E[yt],O=!!N&&("values"==N.name||null==N.name),C=Bt.values;d(p,bt,!0),d(E,wt,c),d(E,Et,!0),d(E,_t,p),(s?new p(1)[mt]==c:mt in E)||B(E,mt,{get:function(){return c}}),w[c]=p,a(a.G+a.W+a.F*(p!=y),w),a(a.S,c,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*o((function(){y.of.call(p,1)})),c,{from:Rt,of:Pt}),Y in E||d(E,Y,e),a(a.P,c,jt),G(c),a(a.P+a.F*It,c,{set:Ft}),a(a.P+a.F*!O,c,Bt),r||E.toString==vt||(E.toString=vt),a(a.P+a.F*o((function(){new p(1).slice()})),c,{slice:Ut}),a(a.P+a.F*(o((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!o((function(){E.toLocaleString.call([1,2])}))),c,{toLocaleString:Lt}),R[c]=O?N:C,r||O||d(E,yt,C)}}else t.exports=function(){}},1541:(t,e,n)=>{"use strict";var r=n(7571),i=n(1216),o=n(2725),a=n(604),u=n(913),s=n(8565),c=n(5338),f=n(6903),l=n(5845),d=n(8087),h=n(5e3),p=n(6907).f,v=n(3886).f,g=n(8676),y=n(5837),m="ArrayBuffer",b="DataView",_="Wrong index!",x=r.ArrayBuffer,w=r.DataView,E=r.Math,S=r.RangeError,A=r.Infinity,T=x,I=E.abs,N=E.pow,O=E.floor,C=E.log,k=E.LN2,D="buffer",M="byteLength",R="byteOffset",P=i?"_b":D,G=i?"_l":M,L=i?"_o":R;function j(t,e,n){var r,i,o,a=new Array(n),u=8*n-e-1,s=(1<<u)-1,c=s>>1,f=23===e?N(2,-24)-N(2,-77):0,l=0,d=t<0||0===t&&1/t<0?1:0;for((t=I(t))!=t||t===A?(i=t!=t?1:0,r=s):(r=O(C(t)/k),t*(o=N(2,-r))<1&&(r--,o*=2),(t+=r+c>=1?f/o:f*N(2,1-c))*o>=2&&(r++,o/=2),r+c>=s?(i=0,r=s):r+c>=1?(i=(t*o-1)*N(2,e),r+=c):(i=t*N(2,c-1)*N(2,e),r=0));e>=8;a[l++]=255&i,i/=256,e-=8);for(r=r<<e|i,u+=e;u>0;a[l++]=255&r,r/=256,u-=8);return a[--l]|=128*d,a}function U(t,e,n){var r,i=8*n-e-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;f=256*f+t[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===f)f=1-a;else{if(f===o)return r?NaN:c?-A:A;r+=N(2,e),f-=a}return(c?-1:1)*r*N(2,f-e)}function F(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function z(t){return[255&t,t>>8&255]}function V(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function W(t){return j(t,52,8)}function H(t){return j(t,23,4)}function X(t,e,n){v(t.prototype,e,{get:function(){return this[n]}})}function q(t,e,n,r){var i=h(+n);if(i+e>t[G])throw S(_);var o=t[P]._b,a=i+t[L],u=o.slice(a,a+e);return r?u:u.reverse()}function Y(t,e,n,r,i,o){var a=h(+n);if(a+e>t[G])throw S(_);for(var u=t[P]._b,s=a+t[L],c=r(+i),f=0;f<e;f++)u[s+f]=c[o?f:e-f-1]}if(a.ABV){if(!c((function(){x(1)}))||!c((function(){new x(-1)}))||c((function(){return new x,new x(1.5),new x(NaN),x.name!=m}))){for(var K,Z=(x=function(t){return f(this,x),new T(h(t))}).prototype=T.prototype,$=p(T),J=0;$.length>J;)(K=$[J++])in x||u(x,K,T[K]);o||(Z.constructor=x)}var Q=new w(new x(2)),tt=w.prototype.setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||s(w.prototype,{setInt8:function(t,e){tt.call(this,t,e<<24>>24)},setUint8:function(t,e){tt.call(this,t,e<<24>>24)}},!0)}else x=function(t){f(this,x,m);var e=h(t);this._b=g.call(new Array(e),0),this[G]=e},w=function(t,e,n){f(this,w,b),f(t,x,b);var r=t[G],i=l(e);if(i<0||i>r)throw S("Wrong offset!");if(i+(n=void 0===n?r-i:d(n))>r)throw S("Wrong length!");this[P]=t,this[L]=i,this[G]=n},i&&(X(x,M,"_l"),X(w,D,"_b"),X(w,M,"_l"),X(w,R,"_o")),s(w.prototype,{getInt8:function(t){return q(this,1,t)[0]<<24>>24},getUint8:function(t){return q(this,1,t)[0]},getInt16:function(t){var e=q(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=q(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return F(q(this,4,t,arguments[1]))},getUint32:function(t){return F(q(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return U(q(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return U(q(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){Y(this,1,t,B,e)},setUint8:function(t,e){Y(this,1,t,B,e)},setInt16:function(t,e){Y(this,2,t,z,e,arguments[2])},setUint16:function(t,e){Y(this,2,t,z,e,arguments[2])},setInt32:function(t,e){Y(this,4,t,V,e,arguments[2])},setUint32:function(t,e){Y(this,4,t,V,e,arguments[2])},setFloat32:function(t,e){Y(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){Y(this,8,t,W,e,arguments[2])}});y(x,m),y(w,b),u(w.prototype,a.VIEW,!0),e.ArrayBuffer=x,e.DataView=w},604:(t,e,n)=>{for(var r,i=n(7571),o=n(913),a=n(4316),u=a("typed_array"),s=a("view"),c=!(!i.ArrayBuffer||!i.DataView),f=c,l=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(r=i[d[l++]])?(o(r.prototype,u,!0),o(r.prototype,s,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:u,VIEW:s}},4316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},2541:(t,e,n)=>{var r=n(7571).navigator;t.exports=r&&r.userAgent||""},4664:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6262:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(2725),a=n(7686),u=n(3886).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},7686:(t,e,n)=>{e.f=n(341)},341:(t,e,n)=>{var r=n(5570)("wks"),i=n(4316),o=n(7571).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},9685:(t,e,n)=>{var r=n(4939),i=n(341)("iterator"),o=n(9740);t.exports=n(2845).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},5305:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{copyWithin:n(1064)}),n(4691)("copyWithin")},5015:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(4);r(r.P+r.F*!n(5296)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},6341:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{fill:n(8676)}),n(4691)("fill")},5119:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(2);r(r.P+r.F*!n(5296)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},4488:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5915:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(5),o="find",a=!0;o in[]&&Array(1).find((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5788:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(0),o=n(5296)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},9689:(t,e,n)=>{"use strict";var r=n(994),i=n(7044),o=n(7583),a=n(4902),u=n(9981),s=n(8087),c=n(1395),f=n(9685);i(i.S+i.F*!n(2803)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,l,d=o(t),h="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,y=0,m=f(d);if(g&&(v=r(v,p>2?arguments[2]:void 0,2)),null==m||h==Array&&u(m))for(n=new h(e=s(d.length));e>y;y++)c(n,y,g?v(d[y],y):d[y]);else for(l=m.call(d),n=new h;!(i=l.next()).done;y++)c(n,y,g?a(l,v,[i.value,y],!0):i.value);return n.length=y,n}})},5377:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(5296)(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(7044);r(r.S,"Array",{isArray:n(7183)})},163:(t,e,n)=>{"use strict";var r=n(4691),i=n(8782),o=n(9740),a=n(8182);t.exports=n(966)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},9026:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=[].join;r(r.P+r.F*(n(8579)!=Object||!n(5296)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},9879:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=n(5845),a=n(8087),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(5296)(u)),"Array",{lastIndexOf:function(t){if(s)return u.apply(this,arguments)||0;var e=i(this),n=a(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},7878:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(1);r(r.P+r.F*!n(5296)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},9003:(t,e,n)=>{"use strict";var r=n(7044),i=n(1395);r(r.S+r.F*n(5338)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)i(n,t,arguments[t++]);return n.length=e,n}})},646:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},8059:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},4088:(t,e,n)=>{"use strict";var r=n(7044),i=n(7680),o=n(1669),a=n(9260),u=n(8087),s=[].slice;r(r.P+r.F*n(5338)((function(){i&&s.call(i)})),"Array",{slice:function(t,e){var n=u(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return s.call(this,t,e);for(var i=a(t,n),c=a(e,n),f=u(c-i),l=new Array(f),d=0;d<f;d++)l[d]="String"==r?this.charAt(i+d):this[i+d];return l}})},3135:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(3);r(r.P+r.F*!n(5296)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},535:(t,e,n)=>{"use strict";var r=n(7044),i=n(1464),o=n(7583),a=n(5338),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(5296)(u)),"Array",{sort:function(t){return void 0===t?u.call(o(this)):u.call(o(this),i(t))}})},9281:(t,e,n)=>{n(4412)("Array")},4094:(t,e,n)=>{var r=n(7044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},5013:(t,e,n)=>{var r=n(7044),i=n(4506);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},8781:(t,e,n)=>{"use strict";var r=n(7044),i=n(7583),o=n(4467);r(r.P+r.F*n(5338)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=i(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},8723:(t,e,n)=>{var r=n(341)("toPrimitive"),i=Date.prototype;r in i||n(913)(i,r,n(9514))},3735:(t,e,n)=>{var r=Date.prototype,i="Invalid Date",o=r.toString,a=r.getTime;new Date(NaN)+""!=i&&n(6476)(r,"toString",(function(){var t=a.call(this);return t==t?o.call(this):i}))},1765:(t,e,n)=>{var r=n(7044);r(r.P,"Function",{bind:n(8366)})},7451:(t,e,n)=>{"use strict";var r=n(1255),i=n(9881),o=n(341)("hasInstance"),a=Function.prototype;o in a||n(3886).f(a,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},5747:(t,e,n)=>{var r=n(3886).f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n(1216)&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},6441:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664),o="Map";t.exports=n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(i(this,o),t);return e&&e.v},set:function(t,e){return r.def(i(this,o),0===t?0:t,e)}},r,!0)},2212:(t,e,n)=>{var r=n(7044),i=n(1618),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},4230:(t,e,n)=>{var r=n(7044),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},9754:(t,e,n)=>{var r=n(7044),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},2811:(t,e,n)=>{var r=n(7044),i=n(2987);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},3998:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},1769:(t,e,n)=>{var r=n(7044),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},8789:(t,e,n)=>{var r=n(7044),i=n(959);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},2848:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(7044),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,a=0,u=arguments.length,s=0;a<u;)s<(n=i(arguments[a++]))?(o=o*(r=s/n)*r+1,s=n):o+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*Math.sqrt(o)}})},1323:(t,e,n)=>{var r=n(7044),i=Math.imul;r(r.S+r.F*n(5338)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(t,e){var n=65535,r=+t,i=+e,o=n&r,a=n&i;return 0|o*a+((n&r>>>16)*a+o*(n&i>>>16)<<16>>>0)}})},6063:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3282:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log1p:n(1618)})},6816:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},1854:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{sign:n(2987)})},3303:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S+r.F*n(5338)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},4421:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S,"Math",{tanh:function(t){var e=i(t=+t),n=i(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},2203:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},7454:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1669),a=n(116),u=n(4467),s=n(5338),c=n(6907).f,f=n(5385).f,l=n(3886).f,d=n(4961).trim,h="Number",p=r.Number,v=p,g=p.prototype,y=o(n(9055)(g))==h,m="trim"in String.prototype,b=function(t){var e=u(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=m?e.trim():d(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,s=e.slice(2),c=0,f=s.length;c<f;c++)if((a=s.charCodeAt(c))<48||a>i)return NaN;return parseInt(s,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(y?s((function(){g.valueOf.call(n)})):o(n)!=h)?a(new v(b(e)),n,p):b(e)};for(var _,x=n(1216)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;x.length>w;w++)i(v,_=x[w])&&!i(p,_)&&l(p,_,f(v,_));p.prototype=g,g.constructor=p,n(6476)(r,h,p)}},7551:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},2929:(t,e,n)=>{var r=n(7044),i=n(7571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},215:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isInteger:n(1272)})},6183:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},8190:(t,e,n)=>{var r=n(7044),i=n(1272),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},476:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},948:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},942:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},2870:(t,e,n)=>{var r=n(7044),i=n(343);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},3053:(t,e,n)=>{"use strict";var r=n(7044),i=n(5845),o=n(8347),a=n(5458),u=1..toFixed,s=Math.floor,c=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",l="0",d=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=s(r/1e7)},h=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=s(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+a.call(l,7-n.length)+n}return e},v=function(t,e,n){return 0===e?n:e%2==1?v(t,e-1,n*t):v(t*t,e/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5338)((function(){u.call({})}))),"Number",{toFixed:function(t){var e,n,r,u,s=o(this,f),c=i(t),g="",y=l;if(c<0||c>20)throw RangeError(f);if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(g="-",s=-s),s>1e-21)if(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(s*v(2,69,1))-69,n=e<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,(e=52-e)>0){for(d(0,n),r=c;r>=7;)d(1e7,0),r-=7;for(d(v(10,r,1),0),r=e-1;r>=23;)h(1<<23),r-=23;h(1<<r),d(1,1),h(2),y=p()}else d(0,n),d(1<<-e,0),y=p()+a.call(l,c);return c>0?g+((u=y.length)<=c?"0."+a.call(l,c-u)+y:y.slice(0,u-c)+"."+y.slice(u-c)):g+y}})},8032:(t,e,n)=>{"use strict";var r=n(7044),i=n(5338),o=n(8347),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},5261:(t,e,n)=>{var r=n(7044);r(r.S+r.F,"Object",{assign:n(4643)})},6051:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{create:n(9055)})},9518:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(6283)})},2640:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(3886).f})},9788:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("freeze",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},8201:(t,e,n)=>{var r=n(8182),i=n(5385).f;n(381)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},7525:(t,e,n)=>{n(381)("getOwnPropertyNames",(function(){return n(3473).f}))},470:(t,e,n)=>{var r=n(7583),i=n(9881);n(381)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},7940:(t,e,n)=>{var r=n(1255);n(381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},6129:(t,e,n)=>{var r=n(1255);n(381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},2802:(t,e,n)=>{var r=n(1255);n(381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9340:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{is:n(6962)})},5723:(t,e,n)=>{var r=n(7583),i=n(9804);n(381)("keys",(function(){return function(t){return i(r(t))}}))},7577:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1498:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("seal",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1584:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{setPrototypeOf:n(473).set})},7298:(t,e,n)=>{"use strict";var r=n(4939),i={};i[n(341)("toStringTag")]="z",i+""!="[object z]"&&n(6476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},2809:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},2784:(t,e,n)=>{var r=n(7044),i=n(343);r(r.G+r.F*(parseInt!=i),{parseInt:i})},7843:(t,e,n)=>{"use strict";var r,i,o,a,u=n(2725),s=n(7571),c=n(994),f=n(4939),l=n(7044),d=n(1255),h=n(1464),p=n(6903),v=n(9822),g=n(8713),y=n(7225).set,m=n(7485)(),b=n(449),_=n(9696),x=n(2541),w=n(909),E="Promise",S=s.TypeError,A=s.process,T=A&&A.versions,I=T&&T.v8||"",N=s.Promise,O="process"==f(A),C=function(){},k=i=b.f,D=!!function(){try{var t=N.resolve(1),e=(t.constructor={})[n(341)("species")]=function(t){t(C,C)};return(O||"function"==typeof PromiseRejectionEvent)&&t.then(C)instanceof e&&0!==I.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(t){}}(),M=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},R=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){for(var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,u=i?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{u?(i||(2==t._h&&L(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(o=M(n))?o.call(n,s,c):s(n)):c(r)}catch(t){f&&!a&&f.exit(),c(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&P(t)}))}},P=function(t){y.call(s,(function(){var e,n,r,i=t._v,o=G(t);if(o&&(e=_((function(){O?A.emit("unhandledRejection",i,t):(n=s.onunhandledrejection)?n({promise:t,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=O||G(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},G=function(t){return 1!==t._h&&0===(t._a||t._c).length},L=function(t){y.call(s,(function(){var e;O?A.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})}))},j=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),R(e,!0))},U=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=M(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(U,r,1),c(j,r,1))}catch(t){j.call(r,t)}})):(n._v=t,n._s=1,R(n,!1))}catch(t){j.call({_w:n,_d:!1},t)}}};D||(N=function(t){p(this,N,E,"_h"),h(t),r.call(this);try{t(c(U,this,1),c(j,this,1))}catch(t){j.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(8565)(N.prototype,{then:function(t,e){var n=k(g(this,N));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=O?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(U,t,1),this.reject=c(j,t,1)},b.f=k=function(t){return t===N||t===a?new o(t):i(t)}),l(l.G+l.W+l.F*!D,{Promise:N}),n(5837)(N,E),n(4412)(E),a=n(2845).Promise,l(l.S+l.F*!D,E,{reject:function(t){var e=k(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!D),E,{resolve:function(t){return w(u&&this===a?N:this,t)}}),l(l.S+l.F*!(D&&n(2803)((function(t){N.all(t).catch(C)}))),E,{all:function(t){var e=this,n=k(e),r=n.resolve,i=n.reject,o=_((function(){var n=[],o=0,a=1;v(t,!1,(function(t){var u=o++,s=!1;n.push(void 0),a++,e.resolve(t).then((function(t){s||(s=!0,n[u]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=k(e),r=n.reject,i=_((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},8275:(t,e,n)=>{var r=n(7044),i=n(1464),o=n(486),a=(n(7571).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(5338)((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=i(t),s=o(n);return a?a(r,e,s):u.call(r,e,s)}})},2552:(t,e,n)=>{var r=n(7044),i=n(9055),o=n(1464),a=n(486),u=n(1255),s=n(5338),c=n(8366),f=(n(7571).Reflect||{}).construct,l=s((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),d=!s((function(){f((function(){}))}));r(r.S+r.F*(l||d),"Reflect",{construct:function(t,e){o(t),a(e);var n=arguments.length<3?t:o(arguments[2]);if(d&&!l)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var s=n.prototype,h=i(u(s)?s:Object.prototype),p=Function.apply.call(t,h,e);return u(p)?p:h}})},3077:(t,e,n)=>{var r=n(3886),i=n(7044),o=n(486),a=n(4467);i(i.S+i.F*n(5338)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){o(t),e=a(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},1031:(t,e,n)=>{var r=n(7044),i=n(5385).f,o=n(486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},8916:(t,e,n)=>{"use strict";var r=n(7044),i=n(486),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(4529)(o,"Object",(function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new o(t)}})},8531:(t,e,n)=>{var r=n(5385),i=n(7044),o=n(486);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},7323:(t,e,n)=>{var r=n(7044),i=n(9881),o=n(486);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},8978:(t,e,n)=>{var r=n(5385),i=n(9881),o=n(7384),a=n(7044),u=n(1255),s=n(486);a(a.S,"Reflect",{get:function t(e,n){var a,c,f=arguments.length<3?e:arguments[2];return s(e)===f?e[n]:(a=r.f(e,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:u(c=i(e))?t(c,n,f):void 0}})},3704:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},3153:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},8812:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{ownKeys:n(8125)})},2636:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},377:(t,e,n)=>{var r=n(7044),i=n(473);i&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){i.check(t,e);try{return i.set(t,e),!0}catch(t){return!1}}})},1602:(t,e,n)=>{var r=n(3886),i=n(5385),o=n(9881),a=n(7384),u=n(7044),s=n(8328),c=n(486),f=n(1255);u(u.S,"Reflect",{set:function t(e,n,u){var l,d,h=arguments.length<4?e:arguments[3],p=i.f(c(e),n);if(!p){if(f(d=o(e)))return t(d,n,u,h);p=s(0)}if(a(p,"value")){if(!1===p.writable||!f(h))return!1;if(l=i.f(h,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=u,r.f(h,n,l)}else r.f(h,n,s(0,u));return!0}return void 0!==p.set&&(p.set.call(h,u),!0)}})},6668:(t,e,n)=>{var r=n(7571),i=n(116),o=n(3886).f,a=n(6907).f,u=n(8990),s=n(3649),c=r.RegExp,f=c,l=c.prototype,d=/a/g,h=/a/g,p=new c(d)!==d;if(n(1216)&&(!p||n(5338)((function(){return h[n(341)("match")]=!1,c(d)!=d||c(h)==h||"/a/i"!=c(d,"i")})))){c=function(t,e){var n=this instanceof c,r=u(t),o=void 0===e;return!n&&r&&t.constructor===c&&o?t:i(p?new f(r&&!o?t.source:t,e):f((r=t instanceof c)?t.source:t,r&&o?s.call(t):e),n?this:l,c)};for(var v=function(t){t in c||o(c,t,{configurable:!0,get:function(){return f[t]},set:function(e){f[t]=e}})},g=a(f),y=0;g.length>y;)v(g[y++]);l.constructor=c,c.prototype=l,n(6476)(r,"RegExp",c)}n(4412)("RegExp")},7139:(t,e,n)=>{"use strict";var r=n(9020);n(7044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},8686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(3886).f(RegExp.prototype,"flags",{configurable:!0,get:n(3649)})},5480:(t,e,n)=>{"use strict";var r=n(486),i=n(8087),o=n(178),a=n(2968);n(6719)("match",1,(function(t,e,n,u){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=u(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this);if(!s.global)return a(s,c);var f=s.unicode;s.lastIndex=0;for(var l,d=[],h=0;null!==(l=a(s,c));){var p=String(l[0]);d[h]=p,""===p&&(s.lastIndex=o(c,i(s.lastIndex),f)),h++}return 0===h?null:d}]}))},9121:(t,e,n)=>{"use strict";var r=n(486),i=n(7583),o=n(8087),a=n(5845),u=n(178),s=n(2968),c=Math.max,f=Math.min,l=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(6719)("replace",2,(function(t,e,n,p){return[function(r,i){var o=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(t,e){var i=p(n,t,this,e);if(i.done)return i.value;var l=r(t),d=String(this),h="function"==typeof e;h||(e=String(e));var g=l.global;if(g){var y=l.unicode;l.lastIndex=0}for(var m=[];;){var b=s(l,d);if(null===b)break;if(m.push(b),!g)break;""===String(b[0])&&(l.lastIndex=u(d,o(l.lastIndex),y))}for(var _,x="",w=0,E=0;E<m.length;E++){b=m[E];for(var S=String(b[0]),A=c(f(a(b.index),d.length),0),T=[],I=1;I<b.length;I++)T.push(void 0===(_=b[I])?_:String(_));var N=b.groups;if(h){var O=[S].concat(T,A,d);void 0!==N&&O.push(N);var C=String(e.apply(void 0,O))}else C=v(S,d,A,T,N,e);A>=w&&(x+=d.slice(w,A)+C,w=A+S.length)}return x+d.slice(w)}];function v(t,e,r,o,a,u){var s=r+t.length,c=o.length,f=h;return void 0!==a&&(a=i(a),f=d),n.call(u,f,(function(n,i){var u;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(s);case"<":u=a[i.slice(1,-1)];break;default:var f=+i;if(0===f)return n;if(f>c){var d=l(f/10);return 0===d?n:d<=c?void 0===o[d-1]?i.charAt(1):o[d-1]+i.charAt(1):n}u=o[f-1]}return void 0===u?"":u}))}}))},914:(t,e,n)=>{"use strict";var r=n(486),i=n(6962),o=n(2968);n(6719)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),s=String(this),c=u.lastIndex;i(c,0)||(u.lastIndex=0);var f=o(u,s);return i(u.lastIndex,c)||(u.lastIndex=c),null===f?-1:f.index}]}))},7742:(t,e,n)=>{"use strict";var r=n(8990),i=n(486),o=n(8713),a=n(178),u=n(8087),s=n(2968),c=n(9020),f=n(5338),l=Math.min,d=[].push,h=4294967295,p=!f((function(){RegExp(h,"y")}));n(6719)("split",2,(function(t,e,n,f){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);for(var o,a,u,s=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,p=void 0===e?h:e>>>0,v=new RegExp(t.source,f+"g");(o=c.call(v,i))&&!((a=v.lastIndex)>l&&(s.push(i.slice(l,o.index)),o.length>1&&o.index<i.length&&d.apply(s,o.slice(1)),u=o[0].length,l=a,s.length>=p));)v.lastIndex===o.index&&v.lastIndex++;return l===i.length?!u&&v.test("")||s.push(""):s.push(i.slice(l)),s.length>p?s.slice(0,p):s}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):v.call(String(i),n,r)},function(t,e){var r=f(v,t,this,e,v!==n);if(r.done)return r.value;var c=i(t),d=String(this),g=o(c,RegExp),y=c.unicode,m=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(p?"y":"g"),b=new g(p?c:"^(?:"+c.source+")",m),_=void 0===e?h:e>>>0;if(0===_)return[];if(0===d.length)return null===s(b,d)?[d]:[];for(var x=0,w=0,E=[];w<d.length;){b.lastIndex=p?w:0;var S,A=s(b,p?d:d.slice(w));if(null===A||(S=l(u(b.lastIndex+(p?0:w)),d.length))===x)w=a(d,w,y);else{if(E.push(d.slice(x,w)),E.length===_)return E;for(var T=1;T<=A.length-1;T++)if(E.push(A[T]),E.length===_)return E;w=x=S}}return E.push(d.slice(x)),E}]}))},6408:(t,e,n)=>{"use strict";n(8686);var r=n(486),i=n(3649),o=n(1216),a="toString",u=/./.toString,s=function(t){n(6476)(RegExp.prototype,a,t,!0)};n(5338)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?s((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):u.name!=a&&s((function(){return u.call(this)}))},429:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664);t.exports=n(859)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"Set"),t=0===t?0:t,t)}},r)},3157:(t,e,n)=>{"use strict";n(5264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},9791:(t,e,n)=>{"use strict";n(5264)("big",(function(t){return function(){return t(this,"big","","")}}))},2296:(t,e,n)=>{"use strict";n(5264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},4555:(t,e,n)=>{"use strict";n(5264)("bold",(function(t){return function(){return t(this,"b","","")}}))},8316:(t,e,n)=>{"use strict";var r=n(7044),i=n(8016)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="endsWith",u="".endsWith;r(r.P+r.F*n(2910)(a),"String",{endsWith:function(t){var e=o(this,t,a),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),s=void 0===n?r:Math.min(i(n),r),c=String(t);return u?u.call(e,c,s):e.slice(s-c.length,s)===c}})},6505:(t,e,n)=>{"use strict";n(5264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(5264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},9713:(t,e,n)=>{"use strict";n(5264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(7044),i=n(9260),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,a=0;r>a;){if(e=+arguments[a++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},637:(t,e,n)=>{"use strict";var r=n(7044),i=n(5692),o="includes";r(r.P+r.F*n(2910)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7392:(t,e,n)=>{"use strict";n(5264)("italics",(function(t){return function(){return t(this,"i","","")}}))},7938:(t,e,n)=>{"use strict";var r=n(8016)(!0);n(966)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},4687:(t,e,n)=>{"use strict";n(5264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},6818:(t,e,n)=>{var r=n(7044),i=n(8182),o=n(8087);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(e[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},8219:(t,e,n)=>{var r=n(7044);r(r.P,"String",{repeat:n(5458)})},3684:(t,e,n)=>{"use strict";n(5264)("small",(function(t){return function(){return t(this,"small","","")}}))},9029:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="startsWith",u="".startsWith;r(r.P+r.F*n(2910)(a),"String",{startsWith:function(t){var e=o(this,t,a),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},3339:(t,e,n)=>{"use strict";n(5264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},4148:(t,e,n)=>{"use strict";n(5264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},7754:(t,e,n)=>{"use strict";n(5264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},5557:(t,e,n)=>{"use strict";n(4961)("trim",(function(t){return function(){return t(this,3)}}))},2825:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1216),a=n(7044),u=n(6476),s=n(4278).KEY,c=n(5338),f=n(5570),l=n(5837),d=n(4316),h=n(341),p=n(7686),v=n(6262),g=n(6397),y=n(7183),m=n(486),b=n(1255),_=n(7583),x=n(8182),w=n(4467),E=n(8328),S=n(9055),A=n(3473),T=n(5385),I=n(3844),N=n(3886),O=n(9804),C=T.f,k=N.f,D=A.f,M=r.Symbol,R=r.JSON,P=R&&R.stringify,G=h("_hidden"),L=h("toPrimitive"),j={}.propertyIsEnumerable,U=f("symbol-registry"),F=f("symbols"),B=f("op-symbols"),z=Object.prototype,V="function"==typeof M&&!!I.f,W=r.QObject,H=!W||!W.prototype||!W.prototype.findChild,X=o&&c((function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=C(z,e);r&&delete z[e],k(t,e,n),r&&t!==z&&k(z,e,r)}:k,q=function(t){var e=F[t]=S(M.prototype);return e._k=t,e},Y=V&&"symbol"==typeof M.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof M},K=function(t,e,n){return t===z&&K(B,e,n),m(t),e=w(e,!0),m(n),i(F,e)?(n.enumerable?(i(t,G)&&t[G][e]&&(t[G][e]=!1),n=S(n,{enumerable:E(0,!1)})):(i(t,G)||k(t,G,E(1,{})),t[G][e]=!0),X(t,e,n)):k(t,e,n)},Z=function(t,e){m(t);for(var n,r=g(e=x(e)),i=0,o=r.length;o>i;)K(t,n=r[i++],e[n]);return t},$=function(t){var e=j.call(this,t=w(t,!0));return!(this===z&&i(F,t)&&!i(B,t))&&(!(e||!i(this,t)||!i(F,t)||i(this,G)&&this[G][t])||e)},J=function(t,e){if(t=x(t),e=w(e,!0),t!==z||!i(F,e)||i(B,e)){var n=C(t,e);return!n||!i(F,e)||i(t,G)&&t[G][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=D(x(t)),r=[],o=0;n.length>o;)i(F,e=n[o++])||e==G||e==s||r.push(e);return r},tt=function(t){for(var e,n=t===z,r=D(n?B:x(t)),o=[],a=0;r.length>a;)!i(F,e=r[a++])||n&&!i(z,e)||o.push(F[e]);return o};V||(M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(n){this===z&&e.call(B,n),i(this,G)&&i(this[G],t)&&(this[G][t]=!1),X(this,t,E(1,n))};return o&&H&&X(z,t,{configurable:!0,set:e}),q(t)},u(M.prototype,"toString",(function(){return this._k})),T.f=J,N.f=K,n(6907).f=A.f=Q,n(4179).f=$,I.f=tt,o&&!n(2725)&&u(z,"propertyIsEnumerable",$,!0),p.f=function(t){return q(h(t))}),a(a.G+a.W+a.F*!V,{Symbol:M});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)h(et[nt++]);for(var rt=O(h.store),it=0;rt.length>it;)v(rt[it++]);a(a.S+a.F*!V,"Symbol",{for:function(t){return i(U,t+="")?U[t]:U[t]=M(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in U)if(U[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!V,"Object",{create:function(t,e){return void 0===e?S(t):Z(S(t),e)},defineProperty:K,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:tt});var ot=c((function(){I.f(1)}));a(a.S+a.F*ot,"Object",{getOwnPropertySymbols:function(t){return I.f(_(t))}}),R&&a(a.S+a.F*(!V||c((function(){var t=M();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(b(e)||void 0!==t)&&!Y(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,P.apply(R,r)}}),M.prototype[L]||n(913)(M.prototype,L,M.prototype.valueOf),l(M,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},6349:(t,e,n)=>{"use strict";var r=n(7044),i=n(604),o=n(1541),a=n(486),u=n(9260),s=n(8087),c=n(1255),f=n(7571).ArrayBuffer,l=n(8713),d=o.ArrayBuffer,h=o.DataView,p=i.ABV&&f.isView,v=d.prototype.slice,g=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(f!==d),{ArrayBuffer:d}),r(r.S+r.F*!i.CONSTR,y,{isView:function(t){return p&&p(t)||c(t)&&g in t}}),r(r.P+r.U+r.F*n(5338)((function(){return!new d(2).slice(1,void 0).byteLength})),y,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var n=a(this).byteLength,r=u(t,n),i=u(void 0===e?n:e,n),o=new(l(this,d))(s(i-r)),c=new h(this),f=new h(o),p=0;r<i;)f.setUint8(p++,c.getUint8(r++));return o}}),n(4412)(y)},3742:(t,e,n)=>{var r=n(7044);r(r.G+r.W+r.F*!n(604).ABV,{DataView:n(1541).DataView})},3421:(t,e,n)=>{n(1063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6144:(t,e,n)=>{n(1063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9363:(t,e,n)=>{n(1063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},8632:(t,e,n)=>{n(1063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9604:(t,e,n)=>{n(1063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3871:(t,e,n)=>{n(1063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(1063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2592:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9290:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},2214:(t,e,n)=>{"use strict";var r,i=n(7571),o=n(7622)(0),a=n(6476),u=n(4278),s=n(4643),c=n(1990),f=n(1255),l=n(4664),d=n(4664),h=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",v=u.getWeak,g=Object.isExtensible,y=c.ufstore,m=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(t){if(f(t)){var e=v(t);return!0===e?y(l(this,p)).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,p),t,e)}},_=t.exports=n(859)(p,m,b,c,!0,!0);d&&h&&(s((r=c.getConstructor(m,p)).prototype,b),u.NEED=!0,o(["delete","has","get","set"],(function(t){var e=_.prototype,n=e[t];a(e,t,(function(e,i){if(f(e)&&!g(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)}))})))},498:(t,e,n)=>{"use strict";var r=n(1990),i=n(4664),o="WeakSet";n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,o),t,!0)}},r,!1,!0)},7744:(t,e,n)=>{"use strict";var r=n(7044),i=n(6806),o=n(7583),a=n(8087),u=n(1464),s=n(6699);r(r.P,"Array",{flatMap:function(t){var e,n,r=o(this);return u(t),e=a(r.length),n=s(r,0),i(n,r,r,e,0,1,t,arguments[1]),n}}),n(4691)("flatMap")},5448:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)("includes")},8938:(t,e,n)=>{var r=n(7044),i=n(6460)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},7819:(t,e,n)=>{var r=n(7044),i=n(8125),o=n(8182),a=n(5385),u=n(1395);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),s=a.f,c=i(r),f={},l=0;c.length>l;)void 0!==(n=s(r,e=c[l++]))&&u(f,e,n);return f}})},6572:(t,e,n)=>{var r=n(7044),i=n(6460)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},8228:(t,e,n)=>{"use strict";var r=n(7044),i=n(2845),o=n(7571),a=n(8713),u=n(909);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return u(e,t()).then((function(){return n}))}:t,n?function(n){return u(e,t()).then((function(){throw n}))}:t)}})},3336:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},3718:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},7831:(t,e,n)=>{"use strict";n(4961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},6642:(t,e,n)=>{"use strict";n(4961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9956:(t,e,n)=>{n(6262)("asyncIterator")},4367:(t,e,n)=>{for(var r=n(163),i=n(9804),o=n(6476),a=n(7571),u=n(913),s=n(9740),c=n(341),f=c("iterator"),l=c("toStringTag"),d=s.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(h),v=0;v<p.length;v++){var g,y=p[v],m=h[y],b=a[y],_=b&&b.prototype;if(_&&(_[f]||u(_,f,d),_[l]||u(_,l,y),s[y]=d,m))for(g in r)_[g]||o(_,g,r[g],!0)}},4433:(t,e,n)=>{var r=n(7044),i=n(7225);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},110:(t,e,n)=>{var r=n(7571),i=n(7044),o=n(2541),a=[].slice,u=/MSIE .\./.test(o),s=function(t){return function(e,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,n)}};i(i.G+i.B+i.F*u,{setTimeout:s(r.setTimeout),setInterval:s(r.setInterval)})},4962:(t,e,n)=>{n(110),n(4433),n(4367),t.exports=n(2845)},5229:t=>{t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},8356:t=>{t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}},5375:t=>{t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},3422:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},5128:t=>{t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},134:t=>{t.exports=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}},7223:(t,e,n)=>{t.exports=n(2274)},2274:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},6770:(t,e,n)=>{t.exports=n(236)},236:t=>{t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},6064:t=>{t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},2157:t=>{t.exports=1e-6},6922:(t,e,n)=>{t.exports=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r*Math.max(1,Math.abs(i),Math.abs(a))};var r=n(2157)},6066:t=>{t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},4860:t=>{t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},7395:(t,e,n)=>{t.exports=function(t,e,n,i,o,a){var u,s;for(e||(e=2),n||(n=0),s=i?Math.min(i*e+n,t.length):t.length,u=n;u<s;u+=e)r[0]=t[u],r[1]=t[u+1],o(r,r,a),t[u]=r[0],t[u+1]=r[1];return t};var r=n(5128)()},4697:t=>{t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},7801:(t,e,n)=>{t.exports={EPSILON:n(2157),create:n(5128),clone:n(5375),fromValues:n(4697),copy:n(3422),set:n(6765),equals:n(6922),exactEquals:n(6066),add:n(5229),subtract:n(4186),sub:n(5302),multiply:n(3848),mul:n(1665),divide:n(236),div:n(6770),inverse:n(1873),min:n(6780),max:n(9564),rotate:n(8615),floor:n(4860),ceil:n(8356),round:n(7313),scale:n(6526),scaleAndAdd:n(7781),distance:n(2274),dist:n(7223),squaredDistance:n(6534),sqrDist:n(4969),length:n(360),len:n(2256),squaredLength:n(5476),sqrLen:n(508),negate:n(388),normalize:n(5927),dot:n(6064),cross:n(134),lerp:n(1099),random:n(679),transformMat2:n(367),transformMat2d:n(655),transformMat3:n(2730),transformMat4:n(4020),forEach:n(7395),limit:n(8709)}},1873:t=>{t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},2256:(t,e,n)=>{t.exports=n(360)},360:t=>{t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},1099:t=>{t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}},8709:t=>{t.exports=function(t,e,n){var r=e[0]*e[0]+e[1]*e[1];if(r>n*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},9564:t=>{t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},6780:t=>{t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}},1665:(t,e,n)=>{t.exports=n(3848)},3848:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},388:t=>{t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},5927:t=>{t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t}},679:t=>{t.exports=function(t,e){e=e||1;var n=2*Math.random()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}},8615:t=>{t.exports=function(t,e,n){var r=Math.cos(n),i=Math.sin(n),o=e[0],a=e[1];return t[0]=o*r-a*i,t[1]=o*i+a*r,t}},7313:t=>{t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},6526:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},7781:t=>{t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},6765:t=>{t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},4969:(t,e,n)=>{t.exports=n(6534)},508:(t,e,n)=>{t.exports=n(5476)},6534:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},5476:t=>{t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},5302:(t,e,n)=>{t.exports=n(4186)},4186:t=>{t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},367:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}},655:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}},2730:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}},4020:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},3039:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Symbol.for("INJECTION");function r(t,e,r,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(n,this,e)&&Reflect.defineMetadata(n,r(),this,e),Reflect.hasMetadata(n,this,e)?Reflect.getMetadata(n,this,e):r()},set:function(t){Reflect.defineMetadata(n,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,i){return function(o,a){r(o,a,(function(){return t.getNamed(n,i)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,i,o){return function(a,u){r(a,u,(function(){return t.getTagged(n,i,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.getAll(n)}),e)}}}},1922:(t,e,n)=>{"use strict";var r=n(3039);e.Z=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},626:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(6078),i=n(295);function o(t,e,n,i,o){var a={},u="number"==typeof o,s=void 0!==o&&u?o.toString():n;if(u&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[s];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var d=l[f];if(d.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+d.key.toString())}else c=[];c.push(i),a[s]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function u(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([u(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},6213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(6078),i=n(295),o=n(5092),a=n(626),u=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=u,e.inject=function(t){return function(e,n,u){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var s=new o.Metadata(i.INJECT_TAG,t);"number"==typeof u?a.tagParameter(e,n,u,s):a.tagProperty(e,n,s)}}},1773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(6078),i=n(295);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},1528:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(295),i=n(5092),o=n(626);e.multiInject=function(t){return function(e,n,a){var u=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},9817:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(295),i=n(5092),o=n(626);e.named=function(t){return function(e,n,a){var u=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},1316:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(295),i=n(5092),o=n(626);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},1971:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(6078),i=n(295),o=n(5092);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},9189:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(5092),i=n(626);e.tagged=function(t,e){return function(n,o,a){var u=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,u):i.tagProperty(n,o,u)}}},8245:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(295),i=n(5092),o=n(626);e.targetName=function(t){return function(e,n,a){var u=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,u)}}},9235:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(295),i=n(5092),o=n(626);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},683:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(7690),i=n(23),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===r.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},3497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},6078:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]},e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},7690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0,e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"},e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},295:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]},596:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var a=n(683),u=n(6078),s=n(7690),c=n(295),f=n(3870),l=n(4142),d=n(9386),h=n(3313),p=n(23),v=n(9552),g=n(1878),y=n(2543),m=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+u.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=p.id(),this._bindingDictionary=new y.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var a=new t,u=o([e,n],r).map((function(t){return l.getBindingDictionary(t)})),s=l.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return u.forEach((function(t){c(t,s)})),a},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return n<r.length?(o=r[n],a=e(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||s.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new h.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(u.CANNOT_UNBIND+" "+v.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new y.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,c.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=l.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(g.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(u.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,c.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,c.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(u.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=l.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),d.resolve(n)}},t}();e.Container=m},2913:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(23);e.ContainerModule=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=r.id(),this.registry=t}},1878:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n},2543:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(6078),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},9311:(t,e,n)=>{"use strict";e.f3=e.t6=e.b2=e.W2=void 0,n(295);var r=n(596);Object.defineProperty(e,"W2",{enumerable:!0,get:function(){return r.Container}});n(7690),n(2913);var i=n(1773);Object.defineProperty(e,"b2",{enumerable:!0,get:function(){return i.injectable}});n(9189);var o=n(9817);Object.defineProperty(e,"t6",{enumerable:!0,get:function(){return o.named}});var a=n(6213);Object.defineProperty(e,"f3",{enumerable:!0,get:function(){return a.inject}});n(1316),n(9235),n(1528),n(8245),n(1971),n(3870),n(23),n(626),n(3140),n(9552),n(4384)},1519:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(23),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},5092:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(295),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},3870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(295),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},6335:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}},4142:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(3497),i=n(6078),o=n(7690),a=n(295),u=n(2542),s=n(9552),c=n(1519),f=n(5092),l=n(6335),d=n(6664),h=n(4810),p=n(9660);function v(t){return t._bindingDictionary}function g(t,e,n,o,a){var u,c=m(n.container,a.serviceIdentifier);return c.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),c=m(n.container,a.serviceIdentifier)),u=e?c:c.filter((function(t){var e=new h.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=s.getServiceIdentifierAsString(t),u=i.NOT_REGISTERED;throw u+=s.listMetadataForTarget(a,n),u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;throw a=s.getServiceIdentifierAsString(t),u=i.AMBIGUOUS_MATCH+" "+a,u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u)}}(a.serviceIdentifier,u,a,n.container),u}function y(t,e,n,r,a,u){var s,c;if(null===a){s=g(t,e,r,null,u),c=new h.Request(n,r,null,s,u);var f=new l.Plan(r,c);r.addPlan(f)}else s=g(t,e,r,a,u),c=a.addChildRequest(u.serviceIdentifier,s,u);s.forEach((function(e){var n=null;if(u.isArray())n=c.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=c}if(e.type===o.BindingTypeEnum.Instance&&null!==e.implementationType){var a=d.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks){var s=d.getBaseClassDependencyCount(t,e.implementationType);if(a.length<s){var f=i.ARGUMENTS_LENGTH_MISMATCH(d.getFunctionName(e.implementationType));throw new Error(f)}}a.forEach((function(e){y(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function m(t,e){var n=[],r=v(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=m(t.parent,e)),n}e.getBindingDictionary=v,e.plan=function(t,e,n,r,i,o,l,d){void 0===d&&(d=!1);var h=new c.Context(e),v=function(t,e,n,r,i,o){var u=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,s=new f.Metadata(u,n),c=new p.Target(e,"",n,s);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}(n,r,i,0,o,l);try{return y(t,d,i,h,null,v),h}catch(t){throw u.isStackOverflowExeption(t)&&h.plan&&s.circularDependencyToException(h.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new p.Target(o.TargetTypeEnum.Variable,"",e,new f.Metadata(n,r)),a=new c.Context(t);return new h.Request(e,a,null,[],i)}},8634:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n},6664:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0;var i=n(6213),o=n(6078),a=n(7690),u=n(295),s=n(9552);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return s.getFunctionName}});var c=n(9660);function f(t,e,n,i){var a=t.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(void 0===u){var s=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(s)}var c=a.userGeneratedMetadata,f=Object.keys(c),h=0===n.length&&f.length>0,p=f.length>n.length,v=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var u=l(a,t,e,n,r);null!==u&&o.push(u)}return o}(i,e,u,c,h||p?f.length:n.length),g=d(t,n);return r(r([],v),g)}function l(t,e,n,r,u){var s=u[t.toString()]||[],f=h(s),l=!0!==f.unmanaged,d=r[t];if((d=f.inject||f.multiInject||d)instanceof i.LazyServiceIdentifer&&(d=d.unwrap()),l){if(!e&&(d===Object||d===Function||void 0===d)){var p=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(p)}var v=new c.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,d);return v.metadata=s,v}return null}function d(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,u=Object.keys(n);o<u.length;o++){var s=u[o],f=n[s],l=h(n[s]),p=l.targetName||s,v=l.inject||l.multiInject,g=new c.Target(a.TargetTypeEnum.ClassProperty,p,v);g.metadata=f,i.push(g)}var y=Object.getPrototypeOf(e.prototype).constructor;if(y!==Object){var m=d(t,y);i=r(r([],i),m)}return i}function h(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[u.INJECT_TAG],multiInject:e[u.MULTI_INJECT_TAG],targetName:e[u.NAME_TAG],unmanaged:e[u.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return f(t,s.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=f(e,s.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===u.UNMANAGED_TAG}))})),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:t(e,r)}return 0}},4810:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(23),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},9660:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(295),i=n(23),o=n(5092),a=n(8634),u=function(){function t(t,e,n,u){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var s=null;"string"==typeof u?s=new o.Metadata(r.NAMED_TAG,u):u instanceof o.Metadata&&(s=u),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++)if(n[e].key===t)return!0;return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=u},8544:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0;var i=n(6078),o=n(7690),a=n(295);e.resolveInstance=function(t,e,n){var u,s,c=null;e.length>0?(s=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n),c=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(c=new((u=t).bind.apply(u,r([void 0],s))),e,n)):c=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,c),c}},9386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(6078),i=n(7690),o=n(2542),a=n(9552),u=n(8544),s=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},c=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,f=e.target&&e.target.isArray(),l=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(f&&l)return o.map((function(e){return c(t)(e)}));var d=null;if(!e.target.isOptional()||0!==n.length){var h=n[0],p=h.scope===i.BindingScopeEnum.Singleton,v=h.scope===i.BindingScopeEnum.Request;if(p&&h.activated)return h.cache;if(v&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===i.BindingTypeEnum.ConstantValue)d=h.cache,h.activated=!0;else if(h.type===i.BindingTypeEnum.Function)d=h.cache,h.activated=!0;else if(h.type===i.BindingTypeEnum.Constructor)d=h.implementationType;else if(h.type===i.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)d=s("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===i.BindingTypeEnum.Factory&&null!==h.factory)d=s("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===i.BindingTypeEnum.Provider&&null!==h.provider)d=s("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==i.BindingTypeEnum.Instance||null===h.implementationType){var g=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+g)}d=u.resolveInstance(h.implementationType,o,c(t))}return"function"==typeof h.onActivation&&(d=h.onActivation(e.parentContext,d)),p&&(h.cache=d,h.activated=!0),v&&null!==t&&!t.has(h.id)&&t.set(h.id,d),d}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},1640:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(7690),i=n(6890),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},2386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(1640),i=n(8926),o=n(2700),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},8926:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(2700),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},3313:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(6078),i=n(7690),o=n(2386),a=n(6890),u=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=u},6890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(8926),i=n(2700),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},2700:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(8926),i=n(3140),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},3140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(295),i=n(5092),o=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||o(n,e))};e.traverseAncerstors=o;var a=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=a;var u=a(r.NAMED_TAG);e.namedConstraint=u,e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},4384:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0,e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},2542:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(6078);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},23:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},9552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0;var r=n(6078);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||o(t.parentRequest,e))}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=i,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(o(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=i(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=a},1739:(t,e,n)=>{var r=n(5229),i=n(6765),o=n(5927),a=n(4186),u=n(6064),s=[0,0];t.exports.x7=function(t,e,n,a,c){return r(t,n,a),o(t,t),i(e,-t[1],t[0]),i(s,-n[1],n[0]),c/u(e,s)},t.exports.mJ=function(t,e){return i(t,-e[1],e[0]),t},t.exports.o7=function(t,e,n){return a(t,e,n),o(t,t),t}},8892:(t,e,n)=>{var r;!function(t){!function(e){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!o&&!a,s={create:o?function(){return P(Object.create(null))}:a?function(){return P({__proto__:null})}:function(){return P({})},has:u?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:u?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),f="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,l=f||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}():Map,d=f||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new l}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}():Set,h=new(f||"function"!=typeof WeakMap?function(){var t=s.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&s.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?s.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var e;do{e="@@WeakMap@@"+a()}while(s.has(t,e));return t[e]=!0,e}function i(t,r){if(!e.call(t,n)){if(!r)return;Object.defineProperty(t,n,{value:s.create()})}return t[n]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<16;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function p(t,e,n){var r=h.get(t);if(E(r)){if(!n)return;r=new l,h.set(t,r)}var i=r.get(e);if(E(i)){if(!n)return;i=new l,r.set(e,i)}return i}function v(t,e,n){if(g(t,e,n))return!0;var r=R(e);return!S(r)&&v(t,r,n)}function g(t,e,n){var r=p(e,n,!1);return!E(r)&&!!r.has(t)}function y(t,e,n){if(g(t,e,n))return m(t,e,n);var r=R(e);return S(r)?void 0:y(t,r,n)}function m(t,e,n){var r=p(e,n,!1);if(!E(r))return r.get(t)}function b(t,e,n,r){p(n,r,!0).set(t,e)}function _(t,e){var n=x(t,e),r=R(t);if(null===r)return n;var i=_(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new d,a=[],u=0,s=n;u<s.length;u++){var c=s[u];o.has(c)||(o.add(c),a.push(c))}for(var f=0,l=i;f<l.length;f++)c=l[f],o.has(c)||(o.add(c),a.push(c));return a}function x(t,e){var n=[],r=p(t,e,!1);if(E(r))return n;for(var o=function(t){var e=k(t,i);if(!O(e))throw new TypeError;var n=e.call(t);if(!A(n))throw new TypeError;return n}(r.keys()),a=0;;){var u=D(o);if(!u)return n.length=a,n;var s=u.value;try{n[a]=s}catch(t){try{M(o)}finally{throw t}}a++}}function w(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function S(t){return null===t}function A(t){return"object"==typeof t?null!==t:"function"==typeof t}function T(t,e){switch(w(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=k(t,r);if(void 0!==i){var o=i.call(t,n);if(A(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(O(n)&&!A(i=n.call(t)))return i;if(O(r=t.valueOf)&&!A(i=r.call(t)))return i}else{var r;if(O(r=t.valueOf)&&!A(i=r.call(t)))return i;var i,o=t.toString;if(O(o)&&!A(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function I(t){var e=T(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function N(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function O(t){return"function"==typeof t}function C(t){return"function"==typeof t}function k(t,e){var n=t[e];if(null!=n){if(!O(n))throw new TypeError;return n}}function D(t){var e=t.next();return!e.done&&e}function M(t){var e=t.return;e&&e.call(t)}function R(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function P(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,n,r){if(E(n)){if(!N(t))throw new TypeError;if(!C(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!E(r)&&!S(r)){if(!C(r))throw new TypeError;e=r}}return e}(t,e)}if(!N(t))throw new TypeError;if(!A(e))throw new TypeError;if(!A(r)&&!E(r)&&!S(r))throw new TypeError;return S(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!E(o)&&!S(o)){if(!A(o))throw new TypeError;r=o}}return r}(t,e,n=I(n),r)})),t("metadata",(function(t,e){return function(n,r){if(!A(n))throw new TypeError;if(!E(r)&&!function(t){switch(w(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),t("defineMetadata",(function(t,e,n,r){if(!A(n))throw new TypeError;return E(r)||(r=I(r)),b(t,e,n,r)})),t("hasMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),v(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),g(t,e,n)})),t("getMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),y(t,e,n)})),t("getOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),m(t,e,n)})),t("getMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),x(t,e)})),t("deleteMetadata",(function(t,e,n){if(!A(e))throw new TypeError;E(n)||(n=I(n));var r=p(e,n,!1);if(E(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=h.get(e);return i.delete(n),i.size>0||h.delete(e),!0}))}(i)}()}(r||(r={}))},405:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),a=new N(r||[]);return o._invoke=function(t,e,n){var r=l;return function(i,o){if(r===h)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=A(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var s=f(t,e,n);if("normal"===s.type){if(r=n.done?p:d,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=p,n.method="throw",n.arg=s.arg)}}}(t,n,a),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",d="suspendedYield",h="executing",p="completed",v={};function g(){}function y(){}function m(){}var b={};s(b,o,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(O([])));x&&x!==n&&r.call(x,o)&&(b=x);var w=m.prototype=g.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,u){var s=f(t[i],t,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function A(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=f(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:C}}function C(){return{value:e,done:!0}}return y.prototype=m,s(w,"constructor",m),s(m,"constructor",y),y.displayName=s(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},E(S.prototype),s(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(w),s(w,u,"Generator"),s(w,o,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:O(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},6377:function(t){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},n="\n";function r(t){var e=new Error("(regl) "+t);throw console.error(e),e}function i(t,e){t||r(e)}function o(t){return t?": "+t:""}function a(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"==typeof t;case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"==typeof t}}function u(t,e,n){e.indexOf(t)<0&&r("invalid value"+o(n)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function d(t,e,n){this.file=t,this.line=e,this.message=n}function h(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function v(t,e){var n,r=t.split("\n"),i=1,o=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||h(),a.unknown.lines.push(new l(0,""));for(var u=0;u<r.length;++u){var s=r[u],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(s);if(c)switch(c[1]){case"line":var d=/(\d+)(\s+\d+)?/.exec(c[2]);d&&(i=0|d[1],d[2]&&((o=0|d[2])in a||(a[o]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new l(i++,s))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function g(t){t._commandRef=h()}function y(t,e){var n=p();r(t+" in command "+(e||h())+("unknown"===n?"":" called from "+n))}function m(t,e,n,r){a(t,e)||y("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t,r||h())}var b=33071,_={};function x(t,e){return 32820===t||32819===t||33635===t?2:34042===t?4:_[t]*e}function w(t){return!(t&t-1||!t)}_[5120]=_[5121]=1,_[5122]=_[5123]=_[36193]=_[33635]=_[32819]=_[32820]=2,_[5124]=_[5125]=_[5126]=_[34042]=4;var E=e(i,{optional:function(t){t()},raise:r,commandRaise:y,command:function(t,e,n){t||y(e,n||h())},parameter:function(t,e,n){t in e||r("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||y("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join(),r||h())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&r('invalid regl constructor argument "'+t+'". must be one of '+s)}))},type:function(t,e,n){a(t,e)||r("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t)},commandType:m,isTypedArray:function(e,n){t(e)||r("invalid parameter type"+o(n)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||r("invalid parameter type, ("+t+")"+o(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,r,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var u=t.getShaderInfoLog(e),s=o===t.FRAGMENT_SHADER?"fragment":"vertex";m(r,"string",s+" shader source must be a string",a);var f=v(r,a),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new d(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new d("unknown",0,t))}})),e}(u);(function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))})(f,l),Object.keys(f).forEach((function(t){var e=f[t];if(e.hasErrors){var r=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+n,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(r){var i=r.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var u=a[1];i=a[2],"assign"===u&&(u="="),e=Math.max(t.line.indexOf(u,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+n,"font-weight:bold"),o(c("| ",6)),o(i+n,"font-weight:bold")})),o(c("| ",6)+n)}else o(c(t.number,4)+"| "),o(t.line+n,"color:red")})),"undefined"==typeof document||window.chrome?console.log(r.join("")):(i[0]=r.join("%c"),console.log.apply(console,i))}function o(t,e){r.push(t),i.push(e||"")}})),i.raise("Error compiling "+s+" shader, "+f[0].name)}},linkError:function(t,e,r,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var u=t.getProgramInfoLog(e),s=v(r,a),c='Error linking program with vertex shader, "'+v(o,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+u,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+u),i.raise(c)}},callSite:p,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var u=t._attributeSet={};o(u,n.static),o(u,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:h,texture2D:function(t,e,n){var r,o=e.width,a=e.height,u=e.channels;i(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),t.wrapS===b&&t.wrapT===b||i(w(o)&&w(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&i(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(i(w(o)&&w(a),"texture must be a square power of 2 to support mipmapping"),i(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&i(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),i(!t.genMipmaps,"mipmap generation not supported with float textures"));var s=e.images;for(r=0;r<16;++r)if(s[r]){var c=o>>r,f=a>>r;i(e.mipmask&1<<r,"missing mipmap data");var l=s[r];if(i(l.width===c&&l.height===f,"invalid shape for mip images"),i(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var d=Math.ceil(x(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;i(l.data.byteLength===d*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||i(0==(e.mipmask&1<<r),"extra mipmap data");e.compressed&&i(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,r){var o=t.width,a=t.height,u=t.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(e.wrapS===b&&e.wrapT===b,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];i(c.width===o&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(i(!c.compressed,"can not generate mipmap for compressed textures"),i(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var d=f[l];if(d){var h=o>>l,p=a>>l;i(c.mipmask&1<<l,"missing mipmap data"),i(d.width===h&&d.height===p,"invalid shape for mip images"),i(d.format===t.format&&d.internalformat===t.internalformat&&d.type===t.type,"incompatible type for mip image"),d.compressed||(d.data?i(d.data.byteLength===h*p*Math.max(x(d.type,u),d.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):d.element||d.copy)}}}}}),S=0;function A(t,e){this.id=S++,this.type=t,this.data=e}function T(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function I(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+T(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return I(t.substr(0,r.index)).concat(I(r[1])).concat(I(t.substr(r.index+r[0].length)));var i=t.split(".");if(1===i.length)return['"'+T(t)+'"'];for(var o=[],a=0;a<i.length;++a)o=o.concat(I(i[a]));return o}function N(t){return"["+I(t).join("][")+"]"}var O={DynamicVariable:A,define:function(t,e){return new A(t,N(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof A},unbox:function t(e,n){return"function"==typeof e?new A(0,e):"number"==typeof e||"boolean"==typeof e?new A(5,e):Array.isArray(e)?new A(6,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof A?e:void E(!1,"invalid option type in uniform "+n)},accessor:N},C={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},k="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function D(t){return"string"==typeof t?t.split():(E(Array.isArray(t),"invalid extension array"),t)}function M(t){return"string"==typeof t?(E("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function R(t){var n,r,i,o,a,u=t||{},s={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,d=!1,h=function(t){t&&E.raise(t)},p=function(){};if("string"==typeof u?(E("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),E(n,"invalid query string for element")):"object"==typeof u?"string"==typeof(a=u).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=u:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(u)?i=(o=u).canvas:(E.constructor(u),"gl"in u?o=u.gl:"canvas"in u?i=M(u.canvas):"container"in u&&(r=M(u.container)),"attributes"in u&&(s=u.attributes,E.type(s,"object","invalid context attributes")),"extensions"in u&&(c=D(u.extensions)),"optionalExtensions"in u&&(f=D(u.optionalExtensions)),"onDone"in u&&(E.type(u.onDone,"function","invalid or missing onDone callback"),h=u.onDone),"profile"in u&&(d=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,E(l>0,"invalid pixel ratio"))):E.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){E("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,l);if(!v)return null;i=v.canvas,p=v.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,s)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:f,pixelRatio:l,profile:d,onDone:h,onDestroy:p}:(p(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function G(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function L(){var t=P(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[G(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[G(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var j=L();j.zero=L();var U=3553,F=6408,B=5126,z=36160;function V(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var W=function(t){return Object.keys(t).map((function(e){return t[e]}))},H={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||j.allocType(n,i);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var i=0,o=0;o<e;++o)for(var a=t[o],u=0;u<n;++u)r[i++]=a[u]}(t,e[0],e[1],a);break;case 3:X(t,e[0],e[1],e[2],a,0);break;default:q(t,e,0,a,0)}return a}};function X(t,e,n,r,i,o){for(var a=o,u=0;u<e;++u)for(var s=t[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)i[a++]=f[l]}function q(t,e,n,r,i){for(var o=1,a=n+1;a<e.length;++a)o*=e[a];var u=e[n];if(e.length-n==4){var s=e[n+1],c=e[n+2],f=e[n+3];for(a=0;a<u;++a)X(t[a],s,c,f,r,i),i+=o}else for(a=0;a<u;++a)q(t[a],e,n+1,r,i),i+=o}var Y={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Z={dynamic:35048,stream:35040,static:35044},$=H.flatten,J=H.shape,Q=5121,tt=5126,et=[];function nt(t){return 0|Y[Object.prototype.toString.call(t)]}function rt(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function it(t,e,n,r,i,o,a){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)t[u++]=e[i*s+o*c+a]}et[5120]=1,et[5122]=2,et[5124]=4,et[5121]=1,et[5123]=2,et[5125]=4,et[5126]=4;var ot={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},at=5121,ut=5123,st=5125,ct=34963;var ft=new Float32Array(1),lt=new Uint32Array(ft.buffer);function dt(t){for(var e=j.allocType(5123,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{ft[0]=t[n];var r=lt[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var u=-14-o;e[n]=i+(a+1024>>u)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function ht(e){return Array.isArray(e)||t(e)}var pt=function(t){return!(t&t-1||!t)},vt=3553,gt=34067,yt=34069,mt=6408,bt=6406,_t=6407,xt=6409,wt=6410,Et=32855,St=6402,At=34041,Tt=35904,It=35906,Nt=36193,Ot=33776,Ct=33777,kt=33778,Dt=33779,Mt=5121,Rt=5123,Pt=5125,Gt=5126,Lt=33071,jt=9728,Ut=9984,Ft=9987,Bt=4352,zt=33984,Vt=[Ut,9986,9985,Ft],Wt=[0,xt,wt,_t,mt],Ht={};function Xt(t){return"[object "+t+"]"}Ht[6409]=Ht[6406]=Ht[6402]=1,Ht[34041]=Ht[6410]=2,Ht[6407]=Ht[35904]=3,Ht[6408]=Ht[35906]=4;var qt=Xt("HTMLCanvasElement"),Yt=Xt("OffscreenCanvas"),Kt=Xt("CanvasRenderingContext2D"),Zt=Xt("ImageBitmap"),$t=Xt("HTMLImageElement"),Jt=Xt("HTMLVideoElement"),Qt=Object.keys(Y).concat([qt,Yt,Kt,Zt,$t,Jt]),te=[];te[5121]=1,te[5126]=4,te[36193]=2,te[5123]=2,te[5125]=4;var ee=[];function ne(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function re(t){return!!Array.isArray(t)&&!(0===t.length||!ht(t[0]))}function ie(t){return Object.prototype.toString.call(t)}function oe(t){return ie(t)===qt}function ae(t){return ie(t)===Yt}function ue(t){if(!t)return!1;var e=ie(t);return Qt.indexOf(e)>=0||ne(t)||re(t)||V(t)}function se(t){return 0|Y[Object.prototype.toString.call(t)]}function ce(t,e){return j.allocType(t.type===Nt?Gt:t.type,e)}function fe(t,e){t.type===Nt?(t.data=dt(e),j.freeType(e)):t.data=e}function le(t,e,n,r,i,o){var a;if(a=void 0!==ee[t]?ee[t]:Ht[t]*te[e],o&&(a*=6),i){for(var u=0,s=n;s>=1;)u+=a*s*s,s/=2;return u}return a*n*r}function de(n,r,i,o,a,u,s){var c={"don't care":Bt,"dont care":Bt,nice:4354,fast:4353},f={repeat:10497,clamp:Lt,mirror:33648},l={nearest:jt,linear:9729},d=e({mipmap:Ft,"nearest mipmap nearest":Ut,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":Ft},l),h={none:0,browser:37444},p={uint8:Mt,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:bt,luminance:xt,"luminance alpha":wt,rgb:_t,rgba:mt,rgba4:32854,"rgb5 a1":Et,rgb565:36194},g={};r.ext_srgb&&(v.srgb=Tt,v.srgba=It),r.oes_texture_float&&(p.float32=p.float=Gt),r.oes_texture_half_float&&(p.float16=p["half float"]=Nt),r.webgl_depth_texture&&(e(v,{depth:St,"depth stencil":At}),e(p,{uint16:Rt,uint32:Pt,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":Ot,"rgba s3tc dxt1":Ct,"rgba s3tc dxt3":kt,"rgba s3tc dxt5":Dt}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(n.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(v[t]=e)}));var m=Object.keys(v);i.textureFormats=m;var b=[];Object.keys(v).forEach((function(t){var e=v[t];b[e]=t}));var _=[];Object.keys(p).forEach((function(t){var e=p[t];_[e]=t}));var x=[];Object.keys(l).forEach((function(t){x[l[t]]=t}));var w=[];Object.keys(d).forEach((function(t){var e=d[t];w[e]=t}));var S=[];Object.keys(f).forEach((function(t){S[f[t]]=t}));var A=m.reduce((function(t,e){var n=v[e];return n===xt||n===bt||n===xt||n===wt||n===St||n===At||r.ext_srgb&&(n===Tt||n===It)?t[n]=n:n===Et||e.indexOf("rgba")>=0?t[n]=mt:t[n]=_t,t}),{});function T(){this.internalformat=mt,this.format=mt,this.type=Mt,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function N(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(E.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(E.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(E.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(E.parameter(e.colorSpace,h,"invalid colorSpace"),t.colorSpace=h[e.colorSpace]),"type"in e){var n=e.type;E(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),E(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),E(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(n,p,"invalid texture type"),t.type=p[n]}var o=t.width,a=t.height,u=t.channels,s=!1;"shape"in e?(E(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(u=e.shape[2],E(u>0&&u<=4,"invalid number of channels"),s=!0),E(o>=0&&o<=i.maxTextureSize,"invalid width"),E(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,E(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,E(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,E(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,E(u>0&&u<=4,"invalid number of channels"),s=!0)),t.width=0|o,t.height=0|a,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;E(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(f,v,"invalid texture format");var l=t.internalformat=v[f];t.format=A[l],f in p&&("type"in e||(t.type=p[f])),f in g&&(t.compressed=!0),c=!0}!s&&c?t.channels=Ht[t.format]:s&&!c?t.channels!==Wt[t.format]&&(t.format=t.internalformat=Wt[t.channels]):c&&s&&E(t.channels===Ht[t.format],"number of channels inconsistent with specified format")}}function O(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function C(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function k(e,n){var r=null;if(ue(n)?r=n:n&&(E.type(n,"object","invalid pixel data type"),N(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),ue(n.data)&&(r=n.data)),E(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){E(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,u=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||u-e.yOffset,e.needsCopy=!0,E(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<u&&e.width>0&&e.width<=o&&e.height>0&&e.height<=u,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||e.type!==Mt||(e.type=se(r));else if(ne(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case Mt:case Rt:case Pt:case Gt:var r=j.allocType(t.type,n);r.set(e),t.data=r;break;case Nt:t.data=dt(e);break;default:E.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(V(r)){var s=r.data;Array.isArray(s)||e.type!==Mt||(e.type=se(s));var c,f,l,d,h,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(E(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=v[0],f=v[1],d=g[0],h=g[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=Wt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,u=t.height,s=t.channels,c=ce(t,a*u*s),f=0,l=0;l<u;++l)for(var d=0;d<a;++d)for(var h=0;h<s;++h)c[f++]=e[n*d+r*l+i*h+o];fe(t,c)}(e,s,d,h,p,r.offset)}else if(oe(r)||ae(r)||ie(r)===Kt)oe(r)||ae(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return ie(t)===Zt}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return ie(t)===$t}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return ie(t)===Jt}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(re(r)){var y=e.width||r[0].length,m=e.height||r.length,b=e.channels;b=ht(r[0][0])?b||r[0][0].length:b||1;for(var _=H.shape(r),x=1,w=0;w<_.length;++w)x*=_[w];var S=ce(e,x);H.flatten(r,_,"",S),fe(e,S),e.alignment=1,e.width=y,e.height=m,e.channels=b,e.format=e.internalformat=Wt[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===Gt?E(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===Nt&&E(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function D(t,e,r){var i=t.element,a=t.data,u=t.internalformat,s=t.format,c=t.type,f=t.width,l=t.height;O(t),i?n.texImage2D(e,r,s,s,c,i):t.compressed?n.compressedTexImage2D(e,r,u,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,s,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,s,f,l,0,s,c,a||null)}function M(t,e,r,i,a){var u=t.element,s=t.data,c=t.internalformat,f=t.format,l=t.type,d=t.width,h=t.height;O(t),u?n.texSubImage2D(e,a,r,i,f,l,u):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,d,h,s):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,d,h)):n.texSubImage2D(e,a,r,i,d,h,f,l,s)}var R=[];function P(){return R.pop()||new C}function G(t){t.needsFree&&j.freeType(t.data),C.call(t),R.push(t)}function L(){T.call(this),this.genMipmaps=!1,this.mipmapHint=Bt,this.mipmask=0,this.images=Array(16)}function U(t,e,n){var r=t.images[0]=P();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function F(t,e){var n=null;if(ue(e))I(n=t.images[0]=P(),t),k(n,e),t.mipmask=1;else if(N(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)I(n=t.images[i]=P(),t),n.width>>=i,n.height>>=i,k(n,r[i]),t.mipmask|=1<<i;else I(n=t.images[0]=P(),t),k(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==Ot&&t.internalformat!==Ct&&t.internalformat!==kt&&t.internalformat!==Dt||E(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function B(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;D(n[r],e,r)}}var z=[];function X(){var t=z.pop()||new L;T.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function q(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&G(e[n]),e[n]=null;z.push(t)}function Y(){this.minFilter=jt,this.magFilter=jt,this.wrapS=Lt,this.wrapT=Lt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Bt}function K(t,e){if("min"in e){var n=e.min;E.parameter(n,d),t.minFilter=d[n],Vt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;E.parameter(r,l),t.magFilter=l[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(E.parameter(u,f),o=a=f[u]):Array.isArray(u)&&(E.parameter(u[0],f),E.parameter(u[1],f),o=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;E.parameter(s,f),o=f[s]}if("wrapT"in e){var h=e.wrapT;E.parameter(h,f),a=f[h]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;E("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(typeof e.mipmap){case"string":E.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":E(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:E.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=Ut)}}function Z(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,J={},Q=i.maxTextureUnits,tt=Array(Q).map((function(){return null}));function et(t){T.call(this),this.mipmask=0,this.internalformat=mt,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Y,s.profile&&(this.stats={size:0})}function nt(t){n.activeTexture(zt),n.bindTexture(t.target,t.texture)}function rt(){var t=tt[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(vt,null)}function it(t){var e=t.texture;E(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(zt+r),n.bindTexture(i,null),tt[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete J[t.id],u.textureCount--}return e(et.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<Q;++r){var i=tt[r];if(i){if(i.bindCount>0)continue;i.unit=-1}tt[r]=t,e=r;break}e>=Q&&E.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(zt+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&it(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(J).forEach((function(e){t+=J[e].stats.size})),t}),{create2D:function(t,e){var r=new et(vt);function o(t,e){var n=r.texInfo;Y.call(n);var a=X();return"number"==typeof t?U(a,0|t,"number"==typeof e?0|e:0|t):t?(E.type(t,"object","invalid arguments to regl.texture"),K(n,t),F(a,t)):U(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),E.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,nt(r),B(a,vt),Z(n,vt),rt(),q(a),s.profile&&(r.stats.size=le(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=b[r.internalformat],o.type=_[r.type],o.mag=x[n.magFilter],o.min=w[n.minFilter],o.wrapS=S[n.wrapS],o.wrapT=S[n.wrapT],o}return J[r.id]=r,u.textureCount++,o(t,e),o.subimage=function(t,e,n,i){E(!!t,"must specify image data");var a=0|e,u=0|n,s=0|i,c=P();return I(c,r),c.width=0,c.height=0,k(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,E(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),E(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),E(r.mipmask&1<<s,"missing mipmap data"),E(c.data||c.element||c.needsCopy,"missing image data"),nt(r),M(c,vt,a,u,s),rt(),G(c),o},o.resize=function(t,e){var i=0|t,a=0|e||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,nt(r);for(var u=0;r.mipmask>>u;++u){var c=i>>u,f=a>>u;if(!c||!f)break;n.texImage2D(vt,u,r.format,c,f,0,r.format,r.type,null)}return rt(),s.profile&&(r.stats.size=le(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,s.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,a,c){var f=new et(gt);J[f.id]=f,u.cubeCount++;var l=new Array(6);function d(t,e,n,r,o,a){var u,c=f.texInfo;for(Y.call(c),u=0;u<6;++u)l[u]=X();if("number"!=typeof t&&t)if("object"==typeof t)if(e)F(l[0],t),F(l[1],e),F(l[2],n),F(l[3],r),F(l[4],o),F(l[5],a);else if(K(c,t),N(f,t),"faces"in t){var h=t.faces;for(E(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),u=0;u<6;++u)E("object"==typeof h[u]&&!!h[u],"invalid input for cube map face"),I(l[u],f),F(l[u],h[u])}else for(u=0;u<6;++u)F(l[u],t);else E.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)U(l[u],p,p)}for(I(f,l[0]),i.npotTextureCube||E(pt(f.width)&&pt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(l[0].width<<1)-1:f.mipmask=l[0].mipmask,E.textureCube(f,c,l,i),f.internalformat=l[0].internalformat,d.width=l[0].width,d.height=l[0].height,nt(f),u=0;u<6;++u)B(l[u],yt+u);for(Z(c,gt),rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,d.width,d.height,c.genMipmaps,!0)),d.format=b[f.internalformat],d.type=_[f.type],d.mag=x[c.magFilter],d.min=w[c.minFilter],d.wrapS=S[c.wrapS],d.wrapT=S[c.wrapT],u=0;u<6;++u)q(l[u]);return d}return d(t,e,r,o,a,c),d.subimage=function(t,e,n,r,i){E(!!e,"must specify image data"),E("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,u=0|i,s=P();return I(s,f),s.width=0,s.height=0,k(s,e),s.width=s.width||(f.width>>u)-o,s.height=s.height||(f.height>>u)-a,E(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),E(o>=0&&a>=0&&o+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),E(f.mipmask&1<<u,"missing mipmap data"),E(s.data||s.element||s.needsCopy,"missing image data"),nt(f),M(s,yt+t,o,a,u),rt(),G(s),d},d.resize=function(t){var e=0|t;if(e!==f.width){d.width=f.width=e,d.height=f.height=e,nt(f);for(var r=0;r<6;++r)for(var i=0;f.mipmask>>i;++i)n.texImage2D(yt+r,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=f,s.profile&&(d.stats=f.stats),d.destroy=function(){f.decRef()},d},clear:function(){for(var t=0;t<Q;++t)n.activeTexture(zt+t),n.bindTexture(vt,null),tt[t]=null;W(J).forEach(it),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null)}W(J).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(t.target===vt)n.texImage2D(vt,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(yt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null),n.activeTexture(zt+t),n.bindTexture(vt,null),n.bindTexture(gt,null)}}}}ee[32854]=2,ee[32855]=2,ee[36194]=2,ee[34041]=4,ee[33776]=.5,ee[33777]=.5,ee[33778]=1,ee[33779]=1,ee[35986]=.5,ee[35987]=1,ee[34798]=1,ee[35840]=.5,ee[35841]=.25,ee[35842]=.5,ee[35843]=.25,ee[36196]=.5;var he=36161,pe=32854,ve=[];function ge(t,e,n){return ve[t]*e*n}ve[32854]=2,ve[32855]=2,ve[36194]=2,ve[33189]=2,ve[36168]=1,ve[34041]=4,ve[35907]=4,ve[34836]=16,ve[34842]=8,ve[34843]=6;var ye=36160,me=36161,be=3553,_e=34069,xe=[6407,6408],we=[];we[6408]=4,we[6407]=3;var Ee=[];Ee[5121]=1,Ee[5126]=4,Ee[36193]=2;var Se=[32854,32855,36194,35907,34842,34843,34836],Ae={};Ae[36053]="complete",Ae[36054]="incomplete attachment",Ae[36057]="incomplete dimensions",Ae[36055]="incomplete, missing attachment",Ae[36061]="unsupported";function Te(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}var Ie=5121,Ne=5126;function Oe(e,n,r,i,o,a,u){function s(s){var c;null===n.next?(E(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=Ie):(E(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(E(c===Ie||c===Ne,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===Ne&&E(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):E(c===Ie,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,d=i.framebufferWidth,h=i.framebufferHeight,p=null;t(s)?p=s:s&&(E.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,E(f>=0&&f<i.framebufferWidth,"invalid x offset for regl.read"),E(l>=0&&l<i.framebufferHeight,"invalid y offset for regl.read"),d=0|(s.width||i.framebufferWidth-f),h=0|(s.height||i.framebufferHeight-l),p=s.data||null),p&&(c===Ie?E(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===Ne&&E(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),E(d>0&&d+f<=i.framebufferWidth,"invalid width for read pixels"),E(h>0&&h+l<=i.framebufferHeight,"invalid height for read pixels"),r();var v=d*h*4;return p||(c===Ie?p=new Uint8Array(v):c===Ne&&(p=p||new Float32Array(v))),E.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),E(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(f,l,d,h,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=s(t)})),e}(t):s(t)}}function Ce(t){return Array.prototype.slice.call(t)}function ke(t){return Ce(t).join("")}var De="xyzw".split(""),Me="dither",Re="blend.enable",Pe="blend.color",Ge="blend.equation",Le="blend.func",je="depth.enable",Ue="depth.func",Fe="depth.range",Be="depth.mask",ze="colorMask",Ve="cull.enable",We="cull.face",He="frontFace",Xe="lineWidth",qe="polygonOffset.enable",Ye="polygonOffset.offset",Ke="sample.alpha",Ze="sample.enable",$e="sample.coverage",Je="stencil.enable",Qe="stencil.mask",tn="stencil.func",en="stencil.opFront",nn="stencil.opBack",rn="scissor.enable",on="scissor.box",an="viewport",un="profile",sn="framebuffer",cn="vert",fn="frag",ln="elements",dn="primitive",hn="count",pn="offset",vn="instances",gn="vao",yn="Width",mn="Height",bn=sn+yn,_n=sn+mn,xn="drawingBufferWidth",wn="drawingBufferHeight",En=[Le,Ge,tn,en,nn,$e,an,on,Ye],Sn=34962,An=5126,Tn=35664,In=35665,Nn=35666,On=5124,Cn=35667,kn=35668,Dn=35669,Mn=35670,Rn=35671,Pn=35672,Gn=35673,Ln=35674,jn=35675,Un=35676,Fn=35678,Bn=35680,zn=1028,Vn=1029,Wn=2305,Hn=7680,Xn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},qn=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Yn={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Kn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Zn={frag:35632,vert:35633},$n={cw:2304,ccw:Wn};function Jn(e){return Array.isArray(e)||t(e)||V(e)}function Qn(t){return t.sort((function(t,e){return t===an?-1:e===an?1:t<e?-1:1}))}function tr(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function er(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function nr(t){return new tr(!1,!1,!1,t)}function rr(t,e){var n=t.type;if(0===n){var r=t.data.length;return new tr(!0,r>=1,r>=2,e)}if(4===n){var i=t.data;return new tr(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new tr(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(1===c.type)u=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new tr(o,a,u,e)}return new tr(3===n,2===n,1===n,e)}var ir=new tr(!1,!1,!1,(function(){}));function or(t,n,r,i,o,a,u,s,c,f,l,d,h,p,v){var g=f.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=32775,y.max=32776);var m=r.angle_instanced_arrays,b=r.webgl_draw_buffers,_={dirty:!0,profile:v.profile},x={},w=[],S={},A={};function T(t){return t.replace(".","_")}function I(t,e,n){var r=T(t);w.push(t),x[r]=_[r]=!!n,S[r]=e}function N(t,e,n){var r=T(t);w.push(t),Array.isArray(n)?(_[r]=n.slice(),x[r]=n.slice()):_[r]=x[r]=n,A[r]=e}I(Me,3024),I(Re,3042),N(Pe,"blendColor",[0,0,0,0]),N(Ge,"blendEquationSeparate",[32774,32774]),N(Le,"blendFuncSeparate",[1,0,1,0]),I(je,2929,!0),N(Ue,"depthFunc",513),N(Fe,"depthRange",[0,1]),N(Be,"depthMask",!0),N(ze,ze,[!0,!0,!0,!0]),I(Ve,2884),N(We,"cullFace",Vn),N(He,He,Wn),N(Xe,Xe,1),I(qe,32823),N(Ye,"polygonOffset",[0,0]),I(Ke,32926),I(Ze,32928),N($e,"sampleCoverage",[1,!1]),I(Je,2960),N(Qe,"stencilMask",-1),N(tn,"stencilFunc",[519,0,-1]),N(en,"stencilOpSeparate",[zn,Hn,Hn,Hn]),N(nn,"stencilOpSeparate",[Vn,Hn,Hn,Hn]),I(rn,3089),N(on,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),N(an,an,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var C={gl:t,context:h,strings:n,next:x,current:_,draw:d,elements:a,buffer:o,shader:l,attributes:f.state,vao:f,uniforms:c,framebuffer:s,extensions:r,timer:p,isBufferArgs:Jn},k={primTypes:ot,compareFuncs:Yn,blendFuncs:Xn,blendEquations:y,stencilOps:Kn,glTypes:K,orientationType:$n};E.optional((function(){C.isArrayLike=ht})),b&&(k.backBuffer=[Vn],k.drawBuffer=P(i.maxDrawbuffers,(function(t){return 0===t?[0]:P(t,(function(t){return 36064+t}))})));var D=0;function M(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,Ce(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Ce(arguments)),n.push(";")),e},toString:function(){return ke([r.length>0?"var "+r.join(",")+";":"",ke(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Ce(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),u={};return{global:a,link:function(e){for(var i=0;i<r.length;++i)if(r[i]===e)return n[i];var o="g"+t++;return n.push(o),r.push(e),o},block:i,proc:function(t,n){var r=[];function i(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)i();var s=o(),c=s.toString;return u[t]=e(s,{arg:i,toString:function(){return ke(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var t=ke(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Ce(arguments)),this},else:function(){return r.apply(r,Ce(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),ke(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e=ke(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,i=t.global;t.id=D++,t.batchId="0";var o=r(C),a=t.shared={props:"a0"};Object.keys(C).forEach((function(t){a[t]=i.def(o,".",t)})),E.optional((function(){t.CHECK=r(E),t.commandStr=E.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},k.invalidBlendCombinations=qn}));var u=t.next={},s=t.current={};Object.keys(A).forEach((function(t){Array.isArray(_[t])&&(u[t]=i.def(a.next,".",t),s[t]=i.def(a.current,".",t))}));var c=t.constants={};Object.keys(k).forEach((function(t){c[t]=i.def(JSON.stringify(k[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var l={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in l)return l[e];var i=f.scope[e];return i||(i=f.scope[e]=new g),l[e]=r(i)},t}function R(t,e,u,c,d){var h=t.static,p=t.dynamic;E.optional((function(){var t=[sn,cn,fn,ln,dn,pn,hn,vn,un,gn].concat(w);function e(e){Object.keys(e).forEach((function(e){E.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',d.commandStr)}))}e(h),e(p)}));var v=function(t,e){var n=t.static;if("string"==typeof n[fn]&&"string"==typeof n[cn]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)E("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),b=function(t,e){var n=t.static,r=t.dynamic;if(sn in n){var i=n[sn];return i?(i=s.getFramebuffer(i),E.command(i,"invalid framebuffer object"),nr((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+bn,n+".width"),e.set(o,"."+_n,n+".height"),n}))):nr((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+bn,r+"."+xn),e.set(r,"."+_n,r+"."+wn),"null"}))}if(sn in r){var o=r[sn];return rr(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");E.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var u=r.context;return e.set(u,"."+bn,a+"?"+a+".width:"+u+"."+xn),e.set(u,"."+_n,a+"?"+a+".height:"+u+"."+wn),a}))}return null}(t),_=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];E.commandType(o,"object","invalid "+t,n.commandStr);var a,u,s=!0,c=0|o.x,f=0|o.y;return"width"in o?(a=0|o.width,E.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in o?(u=0|o.height,E.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new tr(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",bn,"-",c));var i=u;return"height"in o||(i=e.def(n,".",_n,"-",f)),[c,f,r,i]}))}if(t in i){var l=i[t],d=rr(l,(function(e,n){var r=e.invoke(n,l);E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),u=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",bn,"-",o,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",_n,"-",a,")");return E.optional((function(){e.assert(n,u+">=0&&"+s+">=0","invalid "+t)})),[o,a,u,s]}));return e&&(d.thisDep=d.thisDep||e.thisDep,d.contextDep=d.contextDep||e.contextDep,d.propDep=d.propDep||e.propDep),d}return e?new tr(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",bn),e.def(n,".",_n)]})):null}var a=o(an);if(a){var u=a;a=new tr(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o(on)}}(t,b,d),x=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(ln in n){var t=n[ln];Jn(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),E.command(t,"invalid elements",e.commandStr));var i=nr((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(ln in r){var o=r[ln];return rr(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),u=e.def("null"),s=e.def(r,"(",a,")"),c=t.cond(s).then(u,"=",i,".createStream(",a,");").else(u,"=",i,".getElements(",a,");");return E.optional((function(){t.assert(c.else,"!"+a+"||"+u,"invalid elements")})),e.entry(c),e.exit(t.cond(s).then(i,".destroyStream(",u,");")),t.ELEMENTS=u,u}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return E.command(!o||a>=0,"invalid "+t,e.commandStr),nr((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return rr(u,(function(e,n){var r=e.invoke(n,u);return o&&(e.OFFSET=r,E.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?nr((function(t,e){return t.OFFSET="0",0})):null}var u=o(pn,!0);return{elements:i,primitive:function(){if(dn in n){var t=n[dn];return E.commandParameter(t,ot,"invalid primitve",e.commandStr),nr((function(e,n){return ot[t]}))}if(dn in r){var o=r[dn];return rr(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return E.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(ot))})),e.def(n,"[",r,"]")}))}return i?er(i)?i.value?nr((function(t,e){return e.def(t.ELEMENTS,".primType")})):nr((function(){return 4})):new tr(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(hn in n){var t=0|n[hn];return E.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),nr((function(){return t}))}if(hn in r){var o=r[hn];return rr(o,(function(t,e){var n=t.invoke(e,o);return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(er(i)){if(i)return u?new tr(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return E.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):nr((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=nr((function(){return-1}));return E.optional((function(){a.MISSING=!0})),a}var s=new tr(i.thisDep||u.thisDep,i.contextDep||u.contextDep,i.propDep||u.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return E.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:o(vn,!1),offset:u}}(t,d),S=function(t,e){var n=t.static,r=t.dynamic,o={};return w.forEach((function(t){var a=T(t);function u(e,i){if(t in n){var u=e(n[t]);o[a]=nr((function(){return u}))}else if(t in r){var s=r[t];o[a]=rr(s,(function(t,e){return i(t,e,t.invoke(e,s))}))}}switch(t){case Ve:case Re:case Me:case Je:case je:case rn:case qe:case Ke:case Ze:case Be:return u((function(n){return E.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return E.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case Ue:return u((function(n){return E.commandParameter(n,Yn,"invalid "+t,e.commandStr),Yn[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return E.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Yn))})),n.def(i,"[",r,"]")}));case Fe:return u((function(t){return E.command(ht(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case Le:return u((function(t){E.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return E.commandParameter(n,Xn,a+".srcRGB",e.commandStr),E.commandParameter(r,Xn,a+".srcAlpha",e.commandStr),E.commandParameter(i,Xn,a+".dstRGB",e.commandStr),E.commandParameter(o,Xn,a+".dstAlpha",e.commandStr),E.command(-1===qn.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Xn[n],Xn[i],Xn[r],Xn[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var u=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return E.optional((function(){e.assert(n,u+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Xn))})),u}E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),u=o("dst","RGB");E.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[s,n.def(i,"[",u,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case Ge:return u((function(n){return"string"==typeof n?(E.commandParameter(n,y,"invalid "+t,e.commandStr),[y[n],y[n]]):"object"==typeof n?(E.commandParameter(n.rgb,y,t+".rgb",e.commandStr),E.commandParameter(n.alpha,y,t+".alpha",e.commandStr),[y[n.rgb],y[n.alpha]]):void E.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),u=e.cond("typeof ",r,'==="string"');return E.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(y))}n(u.then,t,r),e.assert(u.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(u.else,t+".rgb",r+".rgb"),n(u.else,t+".alpha",r+".alpha")})),u.then(o,"=",a,"=",i,"[",r,"];"),u.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(u),[o,a]}));case Pe:return u((function(t){return E.command(ht(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),P(4,(function(e){return+t[e]}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),P(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Qe:return u((function(t){return E.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case tn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return E.commandParameter(r,Yn,t+".cmp",e.commandStr),E.commandType(i,"number",t+".ref",e.commandStr),E.commandType(o,"number",t+".mask",e.commandStr),[Yn[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return E.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",Hn),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case en:case nn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return E.commandParameter(r,Kn,t+".fail",e.commandStr),E.commandParameter(i,Kn,t+".zfail",e.commandStr),E.commandParameter(o,Kn,t+".zpass",e.commandStr),[t===nn?Vn:zn,Kn[r],Kn[i],Kn[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return E.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Kn))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",Hn)}return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===nn?Vn:zn,o("fail"),o("zfail"),o("zpass")]}));case Ye:return u((function(t){E.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return E.commandType(n,"number",a+".factor",e.commandStr),E.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case We:return u((function(t){var n=0;return"front"===t?n=zn:"back"===t&&(n=Vn),E.command(!!n,a,e.commandStr),n}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',zn,":",Vn)}));case Xe:return u((function(t){return E.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case He:return u((function(t){return E.commandParameter(t,$n,a,e.commandStr),$n[t]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:'+Wn)}));case ze:return u((function(t){return E.command(ht(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),P(4,(function(t){return"!!"+n+"["+t+"]"}))}));case $e:return u((function(t){E.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return E.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,d),A=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);E.optional((function(){l.shader(Zn[t],e,E.guessCommand())}));var r=nr((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return rr(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return E.optional((function(){n(e.shared.shader,".shader(",Zn[t],",",i,",",e.command,");")})),i}))}return null}var u,s=a(fn),c=a(cn),f=null;return er(s)&&er(c)?(f=l.program(c.id,s.id,null,r),u=nr((function(t,e){return t.link(f)}))):u=new tr(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=s?s.append(t,e):e.def(r,".",fn);var i=r+".program("+(c?c.append(t,e):e.def(r,".",cn))+","+n;return E.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:s,vert:c,progVar:u,program:f}}(t,0,v);function I(t){var e=_[t];e&&(S[t]=e)}I(an),I(T(on));var N=Object.keys(S).length>0,O={framebuffer:b,draw:x,shader:A,state:S,dirty:N,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=function(t){var e,n=t.static,r=t.dynamic;if(un in n){var i=!!n[un];(e=nr((function(t,e){return i}))).enable=i}else if(un in r){var o=r[un];e=rr(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),O.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=nr((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=nr((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(E.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=nr((function(t){return t.link(o.color[0])}))):E.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else ht(o)?r=nr((function(e){return e.global.def("[",P(o.length,(function(n){return E.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):E.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),i}(u,d),O.drawVAO=O.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(gn in n){var i=n[gn];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),nr((function(t){return t.link(f.getVAO(i))}))}if(gn in r){var o=r[gn];return rr(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!O.drawVAO&&A.program&&!v&&r.angle_instanced_arrays){var C=!0,k=A.program.attributes.map((function(t){var n=e.static[t];return C=C&&!!n,n}));if(C&&k.length>0){var D=f.getVAO(f.createVAO(k));O.drawVAO=new tr(null,null,null,(function(t,e){return t.link(D)})),O.useVAO=!0}}return v?O.useVAO=!0:O.attributes=function(t,e){var r=t.static,i=t.dynamic,a={};return Object.keys(r).forEach((function(t){var i=r[t],u=n.id(t),s=new g;if(Jn(i))s.state=1,s.buffer=o.getBuffer(o.create(i,Sn,!1,!0)),s.type=0;else{var c=o.getBuffer(i);if(c)s.state=1,s.buffer=c,s.type=0;else if(E.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;s.buffer="null",s.state=2,"number"==typeof f?s.x=f:(E.command(ht(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),De.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=Jn(i.buffer)?o.getBuffer(o.create(i.buffer,Sn,!1,!0)):o.getBuffer(i.buffer),E.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|i.offset;E.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var d=0|i.stride;E.command(d>=0&&d<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var h=0|i.size;E.command(!("size"in i)||h>0&&h<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!i.normalized,v=0;"type"in i&&(E.commandParameter(i.type,K,"invalid type for attribute "+t,e.commandStr),v=K[i.type]);var y=0|i.divisor;"divisor"in i&&(E.command(0===y||m,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),E.command(y>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),E.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){E.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=1,s.size=h,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=d,s.divisor=y}}a[t]=nr((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(s).forEach((function(t){r[t]=s[t]})),s.buffer&&(r.buffer=t.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];a[t]=rr(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,u=o.isBufferArgs,s=o.buffer;E.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+u+"("+i+")||"+s+".getBuffer("+i+")||"+s+".getBuffer("+i+".buffer)||"+u+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},f=new g;f.state=1,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,d=c.type;function h(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",u,"(",i,")){",c.isStream,"=true;",l,"=",s,".createStream(",Sn,",",i,");",d,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",i,");","if(",l,"){",d,"=",l,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[De[0]],"=",i,".constant;",De.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",De.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",i,".buffer)){",l,"=",s,".createStream(",Sn,",",i,".buffer);","}else{",l,"=",s,".getBuffer(",i,".buffer);","}",d,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),h("size"),h("offset"),h("stride"),h("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),a}(e,d),O.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=nr((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),O}function G(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function L(t,e,n,r){var i,o=t.shared,a=o.gl,u=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var s,c=t.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(t,e):e.def(u,".next"),r||e("if(",s,"!==",u,".cur){"),e("if(",s,"){",a,".bindFramebuffer(",36160,",",s,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function j(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,u=r.current,s=r.next,c=t.cond(u,".dirty");w.forEach((function(e){var r,f,l=T(e);if(!(l in n.state))if(l in a){r=a[l],f=o[l];var d=P(_[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(d.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(i,".",A[l],"(",d,");",d.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(s,".",l);var h=t.cond(r,"!==",u,".",l);c(h),l in S?h(t.cond(r).then(i,".enable(",S[l],");").else(i,".disable(",S[l],");"),u,".",l,"=",r,";"):h(i,".",A[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),e(c)}function U(t,e,n,r){var i=t.shared,o=t.current,a=i.current,u=i.gl;Qn(Object.keys(n)).forEach((function(i){var s=n[i];if(!r||r(s)){var c=s.append(t,e);if(S[i]){var f=S[i];er(s)?e(u,c?".enable(":".disable(",f,");"):e(t.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(ht(c)){var l=o[i];e(u,".",A[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(u,".",A[i],"(",c,");",a,".",i,"=",c,";")}}))}function F(t,e){m&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function B(t,e,n,r,i){var o,a,u,s=t.shared,c=t.stats,f=s.current,l=s.timer,d=n.profile;function h(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function v(t){t(o=e.def(),"=",h(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function g(t){t(c,".cpuTime+=",h(),"-",o,";"),p&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function y(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(d){if(er(d))return void(d.enable?(v(e),g(e.exit),y("true")):y("false"));y(u=d.append(t,e))}else u=e.def(f,".profile");var m=t.block();v(m),e("if(",u,"){",m,"}");var b=t.block();g(b),e.exit("if(",u,"){",b,"}")}function z(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;a=s.append(t,e)}else{if(!i(ir))return;var c=t.scopeAttrib(u);E.optional((function(){t.assert(e,c+".state","missing attribute "+u)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,u=e.def(n,".location"),s=e.def(o.attributes,"[",u,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];function h(){e("if(!",s,".buffer){",a,".enableVertexAttribArray(",u,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",s,".type!==",o,"||",s,".size!==",n,"||",d.map((function(t){return s+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",Sn,",",f,".buffer);",a,".vertexAttribPointer(",[u,n,o,i.normalized,i.stride,i.offset],");",s,".type=",o,";",s,".size=",n,";",d.map((function(t){return s+"."+t+"="+i[t]+";"})).join(""),"}"),m){var c=i.divisor;e("if(",s,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function p(){e("if(",s,".buffer){",a,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",De.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",De.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}1===c?h():2===c?p():(e("if(",c,"===",1,"){"),h(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case Tn:case Cn:case Rn:return 2;case In:case kn:case Pn:return 3;case Nn:case Dn:case Gn:return 4;default:return 1}}(r.info.type),a)}))}function V(t,e,r,i,o){for(var a,u=t.shared,s=u.gl,c=0;c<i.length;++c){var f,l=i[c],d=l.name,h=l.info.type,p=r.uniforms[d],v=t.link(l)+".location";if(p){if(!o(p))continue;if(er(p)){var g=p.value;if(E.command(null!=g,'missing uniform "'+d+'"',t.commandStr),h===Fn||h===Bn){E.command("function"==typeof g&&(h===Fn&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||h===Bn&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+d,t.commandStr);var y=t.link(g._texture||g.color[0]._texture);e(s,".uniform1i(",v,",",y+".bind());"),e.exit(y,".unbind();")}else if(h===Ln||h===jn||h===Un){E.optional((function(){E.command(ht(g),"invalid matrix for uniform "+d,t.commandStr),E.command(h===Ln&&4===g.length||h===jn&&9===g.length||h===Un&&16===g.length,"invalid length for matrix uniform "+d,t.commandStr)}));var m=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),b=2;h===jn?b=3:h===Un&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",m,");")}else{switch(h){case An:E.commandType(g,"number","uniform "+d,t.commandStr),a="1f";break;case Tn:E.command(ht(g)&&2===g.length,"uniform "+d,t.commandStr),a="2f";break;case In:E.command(ht(g)&&3===g.length,"uniform "+d,t.commandStr),a="3f";break;case Nn:E.command(ht(g)&&4===g.length,"uniform "+d,t.commandStr),a="4f";break;case Mn:E.commandType(g,"boolean","uniform "+d,t.commandStr),a="1i";break;case On:E.commandType(g,"number","uniform "+d,t.commandStr),a="1i";break;case Rn:case Cn:E.command(ht(g)&&2===g.length,"uniform "+d,t.commandStr),a="2i";break;case Pn:case kn:E.command(ht(g)&&3===g.length,"uniform "+d,t.commandStr),a="3i";break;case Gn:case Dn:E.command(ht(g)&&4===g.length,"uniform "+d,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",ht(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!o(ir))continue;f=e.def(u.uniforms,"[",n.id(d),"]")}h===Fn?(E(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):h===Bn&&(E(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),E.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+d+'". '+r)}function r(t){E(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+'==="'+t+'"',"invalid type, expected "+t)}function i(e,r){Array.isArray(f)?E(f.length===e,"must have length "+e):n(u.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){E(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(3553===e?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(h){case On:r("number");break;case Cn:i(2);break;case kn:i(3);break;case Dn:i(4);break;case An:r("number");break;case Tn:i(2);break;case In:i(3);break;case Nn:i(4);break;case Mn:r("boolean");break;case Rn:i(2);break;case Pn:i(3);break;case Gn:case Ln:i(4);break;case jn:i(9);break;case Un:i(16);break;case Fn:o(3553);break;case Bn:o(34067)}}));var _=1;switch(h){case Fn:case Bn:var x=e.def(f,"._texture");e(s,".uniform1i(",v,",",x,".bind());"),e.exit(x,".unbind();");continue;case On:case Mn:a="1i";break;case Cn:case Rn:a="2i",_=2;break;case kn:case Pn:a="3i",_=3;break;case Dn:case Gn:a="4i",_=4;break;case An:a="1f";break;case Tn:a="2f",_=2;break;case In:a="3f",_=3;break;case Nn:a="4f",_=4;break;case Ln:a="Matrix2fv";break;case jn:a="Matrix3fv";break;case Un:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var w=Math.pow(h-Ln+2,2),S=t.global.def("new Float32Array(",w,")");Array.isArray(f)?e("false,(",P(w,(function(t){return S+"["+t+"]="+f[t]})),",",S,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",P(w,(function(t){return S+"["+t+"]="+f+"["+t+"]"})),",",S,")")}else _>1?e(P(_,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(E(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function W(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,u=r.draw;var s=function(){var i,s=u.elements,c=e;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),i=s.append(t,c)):i=c.def(a,".",ln),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=u[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var f,l,d=c(dn),h=c(pn),p=function(){var i,o=u.count,s=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(s=n),i=o.append(t,s),E.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(s,i+">=0","missing vertex count")}))):(i=s.def(a,".",hn),E.optional((function(){t.assert(s,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");m&&(f=c(vn),l=t.instancing);var v=s+".type",g=u.elements&&er(u.elements);function y(){function t(){n(l,".drawElementsInstancedANGLE(",[d,p,v,h+"<<(("+v+"-5121)>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[d,h,p,f],");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(o+".drawElements("+[d,p,v,h+"<<(("+v+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[d,h,p]+");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}m&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),y(),n("}else if(",f,"<0){"),b(),n("}")):y():b()}function H(t,e,n,r,i){var o=M(),a=o.proc("body",i);return E.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),m&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function X(t,e,n,r){F(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),z(t,e,n,r.attributes,(function(){return!0}))),V(t,e,n,r.uniforms,(function(){return!0})),W(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",F(t,e),z(t,e,n,r.attributes,i),V(t,e,n,r.uniforms,i),W(t,e,e,n)}function Y(t,e,n,r){F(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var u=t.scope(),s=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(u.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",s,"}",u.exit),n.needsContext&&G(t,s,n.context),n.needsFramebuffer&&L(t,s,n.framebuffer),U(t,s,n.state,c),n.profile&&c(n.profile)&&B(t,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),z(t,u,n,r.attributes,f),z(t,s,n,r.attributes,c)),V(t,u,n,r.uniforms,f),V(t,s,n,r.uniforms,c),W(t,u,s,n);else{var l=t.global.def("{}"),d=n.shader.progVar.append(t,s),h=s.def(d,".id"),p=s.def(l,"[",h,"]");s(t.shared.gl,".useProgram(",d,".program);","if(!",p,"){",p,"=",l,"[",h,"]=",t.link((function(e){return H(q,t,n,e,2)})),"(",d,");}",p,".call(this,a0[",o,"],",o,");")}}function Z(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!ht(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(O.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),a=!1,u=!1,s=!1,c=t.global.def("{}");o.forEach((function(e){var n=r[e];if(O.isDynamic(n)){"function"==typeof n&&(n=r[e]=O.unbox(n));var o=rr(n,null);a=a||o.thisDep,s=s||o.propDep,u=u||o.contextDep}else{switch(i(c,".",e,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new O.DynamicVariable(4,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){o.forEach((function(n){var i=r[n];if(O.isDynamic(i)){var o=t.invoke(e,i);e(c,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:x,current:_,procs:function(){var t=M(),e=t.proc("poll"),n=t.proc("refresh"),o=t.block();e(o),n(o);var a,u=t.shared,s=u.gl,c=u.next,f=u.current;o(f,".dirty=false;"),L(t,e),L(t,n,null,!0),m&&(a=t.link(m)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<i.maxAttributes;++l){var d=n.def(u.attributes,"[",l,"]"),h=t.cond(d,".buffer");h.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",Sn,",",d,".buffer.buffer);",s,".vertexAttribPointer(",l,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),n(h),m&&n(a,".vertexAttribDivisorANGLE(",l,",",d,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(S).forEach((function(r){var i=S[r],a=o.def(c,".",r),u=t.block();u("if(",a,"){",s,".enable(",i,")}else{",s,".disable(",i,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")})),Object.keys(A).forEach((function(r){var i,a,u=A[r],l=_[r],d=t.block();if(d(s,".",u,"("),ht(l)){var h=l.length;i=t.global.def(c,".",r),a=t.global.def(f,".",r),d(P(h,(function(t){return i+"["+t+"]"})),");",P(h,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",P(h,(function(t){return i+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",d,"}")}else i=o.def(c,".",r),a=o.def(f,".",r),d(i,");",f,".",r,"=",i,";"),e("if(",i,"!==",a,"){",d,"}");n(d)})),t.compile()}(),compile:function(t,r,i,o,a){var u=M();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){Z(u,r,t)})),En.forEach((function(e){Z(u,t,e)}));var s=R(t,r,i,o,u);return function(t,e){var n=t.proc("draw",1);F(t,n),G(t,n,e.context),L(t,n,e.framebuffer),j(t,n,e),U(t,n,e.state),B(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)X(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return H(X,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}G(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),Qn(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);ht(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),B(t,r,e,!0,!0),[ln,pn,hn,vn,dn].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new g).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(cn),a(fn),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(u,s),function(t,e){var n=t.proc("batch",2);t.batchId="0",F(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(G(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function u(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||L(t,n,o)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),j(t,n,e),U(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||B(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var s=e.shader.progVar;if(s.contextDep&&r||s.propDep)Y(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),d=n.def(f,"[",l,"]");n(t.cond(d).then(d,".call(this,a0,a1);").else(d,"=",f,"[",l,"]=",t.link((function(n){return H(Y,t,e,n,2)})),"(",c,");",d,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),e(u.compile(),{destroy:function(){s.shader.program.destroy()}})}}}var ar=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function u(t){a.push(t)}var s=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){l.length=Math.max(l.length,o+1),f.length=Math.max(f.length,o+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var c=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[t++]=c,f[n+1]=a,l[n+1]=t}for(i.length=t,t=0,n=0;n<s.length;++n){var d=s[n],h=d.startQueryIndex,p=d.endQueryIndex;d.sum+=f[p]-f[h];var v=l[h],g=l[p];g===v?(d.stats.gpuTime+=d.sum/1e6,u(d)):(d.startQueryIndex=v,d.endQueryIndex=g,s[t++]=d)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}},ur="webglcontextlost",sr="webglcontextrestored";function cr(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=R(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),u=function(t,e){var n={};function r(e){E.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(i,r);if(!u)return null;var s,c,f=(s={"":0},c=[""],{id:function(t){var e=s[t];return e||(e=s[t]=c.length,c.push(t),e)},str:function(t){return c[t]}}),l={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},d=u.extensions,h=ar(0,d),p=k(),v=i.drawingBufferWidth,g=i.drawingBufferHeight,y={tick:0,time:0,viewportWidth:v,viewportHeight:g,framebufferWidth:v,framebufferHeight:g,drawingBufferWidth:v,drawingBufferHeight:g,pixelRatio:r.pixelRatio},m=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(U,a),t.texImage2D(U,0,F,1,1,0,F,B,null);var u=t.createFramebuffer();if(t.bindFramebuffer(z,u),t.framebufferTexture2D(z,36064,U,a,0),t.bindTexture(U,null),36053!==t.checkFramebufferStatus(z))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=j.allocType(B,4);t.readPixels(0,0,1,1,F,B,s),t.getError()?o=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),o=1===s[0]),j.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=j.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,F,3,3,0,F,5121,l),j.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,d),b=function(e,n,r,i){var o=0,a={};function u(t){this.id=o++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=Q,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,i,o,a){var u,s;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||tt,n.length>0)if(Array.isArray(n[0])){u=J(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=$(n,u,e.dtype),r),a?e.persistentData=s:j.freeType(s)}else if("number"==typeof n[0]){e.dimension=o;var d=j.allocType(e.dtype,n.length);rt(d,n),c(e,d,r),a?e.persistentData=d:j.freeType(d)}else t(n[0])?(e.dimension=n[0].length,e.dtype=i||nt(n[0])||tt,c(e,s=$(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:j.freeType(s)):E.raise("invalid buffer data")}else if(t(n))e.dtype=i||nt(n),e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(V(n)){u=n.shape;var h=n.stride,p=n.offset,v=0,g=0,y=0,m=0;1===u.length?(v=u[0],g=1,y=h[0],m=0):2===u.length?(v=u[0],g=u[1],y=h[0],m=h[1]):E.raise("invalid shape"),e.dtype=i||nt(n.data)||tt,e.dimension=g;var b=j.allocType(e.dtype,v*g);it(b,n.data,v,g,y,m,p),c(e,b,r),a?e.persistentData=b:j.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=Q,e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):E.raise("invalid buffer data")}function l(t){n.bufferCount--,i(t);var r=t.buffer;E(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(i,o,s,c){n.bufferCount++;var d=new u(o);function h(n){var i=35044,o=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||V(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(E.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(E(null===o||Array.isArray(o)||t(o)||V(o),"invalid data for buffer"),o=n.data),"usage"in n&&(E.parameter(n.usage,Z,"invalid buffer usage"),i=Z[n.usage]),"type"in n&&(E.parameter(n.type,K,"invalid buffer type"),u=K[n.type]),"dimension"in n&&(E.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(E.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),d.bind(),o?f(d,o,i,u,s,c):(a&&e.bufferData(d.type,a,i),d.dtype=u||Q,d.usage=i,d.dimension=s,d.byteLength=a),r.profile&&(d.stats.size=d.byteLength*et[d.dtype]),h}function p(t,n){E(n+t.byteLength<=d.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+d.byteLength),e.bufferSubData(d.type,n,t)}return a[d.id]=d,s||h(i),h._reglType="buffer",h._buffer=d,h.subdata=function(e,n){var r,i=0|(n||0);if(d.bind(),t(e)||e instanceof ArrayBuffer)p(e,i);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var o=j.allocType(d.dtype,e.length);rt(o,e),p(o,i),j.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=J(e);var a=$(e,r,d.dtype);p(a,i),j.freeType(a)}else E.raise("invalid buffer data")}else if(V(e)){r=e.shape;var u=e.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):E.raise("invalid shape");var v=Array.isArray(e.data)?d.dtype:nt(e.data),g=j.allocType(v,s*c);it(g,e.data,s,c,f,l,e.offset),p(g,i),j.freeType(g)}else E.raise("invalid data for buffer subdata");return h},r.profile&&(h.stats=d.stats),h.destroy=function(){l(d)},h},createStream:function(t,e){var n=s.pop();return n||(n=new u(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){W(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){W(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(i,l,r,(function(t){return _.destroyBuffer(t)})),_=function(e,n,r,i,o){for(var a=r.maxAttributes,u=new Array(a),s=0;s<a;++s)u[s]=new Te;var c=0,f={},l={Record:Te,scope:{},state:u,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&W(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){E(Array.isArray(e),"arguments to vertex array constructor must be an array"),E(e.length<a,"too many attributes"),E(e.length>0,"must specify at least one attribute");var i={},s=r.attributes;s.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],d=s[c]=new Te,h=l.data||l;Array.isArray(h)||t(h)||V(h)?(r.buffers[c]&&(f=r.buffers[c],t(h)&&f._buffer.byteLength>=h.byteLength?f.subdata(h):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=o.create(l,34962,!1,!0)),d.buffer=o.getBuffer(f),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1,i[c]=1):o.getBuffer(l)?(d.buffer=o.getBuffer(l),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1):o.getBuffer(l.buffer)?(d.buffer=o.getBuffer(l.buffer),d.size=0|(+l.size||d.buffer.dimension),d.normalized=!!l.normalized||!1,"type"in l?(E.parameter(l.type,K,"invalid buffer type"),d.type=K[l.type]):d.type=d.buffer.dtype,d.offset=0|(l.offset||0),d.stride=0|(l.stride||0),d.divisor=0|(l.divisor||0),d.state=1,E(d.size>=1&&d.size<=4,"size must be between 1 and 4"),E(d.offset>=0,"invalid offset"),E(d.stride>=0&&d.stride<=255,"stride must be between 0 and 255"),E(d.divisor>=0,"divisor must be positive"),E(!d.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(E(c>0,"first attribute must not be a constant"),d.x=+l.x||0,d.y=+l.y||0,d.z=+l.z||0,d.w=+l.w||0,d.state=2):E(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),u}return i.vaoCount+=1,u.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},u._vao=r,u._reglType="vao",u(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:d()?function(t){if(t!==l.currentVAO){var e=d();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=h(),r=0;r<u.length;++r){var i=u[r];i.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}l.currentVAO=t}},clear:d()?function(){W(f).forEach((function(t){t.destroy()}))}:function(){}};function d(){return n.oes_vertex_array_object}function h(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=d();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=h(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)e.disableVertexAttribArray(o)},p.prototype.refresh=function(){var t=d();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=d();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],i.vaoCount-=1)},l}(i,d,m,l,b),x=function(e,n,r,i){var o={},a=0,u={uint8:at,uint16:ut};function s(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=st),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,o,a,u,s,c,f){var l;if(i.buffer.bind(),o){var d=f;f||t(o)&&(!V(o)||t(o.data))||(d=n.oes_element_index_uint?st:ut),r._initBuffer(i.buffer,o,a,d,3)}else e.bufferData(ct,c,a),i.buffer.dtype=l||at,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(l=f,!f){switch(i.buffer.dtype){case at:case 5120:l=at;break;case ut:case 5122:l=ut;break;case st:case 5124:l=st;break;default:E.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,E(l!==st||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var h=s;h<0&&(h=i.buffer.byteLength,l===ut?h>>=1:l===st&&(h>>=2)),i.vertCount=h;var p=u;if(u<0){p=4;var v=i.buffer.dimension;1===v&&(p=0),2===v&&(p=1),3===v&&(p=4)}i.primType=p}function l(t){i.elementsCount--,E(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,ct,!0),a=new s(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=at;else{var n=null,r=35044,i=-1,s=-1,l=0,d=0;Array.isArray(e)||t(e)||V(e)?n=e:(E.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,E(Array.isArray(n)||t(n)||V(n),"invalid data for element buffer")),"usage"in e&&(E.parameter(e.usage,Z,"invalid element buffer usage"),r=Z[e.usage]),"primitive"in e&&(E.parameter(e.primitive,ot,"invalid element buffer primitive"),i=ot[e.primitive]),"count"in e&&(E("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(E.parameter(e.type,u,"invalid buffer type"),d=u[e.type]),"length"in e?l=0|e.length:(l=s,d===ut||5122===d?l*=2:d!==st&&5124!==d||(l*=4))),f(a,n,r,i,s,l,d)}else o(),a.primType=4,a.vertCount=0,a.type=at;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new s(r.create(null,ct,!0,!1)._buffer)),f(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){W(o).forEach(l)}}}(i,d,b,l),w=function(t,n,r,i){var o={},a={};function u(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function s(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,i){var u=35632===e?o:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),E.shaderError(t,s,c,e,i),u[r]=s}return s}var f={},l=[],d=0;function h(t,e){this.id=d++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,o){var a,f,l=c(35632,e.fragId),d=c(35633,e.vertId),h=e.program=t.createProgram();if(t.attachShader(h,l),t.attachShader(h,d),o)for(a=0;a<o.length;++a){var p=o[a];t.bindAttribLocation(h,p[0],p[1])}t.linkProgram(h),E.linkError(t,h,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(h,35718);i.profile&&(e.stats.uniformsCount=v);var g=e.uniforms;for(a=0;a<v;++a)if(f=t.getActiveUniform(h,a))if(f.size>1)for(var y=0;y<f.size;++y){var m=f.name.replace("[0]","["+y+"]");s(g,new u(m,n.id(m),t.getUniformLocation(h,m),f))}else s(g,new u(f.name,n.id(f.name),t.getUniformLocation(h,f.name),f));var b=t.getProgramParameter(h,35721);i.profile&&(e.stats.attributesCount=b);var _=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(h,a))&&s(_,new u(f.name,n.id(f.name),t.getAttribLocation(h,f.name),f))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);W(o).forEach(e),o={},W(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,u,s){E.command(n>=0,"missing vertex shader",u),E.command(i>=0,"missing fragment shader",u);var c=f[i];c||(c=f[i]={});var d=c[n];if(d&&(d.refCount++,!s))return d;var v=new h(i,n);return r.shaderCount++,p(v,u,s),d||(c[n]=v),l.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=l.indexOf(v);l.splice(e,1),r.shaderCount--}c[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete f[v.fragId][v.vertId]),Object.keys(f[v.fragId]).length||(t.deleteShader(o[v.fragId]),delete o[v.fragId],delete f[v.fragId])}})},restore:function(){o={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(i,f,l,r),S=de(i,d,m,(function(){I.procs.poll()}),y,l,r),A=function(t,e,n,r,i){var o={rgba4:pe,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(t){var e=o[t];a[e]=t}));var u=0,s={};function c(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=pe,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;E(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(he,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete s[e.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&f(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach((function(e){t+=s[e].stats.size})),t}),{create:function(e,u){var f=new c(t.createRenderbuffer());function l(e,r){var u=0,s=0,c=pe;if("object"==typeof e&&e){var d=e;if("shape"in d){var h=d.shape;E(Array.isArray(h)&&h.length>=2,"invalid renderbuffer shape"),u=0|h[0],s=0|h[1]}else"radius"in d&&(u=s=0|d.radius),"width"in d&&(u=0|d.width),"height"in d&&(s=0|d.height);"format"in d&&(E.parameter(d.format,o,"invalid renderbuffer format"),c=o[d.format])}else"number"==typeof e?(u=0|e,s="number"==typeof r?0|r:u):e?E.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(E(u>0&&s>0&&u<=n.maxRenderbufferSize&&s<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||s!==f.height||c!==f.format)return l.width=f.width=u,l.height=f.height=s,f.format=c,t.bindRenderbuffer(he,f.renderbuffer),t.renderbufferStorage(he,c,u,s),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height)),l.format=a[f.format],l}return s[f.id]=f,r.renderbufferCount++,l(e,u),l.resize=function(e,r){var o=0|e,a=0|r||o;return o===f.width&&a===f.height||(E(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),l.width=f.width=o,l.height=f.height=a,t.bindRenderbuffer(he,f.renderbuffer),t.renderbufferStorage(he,f.format,o,a),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height))),l},l._reglType="renderbuffer",l._renderbuffer=f,i.profile&&(l.stats=f.stats),l.destroy=function(){f.decRef()},l},clear:function(){W(s).forEach(f)},restore:function(){W(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(he,e.renderbuffer),t.renderbufferStorage(he,e.format,e.width,e.height)})),t.bindRenderbuffer(he,null)}}}(i,d,m,l,r),T=function(t,n,r,i,o,a){var u={cur:null,next:null,dirty:!1,setFBO:null},s=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function l(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function h(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);E(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;E(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(ye,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(ye,e,me,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=be,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),E.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,E(e===be)):"textureCube"===o?(n=i,E(e>=_e&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=me):E.raise("invalid regl object for attachment"),new l(e,n,r)}function g(t,e,n,r,a){if(n){var u=i.create2D({width:t,height:e,format:r,type:a});return u._texture.refCount=0,new l(be,u,null)}var s=o.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(me,null,s)}function y(t){return t&&(t.texture||t.renderbuffer)}function m(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var b=0,_={};function x(){this.id=b++,_[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function w(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function S(e){var n=e.framebuffer;E(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete _[e.id]}function A(e){var n;t.bindFramebuffer(ye,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)p(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(ye,36064+n,be,null,0);t.framebufferTexture2D(ye,33306,be,null,0),t.framebufferTexture2D(ye,36096,be,null,0),t.framebufferTexture2D(ye,36128,be,null,0),p(36096,e.depthAttachment),p(36128,e.stencilAttachment),p(33306,e.depthStencilAttachment);var o=t.checkFramebufferStatus(ye);t.isContextLost()||36053===o||E.raise("framebuffer configuration not supported, status = "+Ae[o]),t.bindFramebuffer(ye,u.next?u.next.framebuffer:null),u.cur=u.next,t.getError()}function T(t,i){var o=new x;function l(t,e){var i;E(u.next!==o,"can not update framebuffer which is currently in use");var a=0,d=0,p=!0,m=!0,b=null,_=!0,x="rgba",S="uint8",T=1,I=null,N=null,O=null,C=!1;if("number"==typeof t)a=0|t,d=0|e||a;else if(t){E.type(t,"object","invalid arguments for framebuffer");var k=t;if("shape"in k){var D=k.shape;E(Array.isArray(D)&&D.length>=2,"invalid shape for framebuffer"),a=D[0],d=D[1]}else"radius"in k&&(a=d=k.radius),"width"in k&&(a=k.width),"height"in k&&(d=k.height);("color"in k||"colors"in k)&&(b=k.color||k.colors,Array.isArray(b)&&E(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in k&&(T=0|k.colorCount,E(T>0,"invalid color buffer count")),"colorTexture"in k&&(_=!!k.colorTexture,x="rgba4"),"colorType"in k&&(S=k.colorType,_?(E(n.oes_texture_float||!("float"===S||"float32"===S),"you must enable OES_texture_float in order to use floating point framebuffer objects"),E(n.oes_texture_half_float||!("half float"===S||"float16"===S),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===S||"float16"===S?(E(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==S&&"float32"!==S||(E(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),E.oneOf(S,f,"invalid color type")),"colorFormat"in k&&(x=k.colorFormat,s.indexOf(x)>=0?_=!0:c.indexOf(x)>=0?_=!1:_?E.oneOf(k.colorFormat,s,"invalid color format for texture"):E.oneOf(k.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in k||"depthStencilTexture"in k)&&(C=!(!k.depthTexture&&!k.depthStencilTexture),E(!C||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in k&&("boolean"==typeof k.depth?p=k.depth:(I=k.depth,m=!1)),"stencil"in k&&("boolean"==typeof k.stencil?m=k.stencil:(N=k.stencil,p=!1)),"depthStencil"in k&&("boolean"==typeof k.depthStencil?p=m=k.depthStencil:(O=k.depthStencil,p=!1,m=!1))}else a=d=1;var M=null,R=null,P=null,G=null;if(Array.isArray(b))M=b.map(v);else if(b)M=[v(b)];else for(M=new Array(T),i=0;i<T;++i)M[i]=g(a,d,_,x,S);E(n.webgl_draw_buffers||M.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),E(M.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||M[0].width,d=d||M[0].height,I?R=v(I):p&&!m&&(R=g(a,d,C,"depth","uint32")),N?P=v(N):m&&!p&&(P=g(a,d,!1,"stencil","uint8")),O?G=v(O):!I&&!N&&m&&p&&(G=g(a,d,C,"depth stencil","depth stencil")),E(!!I+!!N+!!O<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var L=null;for(i=0;i<M.length;++i)if(h(M[i],a,d),E(!M[i]||M[i].texture&&xe.indexOf(M[i].texture._texture.format)>=0||M[i].renderbuffer&&Se.indexOf(M[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),M[i]&&M[i].texture){var j=we[M[i].texture._texture.format]*Ee[M[i].texture._texture.type];null===L?L=j:E(L===j,"all color attachments much have the same number of bits per pixel.")}return h(R,a,d),E(!R||R.texture&&6402===R.texture._texture.format||R.renderbuffer&&33189===R.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),h(P,a,d),E(!P||P.renderbuffer&&36168===P.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),h(G,a,d),E(!G||G.texture&&34041===G.texture._texture.format||G.renderbuffer&&34041===G.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),w(o),o.width=a,o.height=d,o.colorAttachments=M,o.depthAttachment=R,o.stencilAttachment=P,o.depthStencilAttachment=G,l.color=M.map(y),l.depth=y(R),l.stencil=y(P),l.depthStencil=y(G),l.width=o.width,l.height=o.height,A(o),l}return a.framebufferCount++,l(t,i),e(l,{resize:function(t,e){E(u.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return l;for(var i=o.colorAttachments,a=0;a<i.length;++a)m(i[a],n,r);return m(o.depthAttachment,n,r),m(o.stencilAttachment,n,r),m(o.depthStencilAttachment,n,r),o.width=l.width=n,o.height=l.height=r,A(o),l},_reglType:"framebuffer",_framebuffer:o,destroy:function(){S(o),w(o)},use:function(t){u.setFBO({framebuffer:l},t)}})}return e(u,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof x)return e}return null},create:T,createCube:function(t){var o=Array(6);function a(t){var r;E(o.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var c,l={color:null},d=0,h=null,p="rgba",v="uint8",g=1;if("number"==typeof t)d=0|t;else if(t){E.type(t,"object","invalid arguments for framebuffer");var y=t;if("shape"in y){var m=y.shape;E(Array.isArray(m)&&m.length>=2,"invalid shape for framebuffer"),E(m[0]===m[1],"cube framebuffer must be square"),d=m[0]}else"radius"in y&&(d=0|y.radius),"width"in y?(d=0|y.width,"height"in y&&E(y.height===d,"must be square")):"height"in y&&(d=0|y.height);("color"in y||"colors"in y)&&(h=y.color||y.colors,Array.isArray(h)&&E(1===h.length||n.webgl_draw_buffers,"multiple render targets not supported")),h||("colorCount"in y&&(g=0|y.colorCount,E(g>0,"invalid color buffer count")),"colorType"in y&&(E.oneOf(y.colorType,f,"invalid color type"),v=y.colorType),"colorFormat"in y&&(p=y.colorFormat,E.oneOf(y.colorFormat,s,"invalid color format for texture"))),"depth"in y&&(l.depth=y.depth),"stencil"in y&&(l.stencil=y.stencil),"depthStencil"in y&&(l.depthStencil=y.depthStencil)}else d=1;if(h)if(Array.isArray(h))for(c=[],r=0;r<h.length;++r)c[r]=h[r];else c=[h];else{c=Array(g);var b={radius:d,format:p,type:v};for(r=0;r<g;++r)c[r]=i.createCube(b)}for(l.color=Array(c.length),r=0;r<c.length;++r){var _=c[r];E("function"==typeof _&&"textureCube"===_._reglType,"invalid cube map"),d=d||_.width,E(_.width===d&&_.height===d,"invalid cube map shape"),l.color[r]={target:_e,data:c[r]}}for(r=0;r<6;++r){for(var x=0;x<c.length;++x)l.color[x].target=_e+r;r>0&&(l.depth=o[0].depth,l.stencil=o[0].stencil,l.depthStencil=o[0].depthStencil),o[r]?o[r](l):o[r]=T(l)}return e(a,{width:d,height:d,color:c})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(E(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){W(_).forEach(S)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,W(_).forEach((function(e){e.framebuffer=t.createFramebuffer(),A(e)}))}})}(i,d,m,S,A,l),I=or(i,f,d,m,b,x,0,T,{},_,w,{elements:null,primitive:4,count:-1,offset:0,instances:-1},y,h,r),N=Oe(i,T,I.procs.poll,y,o,d,m),D=I.next,M=i.canvas,P=[],G=[],L=[],H=[r.onDestroy],X=null;function q(){if(0===P.length)return h&&h.update(),void(X=null);X=C.next(q),mt();for(var t=P.length-1;t>=0;--t){var e=P[t];e&&e(y,null,0)}i.flush(),h&&h.update()}function Y(){!X&&P.length>0&&(X=C.next(q))}function ft(){X&&(C.cancel(q),X=null)}function lt(t){t.preventDefault(),a=!0,ft(),G.forEach((function(t){t()}))}function dt(t){i.getError(),a=!1,u.restore(),w.restore(),b.restore(),S.restore(),A.restore(),T.restore(),_.restore(),h&&h.restore(),I.procs.refresh(),Y(),L.forEach((function(t){t()}))}function ht(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(O.isDynamic(o))r[i]=O.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(O.isDynamic(o[a]))return void(r[i]=O.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}E(!!t,"invalid args to regl({...})"),E.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),i=n(t.uniforms||{},!0),o=n(t.attributes||{},!1),u=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),s={gpuTime:0,cpuTime:0,count:0},c=I.compile(u,o,i,r,s),f=c.draw,l=c.batch,d=c.scope,h=[];return e((function(t,e){var n;if(a&&E.raise("context lost"),"function"==typeof t)return d.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)d.call(this,null,e,n);else{if(!Array.isArray(t))return d.call(this,t,e,0);for(n=0;n<t.length;++n)d.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;h.length<t;)h.push(null);return h}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:s,destroy:function(){c.destroy()}})}M&&(M.addEventListener(ur,lt,!1),M.addEventListener(sr,dt,!1));var pt=T.setFBO=ht({framebuffer:O.define.call(null,1,"framebuffer")});function vt(t,e){var n=0;I.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),E(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function gt(t){return E.type(t,"function","regl.frame() callback must be a function"),P.push(t),Y(),{cancel:function(){var e=cr(P,t);E(e>=0,"cannot cancel a frame twice"),P[e]=function t(){var e=cr(P,t);P[e]=P[P.length-1],P.length-=1,P.length<=0&&ft()}}}}function yt(){var t=D.viewport,e=D.scissor_box;t[0]=t[1]=e[0]=e[1]=0,y.viewportWidth=y.framebufferWidth=y.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,y.viewportHeight=y.framebufferHeight=y.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function mt(){y.tick+=1,y.time=_t(),yt(),I.procs.poll()}function bt(){S.refresh(),yt(),I.procs.refresh(),h&&h.update()}function _t(){return(k()-p)/1e3}bt();var xt=e(ht,{clear:function(t){if(E("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)pt(e({framebuffer:t.framebuffer.faces[n]},t),vt);else pt(t,vt);else vt(0,t)},prop:O.define.bind(null,1),context:O.define.bind(null,2),this:O.define.bind(null,3),draw:ht({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return x.create(t,!1)},texture:S.create2D,cube:S.createCube,renderbuffer:A.create,framebuffer:T.create,framebufferCube:T.createCube,vao:_.createVAO,attributes:o,frame:gt,on:function(t,e){var n;switch(E.type(e,"function","listener callback must be a function"),t){case"frame":return gt(e);case"lost":n=G;break;case"restore":n=L;break;case"destroy":n=H;break;default:E.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:m,hasExtension:function(t){return m.extensions.indexOf(t.toLowerCase())>=0},read:N,destroy:function(){P.length=0,ft(),M&&(M.removeEventListener(ur,lt),M.removeEventListener(sr,dt)),w.clear(),T.clear(),A.clear(),S.clear(),x.clear(),b.clear(),_.clear(),h&&h.clear(),H.forEach((function(t){t()}))},_gl:i,_refresh:bt,poll:function(){mt(),h&&h.update()},now:_t,stats:l});return r.onDone(null,xt),xt}}()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n(9216);var t,e=(t=n(2680))&&t.__esModule?t:{default:t};e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0})(),(()=>{"use strict";n.r(r),n.d(r,{CircularLayout:()=>Pt,ComboCombinedLayout:()=>g_,ComboForceLayout:()=>h_,ConcentricLayout:()=>Tf,DagreCompoundLayout:()=>qc,DagreLayout:()=>$n,ERLayout:()=>U_,ForceAtlas2Layout:()=>E_,ForceLayout:()=>kt,FruchtermanGPULayout:()=>u_,FruchtermanLayout:()=>Cf,GForceGPULayout:()=>l_,GForceLayout:()=>D,GridLayout:()=>I,Layout:()=>F_,Layouts:()=>B_,MDSLayout:()=>Nf,RadialLayout:()=>Sf,RandomLayout:()=>O,getLayoutByName:()=>A,registerLayout:()=>E,unRegisterLayout:()=>S});var t=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}(),e=function(t){return"string"==typeof t},i=(Object.create(null),Array.isArray),o=function(t){return"number"==typeof t},a=function(t){return Number.isNaN(Number(t))};function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var s,c=function(){return c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},c.apply(this,arguments)},f=function(t){return null!==t&&"object"===u(t)},l=function t(e){if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){var n=[];return e.forEach((function(t){n.push(t)})),n.map((function(e){return t(e)}))}if("object"===u(e)&&e!=={}){var r=c({},e);return Object.keys(r).forEach((function(e){r[e]=t(r[e])})),r}return e},d=function(t,e){var n=t[e];return f(n)?n.cell:n},h=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n?(n.forEach((function(t){var n=d(t,"source"),i=d(t,"target");n&&(r[e[n]]+=1),i&&(r[e[i]]+=1)})),r):r},p=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},v=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e,i.push([])})),r&&r.forEach((function(t){var n=d(t,"source"),r=d(t,"target"),a=o[n],u=o[r];i[a][u]=1,e||(i[u][a]=1)})),i},g=function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)},y=function(t,e){"function"==typeof e&&g(t,e)},m=function(t){return"function"==typeof t},b=function(t,e,n){return n||(o(t)?function(){return t}:function(){return e})},_=function(t,e,n){return void 0===n&&(n=!0),e||0===e?m(e)?e:o(e)?function(){return e}:i(e)?function(){if(n){var r=Math.max.apply(Math,e);return isNaN(r)?t:r}return e}:f(e)?function(){if(n){var r=Math.max(e.width,e.height);return isNaN(r)?t:r}return[e.width,e.height]}:function(){return t}:function(e){return e.size?i(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:f(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}},x=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),w=new Map,E=function(e,n){if(w.get(e)&&console.warn("The layout with the name ".concat(e," exists already, it will be overridden")),f(n)){var r=function(t){function e(e){var r=t.call(this)||this,i=r,o={},a=i.getDefaultCfg();return Object.assign(o,a,n,e),Object.keys(o).forEach((function(t){var e=o[t];i[t]=e})),r}return x(e,t),e}(t);w.set(e,r)}else w.set(e,n);return w.get(e)},S=function(t){w.has(t)&&w.delete(t)},A=function(t){return w.has(t)?w.get(t):null},T=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),I=function(t){function n(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return T(n,t),n.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=t.begin,o=n.length;if(0===o)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};if(1===o)return n[0].x=i[0],n[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};var u=t.sortBy,s=t.width,c=t.height,f=t.condense,l=t.preventOverlapPadding,d=t.preventOverlap,p=t.nodeSpacing,v=t.nodeSize,g=[];n.forEach((function(t){g.push(t)}));var y={};if(g.forEach((function(t,e){y[t.id]=e})),("degree"===u||!e(u)||void 0===g[0][u])&&(u="degree",a(n[0].degree))){var m=h(g.length,y,r);g.forEach((function(t,e){t.degree=m[e]}))}g.sort((function(t,e){return e[u]-t[u]})),s||"undefined"==typeof window||(s=window.innerWidth),c||"undefined"==typeof window||(c=window.innerHeight);var b=t.rows,x=null!=t.cols?t.cols:t.columns;if(t.cells=o,null!=b&&null!=x?(t.rows=b,t.cols=x):null!=b&&null==x?(t.rows=b,t.cols=Math.ceil(t.cells/t.rows)):null==b&&null!=x?(t.cols=x,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.cols*t.rows>t.cells)((E=t.small())-1)*(w=t.large())>=t.cells?t.small(E-1):(w-1)*E>=t.cells&&t.large(w-1);else for(;t.cols*t.rows<t.cells;){var w,E=t.small();((w=t.large())+1)*E>=t.cells?t.large(w+1):t.small(E+1)}if(t.cellWidth=s/t.cols,t.cellHeight=c/t.rows,f&&(t.cellWidth=0,t.cellHeight=0),d||p){var S=_(10,p),A=_(30,v,!1);g.forEach((function(e){e.x&&e.y||(e.x=0,e.y=0);var n=A(e),r=n[0],i=void 0===r?30:r,o=n[1],a=void 0===o?30:o,u=void 0!==S?S(e):l,s=i+u,c=a+u;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,c)}))}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var T=0;T<g.length;T++){var I=g[T],N=void 0;if(t.position&&(N=t.position(I)),N&&(void 0!==N.row||void 0!==N.col)){var O={row:N.row,col:N.col};if(void 0===O.col)for(O.col=0;t.used(O.row,O.col);)O.col++;else if(void 0===O.row)for(O.row=0;t.used(O.row,O.col);)O.row++;t.id2manPos[I.id]=O,t.use(O.row,O.col)}t.getPos(I)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:r,nodes:g}},n.prototype.small=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.min(r,i):Math.min(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.large=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.max(r,i):Math.max(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.used=function(t,e){return this.cellUsed["c-".concat(t,"-").concat(e)]||!1},n.prototype.use=function(t,e){this.cellUsed["c-".concat(t,"-").concat(e)]=!0},n.prototype.moveToNextCell=function(){var t=this,e=t.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},n.prototype.getPos=function(t){var e,n,r=this,i=r.begin,o=r.cellWidth,a=r.cellHeight,u=r.id2manPos[t.id];if(u)e=u.col*o+o/2+i[0],n=u.row*a+a/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*o+o/2+i[0],n=r.row*a+a/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},n.prototype.getType=function(){return"grid"},n}(t),N=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return N(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(t),C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(t,e){return t?o(t)?function(e){return t}:t:function(t){return e||1}},D=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return C(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var a=n.center;if(1===r.length)return r[0].x=a[0],r[0].y=a[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var u={},s={};r.forEach((function(t,e){o(t.x)||(t.x=Math.random()*n.width),o(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),n.nodeMap=u,n.nodeIdxMap=s,n.linkDistance=k(n.linkDistance,1),n.nodeStrength=k(n.nodeStrength,1),n.edgeStrength=k(n.edgeStrength,1);var c,l=n.nodeSize;if(n.preventOverlap){var d,p=n.nodeSpacing;d=o(p)?function(){return p}:m(p)?p:function(){return 0},c=l?i(l)?function(t){return Math.max(l[0],l[1])+d(t)}:function(t){return l+d(t)}:function(t){return t.size?i(t.size)?Math.max(t.size[0],t.size[1])+d(t):f(t.size)?Math.max(t.size.width,t.size.height)+d(t):t.size+d(t):10+d(t)}}n.nodeSize=c;var v=n.edges;n.degrees=h(r.length,n.nodeIdxMap,v),n.getMass||(n.getMass=function(t){return t.mass||n.degrees[n.nodeIdxMap[t.id]]||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(r)if(i||!a){for(var u=0;u<n;u++){var s=e.runOneStep(u);if(e.reachMoveThreshold(r,s,o))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var c=0;this.timeInterval=window.setInterval((function(){var t,i;if(r){var a=e.runOneStep(c)||[];e.reachMoveThreshold(r,a,o)&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval)),++c>=n&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var i=t.x-e[n].x,o=t.y-e[n].y;r+=Math.sqrt(i*i+o*o)})),(r/=t.length)<n},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes,i=n.edges,o=[],a=[];if(r){r.forEach((function(t,e){o[2*e]=0,o[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),n.calRepulsive(o,r),i&&n.calAttractive(o,i),n.calGravity(o,r);var u=Math.max(.02,n.interval-.002*t);n.updateVelocity(o,a,u,r);var s=[];return r.forEach((function(t){s.push({x:t.x,y:t.y})})),n.updatePosition(a,u,r),null===(e=n.tick)||void 0===e||e.call(n),s}},e.prototype.calRepulsive=function(t,e){var n=this,r=n.getMass,i=n.factor,o=n.coulombDisScale,a=n.preventOverlap,u=n.collideStrength,s=void 0===u?1:u,c=n.nodeStrength,f=n.nodeSize;e.forEach((function(n,u){var l=r?r(n):1;e.forEach((function(e,d){if(!(u>=d)){var h=n.x-e.x,p=n.y-e.y;0===h&&0===p&&(h=.01*Math.random(),p=.01*Math.random());var v=h*h+p*p,g=Math.sqrt(v),y=(g+.1)*o,m=h/g,b=p/g,_=.5*(c(n)+c(e))*i/(y*y),x=r?r(e):1;if(t[2*u]+=m*_,t[2*u+1]+=b*_,t[2*d]-=m*_,t[2*d+1]-=b*_,a&&(f(n)+f(e))/2>g){var w=s*(c(n)+c(e))*.5/v;t[2*u]+=m*w/l,t[2*u+1]+=b*w/l,t[2*d]-=m*w/x,t[2*d+1]-=b*w/x}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,i=n.nodeIdxMap,o=n.linkDistance,a=n.edgeStrength,u=n.nodeSize,s=n.getMass;e.forEach((function(e,n){var c=d(e,"source"),f=d(e,"target"),l=r[c],h=r[f],p=h.x-l.x,v=h.y-l.y;0===p&&0===v&&(p=.01*Math.random(),v=.01*Math.random());var g=Math.sqrt(p*p+v*v),y=p/g,m=v/g,b=((o(e,l,h)||1+(u(l)+u(l)||0)/2)-g)*a(e),_=i[c],x=i[f],w=s?s(l):1,E=s?s(h):1;t[2*_]-=y*b/w,t[2*_+1]-=m*b/w,t[2*x]+=y*b/E,t[2*x+1]+=m*b/E}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,i=n.gravity,a=n.degrees,u=e.length,s=0;s<u;s++){var c=e[s],f=c.x-r[0],l=c.y-r[1],d=i;if(n.getCenter){var h=n.getCenter(c,a[s]);h&&o(h[0])&&o(h[1])&&o(h[2])&&(f=c.x-h[0],l=c.y-h[1],d=h[2])}d&&(t[2*s]-=d*f,t[2*s+1]-=d*l)}},e.prototype.updateVelocity=function(t,e,n,r){var i=this,o=n*i.damping;r.forEach((function(n,r){var a=t[2*r]*o||.01,u=t[2*r+1]*o||.01,s=Math.sqrt(a*a+u*u);if(s>i.maxSpeed){var c=i.maxSpeed/s;a*=c,u*=c}e[2*r]=a,e[2*r+1]=u}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if(o(n.fx)&&o(n.fy))return n.x=n.fx,void(n.y=n.fy);var i=t[2*r]*e,a=t[2*r+1]*e;n.x+=i,n.y+=a}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(t);function M(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,u,s,c,f,l,d,h=t._root,p={data:r},v=t._x0,g=t._y0,y=t._x1,m=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a,i=h,!(h=h[l=f<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,h.data),s=+t._y.call(null,h.data),e===u&&n===s)return p.next=h,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a}while((l=f<<1|c)==(d=(s>=a)<<1|u>=o));return i[d]=h,i[l]=p,t}function R(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function P(t){return t[0]}function G(t){return t[1]}function L(t,e,n){var r=new j(null==e?P:e,null==n?G:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function j(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function U(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var F=L.prototype=j.prototype;function B(t){return function(){return t}}function z(t){return 1e-6*(t()-.5)}F.copy=function(){var t,e,n=new j(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=U(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=U(e));return n},F.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return M(this.cover(e,n),e,n,t)},F.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,u[n]=i,r<s&&(s=r),r>f&&(f=r),i<c&&(c=i),i>l&&(l=i));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;n<o;++n)M(this,a[n],u[n],t[n]);return this},F.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,u,s=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=c,c=a,s*=2,u){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},F.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},F.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},F.find=function(t,e,n){var r,i,o,a,u,s,c,f=this._x0,l=this._y0,d=this._x1,h=this._y1,p=[],v=this._root;for(v&&p.push(new R(v,f,l,d,h)),null==n?n=1/0:(f=t-n,l=e-n,d=t+n,h=e+n,n*=n);s=p.pop();)if(!(!(v=s.node)||(i=s.x0)>d||(o=s.y0)>h||(a=s.x1)<f||(u=s.y1)<l))if(v.length){var g=(i+a)/2,y=(o+u)/2;p.push(new R(v[3],g,y,a,u),new R(v[2],i,y,g,u),new R(v[1],g,o,a,y),new R(v[0],i,o,g,y)),(c=(e>=y)<<1|t>=g)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var m=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),_=m*m+b*b;if(_<n){var x=Math.sqrt(n=_);f=t-x,l=e-x,d=t+x,h=e+x,r=v.data}}return r},F.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,u,s,c,f,l,d,h=this._root,p=this._x0,v=this._y0,g=this._x1,y=this._y1;if(!h)return this;if(h.length)for(;;){if((c=o>=(u=(p+g)/2))?p=u:g=u,(f=a>=(s=(v+y)/2))?v=s:y=s,e=h,!(h=h[l=f<<1|c]))return this;if(!h.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,d=l)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},F.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},F.root=function(){return this._root},F.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},F.visit=function(t){var e,n,r,i,o,a,u=[],s=this._root;for(s&&u.push(new R(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&s.length){var c=(r+o)/2,f=(i+a)/2;(n=s[3])&&u.push(new R(n,c,f,o,a)),(n=s[2])&&u.push(new R(n,r,f,c,a)),(n=s[1])&&u.push(new R(n,c,i,o,f)),(n=s[0])&&u.push(new R(n,r,i,c,f))}return this},F.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new R(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,u=e.y0,s=e.x1,c=e.y1,f=(a+s)/2,l=(u+c)/2;(o=i[0])&&n.push(new R(o,a,u,f,l)),(o=i[1])&&n.push(new R(o,f,u,s,l)),(o=i[2])&&n.push(new R(o,a,l,f,c)),(o=i[3])&&n.push(new R(o,f,l,s,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},F.x=function(t){return arguments.length?(this._x=t,this):this._x},F.y=function(t){return arguments.length?(this._y=t,this):this._y};var V={value:()=>{}};function W(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new H(r)}function H(t){this._=t}function X(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function q(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Y(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=V,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}H.prototype=W.prototype={constructor:H,on:function(t,e){var n,r=this._,i=X(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=Y(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Y(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=q(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new H(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const K=W;var Z,$,J=0,Q=0,tt=0,et=0,nt=0,rt=0,it="object"==typeof performance&&performance.now?performance:Date,ot="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function at(){return nt||(ot(ut),nt=it.now()+rt)}function ut(){nt=0}function st(){this._call=this._time=this._next=null}function ct(t,e,n){var r=new st;return r.restart(t,e,n),r}function ft(){nt=(et=it.now())+rt,J=Q=0;try{!function(){at(),++J;for(var t,e=Z;e;)(t=nt-e._time)>=0&&e._call.call(null,t),e=e._next;--J}()}finally{J=0,function(){for(var t,e,n=Z,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Z=e);$=t,dt(r)}(),nt=0}}function lt(){var t=it.now(),e=t-et;e>1e3&&(rt-=e,et=t)}function dt(t){J||(Q&&(Q=clearTimeout(Q)),t-nt>24?(t<1/0&&(Q=setTimeout(ft,t-it.now()-rt)),tt&&(tt=clearInterval(tt))):(tt||(et=it.now(),tt=setInterval(lt,1e3)),J=1,ot(ft)))}st.prototype=ct.prototype={constructor:st,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?at():+n)+(null==e?0:+e),this._next||$===this||($?$._next=this:Z=this,$=this),this._call=t,this._time=n,dt()},stop:function(){this._call&&(this._call=null,this._time=1/0,dt())}};const ht=4294967296;function pt(t){return t.x}function vt(t){return t.y}var gt=Math.PI*(3-Math.sqrt(5));function yt(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,u=new Map,s=ct(l),c=K("tick","end"),f=function(){let t=1;return()=>(t=(1664525*t+1013904223)%ht)/ht}();function l(){d(),c.call("tick",e),n<r&&(s.stop(),c.call("end",e))}function d(r){var s,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(o-n)*i,u.forEach((function(t){t(n)})),s=0;s<f;++s)null==(c=t[s]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*gt;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,f),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return s.restart(l),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),u.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(f=t,u.forEach(p),e):f},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(i=e-(u=t[c]).x)*i+(o=n-u.y)*o)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function mt(){var t,e,n,r,i,o=B(-30),a=1,u=1/0,s=.81;function c(n){var i,o=t.length,a=L(t,pt,vt).visitAfter(l);for(r=n,i=0;i<o;++i)e=t[i],a.visit(d)}function f(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function l(t){var e,n,r,o,a,u=0,s=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,o+=n*e.y);t.x=r/s,t.y=o/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=i[e.data.index]}while(e=e.next)}t.value=u}function d(t,o,c,f){if(!t.value)return!0;var l=t.x-e.x,d=t.y-e.y,h=f-o,p=l*l+d*d;if(h*h/s<p)return p<u&&(0===l&&(p+=(l=z(n))*l),0===d&&(p+=(d=z(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=d*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=z(n))*l),0===d&&(p+=(d=z(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=i[t.data.index]*r/p,e.vx+=l*h,e.vy+=d*h)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:B(+t),f(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c}function bt(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;i<a;++i)u+=(o=n[i]).x,s+=o.y;for(u=(u/a-t)*r,s=(s/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=u,o.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}function _t(t){return t.index}function xt(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function wt(t){var e,n,r,i,o,a,u=_t,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=B(30),f=1;function l(r){for(var i=0,u=t.length;i<f;++i)for(var s,c,l,d,h,p,v,g=0;g<u;++g)c=(s=t[g]).source,d=(l=s.target).x+l.vx-c.x-c.vx||z(a),h=l.y+l.vy-c.y-c.vy||z(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*r*e[g],h*=p,l.vx-=d*(v=o[g]),l.vy-=h*v,c.vx+=d*(v=1-v),c.vy+=h*v}function d(){if(r){var a,s,c=r.length,f=t.length,l=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(a=0,i=new Array(c);a<f;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=xt(l,s.source)),"object"!=typeof s.target&&(s.target=xt(l,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(f);a<f;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(f),h(),n=new Array(f),p()}}function h(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,d()},l.links=function(e){return arguments.length?(t=e,d(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:B(+t),h(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:B(+t),p(),l):c},l}function Et(t){return t.x+t.vx}function St(t){return t.y+t.vy}function At(t){var e,n,r,i=1,o=1;function a(){for(var t,a,s,c,f,l,d,h=e.length,p=0;p<o;++p)for(a=L(e,Et,St).visitAfter(u),t=0;t<h;++t)s=e[t],l=n[s.index],d=l*l,c=s.x+s.vx,f=s.y+s.vy,a.visit(v);function v(t,e,n,o,a){var u=t.data,h=t.r,p=l+h;if(!u)return e>c+p||o<c-p||n>f+p||a<f-p;if(u.index>s.index){var v=c-u.x-u.vx,g=f-u.y-u.vy,y=v*v+g*g;y<p*p&&(0===v&&(y+=(v=z(r))*v),0===g&&(y+=(g=z(r))*g),y=(p-(y=Math.sqrt(y)))/y*i,s.vx+=(v*=y)*(p=(h*=h)/(d+h)),s.vy+=(g*=y)*p,u.vx-=v*(p=1-p),u.vy-=g*p)}}}function u(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=B(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),s(),a):t},a}function Tt(t){var e,n,r,i=B(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=B(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:B(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),a(),o):t},o}function It(t){var e,n,r,i=B(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=B(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:B(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),a(),o):t},o}var Nt="GPU_LAYOUT_END",Ot={gForce:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},Ct=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kt=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return Ct(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},e.prototype.init=function(t){var e=this;e.nodes=t.nodes||[];var n=t.edges||[];e.edges=n.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,u=e.alpha;if(i)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),r&&e.edgeForce?e.edgeForce.links(r):r&&!e.edgeForce&&(f=wt().id((function(t){return t.id})).links(r),e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f))),e.preventOverlap&&e.overlapProcess(i),i.alpha(u).restart(),this.ticking=!0;else try{var s=mt();if(e.nodeStrength&&s.strength(e.nodeStrength),i=yt().nodes(n),e.clustering){var c=function(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),i=t(-1),o=t(100),a=t(.1),u=[0,0],s=[],c={},f=[],l=100,h=100,p={none:{x:0,y:0}},v=[],g="force",y=!0,m=.1;function b(t){if(!y)return b;e.tick(),x();for(var r=0,i=s.length,o=void 0,a=t*m;r<i;++r)(o=s[r]).vx+=(p[n(o)].x-o.x)*a,o.vy+=(p[n(o)].y-o.y)*a}function _(){s&&function(){if(s&&s.length){if(void 0===n(s[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var t,u,p,g,y,m=(t=[],u=[],p={},y=[],g=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var i=n(t),o=r(t),a=e[i];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(o*o)*1.3,e[i]=a})),e}(s),y=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=d(t,"source"),r=d(t,"target"),i=n(c[e]),o=n(c[r]);return i<=o?"".concat(i,"~").concat(o):"".concat(o,"~").concat(i)}(t),i=0;void 0!==e[r]&&(i=e[r]),i+=1,e[r]=i})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],i=e.split("~")[0],o=e.split("~")[1];void 0!==i&&void 0!==o&&r.push({source:i,target:o,count:n})})),r}(f),Object.keys(g).forEach((function(e,n){var r=g[e];t.push({id:e,size:r.count,r:Math.sqrt(r.sumforceNodeSize/Math.PI)}),p[e]=n})),y.forEach((function(t){var e=d(t,"source"),n=d(t,"target"),r=p[e],i=p[n];void 0!==r&&void 0!==i&&u.push({source:r,target:i,count:t.count})})),{nodes:t,links:u});e=yt(m.nodes).force("x",Tt(l).strength(.1)).force("y",It(h).strength(.1)).force("collide",At((function(t){return t.r})).iterations(4)).force("charge",mt().strength(i)).force("links",wt(m.nodes.length?m.links:[]).distance(o).strength(a)),v=e.nodes(),x()}}()}function x(){return p={none:{x:0,y:0}},v.forEach((function(t){p[t.id]={x:t.x-u[0],y:t.y-u[1]}})),p}function w(t){c={},t.forEach((function(t){c[t.id]=t}))}return b.initialize=function(t){s=t,_()},b.template=function(t){return arguments.length?(g=t,_(),b):g},b.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},b):(n=t,b):n},b.enableGrouping=function(t){return arguments.length?(y=t,b):y},b.strength=function(t){return arguments.length?(m=t,b):m},b.centerX=function(t){return arguments.length?(l=t,b):l},b.centerY=function(t){return arguments.length?(h=t,b):h},b.nodes=function(t){return arguments.length?(w(t||[]),s=t||[],b):s},b.links=function(t){return arguments.length?(f=t||[],_(),b):f},b.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),_(),b):r},b.nodeSize=b.forceNodeSize,b.forceCharge=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),_(),b):i},b.forceLinkDistance=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),_(),b):o},b.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),_(),b):a},b.offset=function(t){return arguments.length?(u=t,b):u},b.getFocis=x,b}();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,i.force("group",c)}if(i.force("center",bt(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=wt().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}if(e.workerEnabled&&!Dt()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),h=1;h<=l;h++)i.tick(),postMessage({nodes:n,currentTick:h,totalTicks:l,type:"LAYOUT_TICK"},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,a=r.nodeSize,u=r.nodeSpacing,s=r.collideStrength;if(n=o(u)?function(){return u}:m(u)?u:function(){return 0},a)if(m(a))e=function(t){return a(t)+n(t)};else if(i(a)){var c=(a[0]>a[1]?a[0]:a[1])/2;e=function(t){return c+n(t)}}else if(o(a)){var l=a/2;e=function(t){return l+n(t)}}else e=function(){return 10};else e=function(t){return t.size?i(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",At(e).strength(s))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(t);function Dt(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var Mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Rt(t,e){var n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}var Pt=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return Mt(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this,n=e.nodes,r=e.edges,i=n.length;if(0!==i){e.width||"undefined"==typeof window||(e.width=window.innerWidth),e.height||"undefined"==typeof window||(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var o=e.center;if(1===i)return n[0].x=o[0],n[0].y=o[1],void(e.onLayoutEnd&&e.onLayoutEnd());var a=e.radius,u=e.startRadius,s=e.endRadius,c=e.divisions,f=e.startAngle,l=e.endAngle,d=e.angleRatio,p=e.ordering,v=e.clockwise,g=e.nodeSpacing,y=e.nodeSize,m=(l-f)/i,b={};n.forEach((function(t,e){b[t.id]=e})),e.nodeMap=b;var x=h(n.length,b,r);if(e.degrees=x,g){var w=_(10,g),E=_(10,y),S=-1/0;n.forEach((function(t){var e=E(t);S<e&&(S=e)}));var A=0;n.forEach((function(t,e){A+=0===e?S||10:(w(t)||0)+(S||10)})),a=A/(2*Math.PI)}else a||u||s?!u&&s?u=s:u&&!s&&(s=u):a=e.height>e.width?e.width/2:e.height/2;var T=m*d,I=[];I="topology"===p?e.topologyOrdering():"topology-directed"===p?e.topologyOrdering(!0):"degree"===p?e.degreeOrdering():n;for(var N=Math.ceil(i/c),O=0;O<i;++O){var C=a;C||null===u||null===s||(C=u+O*(s-u)/(i-1)),C||(C=10+100*O/(i-1));var k=f+O%N*T+2*Math.PI/c*Math.floor(O/N);v||(k=l-O%N*T-2*Math.PI/c*Math.floor(O/N)),I[O].x=o[0]+Math.cos(k)*C,I[O].y=o[1]+Math.sin(k)*C,I[O].weight=x[O]}return null===(t=e.onLayoutEnd)||void 0===t||t.call(e),{nodes:I,edges:this.edges}}e.onLayoutEnd&&e.onLayoutEnd()},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this,n=e.degrees,r=e.edges,i=e.nodes,o=l(i),a=e.nodeMap,u=[o[0]],s=[i[0]],c=[],f=i.length;c[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=d(e,"source"),i=d(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].parent;u.push(t[a].id),s.push(t[o].id)})):e.forEach((function(e){var r=d(e,"source"),i=d(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].children;u.push(t[a].id),s.push(t[o].id)}))}(o,r,a,t);var h=0;return o.forEach((function(t,e){if(0!==e)if(e!==f-1&&n[e]===n[e+1]&&!function(t,e,n){for(var r=n.length,i=0;i<r;i++){var o=d(n[i],"source"),a=d(n[i],"target");if(t.id===o&&e.id===a||e.id===o&&t.id===a)return!0}return!1}(u[h],t,r)||c[e]){for(var l=u[h].children,p=!1,v=0;v<l.length;v++){var g=a[l[v]];if(n[g]===n[e]&&!c[g]){u.push(o[g]),s.push(i[a[o[g].id]]),c[g]=!0,p=!0;break}}for(var y=0;!p&&(c[y]||(u.push(o[y]),s.push(i[a[o[y].id]]),c[y]=!0,p=!0),++y!==f););}else u.push(t),s.push(i[a[t.id]]),c[e]=!0,h++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r],e.push(t)})),e.sort(Rt),e},e.prototype.getType=function(){return"circular"},e}(t),Gt=function(t,e){if("next"!==t&&"prev"!==t)return e},Lt=function(t){t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev};const jt=function(){function t(){var t={};t.prev=t,t.next=t.prev,this.shortcut=t}return t.prototype.dequeue=function(){var t=this.shortcut,e=t.prev;if(e&&e!==t)return Lt(e),e},t.prototype.enqueue=function(t){var e=this.shortcut;t.prev&&t.next&&Lt(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e},t.prototype.toString=function(){for(var t=[],e=this.shortcut,n=e.prev;n!==e;)t.push(JSON.stringify(n,Gt)),n=null==n?void 0:n.prev;return"[".concat(t.join(", "),"]")},t}();var Ut;function Ft(t,e){var n=t.get(e)||0;t.set(e,n+1)}function Bt(t,e){var n=t.get(e);void 0!==n&&((n-=1)>0?t.set(e,n):t.delete(e))}function zt(t,e,n,r){var i=String(e),o=String(n);if(!t&&i>o){var a=i;i=o,o=a}return i+Ut.EDGE_KEY_DELIM+o+Ut.EDGE_KEY_DELIM+(void 0===r?Ut.DEFAULT_EDGE_NAME:r)}function Vt(t,e,n,r){var i=String(e),o=String(n),a={v:e,w:n};if(!t&&i>o){var u=a.v;a.v=a.w,a.w=u}return void 0!==r&&(a.name=r),a}function Wt(t,e){return zt(t,e.v,e.w,e.name)}function Ht(t){return!!(t&&t.constructor&&t.call&&t.apply)}!function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}(Ut||(Ut={}));var Xt=function(t){return t.nodes().map((function(e){var n={id:e,value:t.node(e),parent:t.parent(e)};return void 0===n.value&&delete n.value,void 0===n.parent&&delete n.parent,n}))},qt=function(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w,value:n,name:e.name};return void 0===r.name&&delete r.name,void 0===r.value&&delete r.value,r}))},Yt=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Xt(t),edges:qt(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function Kt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kt(Object(n),!0).forEach((function(e){$t(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qt(t,e,n){return e&&Jt(t.prototype,e),n&&Jt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ee={compound:!1,multigraph:!1,directed:!0},ne=Qt((function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};te(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=Ut.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return Ht(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.inEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.sinks=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.outEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.setNode=function(t,n){var r,i=e.nodesLabelMap,o=e.defaultNodeLabelFn,a=e.isCompound,u=e.parentMap,s=e.childrenMap,c=e.inEdgesMap,f=e.outEdgesMap,l=e.predecessorsMap,d=e.successorsMap;return i.has(t)?(void 0!==n&&i.set(t,n),e):(i.set(t,n||o(t)),a()&&(null==u||u.set(t,e.GRAPH_NODE),null==s||s.set(t,new Map),(null==s?void 0:s.has(e.GRAPH_NODE))||null==s||s.set(e.GRAPH_NODE,new Map),null==s||null===(r=s.get(e.GRAPH_NODE))||void 0===r||r.set(t,!0)),[c,f,l,d].forEach((function(e){return e.set(t,new Map)})),e.nodeCountNum+=1,e)},this.setNodes=function(t,n){return t.map((function(t){return e.setNode(t,n)})),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var n,r=null===(n=e.parentMap)||void 0===n?void 0:n.get(t);if(r!==e.GRAPH_NODE)return r}},this.removeFromParentsChildList=function(t){var n=e.parentMap.get(t);e.childrenMap.get(n).delete(t)},this.setParent=function(t,n){var r,i;e.checkCompound();for(var o=void 0===n?e.GRAPH_NODE:n,a=e.parent(o);a;){if(t===a)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");a=e.parent(a)}n&&e.setNode(n),e.setNode(t),e.removeFromParentsChildList(t),null===(r=e.parentMap)||void 0===r||r.set(t,o);var u=e.childrenMap.get(o);return u.set(t,!0),null===(i=e.childrenMap)||void 0===i||i.set(o,u),e},this.children=function(t){var n=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var r,i=null===(r=e.childrenMap)||void 0===r?void 0:r.get(n);return i?Array.from(i.keys()):void 0}return n===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var n=e.predecessorsMap.get(t);return n?Array.from(n.keys()):void 0},this.successors=function(t){var n=e.successorsMap.get(t);return n?Array.from(n.keys()):void 0},this.neighbors=function(t){var n;if(e.hasNode(t))return Array.from(new Set(null===(n=e.predecessors(t))||void 0===n?void 0:n.concat(e.successors(t))))},this.isLeaf=function(t){var n,r;return e.isDirected()?!(null===(r=e.successors(t))||void 0===r?void 0:r.length):!(null===(n=e.neighbors(t))||void 0===n?void 0:n.length)},this.filterNodes=function(n){var r=e.directed,i=e.multigraph,o=e.compound,a=new t({directed:r,multigraph:i,compound:o});return a.setGraph(e.graph()),e.nodes().forEach((function(t){n(t)&&a.setNode(t,e.node(t))})),e.edges().forEach((function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))})),o&&a.nodes().forEach((function(t){a.setParent(t,function(t){for(var n=e.parent(t);void 0!==n&&!a.hasNode(n);)n=e.parent(n);return n}(t))})),a},this.removeNode=function(t){if(e.hasNode(t)){var n,r,i,o=function(t){e.removeEdge(t.v,t.w,t.name)},a=e.inEdgesMap,u=e.outEdgesMap,s=e.predecessorsMap,c=e.successorsMap,f=e.nodesLabelMap;e.isCompound()&&(e.removeFromParentsChildList(t),null===(n=e.parentMap)||void 0===n||n.delete(t),null===(r=e.children(t))||void 0===r||r.forEach((function(t){return e.setParent(t)})),null===(i=e.childrenMap)||void 0===i||i.delete(t));var l=a.get(t),d=u.get(t);Array.from(l.values()).forEach((function(t){return o(t)})),Array.from(d.values()).forEach((function(t){return o(t)})),f.delete(t),a.delete(t),u.delete(t),s.delete(t),c.delete(t),e.nodeCountNum-=1}return e},this.setDefaultEdgeLabel=function(t){return Ht(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdge=function(t,n,r,i){var o,a,u=Vt(e.isDirected(),t,n,i),s=Wt(e.isDirected(),u),c=u.v,f=u.w;if(e.edgesLabelsMap.has(s))return e.edgesLabelsMap.set(s,r),e;if(void 0!==i&&!e.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");e.setNode(c),e.setNode(f),e.edgesLabelsMap.set(s,r||e.defaultEdgeLabelFn(c,f,i)),Object.freeze(u),e.edgesMap.set(s,u);var l=e.predecessorsMap.get(f),d=e.successorsMap.get(c);return Ft(l,c),Ft(d,f),null===(o=e.inEdgesMap.get(f))||void 0===o||o.set(s,u),null===(a=e.outEdgesMap.get(c))||void 0===a||a.set(s,u),e.edgeCountNum+=1,e},this.setEdgeObj=function(t,n){return e.setEdge(t.v,t.w,n,t.name)},this.setPath=function(t,n){return t.reduce((function(t,r){return e.setEdge(t,r,n),r})),e},this.edgeFromArgs=function(t,n,r){return e.edge({v:t,w:n,name:r})},this.edge=function(t){return e.edgesLabelsMap.get(Wt(e.isDirected(),t))},this.hasEdge=function(t,n,r){return e.edgesLabelsMap.has(Wt(e.isDirected(),{v:t,w:n,name:r}))},this.removeEdge=function(t,n,r){var i=zt(e.isDirected(),t,n,r);if(e.edgesMap.get(i)){var o=Vt(e.isDirected(),t,n,r),a=o.v,u=o.w;e.edgesLabelsMap.delete(i),e.edgesMap.delete(i);var s=e.predecessorsMap.get(u),c=e.successorsMap.get(a);Bt(s,a),Bt(c,u),e.inEdgesMap.get(u).delete(i),e.outEdgesMap.get(a).delete(i),e.edgeCountNum-=1}return e},this.removeEdgeObj=function(t){var n=t.v,r=t.w,i=t.name;return e.removeEdge(n,r,i)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,n){var r=e.inEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.v===n}))},this.outEdges=function(t,n){var r=e.outEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.w===n}))},this.nodeEdges=function(t,n){var r;if(e.hasNode(t))return null===(r=e.inEdges(t,n))||void 0===r?void 0:r.concat(e.outEdges(t,n))},this.toJSON=function(){return Yt(e)};var r=Zt(Zt({},ee),n);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}));ne.fromJSON=function(t){var e=new ne(t.options);return void 0!==t.value&&e.setGraph(t.value),t.nodes.forEach((function(t){e.setNode(t.id,t.value),t.parent&&e.setParent(t.id,t.parent)})),t.edges.forEach((function(t){e.setEdge(t.v,t.w,t.value,t.name)})),e},Error;var re=function t(e,n,r,i,o,a){i.includes(n)||(i.push(n),r||a.push(n),o(n).forEach((function(n){return t(e,n,r,i,o,a)})),r&&a.push(n))};const ie=function(t,e,n){var r=Array.isArray(e)?e:[e],i=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},o=[],a=[];return r.forEach((function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);re(t,e,"post"===n,a,i,o)})),o};var oe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ae=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oe(e,t),e}(jt),ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oe(e,t),e}(ne),se=function(){return 1},ce=function(t,e,n,r,i){var o,a,u=[];return null===(o=t.inEdges(r.v))||void 0===o||o.forEach((function(r){var o=t.edge(r),a=t.node(r.v);i&&u.push({v:r.v,w:r.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=o,fe(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var i=t.edge(r),o=r.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,fe(e,n,a)})),t.removeNode(r.v),i?u:void 0},fe=function(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)};const le=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new ue,r=0,i=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var o=n.edge(t)||0,a=(null==e?void 0:e(t))||1,u=o+a;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var o=[],a=i+r+3,u=0;u<a;u++)o.push(new ae);var s=r+1;return n.nodes().forEach((function(t){fe(o,s,n.node(t))})),{buckets:o,zeroIdx:s,graph:n}}(t,e||se);return null===(n=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)ce(t,e,n,r);for(;r=o.dequeue();)ce(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(ce(t,e,n,r,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx).map((function(e){return t.outEdges(e.v,e.w)})))||void 0===n?void 0:n.flat()};var de=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),he=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return de(e,t),e}(ne),pe=function(t,e,n,r){var i;do{i="".concat(r).concat(Math.random())}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i},ve=function(t){var e=new he({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){e.setEdgeObj(n,t.edge(n))})),e},ge=function(t,e){var n,r,i=Number(t.x),o=Number(t.y),a=Number(e.x)-i,u=Number(e.y)-o,s=Number(t.width)/2,c=Number(t.height)/2;return a||u?(Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:i+n,y:o+r}):{x:0,y:0}},ye=function(t){for(var e=[],n=be(t)+1,r=0;r<n;r++)e.push([]);for(t.nodes().forEach((function(n){var r=t.node(n).rank;void 0!==r&&e[r]&&e[r].push(n)})),r=0;r<n;r++)e[r]=e[r].sort((function(e,n){var r,i,o,a;return o=null===(r=t.node(e))||void 0===r?void 0:r.order,a=null===(i=t.node(n))||void 0===i?void 0:i.order,Number(o)-Number(a)}));return e},me=function(t,e,n,r){var i={width:0,height:0};return o(n)&&o(r)&&(i.rank=n,i.order=r),pe(t,"border",i,e)},be=function(t){var e;return t.nodes().forEach((function(n){var r,i=null===(r=t.node(n))||void 0===r?void 0:r.rank;void 0!==i&&(void 0===e||i>e)&&(e=i)})),e||(e=0),e},_e=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}},xe=function(t,e){return e()},we=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))};const Ee=function(t){t.graph().dummyChains=[],t.edges().forEach((function(e){return function(t,e){var n=e.v,r=t.node(n).rank,i=e.w,o=t.node(i).rank,a=e.name,u=t.edge(e),s=u.labelRank;if(o!==r+1){t.removeEdgeObj(e);var c,f,l,d=t.graph();for(l=0,++r;r<o;++l,++r)u.points=[],c=pe(t,"edge",f={edgeLabel:u,width:0,height:0,edgeObj:e,rank:r},"_d"),r===s&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),t.setEdge(n,c,{weight:u.weight},a),0===l&&(d.dummyChains||(d.dummyChains=[]),d.dummyChains.push(c)),n=c;t.setEdge(n,i,{weight:u.weight},a)}}(t,e)}))};var Se=function(t){var e,n={},r=function e(r){var i,o,a=t.node(r);return n[r]?a.rank:(n[r]=!0,null===(i=t.outEdges(r))||void 0===i||i.forEach((function(n){var r=e(n.w)-t.edge(n).minlen;r&&(void 0===o||r<o)&&(o=r)})),o||(o=0),a.rank=o,o)};null===(e=t.sources())||void 0===e||e.forEach((function(t){return r(t)}))},Ae=function(t){var e,n,r={},i=function e(i){var o,a,u=t.node(i);return r[i]?u.rank:(r[i]=!0,null===(o=t.outEdges(i))||void 0===o||o.forEach((function(n){var r=e(n.w)-t.edge(n).minlen;r&&(void 0===a||r<a)&&(a=r)})),a||(a=0),(void 0===n||a<n)&&(n=a),u.rank=a,a)};null===(e=t.sources())||void 0===e||e.forEach((function(t){return i(t)})),void 0===n&&(n=0);var o=function e(n,r){var i,o=t.node(n),a=isNaN(o.layer)?r:o.layer;(void 0===o.rank||o.rank<a)&&(o.rank=a),null===(i=t.outEdges(n))||void 0===i||i.map((function(n){e(n.w,a+t.edge(n).minlen)}))};t.nodes().forEach((function(e){var r=t.node(e);isNaN(r.layer)?r.rank-=n:o(e,r.layer)}))},Te=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},Ie=function(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||Te(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},Ne=function(t,e){return t.nodes().forEach((function n(r){var i;null===(i=e.nodeEdges(r))||void 0===i||i.forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||void 0===e.node(a).layer&&Te(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},Oe=function(t,e){return we(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?Te(e,n):1/0}))},Ce=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},ke=function(t,e){return ie(t,e,"pre")},De=function(t,e){return ie(t,e,"post")},Me=function(t,e){var n=De(t,t.nodes());null==(n=null==n?void 0:n.slice(0,(null==n?void 0:n.length)-1))||n.forEach((function(n){Re(t,e,n)}))},Re=function(t,e,n){var r=t.node(n).parent;t.edgeFromArgs(n,r).cutvalue=Pe(t,e,n)},Pe=function(t,e,n){var r,i=t.node(n).parent,o=!0,a=e.edgeFromArgs(n,i),u=0;return a||(o=!1,a=e.edgeFromArgs(i,n)),u=a.weight,null===(r=e.nodeEdges(n))||void 0===r||r.forEach((function(r){var a=r.v===n,s=a?r.w:r.v;if(s!==i){var c=a===o,f=e.edge(r).weight;if(u+=c?f:-f,ze(t,n,s)){var l=t.edgeFromArgs(n,s).cutvalue;u+=c?-l:l}}})),u},Ge=function(t,e){void 0===e&&(e=t.nodes()[0]),Le(t,{},1,e)},Le=function t(e,n,r,i,o){var a,u=r,s=r,c=e.node(i);return n[i]=!0,null===(a=e.neighbors(i))||void 0===a||a.forEach((function(r){n[r]||(s=t(e,n,s,r,i))})),c.low=u,c.lim=s++,o?c.parent=o:delete c.parent,s},je=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},Ue=function(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var o=t.node(r),a=t.node(i),u=o,s=!1;o.lim>a.lim&&(u=a,s=!0);var c=e.edges().filter((function(e){return s===Ve(t,t.node(e.v),u)&&s!==Ve(t,t.node(e.w),u)}));return we(c,(function(t){return Te(e,t)}))},Fe=function(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),Ge(t),Me(t,e),Be(t,e)},Be=function(t,e){var n=t.nodes().find((function(t){var n;return!(null===(n=e.node(t))||void 0===n?void 0:n.parent)})),r=ke(t,n);null==(r=null==r?void 0:r.slice(1))||r.forEach((function(n){var r=t.node(n).parent,i=e.edgeFromArgs(n,r),o=!1;i||(i=e.edgeFromArgs(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))},ze=function(t,e,n){return t.hasEdge(e,n)},Ve=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};const We=function(t){var e=function(t){var e=(new he).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e}(t);Se(e);var n,r,i=function(t){var e,n,r=new he({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});Ie(r,t)<o;)e=Oe(r,t),n=r.hasNode(e.v)?Te(t,e):-Te(t,e),Ce(r,t,n);return r}(e);for(Ge(i),Me(i,e);n=je(i);)r=Ue(i,e,n),Fe(i,e,n,r)};var He=Se,Xe=function(t){Ae(t),function(t){var e,n,r=new he({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});Ne(r,t)<o;)e=Oe(r,t),n=r.hasNode(e.v)?Te(t,e):-Te(t,e),Ce(r,t,n)}(t)};const qe=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){We(t)}(t);break;case"tight-tree":default:Xe(t);break;case"longest-path":He(t)}};var Ye=function t(e,n,r,i,o,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=me(e,"_bt"),f=me(e,"_bb"),l=e.node(u);e.setParent(c,u),l.borderTop=c,e.setParent(f,u),l.borderBottom=f,null==s||s.forEach((function(s){t(e,n,r,i,o,a,s);var l=e.node(s),d=l.borderTop?l.borderTop:s,h=l.borderBottom?l.borderBottom:s,p=l.borderTop?i:2*i,v=d!==h?1:o-a[u]+1;e.setEdge(c,d,{minlen:v,weight:p,nestingEdge:!0}),e.setEdge(h,f,{minlen:v,weight:p,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:o+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})},Ke=function(t){var e,n={},r=function e(r,i){var o=t.children(r);null==o||o.forEach((function(t){return e(t,i+1)})),n[r]=i};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n};const Ze=function(t){var e,n=pe(t,"root",{},"_root"),r=Ke(t),i=Math.max.apply(Math,Object.values(r));Math.abs(i)===1/0&&(i=1);var o=i-1,a=2*o+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=a}));var u=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e}(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){Ye(t,n,a,u,o,r,e)})),t.graph().nodeRankFactor=a};var $e=function(t,e,n,r,i,o){var a={rank:o,borderType:e,width:0,height:0},u=i[e][o-1],s=pe(t,"border",a,n);i[e][o]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const Je=function(t){var e,n=function e(n){var r=t.children(n),i=t.node(n);if((null==r?void 0:r.length)&&r.forEach((function(t){return e(t)})),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;o+=1)$e(t,"borderLeft","_bl",n,i,o),$e(t,"borderRight","_br",n,i,o)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var Qe=function(t){t.nodes().forEach((function(e){tn(t.node(e))})),t.edges().forEach((function(e){tn(t.edge(e))}))},tn=function(t){var e=t.width;t.width=t.height,t.height=e},en=function(t){(null==t?void 0:t.y)&&(t.y=-t.y)},nn=function(t){var e=t.x;t.x=t.y,t.y=e};const rn=function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==n&&"rl"!==n||function(t){t.nodes().forEach((function(e){en(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return en(t)})),r.hasOwnProperty("y")&&en(r)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){nn(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return nn(t)})),r.hasOwnProperty("x")&&nn(r)}))}(t),Qe(t))},on=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),i=Math.max.apply(Math,r),o=[],a=0;a<i+1;a++)o.push([]);var u=n.sort((function(e,n){return t.node(e).rank-t.node(n).rank})),s=u.filter((function(e){return void 0!==t.node(e).fixorder})),c=s.sort((function(e,n){return t.node(e).fixorder-t.node(n).fixorder}));return null==c||c.forEach((function(n){isNaN(t.node(n).rank)||o[t.node(n).rank].push(n),e[n]=!0})),null==u||u.forEach((function n(r){var i;if(!e.hasOwnProperty(r)){e[r]=!0;var a=t.node(r);isNaN(a.rank)||o[a.rank].push(r),null===(i=t.successors(r))||void 0===i||i.forEach((function(t){return n(t)}))}})),o};var an=function(t,e,n){for(var r=function(t,e){return null==t?void 0:t.reduce((function(t,n,r){return t[n]=e[r],t}),{})}(n,n.map((function(t,e){return e}))),i=e.map((function(e){var n,i=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:r[e.w]||0,weight:t.edge(e).weight}}));return null==i?void 0:i.sort((function(t,e){return t.pos-e.pos}))})),o=i.flat().filter((function(t){return void 0!==t})),a=1;a<n.length;)a<<=1;var u=2*a-1;a-=1;var s=Array(u).fill(0,0,u),c=0;return null==o||o.forEach((function(t){if(t){var e=t.pos+a;s[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;c+=t.weight*n}})),c};const un=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);r+=1)n+=an(t,e[r-1],e[r]);return n};const sn=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root".concat(Math.random())););return e}(t),i=new he({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(o){var a,u=t.node(o),s=t.parent(o);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(i.setNode(o),i.setParent(o,s||r),null===(a=t[n](o))||void 0===a||a.forEach((function(e){var n=e.v===o?e.w:e.v,r=i.edgeFromArgs(n,o),a=void 0!==r?r.weight:0;i.setEdge(n,o,{weight:t.edge(e).weight+a})})),u.hasOwnProperty("minRank")&&i.setNode(o,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),i};var cn=function(t,e){var n,r=0,i=0;t.weight&&(r+=t.barycenter*t.weight,i+=t.weight),e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};const fn=function(t,e){var n,r,i,o={};return null==t||t.forEach((function(t,e){o[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var n=o[t.v];void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(n=e.edges())||void 0===n||n.forEach((function(t){var e=o[t.v],n=o[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(o[t.w]))})),function(t){for(var e,n,r=[],i=function(){var i=t.pop();r.push(i),null===(e=i.in.reverse())||void 0===e||e.forEach((function(t){return(e=i,function(t){t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&cn(e,t)})(t);var e})),null===(n=i.out)||void 0===n||n.forEach((function(e){return(n=i,function(e){e.in.push(n),0==--e.indegree&&t.push(e)})(e);var n}))};null==t?void 0:t.length;)i();var o=r.filter((function(t){return!t.merged})),a=["vs","i","barycenter","weight"];return o.map((function(t){var e={};return null==a||a.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))}(null===(i=(r=Object.values(o)).filter)||void 0===i?void 0:i.call(r,(function(t){return!t.indegree})))};var ln=function(t,e,n){for(var r,i=n;e.length&&(r=e[e.length-1]).i<=i;)e.pop(),null==t||t.push(r.vs),i++;return i};const dn=function(t,e,n){var r=function(t,e){var n={lhs:[],rhs:[]};return null==t||t.forEach((function(t){var e;(e=t).hasOwnProperty("fixorder")&&!isNaN(e.fixorder)||e.hasOwnProperty("barycenter")?n.lhs.push(t):n.rhs.push(t)})),n}(t),i=r.lhs,o=r.rhs.sort((function(t,e){return-t.i- -e.i})),a=[],u=0,s=0,c=0;null==i||i.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenter<r.barycenter)return-1;if(n.barycenter>r.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.order<r.order)return-1;if(n.order>r.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),c=ln(a,o,c),null==i||i.forEach((function(t){var e;c+=null===(e=t.vs)||void 0===e?void 0:e.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=ln(a,o,c)}));var f={vs:a.flat()};return s&&(f.barycenter=u/s,f.weight=s),f};const hn=function t(e,n,r,i,o){var a,u,s,c,f=e.children(n),l=e.node(n),d=l?l.borderLeft:void 0,h=l?l.borderRight:void 0,p={};d&&(f=null==f?void 0:f.filter((function(t){return t!==d&&t!==h})));var v=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null==n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return null==n||n.forEach((function(e){var n=t.edge(e),i=t.node(e.v);r.sum+=n.weight*i.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}(e,f||[]);null==v||v.forEach((function(n){var o,a,u;if(null===(o=e.children(n.v))||void 0===o?void 0:o.length){var s=t(e,n.v,r,i);p[n.v]=s,s.hasOwnProperty("barycenter")&&(u=s,void 0!==(a=n).barycenter?(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight):(a.barycenter=u.barycenter,a.weight=u.weight))}}));var g=fn(v,r);(function(t,e){null==t||t.forEach((function(t){var n,r=null===(n=t.vs)||void 0===n?void 0:n.map((function(t){return e[t]?e[t].vs:t}));t.vs=r.flat()}))})(g,p),null===(a=g.filter((function(t){return t.vs.length>0})))||void 0===a||a.forEach((function(t){var n=e.node(t.vs[0]);n&&(t.fixorder=n.fixorder,t.order=n.order)}));var y=dn(g,i,o);if(d&&(y.vs=[d,y.vs,h].flat(),null===(u=e.predecessors(d))||void 0===u?void 0:u.length)){var m=e.node((null===(s=e.predecessors(d))||void 0===s?void 0:s[0])||""),b=e.node((null===(c=e.predecessors(h))||void 0===c?void 0:c[0])||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+m.order+b.order)/(y.weight+2),y.weight+=2}return y};var pn=function(t,e,n){return e.map((function(e){return sn(t,e,n)}))},vn=function(t,e,n){var r=new he;null==t||t.forEach((function(t){for(var i,o=t.graph().root,a=hn(t,o,r,e,n),u=0;u<(null===(i=a.vs)||void 0===i?void 0:i.length);u++){var s=t.node(a.vs[u]);s&&(s.order=u)}!function(t,e,n){var r,i={};null==n||n.forEach((function(n){for(var o,a,u=t.parent(n);u;){if((o=t.parent(u))?(a=i[o],i[o]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=o}}))}(t,r,a.vs)}))},gn=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};var yn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return yn(e,t),e}(ne),bn=function(t,e){var n,r;if(null===(n=t.node(e))||void 0===n?void 0:n.dummy)return null===(r=t.predecessors(e))||void 0===r?void 0:r.find((function(e){return t.node(e).dummy}))},_n=function(t,e,n){var r=e,i=n;if(r>i){var o=r;r=i,i=o}var a=t[r];a||(t[r]=a={}),a[i]=!0},xn=function(t,e,n){var r=e;return r>n&&(r=n),!!t[r]},wn=function(t,e,n,r){var i=new mn,o=t.graph(),a=En(o.nodesep,o.edgesep,r);return null==e||e.forEach((function(e){var r;null==e||e.forEach((function(e){var o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edgeFromArgs(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e}))})),i};var En=function(t,e,n){return function(r,i,o){var a,u=r.node(i),s=r.node(o),c=0;if(c+=u.width/2,u.hasOwnProperty("labelpos"))switch((u.labelpos||"").toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,s.labelpos)switch((s.labelpos||"").toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}},Sn=function(t,e){return t.node(e).width||0};const An=function(t){var e,n=ve(t);!function(t){var e=ye(t),n=t.graph().ranksep,r=0;null==e||e.forEach((function(e){var i=e.map((function(e){return t.node(e).height})),o=Math.max.apply(Math,i);null==e||e.forEach((function(e){t.node(e).y=r+o/2})),r+=o+n}))}(n);var r=function(t){var e=ye(t),n=Object.assign(function(t,e){var n={};return(null==e?void 0:e.length)&&e.reduce((function(e,r){var i=0,o=0,a=e.length,u=null==r?void 0:r[(null==r?void 0:r.length)-1];return null==r||r.forEach((function(e,s){var c,f=bn(t,e),l=f?t.node(f).order:a;(f||e===u)&&(null===(c=r.slice(o,s+1))||void 0===c||c.forEach((function(e){var r;null===(r=t.predecessors(e))||void 0===r||r.forEach((function(r){var o,a=t.node(r),u=a.order;!(u<i||l<u)||a.dummy&&(null===(o=t.node(e))||void 0===o?void 0:o.dummy)||_n(n,r,e)}))})),o=s+1,i=l)})),r})),n}(t,e),function(t,e){var n={},r=function(e,r,i,o,a){for(var u,s=[],c=r;c<i;c++)s.push(c);s.forEach((function(r){var i,s;u=e[r],(null===(i=t.node(u))||void 0===i?void 0:i.dummy)&&(null===(s=t.predecessors(u))||void 0===s||s.forEach((function(e){var r=t.node(e);r.dummy&&(r.order<o||r.order>a)&&_n(n,e,u)})))}))};return(null==e?void 0:e.length)&&e.reduce((function(e,n){var i,o=-1,a=0;return null==n||n.forEach((function(u,s){var c;if("border"===(null===(c=t.node(u))||void 0===c?void 0:c.dummy)){var f=t.predecessors(u)||[];f.length&&(i=t.node(f[0]).order,r(n,a,s,o,i),a=s,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,e)),r={},i=[];["u","d"].forEach((function(o){i="u"===o?e:Object.values(e).reverse(),["l","r"].forEach((function(e){"r"===e&&(i=i.map((function(t){return Object.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var i={},o={},a={};return null==e||e.forEach((function(t){null==t||t.forEach((function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),null==e||e.forEach((function(t){var e=-1;null==t||t.forEach((function(t){var u=r(t);if(u.length)for(var s=((u=u.sort((function(t,e){return a[t]-a[e]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];o[t]===t&&e<a[l]&&!xn(n,t,l)&&(o[l]=t,o[t]=i[t]=i[l],e=a[l])}}))})),{root:i,align:o}}(0,i,n,a),s=function(t,e,n,r,i){var o,a={},u=wn(t,e,n,i),s=i?"borderLeft":"borderRight",c=function(t,e){for(var n=u.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()};return c((function(t){a[t]=(u.inEdges(t)||[]).reduce((function(t,e){return Math.max(t,(a[e.v]||0)+u.edge(e))}),0)}),u.predecessors.bind(u)),c((function(e){var n=(u.outEdges(e)||[]).reduce((function(t,e){return Math.min(t,(a[e.w]||0)-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==s&&(a[e]=Math.max(a[e],n))}),u.successors.bind(u)),null===(o=Object.values(r))||void 0===o||o.forEach((function(t){a[t]=a[n[t]]})),a}(t,i,u.root,u.align,"r"===e);"r"===e&&Object.keys(s).forEach((function(t){return s[t]=-s[t]})),r[o+e]=s}))}));var o=function(t,e){return we(Object.values(e),(function(e){var n,r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return null===(n=Object.keys(e))||void 0===n||n.forEach((function(n){var o=e[n],a=Sn(t,n)/2;r=Math.max(o+a,r),i=Math.min(o-a,i)})),r-i}))}(t,r);return o&&function(t,e){var n=Object.values(e),r=Math.min.apply(Math,n),i=Math.max.apply(Math,n);["u","d"].forEach((function(n){["l","r"].forEach((function(o){var a,u=n+o,s=t[u];if(s!==e){var c=Object.values(s);(a="l"===o?r-Math.min.apply(Math,c):i-Math.max.apply(Math,c))&&(t[u]={},Object.keys(s).forEach((function(e){t[u][e]=s[e]+a})))}}))}))}(r,o),function(t,e){var n={};return Object.keys(t.ul).forEach((function(r){if(e)n[r]=t[e.toLowerCase()][r];else{var i=Object.values(t).map((function(t){return t[r]})).sort((function(t,e){return t-e}));n[r]=(i[1]+i[2])/2}})),n}(r,t.graph().align)}(n);null===(e=Object.keys(r))||void 0===e||e.forEach((function(t){n.node(t).x=r[t]}))};var Tn=function(){return Tn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Tn.apply(this,arguments)},In=function(t,e,n){e(" removeSelfEdges",(function(){Wn(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?le(t,function(t){return function(e){var n;return(null===(n=t.edge(e))||void 0===n?void 0:n.weight)||1}}(t)):function(t){var e=[],n={},r={};return t.nodes().forEach((function i(o){var a;r[o]||(r[o]=!0,n[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach((function(t){n[t.w]?e.push(t):i(t.w)})),delete n[o])})),e}(t);null==e||e.forEach((function(e){var n=t.edge(e);t.removeEdgeObj(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-".concat(Math.random()))}))}(t)})),e(" nestingGraph.run",(function(){Ze(t)})),e(" rank",(function(){qe(ve(t))})),e(" injectEdgeLabelProxies",(function(){Gn(t)})),e(" removeEmptyRanks",(function(){!function(t){var e=t.nodes(),n=e.filter((function(e){var n;return void 0!==(null===(n=t.node(e))||void 0===n?void 0:n.rank)})).map((function(e){return t.node(e).rank})),r=Math.min.apply(Math,n),i=[];e.forEach((function(e){var n,o=((null===(n=t.node(e))||void 0===n?void 0:n.rank)||0)-r;i[o]||(i[o]=[]),i[o].push(e)}));for(var o=0,a=t.graph().nodeRankFactor||0,u=0;u<i.length;u++){var s=i[u];void 0===s?u%a!=0&&(o-=1):o&&(null==s||s.forEach((function(e){var n=t.node(e);n&&(n.rank=n.rank||0,n.rank+=o)})))}}(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdgeObj(e)}))}(t)})),e(" normalizeRanks",(function(){!function(t){var e=t.nodes().filter((function(e){var n;return void 0!==(null===(n=t.node(e))||void 0===n?void 0:n.rank)})).map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e);t.nodes().forEach((function(e){var r=t.node(e);r.hasOwnProperty("rank")&&n!==1/0&&(r.rank-=n)}))}(t)})),e(" assignRankMinMax",(function(){Ln(t)})),e(" removeEdgeLabelProxies",(function(){jn(t)})),e(" normalize.run",(function(){Ee(t)})),e(" parentDummyChains",(function(){!function(t){var e,n=function(t){var e,n={},r=0;return null===(e=t.children())||void 0===e||e.forEach((function e(i){var o,a=r;null===(o=t.children(i))||void 0===o||o.forEach(e),n[i]={low:a,lim:r++}})),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,i,o=e,a=t.node(o),u=a.edgeObj;if(u)for(var s=function(t,e,n,r){var i,o,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>s||c>e[i].lim));for(o=i,i=r;i&&i!==o;)u.push(i),i=t.parent(i);return{lca:o,path:a.concat(u.reverse())}}(t,n,u.v,u.w),c=s.path,f=s.lca,l=0,d=c[l],h=!0;o!==u.w;){if(a=t.node(o),h){for(;d!==f&&(null===(r=t.node(d))||void 0===r?void 0:r.maxRank)<a.rank;)d=c[++l];d===f&&(h=!1)}if(!h){for(;l<c.length-1&&(null===(i=t.node(c[l+1]))||void 0===i?void 0:i.minRank)<=a.rank;)l++;d=c[l]}t.setParent(o,d),o=t.successors(o)[0]}}))}(t)})),e(" addBorderSegments",(function(){Je(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){!function(t,e){var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),i=Math.max.apply(Math,r),o=Array(i+1).fill([]);null==e||e.forEach((function(e){var n=t.node(e);n&&!(null==n?void 0:n.dummy)&&(isNaN(n.rank)||(n.fixorder=o[n.rank].length,o[n.rank].push(e)))}))}(t,n.nodeOrder)})),e(" order",(function(){!function(t){for(var e=be(t),n=[],r=[],i=1;i<e+1;i++)n.push(i);for(i=e-1;i>-1;i--)r.push(i);var o=pn(t,n,"inEdges"),a=pn(t,r,"outEdges"),u=on(t);gn(t,u);for(var s,c=Number.POSITIVE_INFINITY,f=(i=0,0);f<4;++i,++f)vn(i%2?o:a,i%4>=2),u=ye(t),(d=un(t,u))<c&&(f=0,s=l(u),c=d);for(u=on(t),gn(t,u),i=0,f=0;f<4;++i,++f){var d;vn(i%2?o:a,i%4>=2,!0),u=ye(t),(d=un(t,u))<c&&(f=0,s=l(u),c=d)}gn(t,s)}(t)})),e(" insertSelfEdges",(function(){Hn(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==n&&"rl"!==n||Qe(t)}(t)})),e(" position",(function(){An(t)})),e(" positionSelfEdges",(function(){Xn(t)})),e(" removeBorderNodes",(function(){Vn(t)})),e(" normalize.undo",(function(){!function(t){var e;null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var n,r=t.node(e),i=r.edgeLabel;r.edgeObj&&t.setEdgeObj(r.edgeObj,i);for(var o=e;r.dummy;)n=t.successors(o)[0],t.removeNode(o),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),o=n,r=t.node(o)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){Bn(t)})),e(" undoCoordinateSystem",(function(){rn(t)})),e(" translateGraph",(function(){Un(t)})),e(" assignNodeIntersects",(function(){Fn(t)})),e(" reversePoints",(function(){zn(t)})),e(" acyclic.undo",(function(){!function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))},Nn=["nodesep","edgesep","ranksep","marginx","marginy"],On={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Cn=["acyclicer","ranker","rankdir","align"],kn=["width","height","layer","fixorder"],Dn={width:0,height:0},Mn=["minlen","weight","width","height","labeloffset"],Rn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Pn=["labelpos"],Gn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={e,rank:(t.node(e.w).rank-r.rank)/2+r.rank};pe(t,"edge-proxy",i,"_ep")}}))},Ln=function(t){var e=0;t.nodes().forEach((function(n){var r,i,o=t.node(n);o.borderTop&&(o.minRank=null===(r=t.node(o.borderTop))||void 0===r?void 0:r.rank,o.maxRank=null===(i=t.node(o.borderBottom))||void 0===i?void 0:i.rank,e=Math.max(e,o.maxRank||-1/0))})),t.graph().maxRank=e},jn=function(t){t.nodes().forEach((function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))},Un=function(t){var e,n,r=0,i=0,o=t.graph(),a=o.marginx||0,u=o.marginy||0,s=function(t){if(t){var o=t.x,a=t.y,u=t.width,s=t.height;isNaN(o)||isNaN(u)||(void 0===e&&(e=o-u/2),e=Math.min(e,o-u/2),r=Math.max(r,o+u/2)),isNaN(a)||isNaN(s)||(void 0===n&&(n=a-s/2),n=Math.min(n,a-s/2),i=Math.max(i,a+s/2))}};t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);(null==n?void 0:n.hasOwnProperty("x"))&&s(n)})),e-=a,n-=u,t.nodes().forEach((function(r){var i=t.node(r);i&&(i.x-=e,i.y-=n)})),t.edges().forEach((function(r){var i,o=t.edge(r);null===(i=o.points)||void 0===i||i.forEach((function(t){t.x-=e,t.y-=n})),o.hasOwnProperty("x")&&(o.x-=e),o.hasOwnProperty("y")&&(o.y-=n)})),o.width=r-e+a,o.height=i-n+u},Fn=function(t){t.edges().forEach((function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(ge(o,n)),i.points.push(ge(a,r))}))},Bn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(null==n?void 0:n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))},zn=function(t){t.edges().forEach((function(e){var n,r=t.edge(e);r.reversed&&(null===(n=r.points)||void 0===n||n.reverse())}))},Vn=function(t){t.nodes().forEach((function(e){var n,r,i;if(null===(n=t.children(e))||void 0===n?void 0:n.length){var o=t.node(e),a=t.node(o.borderTop),u=t.node(o.borderBottom),s=t.node(o.borderLeft[(null===(r=o.borderLeft)||void 0===r?void 0:r.length)-1]),c=t.node(o.borderRight[(null===(i=o.borderRight)||void 0===i?void 0:i.length)-1]);o.width=Math.abs((null==c?void 0:c.x)-(null==s?void 0:s.x))||10,o.height=Math.abs((null==u?void 0:u.y)-(null==a?void 0:a.y))||10,o.x=((null==s?void 0:s.x)||0)+o.width/2,o.y=((null==a?void 0:a.y)||0)+o.height/2}})),t.nodes().forEach((function(e){var n;"border"===(null===(n=t.node(e))||void 0===n?void 0:n.dummy)&&t.removeNode(e)}))},Wn=function(t){t.edges().forEach((function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdgeObj(e)}}))},Hn=function(t){var e=ye(t);null==e||e.forEach((function(e){var n=0;null==e||e.forEach((function(e,r){var i,o=t.node(e);o.order=r+n,null===(i=o.selfEdges)||void 0===i||i.forEach((function(e){pe(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))},Xn=function(t){t.nodes().forEach((function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,u=r.height/2;t.setEdgeObj(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{y:o,x:i+a},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],n.label.x=n.x,n.label.y=n.y}}))},qn=function(t,e){var n={};return null==e||e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},Yn=function(t){void 0===t&&(t={});var e={};return Object.keys(t).forEach((function(n){e[n.toLowerCase()]=t[n]})),e};const Kn=function(t,e){var n=e&&e.debugTiming?_e:xe;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,r;n=t,r=e.prevGraph,n.nodes().forEach((function(t){var e=n.node(t),i=r.node(t);void 0!==i?(e.fixorder=i._order,delete i._order):delete e.fixorder}))}));var r=n(" buildLayoutGraph",(function(){return function(t){var e=new he({multigraph:!0,compound:!0}),n=Yn(t.graph()),r={};return null==Cn||Cn.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},On,qn(n,Nn),r)),t.nodes().forEach((function(n){var r=Yn(t.node(n)),i=Tn(Tn({},Dn),r),o=qn(i,kn);e.setNode(n,o),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=Yn(t.edge(n)),i={};null==Pn||Pn.forEach((function(t){void 0!==r[t]&&(i[t]=r[t])})),e.setEdgeObj(n,Object.assign({},Rn,qn(r,Mn),i))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach((function(e){var n=t.node(e);isNaN(n.layer)||(n.layer?n.layer*=2:n.layer=0)})),t.edges().forEach((function(n){var r,i=t.edge(n);i.minlen*=2,"c"!==(null===(r=i.labelpos)||void 0===r?void 0:r.toLowerCase())&&("TB"===e.rankdir||"BT"===e.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}(r)}));try{n(" runLayout",(function(){In(r,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void console.error("The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){t.nodes().forEach((function(n){var r,i=t.node(n);if(i){var o=e.node(n);i.x=o.x,i.y=o.y,i._order=o.order,i._rank=o.rank,(null===(r=e.children(n))||void 0===r?void 0:r.length)&&(i.width=o.width,i.height=o.height)}})),t.edges().forEach((function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,i.hasOwnProperty("x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)}))}))};var Zn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$n=function(t){function n(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return Zn(n,t),n.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},n.prototype.execute=function(){var t,n=this,r=this,a=r.nodes,u=r.nodeSize,s=r.rankdir,c=r.combos,l=r.begin,h=r.radial;if(a){var p,v=r.edges||[],g=new he({multigraph:!0,compound:!0});p=u?i(u)?function(){return u}:function(){return[u,u]}:function(t){return t.size?i(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var y=b(r.ranksep,50,r.ranksepFunc),m=b(r.nodesep,50,r.nodesepFunc),_=m,x=y;"LR"!==s&&"RL"!==s||(_=y,x=m),g.setDefaultEdgeLabel((function(){return{}})),g.setGraph(r);var w={};this.sortByCombo&&c&&c.forEach((function(t){t.parentId&&(w[t.parentId]||(w[t.parentId]=!0,g.setNode(t.parentId,{})),g.setParent(t.id,t.parentId))})),a.filter((function(t){return!1!==t.layout})).forEach((function(t){var e=p(t),r=x(t),i=_(t),a=e[0]+2*i,u=e[1]+2*r,s=t.layer;o(s)?g.setNode(t.id,{width:a,height:u,layer:s}):g.setNode(t.id,{width:a,height:u}),n.sortByCombo&&t.comboId&&(w[t.comboId]||(w[t.comboId]=!0,g.setNode(t.comboId,{})),g.setParent(t.id,t.comboId))})),v.forEach((function(t){var e=d(t,"source"),r=d(t,"target");n.layoutNode(e)&&n.layoutNode(r)&&g.setEdge(e,r,{weight:t.weight||1})}));var E=void 0;r.preset&&(E=new he({multigraph:!0,compound:!0}),r.preset.nodes.forEach((function(t){null==E||E.setNode(t.id,t)}))),Kn(g,{prevGraph:E,edgeLabelSpace:r.edgeLabelSpace,keepNodeOrder:Boolean(!!r.nodeOrder),nodeOrder:r.nodeOrder});var S=[0,0];if(l){var A=1/0,T=1/0;g.nodes().forEach((function(t){var e=g.node(t);A>e.x&&(A=e.x),T>e.y&&(T=e.y)})),g.edges().forEach((function(t){var e;null===(e=g.edge(t).points)||void 0===e||e.forEach((function(t){A>t.x&&(A=t.x),T>t.y&&(T=t.y)}))})),S[0]=l[0]-A,S[1]=l[1]-T}if(h){var I=this,N=I.focusNode,O=I.ranksep,C=I.getRadialPos,k=e(N)?N:null==N?void 0:N.id,D=k?null===(t=g.node(k))||void 0===t?void 0:t._rank:0,M=[],R="LR"===s||"RL"===s,P=R?"y":"x",G=R?"height":"width",L=1/0,j=-1/0;g.nodes().forEach((function(t){var e=g.node(t),n=a.findIndex((function(e){return e.id===t}));if(a[n]){var r=m(a[n]);if(0===D)M[e._rank]||(M[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),M[e._rank].nodes.push(t),M[e._rank].totalWidth+=2*r+e[G],M[e._rank].maxSize<Math.max(e.width,e.height)&&(M[e._rank].maxSize=Math.max(e.width,e.height));else{var i=e._rank-D;if(0===i)M[i]||(M[i]={nodes:[],totalWidth:0,maxSize:-1/0}),M[i].nodes.push(t),M[i].totalWidth+=2*r+e[G],M[i].maxSize<Math.max(e.width,e.height)&&(M[i].maxSize=Math.max(e.width,e.height));else{var o=Math.abs(i);M[o]||(M[o]={left:[],right:[],totalWidth:0,maxSize:-1/0}),M[o].totalWidth+=2*r+e[G],M[o].maxSize<Math.max(e.width,e.height)&&(M[o].maxSize=Math.max(e.width,e.height)),i<0?M[o].left.push(t):M[o].right.push(t)}}var u=e[P]-e[G]/2-r,s=e[P]+e[G]/2+r;u<L&&(L=u),s>j&&(j=s)}}));var U=O||50,F={},B=(j-L)/.9,z=[.5*(L+j-B),.5*(L+j+B)],V=function(t,e,n,r){void 0===n&&(n=-1/0),void 0===r&&(r=[0,1]);var i=n;return t.forEach((function(t){var n=g.node(t);F[t]=e;var o=C(n[P],z,B,e,r),u=o.x,s=o.y,c=a.findIndex((function(e){return e.id===t}));if(a[c]){a[c].x=u+S[0],a[c].y=s+S[1],a[c]._order=n._order;var f=y(a[c]);i<f&&(i=f)}})),i},W=!0;M.forEach((function(t){var e,n,r,i,o,u,s;if((null===(e=null==t?void 0:t.nodes)||void 0===e?void 0:e.length)||(null===(n=null==t?void 0:t.left)||void 0===n?void 0:n.length)||(null===(r=null==t?void 0:t.right)||void 0===r?void 0:r.length)){if(W&&1===t.nodes.length){var c=a.findIndex((function(e){return e.id===t.nodes[0]}));return a[c].x=S[0],a[c].y=S[1],F[t.nodes[0]]=0,U=y(a[c]),void(W=!1)}U=Math.max(U,t.totalWidth/(2*Math.PI));var f=-1/0;if(0===D||(null===(i=t.nodes)||void 0===i?void 0:i.length))f=V(t.nodes,U,f,[0,1]);else{var l=(null===(o=t.left)||void 0===o?void 0:o.length)/((null===(u=t.left)||void 0===u?void 0:u.length)+(null===(s=t.right)||void 0===s?void 0:s.length));f=V(t.left,U,f,[0,l]),f=V(t.right,U,f,[l+.05,1])}U+=f,W=!1,t.maxSize}})),g.edges().forEach((function(t){var e,n,i,o=g.edge(t),a=v.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(r.edgeLabelSpace&&r.controlPoints&&"loop"!==v[a].type){var u="x"===P?"y":"x",s=null===(e=null==o?void 0:o.points)||void 0===e?void 0:e.slice(1,o.points.length-1),c=[],f=null===(n=g.node(t.v))||void 0===n?void 0:n[u],l=f-(null===(i=g.node(t.w))||void 0===i?void 0:i[u]),h=F[t.v],p=h-F[t.w];null==s||s.forEach((function(t){var e=(t[u]-f)/l*p+h,n=C(t[P],z,B,e);c.push({x:n.x+S[0],y:n.y+S[1]})})),v[a].controlPoints=c}}))}else g.nodes().forEach((function(t){var e=g.node(t),n=a.findIndex((function(e){return e.id===t}));a[n]&&(a[n].x=e.x+S[0],a[n].y=e.y+S[1],a[n]._order=e._order)})),g.edges().forEach((function(t){var e,n=g.edge(t),i=v.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));r.edgeLabelSpace&&r.controlPoints&&"loop"!==v[i].type&&(v[i].controlPoints=null===(e=null==n?void 0:n.points)||void 0===e?void 0:e.slice(1,n.points.length-1),v[i].controlPoints.forEach((function(t){t.x+=S[0],t.y+=S[1]})))}));return r.onLayoutEnd&&r.onLayoutEnd(),{nodes:a,edges:v}}},n.prototype.getRadialPos=function(t,e,n,r,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/n,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*r,y:Math.sin(a)*r}},n.prototype.getType=function(){return"dagre"},n}(t);const Jn={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function Qn(t={},e=Jn){var n,r,i,o;const a=JSON.parse(JSON.stringify(e)),u=(null===(n=null==t?void 0:t.graph)||void 0===n?void 0:n.meta)||{},s=(null===(r=null==t?void 0:t.subScene)||void 0===r?void 0:r.meta)||{},c=(null===(i=null==t?void 0:t.nodeSize)||void 0===i?void 0:i.meta)||{},f=(null===(o=null==t?void 0:t.nodeSize)||void 0===o?void 0:o.node)||{},l=a.nodeSize.bridge;return{graph:{meta:Object.assign(a.graph.meta,u)},subScene:{meta:Object.assign(a.subScene.meta,s)},nodeSize:{meta:Object.assign(a.nodeSize.meta,c),node:Object.assign(a.nodeSize.node,f),bridge:l}}}function tr(t){return`◬${t}◬`}const er=tr("ROOT"),nr=tr("BRIDGE_GRAPH");var rr,ir,or,ar;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(rr||(rr={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(ir||(ir={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(or||(or={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(ar||(ar={}));var ur="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function sr(t,e){return t(e={exports:{}},e.exports),e.exports}var cr=function(t,e){return t===e||t!=t&&e!=e},fr=function(t,e){for(var n=t.length;n--;)if(cr(t[n][0],e))return n;return-1},lr=Array.prototype.splice;function dr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}dr.prototype.clear=function(){this.__data__=[],this.size=0},dr.prototype.delete=function(t){var e=this.__data__,n=fr(e,t);return!(n<0||(n==e.length-1?e.pop():lr.call(e,n,1),--this.size,0))},dr.prototype.get=function(t){var e=this.__data__,n=fr(e,t);return n<0?void 0:e[n][1]},dr.prototype.has=function(t){return fr(this.__data__,t)>-1},dr.prototype.set=function(t,e){var n=this.__data__,r=fr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var hr,pr=dr,vr="object"==typeof ur&&ur&&ur.Object===Object&&ur,gr="object"==typeof self&&self&&self.Object===Object&&self,yr=vr||gr||Function("return this")(),mr=yr.Symbol,br=Object.prototype,_r=br.hasOwnProperty,xr=br.toString,wr=mr?mr.toStringTag:void 0,Er=Object.prototype.toString,Sr=mr?mr.toStringTag:void 0,Ar=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Sr&&Sr in Object(t)?function(t){var e=_r.call(t,wr),n=t[wr];try{t[wr]=void 0;var r=!0}catch(t){}var i=xr.call(t);return r&&(e?t[wr]=n:delete t[wr]),i}(t):function(t){return Er.call(t)}(t)},Tr=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Ir=function(t){if(!Tr(t))return!1;var e=Ar(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Nr=yr["__core-js_shared__"],Or=(hr=/[^.]+$/.exec(Nr&&Nr.keys&&Nr.keys.IE_PROTO||""))?"Symbol(src)_1."+hr:"",Cr=Function.prototype.toString,kr=function(t){if(null!=t){try{return Cr.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Dr=/^\[object .+?Constructor\]$/,Mr=Function.prototype,Rr=Object.prototype,Pr=Mr.toString,Gr=Rr.hasOwnProperty,Lr=RegExp("^"+Pr.call(Gr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jr=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Tr(t)||function(t){return!!Or&&Or in t}(t))&&(Ir(t)?Lr:Dr).test(kr(t))}(n)?n:void 0},Ur=jr(yr,"Map"),Fr=jr(Object,"create"),Br=Object.prototype.hasOwnProperty,zr=Object.prototype.hasOwnProperty;function Vr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Vr.prototype.clear=function(){this.__data__=Fr?Fr(null):{},this.size=0},Vr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vr.prototype.get=function(t){var e=this.__data__;if(Fr){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Br.call(e,t)?e[t]:void 0},Vr.prototype.has=function(t){var e=this.__data__;return Fr?void 0!==e[t]:zr.call(e,t)},Vr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Fr&&void 0===e?"__lodash_hash_undefined__":e,this};var Wr=Vr,Hr=function(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map};function Xr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Xr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ur||pr),string:new Wr}},Xr.prototype.delete=function(t){var e=Hr(this,t).delete(t);return this.size-=e?1:0,e},Xr.prototype.get=function(t){return Hr(this,t).get(t)},Xr.prototype.has=function(t){return Hr(this,t).has(t)},Xr.prototype.set=function(t,e){var n=Hr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var qr=Xr;function Yr(t){var e=this.__data__=new pr(t);this.size=e.size}Yr.prototype.clear=function(){this.__data__=new pr,this.size=0},Yr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yr.prototype.get=function(t){return this.__data__.get(t)},Yr.prototype.has=function(t){return this.__data__.has(t)},Yr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof pr){var r=n.__data__;if(!Ur||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new qr(r)}return n.set(t,e),this.size=n.size,this};var Kr=Yr,Zr=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},$r=function(){try{var t=jr(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Jr=function(t,e,n){"__proto__"==e&&$r?$r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Qr=Object.prototype.hasOwnProperty,ti=function(t,e,n){var r=t[e];Qr.call(t,e)&&cr(r,n)&&(void 0!==n||e in t)||Jr(t,e,n)},ei=function(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var u=e[o],s=r?r(n[u],t[u],u,n,t):void 0;void 0===s&&(s=t[u]),i?Jr(n,u,s):ti(n,u,s)}return n},ni=function(t){return null!=t&&"object"==typeof t},ri=function(t){return ni(t)&&"[object Arguments]"==Ar(t)},ii=Object.prototype,oi=ii.hasOwnProperty,ai=ii.propertyIsEnumerable,ui=ri(function(){return arguments}())?ri:function(t){return ni(t)&&oi.call(t,"callee")&&!ai.call(t,"callee")},si=Array.isArray,ci=function(){return!1},fi=sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n?yr.Buffer:void 0,o=(i?i.isBuffer:void 0)||ci;t.exports=o})),li=/^(?:0|[1-9]\d*)$/,di=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&li.test(t))&&t>-1&&t%1==0&&t<e},hi=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},pi={};pi["[object Float32Array]"]=pi["[object Float64Array]"]=pi["[object Int8Array]"]=pi["[object Int16Array]"]=pi["[object Int32Array]"]=pi["[object Uint8Array]"]=pi["[object Uint8ClampedArray]"]=pi["[object Uint16Array]"]=pi["[object Uint32Array]"]=!0,pi["[object Arguments]"]=pi["[object Array]"]=pi["[object ArrayBuffer]"]=pi["[object Boolean]"]=pi["[object DataView]"]=pi["[object Date]"]=pi["[object Error]"]=pi["[object Function]"]=pi["[object Map]"]=pi["[object Number]"]=pi["[object Object]"]=pi["[object RegExp]"]=pi["[object Set]"]=pi["[object String]"]=pi["[object WeakMap]"]=!1;var vi=function(t){return function(e){return t(e)}},gi=sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n&&vr.process,o=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o})),yi=gi&&gi.isTypedArray,mi=yi?vi(yi):function(t){return ni(t)&&hi(t.length)&&!!pi[Ar(t)]},bi=Object.prototype.hasOwnProperty,_i=function(t,e){var n=si(t),r=!n&&ui(t),i=!n&&!r&&fi(t),o=!n&&!r&&!i&&mi(t),a=n||r||i||o,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],s=u.length;for(var c in t)!e&&!bi.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||di(c,s))||u.push(c);return u},xi=Object.prototype,wi=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||xi)},Ei=function(t,e){return function(n){return t(e(n))}},Si=Ei(Object.keys,Object),Ai=Object.prototype.hasOwnProperty,Ti=function(t){if(!wi(t))return Si(t);var e=[];for(var n in Object(t))Ai.call(t,n)&&"constructor"!=n&&e.push(n);return e},Ii=function(t){return null!=t&&hi(t.length)&&!Ir(t)},Ni=function(t){return Ii(t)?_i(t):Ti(t)},Oi=Object.prototype.hasOwnProperty,Ci=function(t){return Ii(t)?_i(t,!0):function(t){if(!Tr(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=wi(t),n=[];for(var r in t)("constructor"!=r||!e&&Oi.call(t,r))&&n.push(r);return n}(t)},ki=sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n?yr.Buffer:void 0,o=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=o?o(n):new t.constructor(n);return t.copy(r),r}})),Di=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e},Mi=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o},Ri=function(){return[]},Pi=Object.prototype.propertyIsEnumerable,Gi=Object.getOwnPropertySymbols,Li=Gi?function(t){return null==t?[]:(t=Object(t),Mi(Gi(t),(function(e){return Pi.call(t,e)})))}:Ri,ji=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t},Ui=Ei(Object.getPrototypeOf,Object),Fi=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)ji(e,Li(t)),t=Ui(t);return e}:Ri,Bi=function(t,e,n){var r=e(t);return si(t)?r:ji(r,n(t))},zi=function(t){return Bi(t,Ni,Li)},Vi=function(t){return Bi(t,Ci,Fi)},Wi=jr(yr,"DataView"),Hi=jr(yr,"Promise"),Xi=jr(yr,"Set"),qi=jr(yr,"WeakMap"),Yi=kr(Wi),Ki=kr(Ur),Zi=kr(Hi),$i=kr(Xi),Ji=kr(qi),Qi=Ar;(Wi&&"[object DataView]"!=Qi(new Wi(new ArrayBuffer(1)))||Ur&&"[object Map]"!=Qi(new Ur)||Hi&&"[object Promise]"!=Qi(Hi.resolve())||Xi&&"[object Set]"!=Qi(new Xi)||qi&&"[object WeakMap]"!=Qi(new qi))&&(Qi=function(t){var e=Ar(t),n="[object Object]"==e?t.constructor:void 0,r=n?kr(n):"";if(r)switch(r){case Yi:return"[object DataView]";case Ki:return"[object Map]";case Zi:return"[object Promise]";case $i:return"[object Set]";case Ji:return"[object WeakMap]"}return e});var to=Qi,eo=Object.prototype.hasOwnProperty,no=yr.Uint8Array,ro=function(t){var e=new t.constructor(t.byteLength);return new no(e).set(new no(t)),e},io=/\w*$/,oo=mr?mr.prototype:void 0,ao=oo?oo.valueOf:void 0,uo=function(t,e){var n=e?ro(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},so=Object.create,co=function(){function t(){}return function(e){if(!Tr(e))return{};if(so)return so(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),fo=function(t){return"function"!=typeof t.constructor||wi(t)?{}:co(Ui(t))},lo=gi&&gi.isMap,ho=lo?vi(lo):function(t){return ni(t)&&"[object Map]"==to(t)},po=gi&&gi.isSet,vo=po?vi(po):function(t){return ni(t)&&"[object Set]"==to(t)},go={};go["[object Arguments]"]=go["[object Array]"]=go["[object ArrayBuffer]"]=go["[object DataView]"]=go["[object Boolean]"]=go["[object Date]"]=go["[object Float32Array]"]=go["[object Float64Array]"]=go["[object Int8Array]"]=go["[object Int16Array]"]=go["[object Int32Array]"]=go["[object Map]"]=go["[object Number]"]=go["[object Object]"]=go["[object RegExp]"]=go["[object Set]"]=go["[object String]"]=go["[object Symbol]"]=go["[object Uint8Array]"]=go["[object Uint8ClampedArray]"]=go["[object Uint16Array]"]=go["[object Uint32Array]"]=!0,go["[object Error]"]=go["[object Function]"]=go["[object WeakMap]"]=!1;var yo=function t(e,n,r,i,o,a){var u,s=1&n,c=2&n,f=4&n;if(r&&(u=o?r(e,i,o,a):r(e)),void 0!==u)return u;if(!Tr(e))return e;var l=si(e);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&eo.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!s)return Di(e,u)}else{var d=to(e),h="[object Function]"==d||"[object GeneratorFunction]"==d;if(fi(e))return ki(e,s);if("[object Object]"==d||"[object Arguments]"==d||h&&!o){if(u=c||h?{}:fo(e),!s)return c?function(t,e){return ei(t,Fi(t),e)}(e,function(t,e){return t&&ei(e,Ci(e),t)}(u,e)):function(t,e){return ei(t,Li(t),e)}(e,function(t,e){return t&&ei(e,Ni(e),t)}(u,e))}else{if(!go[d])return o?e:{};u=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return ro(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?ro(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return uo(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,io.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return ao?Object(ao.call(t)):{}}(t)}}(e,d,s)}}a||(a=new Kr);var p=a.get(e);if(p)return p;a.set(e,u),vo(e)?e.forEach((function(i){u.add(t(i,n,r,i,e,a))})):ho(e)&&e.forEach((function(i,o){u.set(o,t(i,n,r,o,e,a))}));var v=l?void 0:(f?c?Vi:zi:c?Ci:Ni)(e);return Zr(v||e,(function(i,o){v&&(i=e[o=i]),ti(u,o,t(i,n,r,o,e,a))})),u},mo=function(t){return function(){return t}},bo=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),a=o.length;a--;){var u=o[++r];if(!1===e(i[u],u,i))break}return t},_o=function(t,e){return t&&bo(t,e,Ni)},xo=function(t,e){return function(e,n){if(null==e)return e;if(!Ii(e))return t(e,n);for(var r=e.length,i=-1,o=Object(e);++i<r&&!1!==n(o[i],i,o););return e}}(_o),wo=function(t){return t},Eo=function(t){return"function"==typeof t?t:wo},So=function(t,e){return(si(t)?Zr:xo)(t,Eo(e))},Ao=So,To=function(t,e){var n=[];return xo(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n};function Io(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new qr;++e<n;)this.add(t[e])}Io.prototype.add=Io.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Io.prototype.has=function(t){return this.__data__.has(t)};var No=Io,Oo=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},Co=function(t,e){return t.has(e)},ko=function(t,e,n,r,i,o){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var l=-1,d=!0,h=2&n?new No:void 0;for(o.set(t,e),o.set(e,t);++l<u;){var p=t[l],v=e[l];if(r)var g=a?r(v,p,l,e,t,o):r(p,v,l,t,e,o);if(void 0!==g){if(g)continue;d=!1;break}if(h){if(!Oo(e,(function(t,e){if(!Co(h,e)&&(p===t||i(p,t,n,r,o)))return h.push(e)}))){d=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){d=!1;break}}return o.delete(t),o.delete(e),d},Do=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},Mo=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Ro=mr?mr.prototype:void 0,Po=Ro?Ro.valueOf:void 0,Go=function(t,e,n,r,i,o,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new no(t),new no(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return cr(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=Do;case"[object Set]":var s=1&r;if(u||(u=Mo),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=ko(u(t),u(e),r,i,o,a);return a.delete(t),f;case"[object Symbol]":if(Po)return Po.call(t)==Po.call(e)}return!1},Lo=Object.prototype.hasOwnProperty,jo=Object.prototype.hasOwnProperty,Uo=function t(e,n,r,i,o){return e===n||(null==e||null==n||!ni(e)&&!ni(n)?e!=e&&n!=n:function(t,e,n,r,i,o){var a=si(t),u=si(e),s=a?"[object Array]":to(t),c=u?"[object Array]":to(e),f="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s),l="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),d=s==c;if(d&&fi(t)){if(!fi(e))return!1;a=!0,f=!1}if(d&&!f)return o||(o=new Kr),a||mi(t)?ko(t,e,n,r,i,o):Go(t,e,s,n,r,i,o);if(!(1&n)){var h=f&&jo.call(t,"__wrapped__"),p=l&&jo.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return o||(o=new Kr),i(v,g,n,r,o)}}return!!d&&(o||(o=new Kr),function(t,e,n,r,i,o){var a=1&n,u=zi(t),s=u.length;if(s!=zi(e).length&&!a)return!1;for(var c=s;c--;){var f=u[c];if(!(a?f in e:Lo.call(e,f)))return!1}var l=o.get(t),d=o.get(e);if(l&&d)return l==e&&d==t;var h=!0;o.set(t,e),o.set(e,t);for(var p=a;++c<s;){var v=t[f=u[c]],g=e[f];if(r)var y=a?r(g,v,f,e,t,o):r(v,g,f,t,e,o);if(!(void 0===y?v===g||i(v,g,n,r,o):y)){h=!1;break}p||(p="constructor"==f)}if(h&&!p){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(h=!1)}return o.delete(t),o.delete(e),h}(t,e,n,r,i,o))}(e,n,r,i,t,o))},Fo=function(t){return t==t&&!Tr(t)},Bo=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},zo=function(t){return"symbol"==typeof t||ni(t)&&"[object Symbol]"==Ar(t)},Vo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wo=/^\w*$/,Ho=function(t,e){if(si(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!zo(t))||Wo.test(t)||!Vo.test(t)||null!=e&&t in Object(e)};function Xo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Xo.Cache||qr),n}Xo.Cache=qr;var qo,Yo=Xo,Ko=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zo=/\\(\\)?/g,$o=function(t){var e=Yo((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ko,(function(t,n,r,i){e.push(r?i.replace(Zo,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),Jo=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i},Qo=mr?mr.prototype:void 0,ta=Qo?Qo.toString:void 0,ea=function t(e){if("string"==typeof e)return e;if(si(e))return Jo(e,t)+"";if(zo(e))return ta?ta.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},na=function(t){return null==t?"":ea(t)},ra=function(t,e){return si(t)?t:Ho(t,e)?[t]:$o(na(t))},ia=function(t){if("string"==typeof t||zo(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},oa=function(t,e){for(var n=0,r=(e=ra(e,t)).length;null!=t&&n<r;)t=t[ia(e[n++])];return n&&n==r?t:void 0},aa=function(t,e){return null!=t&&e in Object(t)},ua=function(t,e,n){for(var r=-1,i=(e=ra(e,t)).length,o=!1;++r<i;){var a=ia(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&hi(i)&&di(a,i)&&(si(t)||ui(t))},sa=function(t,e){return null!=t&&ua(t,e,aa)},ca=function(t){return function(e){return null==e?void 0:e[t]}},fa=function(t){return"function"==typeof t?t:null==t?wo:"object"==typeof t?si(t)?function(t,e){return Ho(t)&&Fo(e)?Bo(ia(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:oa(t,e);return void 0===r?void 0:r}(n,t);return void 0===r&&r===e?sa(n,t):Uo(e,r,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Ni(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Fo(i)]}return e}(t);return 1==e.length&&e[0][2]?Bo(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var u=(a=n[i])[0],s=t[u],c=a[1];if(a[2]){if(void 0===s&&!(u in t))return!1}else{var f,l=new Kr;if(!(void 0===f?Uo(c,s,3,r,l):f))return!1}}return!0}(n,0,e)}}(t):function(t){return Ho(t)?ca(ia(t)):function(t){return function(e){return oa(e,t)}}(t)}(t)},la=function(t,e){return(si(t)?Mi:To)(t,fa(e))},da=Object.prototype.hasOwnProperty,ha=function(t,e){return null!=t&&da.call(t,e)},pa=function(t,e){return null!=t&&ua(t,e,ha)},va=Object.prototype.hasOwnProperty,ga=function(t){return void 0===t},ya=function(t,e){var n=-1,r=Ii(t)?Array(t.length):[];return xo(t,(function(t,i,o){r[++n]=e(t,i,o)})),r},ma=function(t,e){return(si(t)?Jo:ya)(t,fa(e))},ba=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n},_a=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n},xa=function(t,e,n){var r=si(t)?ba:_a,i=arguments.length<3;return r(t,fa(e),n,i,xo)},wa=ca("length"),Ea=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Sa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Aa="\\ud83c[\\udffb-\\udfff]",Ta="[^\\ud800-\\udfff]",Ia="(?:\\ud83c[\\udde6-\\uddff]){2}",Na="[\\ud800-\\udbff][\\udc00-\\udfff]",Oa="(?:"+Sa+"|"+Aa+")?",Ca="[\\ufe0e\\ufe0f]?"+Oa+"(?:\\u200d(?:"+[Ta,Ia,Na].join("|")+")[\\ufe0e\\ufe0f]?"+Oa+")*",ka="(?:"+[Ta+Sa+"?",Sa,Ia,Na,"[\\ud800-\\udfff]"].join("|")+")",Da=RegExp(Aa+"(?="+Aa+")|"+ka+Ca,"g"),Ma=mr?mr.isConcatSpreadable:void 0,Ra=function(t){return si(t)||ui(t)||!!(Ma&&t&&t[Ma])},Pa=function t(e,n,r,i,o){var a=-1,u=e.length;for(r||(r=Ra),o||(o=[]);++a<u;){var s=e[a];n>0&&r(s)?n>1?t(s,n-1,r,i,o):ji(o,s):i||(o[o.length]=s)}return o},Ga=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},La=Math.max,ja=function(t,e,n){return e=La(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=La(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=r[i];return u[e]=n(a),Ga(t,this,u)}},Ua=$r?function(t,e){return $r(t,"toString",{configurable:!0,enumerable:!1,value:mo(e),writable:!0})}:wo,Fa=Date.now,Ba=function(t){var e=0,n=0;return function(){var r=Fa(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Ua),za=function(t,e){return Ba(ja(t,e,wo),t+"")},Va=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1},Wa=function(t){return t!=t},Ha=function(t,e){return!(null==t||!t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var r=-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e):Va(t,Wa,0)}(t,e)>-1},Xa=Xi&&1/Mo(new Xi([,-0]))[1]==1/0?function(t){return new Xi(t)}:function(){},qa=function(t){return ni(t)&&Ii(t)},Ya=za((function(t){return function(t,e,n){var r=-1,i=Ha,o=t.length,a=!0,u=[],s=u;if(o>=200){var c=Xa(t);if(c)return Mo(c);a=!1,i=Co,s=new No}else s=u;t:for(;++r<o;){var f=t[r],l=f;if(f=0!==f?f:0,a&&l==l){for(var d=s.length;d--;)if(s[d]===l)continue t;u.push(f)}else i(s,l,n)||(s!==u&&s.push(l),u.push(f))}return u}(Pa(t,1,qa,!0))})),Ka=function(t){return null==t?[]:function(t,e){return Jo(e,(function(e){return t[e]}))}(t,Ni(t))};try{qo={clone:function(t){return yo(t,4)},constant:mo,each:Ao,filter:la,has:pa,isArray:si,isEmpty:function(t){if(null==t)return!0;if(Ii(t)&&(si(t)||"string"==typeof t||"function"==typeof t.splice||fi(t)||mi(t)||ui(t)))return!t.length;var e=to(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(wi(t))return!Ti(t).length;for(var n in t)if(va.call(t,n))return!1;return!0},isFunction:Ir,isUndefined:ga,keys:Ni,map:ma,reduce:xa,size:function(t){if(null==t)return 0;if(Ii(t))return function(t){return"string"==typeof t||!si(t)&&ni(t)&&"[object String]"==Ar(t)}(t)?function(t){return function(t){return Ea.test(t)}(t)?function(t){for(var e=Da.lastIndex=0;Da.test(t);)++e;return e}(t):wa(t)}(t):t.length;var e=to(t);return"[object Map]"==e||"[object Set]"==e?t.size:Ti(t).length},transform:function(t,e,n){var r=si(t),i=r||fi(t)||mi(t);if(e=fa(e),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Tr(t)&&Ir(o)?co(Ui(t)):{}}return(i?Zr:_o)(t,(function(t,r,i){return e(n,t,r,i)})),n},union:Ya,values:Ka}}catch(Jn){}qo||(qo=window._);var Za=qo,$a=Ja;function Ja(t){this._isDirected=!Za.has(t,"directed")||t.directed,this._isMultigraph=!!Za.has(t,"multigraph")&&t.multigraph,this._isCompound=!!Za.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=Za.constant(void 0),this._defaultEdgeLabelFn=Za.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function Qa(t,e){t[e]?t[e]++:t[e]=1}function tu(t,e){--t[e]||delete t[e]}function eu(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}return i+""+o+""+(Za.isUndefined(r)?"\0":r)}function nu(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var u={v:i,w:o};return r&&(u.name=r),u}function ru(t,e){return eu(t,e.v,e.w,e.name)}Ja.prototype._nodeCount=0,Ja.prototype._edgeCount=0,Ja.prototype.isDirected=function(){return this._isDirected},Ja.prototype.isMultigraph=function(){return this._isMultigraph},Ja.prototype.isCompound=function(){return this._isCompound},Ja.prototype.setGraph=function(t){return this._label=t,this},Ja.prototype.graph=function(){return this._label},Ja.prototype.setDefaultNodeLabel=function(t){return Za.isFunction(t)||(t=Za.constant(t)),this._defaultNodeLabelFn=t,this},Ja.prototype.nodeCount=function(){return this._nodeCount},Ja.prototype.nodes=function(){return Za.keys(this._nodes)},Ja.prototype.sources=function(){var t=this;return Za.filter(this.nodes(),(function(e){return Za.isEmpty(t._in[e])}))},Ja.prototype.sinks=function(){var t=this;return Za.filter(this.nodes(),(function(e){return Za.isEmpty(t._out[e])}))},Ja.prototype.setNodes=function(t,e){var n=arguments,r=this;return Za.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},Ja.prototype.setNode=function(t,e){return Za.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},Ja.prototype.node=function(t){return this._nodes[t]},Ja.prototype.hasNode=function(t){return Za.has(this._nodes,t)},Ja.prototype.removeNode=function(t){var e=this;if(Za.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Za.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),Za.each(Za.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],Za.each(Za.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},Ja.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Za.isUndefined(e))e="\0";else{for(var n=e+="";!Za.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},Ja.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},Ja.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},Ja.prototype.children=function(t){if(Za.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return Za.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},Ja.prototype.predecessors=function(t){var e=this._preds[t];if(e)return Za.keys(e)},Ja.prototype.successors=function(t){var e=this._sucs[t];if(e)return Za.keys(e)},Ja.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return Za.union(e,this.successors(t))},Ja.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},Ja.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Za.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),Za.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var o=n.parent(t);return void 0===o||e.hasNode(o)?(r[t]=o,o):o in r?r[o]:i(o)}return this._isCompound&&Za.each(e.nodes(),(function(t){e.setParent(t,i(t))})),e},Ja.prototype.setDefaultEdgeLabel=function(t){return Za.isFunction(t)||(t=Za.constant(t)),this._defaultEdgeLabelFn=t,this},Ja.prototype.edgeCount=function(){return this._edgeCount},Ja.prototype.edges=function(){return Za.values(this._edgeObjs)},Ja.prototype.setPath=function(t,e){var n=this,r=arguments;return Za.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},Ja.prototype.setEdge=function(){var t,e,n,r,i=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(t=o.v,e=o.w,n=o.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=o,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,Za.isUndefined(n)||(n=""+n);var a=eu(this._isDirected,t,e,n);if(Za.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=r),this;if(!Za.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?r:this._defaultEdgeLabelFn(t,e,n);var u=nu(this._isDirected,t,e,n);return t=u.v,e=u.w,Object.freeze(u),this._edgeObjs[a]=u,Qa(this._preds[e],t),Qa(this._sucs[t],e),this._in[e][a]=u,this._out[t][a]=u,this._edgeCount++,this},Ja.prototype.edge=function(t,e,n){var r=1===arguments.length?ru(this._isDirected,arguments[0]):eu(this._isDirected,t,e,n);return this._edgeLabels[r]},Ja.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?ru(this._isDirected,arguments[0]):eu(this._isDirected,t,e,n);return Za.has(this._edgeLabels,r)},Ja.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?ru(this._isDirected,arguments[0]):eu(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],tu(this._preds[e],t),tu(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},Ja.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=Za.values(n);return e?Za.filter(r,(function(t){return t.v===e})):r}},Ja.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=Za.values(n);return e?Za.filter(r,(function(t){return t.w===e})):r}},Ja.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var iu={Graph:$a,version:"2.1.8"},ou={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:au(t),edges:uu(t)};return Za.isUndefined(t.graph())||(e.value=Za.clone(t.graph())),e},read:function(t){var e=new $a(t.options).setGraph(t.value);return Za.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),Za.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function au(t){return Za.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return Za.isUndefined(n)||(i.value=n),Za.isUndefined(r)||(i.parent=r),i}))}function uu(t){return Za.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return Za.isUndefined(e.name)||(r.name=e.name),Za.isUndefined(n)||(r.value=n),r}))}var su=cu;function cu(){this._arr=[],this._keyIndices={}}cu.prototype.size=function(){return this._arr.length},cu.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},cu.prototype.has=function(t){return Za.has(this._keyIndices,t)},cu.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},cu.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},cu.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!Za.has(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1},cu.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},cu.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},cu.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},cu.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},cu.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e};var fu=function(t,e,n,r){return function(t,e,n,r){var i,o,a={},u=new su,s=function(t){var e=t.v!==i?t.v:t.w,r=a[e],s=n(t),c=o.distance+s;if(s<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+s);c<r.distance&&(r.distance=c,r.predecessor=i,u.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;a[t]={distance:n},u.add(t,n)}));u.size()>0&&(i=u.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(s);return a}(t,String(e),n||lu,r||function(e){return t.outEdges(e)})},lu=Za.constant(1),du=function(t){var e=0,n=[],r={},i=[];function o(a){var u=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){Za.has(r,t)?r[t].onStack&&(u.lowlink=Math.min(u.lowlink,r[t].index)):(o(t),u.lowlink=Math.min(u.lowlink,r[t].lowlink))})),u.lowlink===u.index){var s,c=[];do{s=n.pop(),r[s].onStack=!1,c.push(s)}while(a!==s);i.push(c)}}return t.nodes().forEach((function(t){Za.has(r,t)||o(t)})),i},hu=Za.constant(1),pu=vu;function vu(t){var e={},n={},r=[];if(Za.each(t.sinks(),(function i(o){if(Za.has(n,o))throw new gu;Za.has(e,o)||(n[o]=!0,e[o]=!0,Za.each(t.predecessors(o),i),delete n[o],r.push(o))})),Za.size(e)!==t.nodeCount())throw new gu;return r}function gu(){}vu.CycleException=gu,gu.prototype=new Error;var yu=function(t,e,n){Za.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],o={};return Za.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);mu(t,e,"post"===n,o,r,i)})),i};function mu(t,e,n,r,i,o){Za.has(r,e)||(r[e]=!0,n||o.push(e),Za.each(i(e),(function(e){mu(t,e,n,r,i,o)})),n&&o.push(e))}var bu,_u={Graph:iu.Graph,json:ou,alg:{components:function(t){var e,n={},r=[];function i(r){Za.has(n,r)||(n[r]=!0,e.push(r),Za.each(t.successors(r),i),Za.each(t.predecessors(r),i))}return Za.each(t.nodes(),(function(t){e=[],i(t),e.length&&r.push(e)})),r},dijkstra:fu,dijkstraAll:function(t,e,n){return Za.transform(t.nodes(),(function(r,i){r[i]=fu(t,i,e,n)}),{})},findCycles:function(t){return Za.filter(du(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))},floydWarshall:function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],u=r.distance+i.distance;u<a.distance&&(a.distance=u,a.predecessor=i.predecessor)}))}))})),r}(t,e||hu,n||function(e){return t.outEdges(e)})},isAcyclic:function(t){try{pu(t)}catch(t){if(t instanceof pu.CycleException)return!1;throw t}return!0},postorder:function(t,e){return yu(t,e,"post")},preorder:function(t,e){return yu(t,e,"pre")},prim:function(t,e){var n,r=new $a,i={},o=new su;function a(t){var r=t.v===n?t.w:t.v,a=o.priority(r);if(void 0!==a){var u=e(t);u<a&&(i[r]=n,o.decrease(r,u))}}if(0===t.nodeCount())return r;Za.each(t.nodes(),(function(t){o.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),o.decrease(t.nodes()[0],0);for(var u=!1;o.size()>0;){if(n=o.removeMin(),Za.has(i,n))r.setEdge(n,i[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(a)}return r},tarjan:du,topsort:pu},version:iu.version};try{bu=_u}catch(Jn){}bu||(bu=window.graphlib);var xu,wu=bu,Eu=function(t,e,n){if(!Tr(n))return!1;var r=typeof e;return!!("number"==r?Ii(n)&&di(e,n.length):"string"==r&&e in n)&&cr(n[e],t)},Su=Object.prototype,Au=Su.hasOwnProperty,Tu=za((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Eu(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=Ci(o),u=-1,s=a.length;++u<s;){var c=a[u],f=t[c];(void 0===f||cr(f,Su[c])&&!Au.call(t,c))&&(t[c]=o[c])}return t})),Iu=/^\s+|\s+$/g,Nu=/^[-+]0x[0-9a-f]+$/i,Ou=/^0b[01]+$/i,Cu=/^0o[0-7]+$/i,ku=parseInt,Du=function(t){return t?1/0===(t=function(t){if("number"==typeof t)return t;if(zo(t))return NaN;if(Tr(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Tr(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Iu,"");var n=Ou.test(t);return n||Cu.test(t)?ku(t.slice(2),n?2:8):Nu.test(t)?NaN:+t}(t))||-1/0===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},Mu=Math.max,Ru=function(t,e,n){var r=Object(t);if(!Ii(t)){var i=fa(e);t=Ni(t),e=function(t){return i(r[t],t,r)}}var o=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:function(t){var e=Du(t),n=e%1;return e==e?n?e-n:e:0}(n);return i<0&&(i=Mu(r+i,0)),Va(t,fa(e),i)}(t,e,n);return o>-1?r[i?t[o]:o]:void 0},Pu=function(t){return null!=t&&t.length?Pa(t,1):[]},Gu=function(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(null!=a&&(void 0===u?a==a&&!zo(a):n(a,u)))var u=a,s=o}return s},Lu=function(t,e){return t>e},ju=function(t,e,n){(void 0!==n&&!cr(t[e],n)||void 0===n&&!(e in t))&&Jr(t,e,n)},Uu=Function.prototype,Fu=Object.prototype,Bu=Uu.toString,zu=Fu.hasOwnProperty,Vu=Bu.call(Object),Wu=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},Hu=function t(e,n,r,i,o){e!==n&&bo(n,(function(a,u){if(o||(o=new Kr),Tr(a))!function(t,e,n,r,i,o,a){var u=Wu(t,n),s=Wu(e,n),c=a.get(s);if(c)ju(t,n,c);else{var f=o?o(u,s,n+"",t,e,a):void 0,l=void 0===f;if(l){var d=si(s),h=!d&&fi(s),p=!d&&!h&&mi(s);f=s,d||h||p?si(u)?f=u:qa(u)?f=Di(u):h?(l=!1,f=ki(s,!0)):p?(l=!1,f=uo(s,!0)):f=[]:function(t){if(!ni(t)||"[object Object]"!=Ar(t))return!1;var e=Ui(t);if(null===e)return!0;var n=zu.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Bu.call(n)==Vu}(s)||ui(s)?(f=u,ui(u)?f=function(t){return ei(t,Ci(t))}(u):Tr(u)&&!Ir(u)||(f=fo(s))):l=!1}l&&(a.set(s,f),i(f,s,r,o,a),a.delete(s)),ju(t,n,f)}}(e,n,u,r,t,i,o);else{var s=i?i(Wu(e,u),a,u+"",e,n,o):void 0;void 0===s&&(s=a),ju(e,u,s)}}),Ci)},Xu=function(t){return za((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Eu(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r)}return e}))}((function(t,e,n){Hu(t,e,n)})),qu=function(t,e){return t<e},Yu=function(t,e,n,r){if(!Tr(t))return t;for(var i=-1,o=(e=ra(e,t)).length,a=o-1,u=t;null!=u&&++i<o;){var s=ia(e[i]),c=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return t;if(i!=a){var f=u[s];void 0===(c=r?r(f,s,u):void 0)&&(c=Tr(f)?f:di(e[i+1])?[]:{})}ti(u,s,c),u=u[s]}return t},Ku=function(t){return Ba(ja(t,void 0,Pu),t+"")}((function(t,e){return null==t?{}:function(t,e){return function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],u=oa(t,a);n(0,a)&&Yu(o,ra(a,t),u)}return o}(t,e,(function(e,n){return sa(t,n)}))}(t,e)})),Zu=Math.ceil,$u=Math.max,Ju=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=zo(t),a=void 0!==e,u=null===e,s=e==e,c=zo(e);if(!u&&!c&&!o&&t>e||o&&a&&s&&!u&&!c||r&&a&&s||!n&&s||!i)return 1;if(!r&&!o&&!c&&t<e||c&&n&&i&&!r&&!o||u&&n&&i||!a&&i||!s)return-1}return 0},Qu=za((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Eu(t,e[0],e[1])?e=[]:n>2&&Eu(e[0],e[1],e[2])&&(e=[e[0]]),function(t,e,n){e=e.length?Jo(e,(function(t){return si(t)?function(e){return oa(e,1===t.length?t[0]:t)}:t})):[wo];var r=-1;e=Jo(e,vi(fa));var i=ya(t,(function(t,n,i){return{criteria:Jo(e,(function(e){return e(t)})),index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,u=n.length;++r<a;){var s=Ju(i[r],o[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}(t,Pa(e,1),[])})),ts=0;try{xu={cloneDeep:function(t){return yo(t,5)},constant:mo,defaults:Tu,each:Ao,filter:la,find:Ru,flatten:Pu,forEach:So,forIn:function(t,e){return null==t?t:bo(t,Eo(e),Ci)},has:pa,isUndefined:ga,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:ma,mapValues:function(t,e){var n={};return e=fa(e),_o(t,(function(t,r,i){Jr(n,r,e(t,r,i))})),n},max:function(t){return t&&t.length?Gu(t,wo,Lu):void 0},merge:Xu,min:function(t){return t&&t.length?Gu(t,wo,qu):void 0},minBy:function(t,e){return t&&t.length?Gu(t,fa(e),qu):void 0},now:function(){return yr.Date.now()},pick:Ku,range:function(t,e,n){return n&&"number"!=typeof n&&Eu(t,e,n)&&(e=n=void 0),t=Du(t),void 0===e?(e=t,t=0):e=Du(e),function(t,e,n,r){for(var i=-1,o=$u(Zu((e-t)/(n||1)),0),a=Array(o);o--;)a[++i]=t,t+=n;return a}(t,e,n=void 0===n?t<e?1:-1:Du(n))},reduce:xa,sortBy:Qu,uniqueId:function(t){var e=++ts;return na(t)+e},values:Ka,zipObject:function(t,e){return function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var u=r<o?e[r]:void 0;n(a,t[r],u)}return a}(t||[],e||[],ti)}}}catch(Jn){}xu||(xu=window._);var es=xu,ns=rs;function rs(){var t={};t._next=t._prev=t,this._sentinel=t}function is(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function os(t,e){if("_next"!==t&&"_prev"!==t)return e}rs.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return is(e),e},rs.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&is(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},rs.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,os)),n=n._prev;return"["+t.join(", ")+"]"};var as=wu.Graph,us=es.constant(1);function ss(t,e,n,r,i){var o=i?[]:void 0;return es.forEach(t.inEdges(r.v),(function(r){var a=t.edge(r),u=t.node(r.v);i&&o.push({v:r.v,w:r.w}),u.out-=a,cs(e,n,u)})),es.forEach(t.outEdges(r.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,cs(e,n,a)})),t.removeNode(r.v),o}function cs(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var fs=wu.Graph,ls={addDummyNode:ds,simplify:function(t){var e=(new fs).setGraph(t.graph());return es.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),es.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new fs({multigraph:t.isMultigraph()}).setGraph(t.graph());return es.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),es.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=es.map(t.nodes(),(function(e){var n={};return es.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return es.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=es.map(t.nodes(),(function(e){var n={};return es.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return es.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,u=e.y-o,s=t.width/2,c=t.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=es.map(es.range(hs(t)+1),(function(){return[]}));return es.forEach(t.nodes(),(function(n){var r=t.node(n),i=r.rank;es.isUndefined(i)||(e[i][r.order]=n)})),e},normalizeRanks:function(t){var e=es.min(es.map(t.nodes(),(function(e){return t.node(e).rank})));es.forEach(t.nodes(),(function(n){var r=t.node(n);es.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=es.min(es.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];es.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var r=0,i=t.graph().nodeRankFactor;es.forEach(n,(function(e,n){es.isUndefined(e)&&n%i!=0?--r:r&&es.forEach(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),ds(t,"border",i,e)},maxRank:hs,partition:function(t,e){var n={lhs:[],rhs:[]};return es.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=es.now();try{return e()}finally{console.log(t+" time: "+(es.now()-n)+"ms")}},notime:function(t,e){return e()}};function ds(t,e,n,r){var i;do{i=es.uniqueId(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function hs(t){return es.max(es.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!es.isUndefined(n))return n})))}var ps=function(t){var e={};es.forEach(t.sources(),(function n(r){var i=t.node(r);if(es.has(e,r))return i.rank;e[r]=!0;var o=es.min(es.map(t.outEdges(r),(function(e){return n(e.w)-t.edge(e).minlen})));return o!==Number.POSITIVE_INFINITY&&null!=o||(o=0),i.rank=o}))},vs=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},gs=wu.Graph,ys=vs,ms=function(t){var e,n,r=new gs({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});bs(r,t)<o;)e=_s(r,t),n=r.hasNode(e.v)?ys(t,e):-ys(t,e),xs(r,t,n);return r};function bs(t,e){return es.forEach(t.nodes(),(function n(r){es.forEach(e.nodeEdges(r),(function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||ys(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()}function _s(t,e){return es.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return ys(e,n)}))}function xs(t,e,n){es.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}var ws=vs,Es=ps,Ss=wu.alg.preorder,As=wu.alg.postorder,Ts=ls.simplify,Is=Ns;function Ns(t){t=Ts(t),Es(t);var e,n=ms(t);for(ks(n),Os(n,t);e=Ms(n);)Ps(n,t,e,Rs(n,t,e))}function Os(t,e){var n=As(t,t.nodes());n=n.slice(0,n.length-1),es.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=Cs(t,e,n)}(t,e,n)}))}function Cs(t,e,n){var r=t.node(n).parent,i=!0,o=e.edge(n,r),a=0;return o||(i=!1,o=e.edge(r,n)),a=o.weight,es.forEach(e.nodeEdges(n),(function(o){var u,s,c=o.v===n,f=c?o.w:o.v;if(f!==r){var l=c===i,d=e.edge(o).weight;if(a+=l?d:-d,u=n,s=f,t.hasEdge(u,s)){var h=t.edge(n,f).cutvalue;a+=l?-h:h}}})),a}function ks(t,e){arguments.length<2&&(e=t.nodes()[0]),Ds(t,{},1,e)}function Ds(t,e,n,r,i){var o=n,a=t.node(r);return e[r]=!0,es.forEach(t.neighbors(r),(function(i){es.has(e,i)||(n=Ds(t,e,n,i,r))})),a.low=o,a.lim=n++,i?a.parent=i:delete a.parent,n}function Ms(t){return es.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function Rs(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var o=t.node(r),a=t.node(i),u=o,s=!1;o.lim>a.lim&&(u=a,s=!0);var c=es.filter(e.edges(),(function(e){return s===Gs(0,t.node(e.v),u)&&s!==Gs(0,t.node(e.w),u)}));return es.minBy(c,(function(t){return ws(e,t)}))}function Ps(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),ks(t),Os(t,e),function(t,e){var n=es.find(t.nodes(),(function(t){return!e.node(t).parent})),r=Ss(t,n);r=r.slice(1),es.forEach(r,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function Gs(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Ns.initLowLimValues=ks,Ns.initCutValues=Os,Ns.calcCutValue=Cs,Ns.leaveEdge=Ms,Ns.enterEdge=Rs,Ns.exchangeEdges=Ps;var Ls=ps,js=Ls;var Us=function(t){var e=ls.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var o=t.children(r);o&&o.length&&es.forEach(o,(function(t){n(t,i+1)})),e[r]=i}return es.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=es.max(es.values(n))-1,i=2*r+1;t.graph().nestingRoot=e,es.forEach(t.edges(),(function(e){t.edge(e).minlen*=i}));var o=function(t){return es.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;es.forEach(t.children(),(function(a){Fs(t,e,i,o,r,n,a)})),t.graph().nodeRankFactor=i};function Fs(t,e,n,r,i,o,a){var u=t.children(a);if(u.length){var s=ls.addBorderNode(t,"_bt"),c=ls.addBorderNode(t,"_bb"),f=t.node(a);t.setParent(s,a),f.borderTop=s,t.setParent(c,a),f.borderBottom=c,es.forEach(u,(function(u){Fs(t,e,n,r,i,o,u);var f=t.node(u),l=f.borderTop?f.borderTop:u,d=f.borderBottom?f.borderBottom:u,h=f.borderTop?r:2*r,p=l!==d?1:i-o[a]+1;t.setEdge(s,l,{weight:h,minlen:p,nestingEdge:!0}),t.setEdge(d,c,{weight:h,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,s,{weight:0,minlen:i+o[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}function Bs(t,e,n,r,i,o){var a={width:0,height:0,rank:o,borderType:e},u=i[e][o-1],s=ls.addDummyNode(t,"border",a,n);i[e][o]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})}function zs(t){es.forEach(t.nodes(),(function(e){Vs(t.node(e))})),es.forEach(t.edges(),(function(e){Vs(t.edge(e))}))}function Vs(t){var e=t.width;t.width=t.height,t.height=e}function Ws(t){t.y=-t.y}function Hs(t){var e=t.x;t.x=t.y,t.y=e}var Xs=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=qs(t,e[r-1],e[r]);return n};function qs(t,e,n){for(var r=es.zipObject(n,es.map(n,(function(t,e){return e}))),i=es.flatten(es.map(e,(function(e){return es.sortBy(es.map(t.outEdges(e),(function(e){return{pos:r[e.w],weight:t.edge(e).weight}})),"pos")})),!0),o=1;o<n.length;)o<<=1;var a=2*o-1;o-=1;var u=es.map(new Array(a),(function(){return 0})),s=0;return es.forEach(i.forEach((function(t){var e=t.pos+o;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;s+=t.weight*n}))),s}function Ys(t,e,n){for(var r;e.length&&(r=es.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var Ks=function t(e,n,r,i){var o=e.children(n),a=e.node(n),u=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};u&&(o=es.filter(o,(function(t){return t!==u&&t!==s})));var f=function(t,e){return es.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=es.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,o);es.forEach(f,(function(n){if(e.children(n.v).length){var o=t(e,n.v,r,i);c[n.v]=o,es.has(o,"barycenter")&&(a=n,u=o,es.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u}));var l=function(t,e){var n={};return es.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};es.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),es.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];es.isUndefined(e)||es.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(es.isUndefined(e.barycenter)||es.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var i=t.pop();e.push(i),es.forEach(i.in.reverse(),n(i)),es.forEach(i.out,r(i))}return es.map(es.filter(e,(function(t){return!t.merged})),(function(t){return es.pick(t,["vs","i","barycenter","weight"])}))}(es.filter(n,(function(t){return!t.indegree})))}(f,r);!function(t,e){es.forEach(t,(function(t){t.vs=es.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(l,c);var d=function(t,e){var n,r=ls.partition(t,(function(t){return es.has(t,"barycenter")})),i=r.lhs,o=es.sortBy(r.rhs,(function(t){return-t.i})),a=[],u=0,s=0,c=0;i.sort((n=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:n?e.i-t.i:t.i-e.i})),c=Ys(a,o,c),es.forEach(i,(function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=Ys(a,o,c)}));var f={vs:es.flatten(a,!0)};return s&&(f.barycenter=u/s,f.weight=s),f}(l,i);if(u&&(d.vs=es.flatten([u,d.vs,s],!0),e.predecessors(u).length)){var h=e.node(e.predecessors(u)[0]),p=e.node(e.predecessors(s)[0]);es.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+p.order)/(d.weight+2),d.weight+=2}return d},Zs=wu.Graph,$s=wu.Graph;function Js(t,e,n){return es.map(e,(function(e){return function(t,e,n){var r=function(t){for(var e;t.hasNode(e=es.uniqueId("_root")););return e}(t),i=new Zs({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return es.forEach(t.nodes(),(function(o){var a=t.node(o),u=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||r),es.forEach(t[n](o),(function(e){var n=e.v===o?e.w:e.v,r=i.edge(n,o),a=es.isUndefined(r)?0:r.weight;i.setEdge(n,o,{weight:t.edge(e).weight+a})})),es.has(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),i}(t,e,n)}))}function Qs(t,e){var n=new $s;es.forEach(t,(function(t){var r=t.graph().root,i=Ks(t,r,n,e);es.forEach(i.vs,(function(e,n){t.node(e).order=n})),function(t,e,n){var r,i={};es.forEach(n,(function(n){for(var o,a,u=t.parent(n);u;){if((o=t.parent(u))?(a=i[o],i[o]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=o}}))}(t,n,i.vs)}))}function tc(t,e){es.forEach(e,(function(e){es.forEach(e,(function(e,n){t.node(e).order=n}))}))}var ec=wu.Graph;function nc(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function rc(t,e,n){if(e>n){var r=e;e=n,n=r}return es.has(t[e],n)}var ic=ls.normalizeRanks,oc=ls.removeEmptyRanks,ac=ls,uc=wu.Graph,sc=["nodesep","edgesep","ranksep","marginx","marginy"],cc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},fc=["acyclicer","ranker","rankdir","align"],lc=["width","height"],dc={width:0,height:0},hc=["minlen","weight","width","height","labeloffset"],pc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},vc=["labelpos"];function gc(t,e){return es.mapValues(es.pick(t,e),Number)}function yc(t){var e={};return es.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}var mc=wu.Graph,bc={graphlib:wu,layout:function(t,e){var n=e&&e.debugTiming?ac.time:ac.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new uc({multigraph:!0,compound:!0}),n=yc(t.graph());return e.setGraph(es.merge({},cc,gc(n,sc),es.pick(n,fc))),es.forEach(t.nodes(),(function(n){var r=yc(t.node(n));e.setNode(n,es.defaults(gc(r,lc),dc)),e.setParent(n,t.parent(n))})),es.forEach(t.edges(),(function(n){var r=yc(t.edge(n));e.setEdge(n,es.merge({},pc,gc(r,hc),es.pick(r,vc)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,es.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){es.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new as,r=0,i=0;es.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),es.forEach(t.edges(),(function(t){var o=n.edge(t.v,t.w)||0,a=e(t),u=o+a;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));var o=es.range(i+r+3).map((function(){return new ns})),a=r+1;return es.forEach(n.nodes(),(function(t){cs(o,a,n.node(t))})),{graph:n,buckets:o,zeroIdx:a}}(t,e||us),r=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)ss(t,e,n,r);for(;r=o.dequeue();)ss(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(ss(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return es.flatten(es.map(r,(function(e){return t.outEdges(e.v,e.w)})),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return es.forEach(t.nodes(),(function i(o){es.has(r,o)||(r[o]=!0,n[o]=!0,es.forEach(t.outEdges(o),(function(t){es.has(n,t.w)?e.push(t):i(t.w)})),delete n[o])})),e}(t);es.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,es.uniqueId("rev"))}))}(t)})),e(" nestingGraph.run",(function(){Us(t)})),e(" rank",(function(){!function(t){switch(t.graph().ranker){case"network-simplex":default:!function(t){Is(t)}(t);break;case"tight-tree":!function(t){Ls(t),ms(t)}(t);break;case"longest-path":js(t)}}(ac.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){es.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};ac.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){oc(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,es.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){ic(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;es.forEach(t.nodes(),(function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=es.max(e,r.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){es.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){!function(t){t.graph().dummyChains=[],es.forEach(t.edges(),(function(e){!function(t,e){var n,r,i,o=e.v,a=t.node(o).rank,u=e.w,s=t.node(u).rank,c=e.name,f=t.edge(e),l=f.labelRank;if(s!==a+1){for(t.removeEdge(e),i=0,++a;a<s;++i,++a)f.points=[],r={width:0,height:0,edgeLabel:f,edgeObj:e,rank:a},n=ls.addDummyNode(t,"edge",r,"_d"),a===l&&(r.width=f.width,r.height=f.height,r.dummy="edge-label",r.labelpos=f.labelpos),t.setEdge(o,n,{weight:f.weight},c),0===i&&t.graph().dummyChains.push(n),o=n;t.setEdge(o,u,{weight:f.weight},c)}}(t,e)}))}(t)})),e(" parentDummyChains",(function(){!function(t){var e=function(t){var e={},n=0;return es.forEach(t.children(),(function r(i){var o=n;es.forEach(t.children(i),r),e[i]={low:o,lim:n++}})),e}(t);es.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>s||c>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)u.push(i);return{path:a.concat(u.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,u=o.lca,s=0,c=a[s],f=!0;n!==i.w;){if(r=t.node(n),f){for(;(c=a[s])!==u&&t.node(c).maxRank<r.rank;)s++;c===u&&(f=!1)}if(!f){for(;s<a.length-1&&t.node(c=a[s+1]).minRank<=r.rank;)s++;c=a[s]}t.setParent(n,c),n=t.successors(n)[0]}}))}(t)})),e(" addBorderSegments",(function(){!function(t){es.forEach(t.children(),(function e(n){var r=t.children(n),i=t.node(n);if(r.length&&es.forEach(r,e),es.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)Bs(t,"borderLeft","_bl",n,i,o),Bs(t,"borderRight","_br",n,i,o)}}))}(t)})),e(" order",(function(){!function(t){var e=ls.maxRank(t),n=Js(t,es.range(1,e+1),"inEdges"),r=Js(t,es.range(e-1,-1,-1),"outEdges"),i=function(t){var e={},n=es.filter(t.nodes(),(function(e){return!t.children(e).length})),r=es.max(es.map(n,(function(e){return t.node(e).rank}))),i=es.map(es.range(r+1),(function(){return[]})),o=es.sortBy(n,(function(e){return t.node(e).rank}));return es.forEach(o,(function n(r){if(!es.has(e,r)){e[r]=!0;var o=t.node(r);i[o.rank].push(r),es.forEach(t.successors(r),n)}})),i}(t);tc(t,i);for(var o,a=Number.POSITIVE_INFINITY,u=0,s=0;s<4;++u,++s){Qs(u%2?n:r,u%4>=2),i=ls.buildLayerMatrix(t);var c=Xs(t,i);c<a&&(s=0,o=es.cloneDeep(i),a=c)}tc(t,o)}(t)})),e(" insertSelfEdges",(function(){!function(t){var e=ac.buildLayerMatrix(t);es.forEach(e,(function(e){var n=0;es.forEach(e,(function(e,r){var i=t.node(e);i.order=r+n,es.forEach(i.selfEdges,(function(e){ac.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||zs(t)}(t)})),e(" position",(function(){!function(t){(function(t){var e=ls.buildLayerMatrix(t),n=t.graph().ranksep,r=0;es.forEach(e,(function(e){var i=es.max(es.map(e,(function(e){return t.node(e).height})));es.forEach(e,(function(e){t.node(e).y=r+i/2})),r+=i+n}))})(t=ls.asNonCompoundGraph(t)),es.forEach(function(t){var e,n=ls.buildLayerMatrix(t),r=es.merge(function(t,e){var n={};return es.reduce(e,(function(e,r){var i=0,o=0,a=e.length,u=es.last(r);return es.forEach(r,(function(e,s){var c=function(t,e){if(t.node(e).dummy)return es.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=c?t.node(c).order:a;(c||e===u)&&(es.forEach(r.slice(o,s+1),(function(e){es.forEach(t.predecessors(e),(function(r){var o=t.node(r),a=o.order;!(a<i||f<a)||o.dummy&&t.node(e).dummy||nc(n,r,e)}))})),o=s+1,i=f)})),r})),n}(t,n),function(t,e){var n={};function r(e,r,i,o,a){var u;es.forEach(es.range(r,i),(function(r){u=e[r],t.node(u).dummy&&es.forEach(t.predecessors(u),(function(e){var r=t.node(e);r.dummy&&(r.order<o||r.order>a)&&nc(n,e,u)}))}))}return es.reduce(e,(function(e,n){var i,o=-1,a=0;return es.forEach(n,(function(u,s){if("border"===t.node(u).dummy){var c=t.predecessors(u);c.length&&(i=t.node(c[0]).order,r(n,a,s,o,i),a=s,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,n)),i={};es.forEach(["u","d"],(function(o){e="u"===o?n:es.values(n).reverse(),es.forEach(["l","r"],(function(n){"r"===n&&(e=es.map(e,(function(t){return es.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var i={},o={},a={};return es.forEach(e,(function(t){es.forEach(t,(function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),es.forEach(e,(function(t){var e=-1;es.forEach(t,(function(t){var u=r(t);if(u.length)for(var s=((u=es.sortBy(u,(function(t){return a[t]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];o[t]===t&&e<a[l]&&!rc(n,t,l)&&(o[l]=t,o[t]=i[t]=i[l],e=a[l])}}))})),{root:i,align:o}}(0,e,r,a),s=function(t,e,n,r,i){var o={},a=function(t,e,n,r){var i=new ec,o=t.graph(),a=function(t,e,n){return function(r,i,o){var a,u=r.node(i),s=r.node(o),c=0;if(c+=u.width/2,es.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,es.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}}(o.nodesep,o.edgesep,r);return es.forEach(e,(function(e){var r;es.forEach(e,(function(e){var o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edge(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e}))})),i}(t,e,n,i),u=i?"borderLeft":"borderRight";function s(t,e){for(var n=a.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return s((function(t){o[t]=a.inEdges(t).reduce((function(t,e){return Math.max(t,o[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),s((function(e){var n=a.outEdges(e).reduce((function(t,e){return Math.min(t,o[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(o[e]=Math.max(o[e],n))}),a.successors.bind(a)),es.forEach(r,(function(t){o[t]=o[n[t]]})),o}(t,e,u.root,u.align,"r"===n);"r"===n&&(s=es.mapValues(s,(function(t){return-t}))),i[o+n]=s}))}));var o=function(t,e){return es.minBy(es.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return es.forIn(e,(function(e,i){var o=function(t,e){return t.node(e).width}(t,i)/2;n=Math.max(e+o,n),r=Math.min(e-o,r)})),n-r}))}(t,i);return function(t,e){var n=es.values(e),r=es.min(n),i=es.max(n);es.forEach(["u","d"],(function(n){es.forEach(["l","r"],(function(o){var a,u=n+o,s=t[u];if(s!==e){var c=es.values(s);(a="l"===o?r-es.min(c):i-es.max(c))&&(t[u]=es.mapValues(s,(function(t){return t+a})))}}))}))}(i,o),function(t,e){return es.mapValues(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var i=es.sortBy(es.map(t,r));return(i[1]+i[2])/2}))}(i,t.graph().align)}(t),(function(e,n){t.node(n).x=e}))}(t)})),e(" positionSelfEdges",(function(){!function(t){es.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){es.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),o=t.node(es.last(n.borderLeft)),a=t.node(es.last(n.borderRight));n.width=Math.abs(a.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}})),es.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){!function(t){es.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){es.forEach(t.edges(),(function(e){var n=t.edge(e);if(es.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){es.forEach(t.nodes(),(function(e){Ws(t.node(e))})),es.forEach(t.edges(),(function(e){var n=t.edge(e);es.forEach(n.points,Ws),es.has(n,"y")&&Ws(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){es.forEach(t.nodes(),(function(e){Hs(t.node(e))})),es.forEach(t.edges(),(function(e){var n=t.edge(e);es.forEach(n.points,Hs),es.has(n,"x")&&Hs(n)}))}(t),zs(t))}(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=t.graph(),a=o.marginx||0,u=o.marginy||0;function s(t){var o=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,o-u/2),n=Math.max(n,o+u/2),r=Math.min(r,a-s/2),i=Math.max(i,a+s/2)}es.forEach(t.nodes(),(function(e){s(t.node(e))})),es.forEach(t.edges(),(function(e){var n=t.edge(e);es.has(n,"x")&&s(n)})),e-=a,r-=u,es.forEach(t.nodes(),(function(n){var i=t.node(n);i.x-=e,i.y-=r})),es.forEach(t.edges(),(function(n){var i=t.edge(n);es.forEach(i.points,(function(t){t.x-=e,t.y-=r})),es.has(i,"x")&&(i.x-=e),es.has(i,"y")&&(i.y-=r)})),o.width=n-e+a,o.height=i-r+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){es.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(ac.intersectRect(o,n)),i.points.push(ac.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){es.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){!function(t){es.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){es.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),es.forEach(t.edges(),(function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,es.has(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))},debug:{debugOrdering:function(t){var e=ls.buildLayerMatrix(t),n=new mc({compound:!0,multigraph:!0}).setGraph({});return es.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),es.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),es.forEach(e,(function(t,e){var r="layer"+e;n.setNode(r,{rank:"same"}),es.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}},util:{time:ls.time,notime:ls.notime},version:"0.8.5"},_c=bc.graphlib,xc=bc.layout;class wc{constructor(t){this.cardinality=1,this.include=ir.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=rr.NODE,this.name=t.name,this.attr=t.attr||{},this.inputs=t.inputs,this.path=t.path||[],this.width=t.width,this.height=t.height}}class Ec{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}class Sc{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=ir.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=rr.META,this.path=[],this.name=t,this.metaGraph=Nc(t,or.META,e)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map((t=>this.metaGraph.node(t)))}leaves(){let t,e=[],n=[this];for(;n.length;){let r=n.shift();r.isGroupNode?(t=r.metaGraph,t.nodes().forEach((e=>n.push(t.node(e))))):e.push(r.name)}return e}}class Ac{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function Tc(t,e={}){return new Sc(t,e)}function Ic(t,e){return new Ac(t,e)}function Nc(t,e,n){const r=n||{},i=new _c.Graph(r);return i.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),i}class Oc{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=Tc(er,this.graphOptions),this.index[er]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const r=Nc(nr,or.BRIDGE,this.graphOptions);if(n.bridgeGraph=r,!e.parentNode||!("metaGraph"in e.parentNode))return r;const i=e.parentNode;return[i.metaGraph,this.getBridgeGraph(i.name)].forEach((e=>{e.edges().filter((e=>e.v===t||e.w===t)).forEach((n=>{const i=n.w===t;e.edge(n).baseEdgeList.forEach((e=>{const[o,a]=i?[e.w,n.v]:[e.v,n.w],u=this.getChildName(t,o),s={v:i?a:u,w:i?u:a};let c=r.edge(s);c||(c=Ic(s.v,s.w),c.inbound=i,r.setEdge(s.v,s.w,c)),c.addBaseEdge(e,this)}))}))})),r}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const r=t.parentNode,i=r.metaGraph,o=this.getBridgeGraph(r.name);return Cc(i,t,e,n),Cc(o,t,e,n),n}}function Cc(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class kc{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new Rc(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==rr.META)return;const n=e,r=n.node.metaGraph,i=n.coreGraph;r.nodes().forEach((t=>{const e=this.getOrCreateRenderNodeByName(t);i.setNode(t,e)})),r.edges().forEach((t=>{const e=r.edge(t),n=new Mc(e);i.setEdge(t.v,t.w,n)}));const o=n.node.parentNode;if(!o)return;const a=this.getRenderNodeByName(o.name),u=(t,...e)=>e.concat([t?"IN":"OUT"]).join("~~"),s=this.hierarchy.getBridgeGraph(t);s.edges().forEach((e=>{const n=s.edge(e),c=!!r.node(e.w),[f,l]=c?[e.w,e.v]:[e.v,e.w],d=e=>{const n=c?{v:e,w:t}:{v:t,w:e};return a.coreGraph.edge(n)};let h=d(l);h||(h=d(u(c,l,o.name)));const p=u(c,t),v=u(c,l,t);let g=i.node(v);if(!g){let t=i.node(p);if(!t){const e={name:p,type:rr.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:ir.UNSPECIFIED,inbound:c,attr:{}};t=new Dc(e),this.index[p]=t,i.setNode(p,t)}const e={name:v,type:rr.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:ir.UNSPECIFIED,inbound:c,attr:{}};g=new Dc(e),this.index[v]=g,i.setNode(v,g),i.setParent(v,p),t.node.cardinality++}const y=new Mc(n);y.adjoiningMetaEdge=h,c?i.setEdge(v,f,y):i.setEdge(f,v,y)}))}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new Rc(e,this.hierarchy.graphOptions):new Dc(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class Dc{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class Mc{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class Rc extends Dc{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=Nc(n.name,or.CORE,e)}}function Pc(t,e){t.node.isGroupNode&&function(t,e){const n=Qn(e);t.coreGraph.nodes().map((e=>t.coreGraph.node(e))).forEach((t=>{var r,i,o,a,u,s;const{height:c,width:f}=t;switch(t.node.type){case rr.NODE:Object.assign(t,n.nodeSize.node),t.height=c||n.nodeSize.node.height,t.width=f||n.nodeSize.node.width;break;case rr.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case rr.META:t.expanded?Pc(t,e):(Object.assign(t,n.nodeSize.meta),t.height=n.nodeSize.meta.height,t.width=n.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+t.node.type)}if(!t.expanded){const n=t.attr;!function(t,e=!1){if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){const e=`${t.displayName}`.length,n=3;t.width=Math.max(t.coreBox.width,e*n)}}(t,e&&(0===t.node.type&&!!(null===(i=null===(r=null==e?void 0:e.nodeSize)||void 0===r?void 0:r.meta)||void 0===i?void 0:i.width)||1===t.node.type&&(!!(null===(a=null===(o=null==e?void 0:e.nodeSize)||void 0===o?void 0:o.node)||void 0===a?void 0:a.width)||!!n.width)||2===t.node.type&&!!(null===(s=null===(u=null==e?void 0:e.nodeSize)||void 0===u?void 0:u.bridge)||void 0===s?void 0:s.width)))}}))}(t,e),t.node.type===rr.META&&function(t,e){const n=Qn(e),r=n.subScene.meta;Object.assign(t,r);const{nodeSep:i,rankSep:o,edgeSep:a,align:u}=n.graph.meta,s={nodesep:i,ranksep:o,edgesep:a,align:u};Object.assign(t.coreBox,function(t,e){const{ranksep:n,nodesep:r,edgesep:i,align:o}=e;Object.assign(t.graph(),{ranksep:n,nodesep:r,edgesep:i,align:o});const a=[];if(t.nodes().forEach((e=>{t.node(e).node.type!==rr.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};xc(t);let u=1/0,s=1/0,c=-1/0,f=-1/0;return a.forEach((e=>{const n=t.node(e),r=.5*n.width,i=n.x-r,o=n.x+r;u=i<u?i:u,c=o>c?o:c;const a=.5*n.height,l=n.y-a,d=n.y+a;s=l<s?l:s,f=d>f?d:f})),t.edges().forEach((e=>{const n=t.edge(e),r=t.node(n.metaEdge.v),i=t.node(n.metaEdge.w);if(3===n.points.length&&function(t){let e=Gc(t[0],t[1]);for(let n=1;n<t.length-1;n++){const r=Gc(t[n],t[n+1]);if(Math.abs(r-e)>1)return!1;e=r}return!0}(n.points)){if(null!=r){const t=r.expanded?r.x:Lc(r);n.points[0].x=t}if(null!=i){const t=i.expanded?i.x:Lc(i);n.points[2].x=t}n.points=[n.points[0],n.points[1]]}const o=n.points[n.points.length-2];null!=i&&(n.points[n.points.length-1]=jc(o,i));const a=n.points[1];null!=r&&(n.points[0]=jc(a,r)),n.points.forEach((t=>{u=t.x<u?t.x:u,c=t.x>c?t.x:c,s=t.y<s?t.y:s,f=t.y>f?t.y:f}))})),t.nodes().forEach((e=>{const n=t.node(e);n.x-=u,n.y-=s})),t.edges().forEach((e=>{t.edge(e).points.forEach((t=>{t.x-=u,t.y-=s}))})),{width:c-u,height:f-s}}(t.coreGraph,s));let c=0;t.coreGraph.nodeCount()>0&&c++;const f=c<=1?0:c;t.coreBox.width+=f+f,t.coreBox.height=r.labelHeight+t.coreBox.height,t.width=t.coreBox.width+r.paddingLeft+r.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function Gc(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function Lc(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function jc(t,e){const n=e.expanded?e.x:Lc(e),r=e.y,i=t.x-n,o=t.y-r;let a,u,s=e.expanded?e.width:e.coreBox.width,c=e.expanded?e.height:e.coreBox.height;return Math.abs(o)*s/2>Math.abs(i)*c/2?(o<0&&(c=-c),a=0===o?0:c/2*i/o,u=c/2):(i<0&&(s=-s),a=s/2,u=0===i?0:s/2*o/i),{x:n+a,y:r+u}}function Uc(t,e,n){var r,i,o,a;const u=t.nodes.filter(((t,e,n)=>n.findIndex((e=>e.id===t.id))!==e)).map((t=>t.id));if(u.length)throw new Error(`Duplicated ids found: ${u.join(", ")}`);const s=function(t){const e={nodes:[]},n=t.compound,r=Object.keys(n||{}),i=new Map,o=(t,e=[])=>{if(i.has(t))return i.get(t);for(let i=0;i<r.length;i++){let a=r[i];if(n&&-1!==n[a].indexOf(t))return e.unshift(a),o(a,e)}return 0===e.length&&i.set(t,e),e},a=e=>t.edges.filter((t=>t.w===e)).map((t=>({name:t.v})));return t.nodes.forEach((t=>{const n=t.id,r=[...o(n),n];let i=a(n);e.nodes.push({name:n,path:r,inputs:i,width:t.width,height:t.height,attr:Object.assign({},t)})})),e}(t),c=function(t,e){const n=(t,e)=>{for(let n of e.values())if(n.includes(t))return!0;return!1},r=(t,e=[])=>{if(0===Object.keys(t).length)return[...new Set(e)];const i=new Map(Object.keys(t).map((e=>[e,t[e]]))),o={};for(let[t,r]of i)n(t,i)?o[t]=r:e=e.concat(t,r);return r(o,e)};return r(t).filter((t=>e.includes(t)))}(t.compound||{},(null==e?void 0:e.expanded)||[]),f=function(t,e){return function(t){return new kc(t)}(function(t,e){const{rankDirection:n,align:r}=e,i=new Oc({rankdir:n,align:r});return function(t,e){Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n],i=r.path;let o=t.root;o.depth=Math.max(i.length,o.depth);for(let e=0;e<i.length&&(o.depth=Math.max(o.depth,i.length-e),o.cardinality+=r.cardinality,e!==i.length-1);e++){const n=i[e];let a=t.node(n);a||(a=Tc(n,t.graphOptions),a.path=r.path.slice(0,e+1),a.parentNode=o,t.setNode(n,a),o.metaGraph.setNode(n,a)),o=a}t.setNode(r.name,r),r.parentNode=o,o.metaGraph.setNode(r.name,r)}))}(i,t),function(t,e){const n=t.getNodeMap();let r=[],i=[];const o=(t,e)=>{let n=0;for(;t;)e[n++]=t.name,t=t.parentNode;return n-1};e.edges.forEach((a=>{r=[],i=[];let u=o(e.nodes[a.v],r),s=o(e.nodes[a.w],i);for(;r[u]===i[s];)if(u--,s--,u<0||s<0)throw Error("No difference found between ancestor paths.");const c=n[r[u+1]],f=r[u],l=i[s];let d=c.metaGraph.edge(f,l);d||(d=Ic(f,l),c.metaGraph.setEdge(f,l,d)),d.addBaseEdge(a,t)}))}(i,t),i}(function(t){const e=new Ec;return t.nodes.map((t=>new wc(t))).forEach((t=>{e.nodes[t.name]=t,t.inputs.forEach((n=>{!function(t,e,n){n.name!==e.name&&t.edges.push(Object.assign(Object.assign({},n.attr),{v:n.name,w:e.name}))}(e,t,n)}))})),e}(t),e))}(s,{rankDirection:(null===(i=null===(r=null==n?void 0:n.graph)||void 0===r?void 0:r.meta)||void 0===i?void 0:i.rankDir)||(null==e?void 0:e.rankDirection)||Jn.graph.meta.rankDir,align:(null===(a=null===(o=null==n?void 0:n.graph)||void 0===o?void 0:o.meta)||void 0===a?void 0:a.align)||Jn.graph.meta.align});return function(t,e){e.forEach((e=>{const n=t.getRenderInfoNodes().find((t=>t.displayName===e));let r=n&&n.node&&n.node.name||"";const i=t.getRenderNodeByName(r);if(!i)throw new Error(`No nodes found: ${r}`);i.expanded=!0,t.buildSubHierarchy(r)}))}(f,c),Pc(f.root,n),Bc(f.root)}function Fc(t,e,n,r){var i,o;let a=[];const u=(null===(i=n.find((e=>e.id===t)))||void 0===i?void 0:i.path)||[],s=(null===(o=n.find((t=>t.id===e)))||void 0===o?void 0:o.path)||[],c=[er,...u].slice(0,u.length).reverse(),f=[er,...s].slice(0,s.length);return c.forEach((i=>{const o=n.find((t=>t.id===i));a=a.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),f.filter((t=>!c.includes(t))).forEach((i=>{const o=n.find((t=>t.id===i));a=a.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),a}function Bc(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},zc(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===rr.META?Bc(t):zc(t)))):[],edges:t.expanded?Vc(t):[]});var n}function zc(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}function Vc(t){return t.coreGraph.edges().map((e=>({renderInfoEdge:t.coreGraph.edge(e),edge:e}))).filter((({renderInfoEdge:t})=>t.metaEdge)).map((({edge:e,renderInfoEdge:n})=>{const r=function(t,e){const n=e.points.map((t=>Object.assign({},t)));if(e.adjoiningMetaEdge){const r=e.adjoiningMetaEdge.points,i=e.metaEdge.inbound,o=i?r[r.length-1]:r[0],a=n[i?0:n.length-1],u=t.x-t.width/2,s=t.y-t.height/2,c=o.x-u,f=o.y-s,l=-t.paddingLeft,d=-(t.paddingTop+t.labelHeight);a.x=c+l,a.y=f+d}return n}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}}))}var Wc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hc=function(){return Hc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Hc.apply(this,arguments)},Xc=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},qc=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.edgesep=5,n.ranksep=50,n.controlPoints=!0,n.anchorPoint=!0,n.nodes=[],n.edges=[],n.combos=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return Wc(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},e.prototype.init=function(t){var e=t.hiddenNodes||[],n=t.hiddenEdges||[],r=t.hiddenCombos||[];this.nodes=this.getDataByOrder((t.nodes||[]).concat(e)),this.edges=this.getDataByOrder((t.edges||[]).concat(n)),this.combos=(t.combos||[]).concat(r.map((function(t){return Hc(Hc({},t),{collapsed:!0})})))},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;if(e){var r=t.getLayoutConfig(),i=function(t,e=!1){const n=JSON.parse(JSON.stringify(t)),r={nodes:[n],edges:[...n.edges]};return n.nodes.forEach((function t(e){(0===e.type||1===e.type)&&r.nodes.push(e),0===e.type&&(r.edges=r.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)})),e&&r.nodes.forEach((t=>{const e=r.nodes.find((e=>e.id===t.parentNodeName));if(e){const n=e.x-e.width/2+e.paddingLeft,r=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==er&&(t.x+=n,t.y+=r),0===t.type&&t.edges.forEach((e=>{e.points.forEach((e=>{e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop}))}))}})),r}(Uc(r.graphDef,r.graphOption,r.graphSettings),!0);return this.updatePosition(i),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}},e.prototype.getNodePath=function(t){var e=this.nodes,n=this.combos,r=e.find((function(e){return e.id===t}));return r&&r.comboId?function t(e,r){void 0===r&&(r=[]);var i=n.find((function(t){return t.id===e}));return i?(r.unshift(e),i.parentId?t(i.parentId,r):r):r}(r.comboId,[t]):[t]},e.prototype.getLayoutConfig=function(){var t,e,n,r,o=this,a=o.nodes,u=o.edges,s=o.combos,c=o.nodeSize,l=o.rankdir,d=o.align,h=o.edgesep,p=o.nodesep,v=o.ranksep,g=o.settings,y=(s||[]).reduce((function(t,e){var n=a.filter((function(t){return t.comboId===e.id})).map((function(t){return t.id})),r=(s||[]).filter((function(t){return t.parentId===e.id})).map((function(t){return t.id}));return(n.length||r.length)&&(t[e.id]=Xc(Xc([],n,!0),r,!0)),t}),{});r=c?i(c)?function(){return c}:function(){return[c,c]}:function(t){return t&&t.size?i(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var m=function(t){return t&&t.size?i(t.size)?t.size:[t.size,t.size]:[80,40]}(null==s?void 0:s[0]),b=m[0],_=m[1],x=null===(e=null===(t=o.graphSettings)||void 0===t?void 0:t.subScene)||void 0===e?void 0:e.meta,w=(null===(n=s.find((function(t){return!t.collapsed})))||void 0===n?void 0:n.padding)||[20,20,20,20],E=w[0],S=w[1],A=w[2],T=w[3],I={compound:y,nodes:Xc([],(a||[]).map((function(t){var e=r(t),n=e[0],i=e[1];return Hc(Hc({},t),{width:n,height:i})})),!0),edges:Xc([],(u||[]).map((function(t){return Hc(Hc({},t),{v:t.source,w:t.target})})),!0)},N={expanded:(s||[]).filter((function(t){return!t.collapsed})).map((function(t){return t.id}))},O={graph:{meta:{align:d,rankDir:l,nodeSep:p,edgeSep:h,rankSep:v}},subScene:{meta:{paddingTop:E||(null==x?void 0:x.paddingTop)||20,paddingRight:S||(null==x?void 0:x.paddingRight)||20,paddingBottom:A||(null==x?void 0:x.paddingBottom)||20,paddingLeft:T||(null==x?void 0:x.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:b,height:_}}},C=Qn(g,Hc({},Qn(O,Jn)));return o.graphSettings=C,{graphDef:I,graphOption:N,graphSettings:C}},e.prototype.updatePosition=function(t){var e=t.nodes,n=t.edges;this.updateNodePosition(e,n),this.updateEdgePosition(e,n)},e.prototype.getBegin=function(t,e){var n=this.begin,r=[0,0];if(n){var i=1/0,o=1/0;t.forEach((function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)})),e.forEach((function(t){t.points.forEach((function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)}))})),r[0]=n[0]-i,r[1]=n[1]-o}return r},e.prototype.updateNodePosition=function(t,e){var n=this,r=n.combos,i=n.nodes,o=n.edges,a=n.anchorPoint,u=n.graphSettings,s=this.getBegin(t,e);t.forEach((function(t){var n,c=t.x,f=t.y,l=t.id,d=t.type,h=t.coreBox;if(d===ar.META&&l!==er){var p=r.findIndex((function(t){return t.id===l})),v=null===(n=null==u?void 0:u.subScene)||void 0===n?void 0:n.meta;r[p].offsetX=c+s[0],r[p].offsetY=f+s[1],r[p].fixSize=[h.width,h.height],r[p].fixCollapseSize=[h.width,h.height],t.expanded?r[p].padding=[null==v?void 0:v.paddingTop,null==v?void 0:v.paddingRight,null==v?void 0:v.paddingBottom,null==v?void 0:v.paddingLeft]:r[p].padding=[0,0,0,0]}else if(d===ar.OP&&(p=i.findIndex((function(t){return t.id===l})),i[p].x=c+s[0],i[p].y=f+s[1],a)){var g=[],y=e.filter((function(t){return t.v===l})),m=e.filter((function(t){return t.w===l}));y.length>0&&y.forEach((function(e){var n=e.points[0],r=(n.x-c)/t.width+.5,i=(n.y-f)/t.height+.5;g.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.sourceAnchor=g.length-1)}))})),m.length>0&&m.forEach((function(e){var n=e.points[e.points.length-1],r=(n.x-c)/t.width+.5,i=(n.y-f)/t.height+.5;g.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.targetAnchor=g.length-1)}))})),i[p].anchorPoints=g.length>0?g:i[p].anchorPoints||[]}}))},e.prototype.updateEdgePosition=function(t,e){var n=this,r=n.combos,i=n.edges,o=n.controlPoints,a=this.getBegin(t,e);o&&(r.forEach((function(t){t.inEdges=[],t.outEdges=[]})),i.forEach((function(e){var i,o,u,s,c=t.find((function(t){return t.id===e.source})),f=t.find((function(t){return t.id===e.target})),l=[],d=[];if(c&&f)d=Fc(null==c?void 0:c.id,null==f?void 0:f.id,t);else if(!c||!f){var h=n.getNodePath(e.source),p=n.getNodePath(e.target),v=h.reverse().slice(c?0:1).find((function(e){return t.find((function(t){return t.id===e}))})),g=p.reverse().slice(f?0:1).find((function(e){return t.find((function(t){return t.id===e}))}));c=t.find((function(t){return t.id===v})),f=t.find((function(t){return t.id===g})),d=Fc(null==c?void 0:c.id,null==f?void 0:f.id,t,{v:e.source,w:e.target})}if(l=(l=d.reduce((function(t,e){return Xc(Xc([],t,!0),e.points.map((function(t){return Hc(Hc({},t),{x:t.x+a[0],y:t.y+a[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=l,(null==f?void 0:f.type)===rr.META){var y=r.findIndex((function(t){return t.id===(null==f?void 0:f.id)}));if(!r[y]||(null===(i=r[y].inEdges)||void 0===i?void 0:i.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(o=r[y].inEdges)||void 0===o||o.push({source:c.id,target:f.id,controlPoints:l})}if((null==c?void 0:c.type)===rr.META){if(y=r.findIndex((function(t){return t.id===(null==c?void 0:c.id)})),!r[y]||(null===(u=r[y].outEdges)||void 0===u?void 0:u.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(s=r[y].outEdges)||void 0===s||s.push({source:c.id,target:f.id,controlPoints:l})}})))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every((function(t){return void 0!==t.layoutOrder}))||t.forEach((function(t,e){t.layoutOrder=e})),t.sort((function(t,e){return t.layoutOrder-e.layoutOrder}))},e}(t);const Yc=Object.prototype.toString;function Kc(t){return Yc.call(t).endsWith("Array]")}function Zc(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Kc(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]>a&&(a=t[u]);return a}function $c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Kc(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]<a&&(a=t[u]);return a}function Jc(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Kc(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!Kc(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=$c(t),i=Zc(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=n.min,a=void 0===o?n.autoMinMax?r:0:o,u=n.max,s=void 0===u?n.autoMinMax?i:1:u;if(a>=s)throw new RangeError("min option must be smaller than max option");for(var c=(s-a)/(i-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e}const Qc=" ".repeat(2),tf=" ".repeat(4);function ef(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${t.constructor.name} {\n${Qc}[\n${tf}${function(t,e,n,r){const{rows:i,columns:o}=t,a=Math.min(i,e),u=Math.min(o,n),s=[];for(let e=0;e<a;e++){let n=[];for(let i=0;i<u;i++)n.push(nf(t.get(e,i),r));s.push(`${n.join(" ")}`)}return u!==o&&(s[s.length-1]+=` ... ${o-n} more columns`),a!==i&&s.push(`... ${i-e} more rows`),s.join(`\n${tf}`)}(t,n,r,i)}\n${Qc}]\n${Qc}rows: ${t.rows}\n${Qc}columns: ${t.columns}\n}`}function nf(t,e){const n=String(t);if(n.length<=e)return n.padEnd(e," ");const r=t.toPrecision(e-2);if(r.length<=e)return r;const i=t.toExponential(e-2),o=i.indexOf("e"),a=i.slice(o);return i.slice(0,e-a.length)+a}function rf(t,e,n){let r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function of(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function af(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function uf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function sf(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(ff("startRow",e),ff("endRow",n),ff("startColumn",r),ff("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function cf(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function ff(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function lf(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class df{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new pf(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)r.set(i,t,n[i*e+t]);return r}static rowVector(t){let e=new pf(1,t.length);for(let n=0;n<t.length;n++)e.set(0,n,t[n]);return e}static columnVector(t){let e=new pf(t.length,1);for(let n=0;n<t.length;n++)e.set(n,0,t[n]);return e}static zeros(t,e){return new pf(t,e)}static ones(t,e){return new pf(t,e).fill(1)}static rand(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{random:r=Math.random}=n;let i=new pf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.set(n,t,r());return i}static randInt(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{min:r=0,max:i=1e3,random:o=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(r>=i)throw new RangeError("min must be smaller than max");let a=i-r,u=new pf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(o()*a);u.set(n,t,e)}return u}static eye(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);let r=Math.min(t,e),i=this.zeros(t,e);for(let t=0;t<r;t++)i.set(t,t,n);return i}static diag(t,e,n){let r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);let i=Math.min(r,e,n),o=this.zeros(e,n);for(let e=0;e<i;e++)o.set(e,e,t[e]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new pf(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.min(t.get(o,n),e.get(o,n)));return i}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new this(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.max(t.get(o,n),e.get(o,n)));return i}static checkMatrix(t){return df.isMatrix(t)?t:new pf(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.call(this,e,n);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.push(this.get(e,n));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);for(let n=e+1;n<this.rows;n++)0!==this.get(t,n)&&(r=!1);t++}return r}echelonForm(){let t=this.clone(),e=0,n=0;for(;e<t.rows&&n<t.columns;){let r=e;for(let i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let i=t.get(e,n);for(let r=n;r<t.columns;r++)t.set(e,r,t.get(e,r)/i);for(let r=e+1;r<t.rows;r++){let i=t.get(r,n)/t.get(e,n);t.set(r,n,0);for(let o=n+1;o<t.columns;o++)t.set(r,o,t.get(r,o)-t.get(e,o)*i)}e++,n++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;for(;r>=0;)if(0===t.maxRow(r))r--;else{let i=0,o=!1;for(;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(let n=0;n<r;n++){let o=t.get(n,i);for(let a=i;a<e;a++){let e=t.get(n,a)-o*t.get(r,a);t.set(n,a,e)}}r--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:n=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let r=new pf(this.rows*e,this.columns*n);for(let t=0;t<e;t++)for(let e=0;e<n;e++)r.setSubMatrix(this,this.rows*t,this.columns*e);return r}fill(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,t);return this}neg(){return this.mulS(-1)}getRow(t){rf(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return pf.rowVector(this.getRow(t))}setRow(t,e){rf(this,t),e=af(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){rf(this,t),rf(this,e);for(let n=0;n<this.columns;n++){let r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}getColumn(t){of(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return pf.columnVector(this.getColumn(t))}setColumn(t,e){of(this,t),e=uf(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){of(this,t),of(this,e);for(let n=0;n<this.rows;n++){let r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}addRowVector(t){t=af(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}subRowVector(t){t=af(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}mulRowVector(t){t=af(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}divRowVector(t){t=af(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}addColumnVector(t){t=uf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}subColumnVector(t){t=uf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}mulColumnVector(t){t=uf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}divColumnVector(t){t=uf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}mulRow(t,e){rf(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){of(this,t);for(let n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}max(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}maxIndex(){lf(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}minIndex(){lf(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}maxRow(t){if(rf(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}maxRowIndex(t){rf(this,t),lf(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}minRow(t){if(rf(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}minRowIndex(t){rf(this,t),lf(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}maxColumn(t){if(of(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}maxColumnIndex(t){of(this,t),lf(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){if(of(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}minColumnIndex(t){of(this,t),lf(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let n=0;n<t;n++)e.push(this.get(n,n));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e+=this.get(t,n)*this.get(t,n);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}dot(t){df.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}mmul(t){t=pf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,i=new pf(e,r),o=new Float64Array(n);for(let a=0;a<r;a++){for(let e=0;e<n;e++)o[e]=t.get(e,a);for(let t=0;t<e;t++){let e=0;for(let r=0;r<n;r++)e+=this.get(t,r)*o[r];i.set(t,a,e)}}return i}strassen2x2(t){t=pf.checkMatrix(t);let e=new pf(2,2);const n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),u=t.get(1,0),s=this.get(1,1),c=t.get(1,1),f=(n+s)*(r+c),l=(a+s)*r,d=n*(o-c),h=s*(u-r),p=(n+i)*c,v=f+h-p+(i-s)*(u+c),g=d+p,y=l+h,m=f-l+d+(a-n)*(r+o);return e.set(0,0,v),e.set(0,1,g),e.set(1,0,y),e.set(1,1,m),e}strassen3x3(t){t=pf.checkMatrix(t);let e=new pf(3,3);const n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),u=this.get(1,2),s=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),d=t.get(0,1),h=t.get(0,2),p=t.get(1,0),v=t.get(1,1),g=t.get(1,2),y=t.get(2,0),m=t.get(2,1),b=t.get(2,2),_=(n-o)*(-d+v),x=(-n+o+a)*(l-d+v),w=(o+a)*(-l+d),E=n*l,S=(-n+s+c)*(l-h+g),A=(-n+s)*(h-g),T=(s+c)*(-l+h),I=(-i+c+f)*(v+y-m),N=(i-f)*(v-m),O=i*y,C=(c+f)*(-y+m),k=(-i+a+u)*(g+y-b),D=(i-u)*(g-b),M=(a+u)*(-y+b),R=E+O+r*p,P=(n+r+i-o-a-c-f)*v+x+w+E+I+O+C,G=E+S+T+(n+r+i-a-u-s-c)*g+O+k+M,L=_+a*(-l+d+p-v-g-y+b)+x+E+O+k+D,j=_+x+w+E+u*m,U=O+k+D+M+o*h,F=E+S+A+c*(-l+h+p-v-g-y+m)+I+N+O,B=I+N+O+C+s*d,z=E+S+A+T+f*b;return e.set(0,0,R),e.set(0,1,P),e.set(0,2,G),e.set(1,0,L),e.set(1,1,j),e.set(1,2,U),e.set(2,0,F),e.set(2,1,B),e.set(2,2,z),e}mmulStrassen(t){t=pf.checkMatrix(t);let e=this.clone(),n=e.rows,r=e.columns,i=t.rows,o=t.columns;function a(t,e,n){let r=t.rows,i=t.columns;if(r===e&&i===n)return t;{let r=df.zeros(e,n);return r=r.setSubMatrix(t,0,0),r}}r!==i&&console.warn(`Multiplying ${n} x ${r} and ${i} x ${o} matrix: dimensions do not match.`);let u=Math.max(n,i),s=Math.max(r,o);return e=a(e,u,s),function t(e,n,r,i){if(r<=512||i<=512)return e.mmul(n);r%2==1&&i%2==1?(e=a(e,r+1,i+1),n=a(n,r+1,i+1)):r%2==1?(e=a(e,r+1,i),n=a(n,r+1,i)):i%2==1&&(e=a(e,r,i+1),n=a(n,r,i+1));let o=parseInt(e.rows/2,10),u=parseInt(e.columns/2,10),s=e.subMatrix(0,o-1,0,u-1),c=n.subMatrix(0,o-1,0,u-1),f=e.subMatrix(0,o-1,u,e.columns-1),l=n.subMatrix(0,o-1,u,n.columns-1),d=e.subMatrix(o,e.rows-1,0,u-1),h=n.subMatrix(o,n.rows-1,0,u-1),p=e.subMatrix(o,e.rows-1,u,e.columns-1),v=n.subMatrix(o,n.rows-1,u,n.columns-1),g=t(df.add(s,p),df.add(c,v),o,u),y=t(df.add(d,p),c,o,u),m=t(s,df.sub(l,v),o,u),b=t(p,df.sub(h,c),o,u),_=t(df.add(s,f),v,o,u),x=t(df.sub(d,s),df.add(c,l),o,u),w=t(df.sub(f,p),df.add(h,v),o,u),E=df.add(g,b);E.sub(_),E.add(w);let S=df.add(m,_),A=df.add(y,b),T=df.sub(g,y);T.add(m),T.add(x);let I=df.zeros(2*E.rows,2*E.columns);return I=I.setSubMatrix(E,0,0),I=I.setSubMatrix(S,E.rows,0),I=I.setSubMatrix(A,0,E.columns),I=I.setSubMatrix(T,E.rows,E.columns),I.subMatrix(0,r-1,0,i-1)}(e,t=a(t,u,s),u,s)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new pf(this.rows,this.columns);for(let t=0;t<this.rows;t++){const i=this.getRow(t);i.length>0&&Jc(i,{min:e,max:n,output:i}),r.setRow(t,i)}return r}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new pf(this.rows,this.columns);for(let t=0;t<this.columns;t++){const i=this.getColumn(t);i.length&&Jc(i,{min:e,max:n,output:i}),r.setColumn(t,i)}return r}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let n=0;n<t;n++){let t=this.get(e,n),r=this.get(e,this.columns-1-n);this.set(e,n,r),this.set(e,this.columns-1-n,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let n=0;n<t;n++){let t=this.get(n,e),r=this.get(this.rows-1-n,e);this.set(n,e,r),this.set(this.rows-1-n,e,t)}return this}kroneckerProduct(t){t=pf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new pf(e*r,n*i);for(let a=0;a<e;a++)for(let e=0;e<n;e++)for(let n=0;n<r;n++)for(let u=0;u<i;u++)o.set(r*a+n,i*e+u,this.get(a,e)*t.get(n,u));return o}kroneckerSum(t){if(t=pf.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let e=this.rows,n=t.rows,r=this.kroneckerProduct(pf.eye(n,n)),i=pf.eye(e,e).kroneckerProduct(t);return r.add(i)}transpose(){let t=new pf(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}sortRows(t=hf){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=hf){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){sf(this,t,e,n,r);let i=new pf(e-t+1,r-n+1);for(let o=t;o<=e;o++)for(let e=n;e<=r;e++)i.set(o-t,e-n,this.get(o,e));return i}subMatrixRow(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new pf(t.length,n-e+1);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);r.set(i,o-e,this.get(t[i],o))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new pf(n-e+1,t.length);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);r.set(o-e,i,this.get(o,t[i]))}return r}setSubMatrix(t,e,n){if((t=pf.checkMatrix(t)).isEmpty())return this;sf(this,e,e+t.rows-1,n,n+t.columns-1);for(let r=0;r<t.rows;r++)for(let i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}selection(t,e){!function(t,e){if(!Kc(e))throw new TypeError("row indices must be an array");for(let n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.rows)throw new RangeError("row indices are out of range")}(this,t),function(t,e){if(!Kc(e))throw new TypeError("column indices must be an array");for(let n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.columns)throw new RangeError("column indices are out of range")}(this,e);let n=new pf(t.length,e.length);for(let r=0;r<t.length;r++){let i=t[r];for(let t=0;t<e.length;t++){let o=e[t];n.set(r,t,this.get(i,o))}}return n}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let n=0;n<t;n++)e+=this.get(n,n);return e}clone(){let t=new pf(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}sum(t){switch(t){case"row":return function(t){let e=cf(t.rows);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){let e=cf(t.columns);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){let e=0;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return function(t){let e=cf(t.rows,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){let e=cf(t.columns,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){let e=1;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:n=!0,mean:r=this.mean(t)}=e;if("boolean"!=typeof n)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Kc(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<r;a++){let r=0,u=0,s=0;for(let e=0;e<i;e++)s=t.get(a,e)-n[a],r+=s,u+=s*s;e?o.push((u-r*r/i)/(i-1)):o.push((u-r*r/i)/i)}return o}(this,n,r);case"column":if(!Kc(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<i;a++){let i=0,u=0,s=0;for(let e=0;e<r;e++)s=t.get(e,a)-n[a],i+=s,u+=s*s;e?o.push((u-i*i/r)/(r-1)):o.push((u-i*i/r)/r)}return o}(this,n,r);case void 0:if("number"!=typeof r)throw new TypeError("mean must be a number");return function(t,e,n){const r=t.rows,i=t.columns,o=r*i;let a=0,u=0,s=0;for(let e=0;e<r;e++)for(let r=0;r<i;r++)s=t.get(e,r)-n,a+=s,u+=s*s;return e?(u-a*a/o)/(o-1):(u-a*a/o)/o}(this,n,r);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(let t=0;t<n.length;t++)n[t]=Math.sqrt(n[t]);return n}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:n=this.mean(t)}=e;switch(t){case"row":if(!Kc(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}(this,n),this;case"column":if(!Kc(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}(this,n),this;case void 0:if("number"!=typeof n)throw new TypeError("center must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let n=e.scale;switch(t){case"row":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.rows;n++){let r=0;for(let e=0;e<t.columns;e++)r+=Math.pow(t.get(n,e),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}(this);else if(!Kc(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}(this,n),this;case"column":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.columns;n++){let r=0;for(let e=0;e<t.rows;e++)r+=Math.pow(t.get(e,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}(this);else if(!Kc(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}(this,n),this;case void 0:if(void 0===n)n=function(t){const e=t.size-1;let n=0;for(let r=0;r<t.columns;r++)for(let i=0;i<t.rows;i++)n+=Math.pow(t.get(i,r),2)/e;return Math.sqrt(n)}(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}toString(t){return ef(this,t)}}function hf(t,e){return t-e}df.prototype.klass="Matrix","undefined"!=typeof Symbol&&(df.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return ef(this)}),df.random=df.rand,df.randomInt=df.randInt,df.diagonal=df.diag,df.prototype.diagonal=df.prototype.diag,df.identity=df.eye,df.prototype.negate=df.prototype.neg,df.prototype.tensorProduct=df.prototype.kroneckerProduct;class pf extends df{constructor(t,e){if(super(),pf.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>=0){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n<t;n++)this.data.push(new Float64Array(e))}else{if(!Kc(t))throw new TypeError("First argument must be a positive number or an array");{const n=t;if("number"!=typeof(e=(t=n.length)?n[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let r=0;r<t;r++){if(n[r].length!==e)throw new RangeError("Inconsistent array dimensions");this.data.push(Float64Array.from(n[r]))}}}this.rows=t,this.columns=e}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}removeRow(t){return rf(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),rf(this,t,!0),e=Float64Array.from(af(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){of(this,t);for(let e=0;e<this.rows;e++){const n=new Float64Array(this.columns-1);for(let r=0;r<t;r++)n[r]=this.data[e][r];for(let r=t+1;r<this.columns;r++)n[r-1]=this.data[e][r];this.data[e]=n}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),of(this,t,!0),e=uf(this,e);for(let n=0;n<this.rows;n++){const r=new Float64Array(this.columns+1);let i=0;for(;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},t.add=function(t,n){return new e(t).add(n)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},t.sub=function(t,n){return new e(t).sub(n)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},t.mul=function(t,n){return new e(t).mul(n)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},t.div=function(t,n){return new e(t).div(n)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},t.mod=function(t,n){return new e(t).mod(n)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},t.and=function(t,n){return new e(t).and(n)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},t.or=function(t,n){return new e(t).or(n)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},t.xor=function(t,n){return new e(t).xor(n)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},t.leftShift=function(t,n){return new e(t).leftShift(n)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,n){return new e(t).pow(n)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this}}(df,pf);class vf extends df{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}}function gf(t,e){let n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class yf{constructor(t,e={}){if((t=vf.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let n=t.rows,r=t.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:o=!0,autoTranspose:a=!1}=e;let u,s=Boolean(i),c=Boolean(o),f=!1;if(n<r)if(a){u=t.transpose(),n=u.rows,r=u.columns,f=!0;let e=s;s=c,c=e}else u=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else u=t.clone();let l=Math.min(n,r),d=Math.min(n+1,r),h=new Float64Array(d),p=new pf(n,l),v=new pf(r,r),g=new Float64Array(r),y=new Float64Array(n),m=new Float64Array(d);for(let t=0;t<d;t++)m[t]=t;let b=Math.min(n-1,r),_=Math.max(0,Math.min(r-2,n)),x=Math.max(b,_);for(let t=0;t<x;t++){if(t<b){h[t]=0;for(let e=t;e<n;e++)h[t]=gf(h[t],u.get(e,t));if(0!==h[t]){u.get(t,t)<0&&(h[t]=-h[t]);for(let e=t;e<n;e++)u.set(e,t,u.get(e,t)/h[t]);u.set(t,t,u.get(t,t)+1)}h[t]=-h[t]}for(let e=t+1;e<r;e++){if(t<b&&0!==h[t]){let r=0;for(let i=t;i<n;i++)r+=u.get(i,t)*u.get(i,e);r=-r/u.get(t,t);for(let i=t;i<n;i++)u.set(i,e,u.get(i,e)+r*u.get(i,t))}g[e]=u.get(t,e)}if(s&&t<b)for(let e=t;e<n;e++)p.set(e,t,u.get(e,t));if(t<_){g[t]=0;for(let e=t+1;e<r;e++)g[t]=gf(g[t],g[e]);if(0!==g[t]){g[t+1]<0&&(g[t]=0-g[t]);for(let e=t+1;e<r;e++)g[e]/=g[t];g[t+1]+=1}if(g[t]=-g[t],t+1<n&&0!==g[t]){for(let e=t+1;e<n;e++)y[e]=0;for(let e=t+1;e<n;e++)for(let n=t+1;n<r;n++)y[e]+=g[n]*u.get(e,n);for(let e=t+1;e<r;e++){let r=-g[e]/g[t+1];for(let i=t+1;i<n;i++)u.set(i,e,u.get(i,e)+r*y[i])}}if(c)for(let e=t+1;e<r;e++)v.set(e,t,g[e])}}let w=Math.min(r,n+1);if(b<r&&(h[b]=u.get(b,b)),n<w&&(h[w-1]=0),_+1<w&&(g[_]=u.get(_,w-1)),g[w-1]=0,s){for(let t=b;t<l;t++){for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}for(let t=b-1;t>=0;t--)if(0!==h[t]){for(let e=t+1;e<l;e++){let r=0;for(let i=t;i<n;i++)r+=p.get(i,t)*p.get(i,e);r=-r/p.get(t,t);for(let i=t;i<n;i++)p.set(i,e,p.get(i,e)+r*p.get(i,t))}for(let e=t;e<n;e++)p.set(e,t,-p.get(e,t));p.set(t,t,1+p.get(t,t));for(let e=0;e<t-1;e++)p.set(e,t,0)}else{for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}}if(c)for(let t=r-1;t>=0;t--){if(t<_&&0!==g[t])for(let e=t+1;e<r;e++){let n=0;for(let i=t+1;i<r;i++)n+=v.get(i,t)*v.get(i,e);n=-n/v.get(t+1,t);for(let i=t+1;i<r;i++)v.set(i,e,v.get(i,e)+n*v.get(i,t))}for(let e=0;e<r;e++)v.set(e,t,0);v.set(t,t,1)}let E=w-1,S=0,A=Number.EPSILON;for(;w>0;){let t,e;for(t=w-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(h[t]+Math.abs(h[t+1]));if(Math.abs(g[t])<=e||Number.isNaN(g[t])){g[t]=0;break}}if(t===w-2)e=4;else{let n;for(n=w-1;n>=t&&n!==t;n--){let e=(n!==w?Math.abs(g[n]):0)+(n!==t+1?Math.abs(g[n-1]):0);if(Math.abs(h[n])<=A*e){h[n]=0;break}}n===t?e=3:n===w-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=g[w-2];g[w-2]=0;for(let n=w-2;n>=t;n--){let i=gf(h[n],e),o=h[n]/i,a=e/i;if(h[n]=i,n!==t&&(e=-a*g[n-1],g[n-1]=o*g[n-1]),c)for(let t=0;t<r;t++)i=o*v.get(t,n)+a*v.get(t,w-1),v.set(t,w-1,-a*v.get(t,n)+o*v.get(t,w-1)),v.set(t,n,i)}break}case 2:{let e=g[t-1];g[t-1]=0;for(let r=t;r<w;r++){let i=gf(h[r],e),o=h[r]/i,a=e/i;if(h[r]=i,e=-a*g[r],g[r]=o*g[r],s)for(let e=0;e<n;e++)i=o*p.get(e,r)+a*p.get(e,t-1),p.set(e,t-1,-a*p.get(e,r)+o*p.get(e,t-1)),p.set(e,r,i)}break}case 3:{const e=Math.max(Math.abs(h[w-1]),Math.abs(h[w-2]),Math.abs(g[w-2]),Math.abs(h[t]),Math.abs(g[t])),i=h[w-1]/e,o=h[w-2]/e,a=g[w-2]/e,u=h[t]/e,f=g[t]/e,l=((o+i)*(o-i)+a*a)/2,d=i*a*(i*a);let y=0;0===l&&0===d||(y=l<0?0-Math.sqrt(l*l+d):Math.sqrt(l*l+d),y=d/(l+y));let m=(u+i)*(u-i)+y,b=u*f;for(let e=t;e<w-1;e++){let i=gf(m,b);0===i&&(i=Number.MIN_VALUE);let o=m/i,a=b/i;if(e!==t&&(g[e-1]=i),m=o*h[e]+a*g[e],g[e]=o*g[e]-a*h[e],b=a*h[e+1],h[e+1]=o*h[e+1],c)for(let t=0;t<r;t++)i=o*v.get(t,e)+a*v.get(t,e+1),v.set(t,e+1,-a*v.get(t,e)+o*v.get(t,e+1)),v.set(t,e,i);if(i=gf(m,b),0===i&&(i=Number.MIN_VALUE),o=m/i,a=b/i,h[e]=i,m=o*g[e]+a*h[e+1],h[e+1]=-a*g[e]+o*h[e+1],b=a*g[e+1],g[e+1]=o*g[e+1],s&&e<n-1)for(let t=0;t<n;t++)i=o*p.get(t,e)+a*p.get(t,e+1),p.set(t,e+1,-a*p.get(t,e)+o*p.get(t,e+1)),p.set(t,e,i)}g[w-2]=m,S+=1;break}case 4:if(h[t]<=0&&(h[t]=h[t]<0?-h[t]:0,c))for(let e=0;e<=E;e++)v.set(e,t,-v.get(e,t));for(;t<E&&!(h[t]>=h[t+1]);){let e=h[t];if(h[t]=h[t+1],h[t+1]=e,c&&t<r-1)for(let n=0;n<r;n++)e=v.get(n,t+1),v.set(n,t+1,v.get(n,t)),v.set(n,t,e);if(s&&t<n-1)for(let r=0;r<n;r++)e=p.get(r,t+1),p.set(r,t+1,p.get(r,t)),p.set(r,t,e);t++}S=0,w--}}if(f){let t=v;v=p,p=t}this.m=n,this.n=r,this.s=h,this.U=p,this.V=v}solve(t){let e=t,n=this.threshold,r=this.s.length,i=pf.zeros(r,r);for(let t=0;t<r;t++)Math.abs(this.s[t])<=n?i.set(t,t,0):i.set(t,t,1/this.s[t]);let o=this.U,a=this.rightSingularVectors,u=a.mmul(i),s=a.rows,c=o.rows,f=pf.zeros(s,c);for(let t=0;t<s;t++)for(let e=0;e<c;e++){let n=0;for(let i=0;i<r;i++)n+=u.get(t,i)*o.get(e,i);f.set(t,e,n)}return f.mmul(e)}solveForDiagonal(t){return this.solve(pf.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new pf(n,this.s.length);for(let o=0;o<n;o++)for(let n=0;n<r;n++)Math.abs(this.s[n])>e&&i.set(o,n,t.get(o,n)/this.s[n]);let o=this.U,a=o.rows,u=o.columns,s=new pf(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<u;r++)n+=i.get(t,r)*o.get(e,r);s.set(t,e,n)}return s}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s;for(let r=0,i=n.length;r<i;r++)n[r]>t&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return pf.diag(this.s)}}var mf=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,r=t.linkDistance;try{var i=pf.mul(pf.pow(n,2),-.5),o=i.mean("row"),a=i.mean("column"),u=i.mean();i.add(u).subRowVector(o).subColumnVector(a);var s=new yf(i),c=pf.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return pf.mul([t],[c]).toJSON()[0].splice(0,e)}))}catch(t){for(var f=[],l=0;l<n.length;l++){var d=Math.random()*r,h=Math.random()*r;f.push([d,h])}return f}},t}();const bf=mf;var _f=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,i=t.width/10;t.maxDisplace=i,t.disp=n;for(var o=0;o<r;o++)e.forEach((function(t,e){n[e]={x:0,y:0}})),t.getRepulsion(),t.updatePositions();return e},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,i=t.k,o=t.radii||[];e.forEach((function(a,u){r[u]={x:0,y:0},e.forEach((function(e,s){if(u!==s&&o[u]===o[s]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var d=u>s?1:-1;c=.01*d,f=.01*d}if(l<t.nodeSizeFunc(n[u])/2+t.nodeSizeFunc(n[s])/2){var h=i*i/l;r[u].x+=c/l*h,r[u].y+=f/l*h}}}))}))},t.prototype.updatePositions=function(){var t=this,e=t.positions,n=t.disp,r=t.speed,i=t.strictRadial,o=t.focusID,a=t.maxDisplace||t.width/10;i&&n.forEach((function(t,n){var r=e[n][0]-e[o][0],i=e[n][1]-e[o][1],a=Math.sqrt(r*r+i*i),u=i/a,s=-r/a,c=Math.sqrt(t.x*t.x+t.y*t.y),f=Math.acos((u*t.x+s*t.y)/c);f>Math.PI/2&&(f-=Math.PI/2,u*=-1,s*=-1);var l=Math.cos(f)*c;t.x=u*l,t.y=s*l}));var u=t.radii;e.forEach((function(t,s){if(s!==o){var c=Math.sqrt(n[s].x*n[s].x+n[s].y*n[s].y);if(c>0&&s!==o){var f=Math.min(a*(r/800),c);if(t[0]+=n[s].x/c*f,t[1]+=n[s].y/c*f,i){var l=t[0]-e[o][0],d=t[1]-e[o][1],h=Math.sqrt(l*l+d*d);l=l/h*u[s],d=d/h*u[s],t[0]=e[o][0]+l,t[1]=e[o][1]+d}}}}))},t}();const xf=_f;var wf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Ef(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Sf=function(t){function n(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.focusNode=null,n.unitRadius=null,n.linkDistance=50,n.preventOverlap=!1,n.strictRadial=!0,n.maxPreventOverlapIteration=200,n.sortStrength=10,n.nodes=[],n.edges=[],n.updateCfg(e),n}return wf(n,t),n.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges||[];if(n&&0!==n.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var u=t.center;if(1===n.length)return n[0].x=u[0],n[0].y=u[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s=t.linkDistance,c=null;if(e(t.focusNode)){for(var l=!1,d=0;d<n.length;d++)n[d].id===t.focusNode&&(c=n[d],t.focusNode=c,l=!0,d=n.length);l||(c=null)}else c=t.focusNode;c||(c=n[0],t.focusNode=c);var h=function(t,e){var n=-1;return t.forEach((function(t,r){t.id===e&&(n=r)})),n}(n,c.id);h<0&&(h=0),t.focusIndex=h;var g=v({nodes:n,edges:r},!1),y=p(g),b=t.maxToFocus(y,h);t.handleInfinity(y,h,b+1),t.distances=y;var _=y[h],x=t.width||500,w=t.height||500,E=x-u[0]>u[0]?u[0]:x-u[0],S=w-u[1]>u[1]?u[1]:w-u[1];0===E&&(E=x/2),0===S&&(S=w/2);var A=S>E?E:S,T=Math.max.apply(Math,_),I=[];_.forEach((function(e,n){t.unitRadius||(t.unitRadius=A/T),I[n]=e*t.unitRadius})),t.radii=I;var N=t.eIdealDisMatrix();t.eIdealDistances=N;var O=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;i<e;i++){for(var o=[],a=0;a<n;a++)0!==t[i][a]?o.push(1/(t[i][a]*t[i][a])):o.push(0);r.push(o)}return r}(N);t.weights=O;var C=new bf({linkDistance:s,distances:N}).layout();C.forEach((function(t){a(t[0])&&(t[0]=Math.random()*s),a(t[1])&&(t[1]=Math.random()*s)})),t.positions=C,C.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),C.forEach((function(t){t[0]-=C[h][0],t[1]-=C[h][1]})),t.run();var k,D=t.preventOverlap,M=t.nodeSize,R=t.strictRadial;if(D){var P,G=t.nodeSpacing;P=o(G)?function(){return G}:m(G)?G:function(){return 0},k=M?i(M)?function(t){return(M[0]>M[1]?M[0]:M[1])+P(t)}:function(t){return M+P(t)}:function(t){return t.size?i(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+P(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+P(t):t.size+P(t):10+P(t)};var L={nodes:n,nodeSizeFunc:k,adjMatrix:g,positions:C,radii:I,height:w,width:x,strictRadial:R,focusID:h,iterations:t.maxPreventOverlapIteration||200,k:C.length/4.5},j=new xf(L);C=j.layout()}return C.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],i=t.eIdealDistances||[],o=t.radii||[],a=0;a<=e;a++){var u=a/e;t.oneIteration(u,n,o,i,r)}},n.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(u,s){var c=Ef(u,[0,0]),f=0===c?0:1/c;if(s!==a){var l=0,d=0,h=0;e.forEach((function(t,e){if(s!==e){var n=Ef(u,t),o=0===n?0:1/n,a=r[e][s];h+=i[s][e],l+=i[s][e]*(t[0]+a*(u[0]-t[0])*o),d+=i[s][e]*(t[1]+a*(u[1]-t[1])*o)}}));var p=0===n[s]?0:1/n[s];h*=o,h+=t*p*p,l*=o,l+=t*p*u[0]*f,u[0]=l/h,d*=o,d+=t*p*u[1]*f,u[1]=d/h}}))},n.prototype.eIdealDisMatrix=function(){var t=this,n=t.nodes;if(!n)return[];var r=t.distances,i=t.linkDistance,o=t.radii||[],a=t.unitRadius||50,u=[];return r&&r.forEach((function(r,s){var c=[];r.forEach((function(r,u){if(s===u)c.push(0);else if(o[s]===o[u])if("data"===t.sortBy)c.push(r*(Math.abs(s-u)*t.sortStrength)/(o[s]/a));else if(t.sortBy){var f=n[s][t.sortBy]||0,l=n[u][t.sortBy]||0;e(f)&&(f=f.charCodeAt(0)),e(l)&&(l=l.charCodeAt(0)),c.push(r*(Math.abs(f-l)*t.sortStrength)/(o[s]/a))}else c.push(r*i/(o[s]/a));else{var d=(i+a)/2;c.push(r*d)}})),u.push(c)})),u},n.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(var o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(i=0;i<r;i++)if(i!==e)for(o=0;o<r;o++)if(t[i][o]===1/0){var a=Math.abs(t[e][i]-t[e][o]);a=0===a?1:a,t[i][o]=a}},n.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},n.prototype.getType=function(){return"radial"},n}(t),Af=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tf=function(t){function n(e){var n=t.call(this)||this;return n.nodeSize=30,n.minNodeSpacing=10,n.nodeSpacing=10,n.preventOverlap=!1,n.equidistant=!1,n.startAngle=1.5*Math.PI,n.clockwise=!0,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.onLayoutEnd=function(){},n.updateCfg(e),n}return Af(n,t),n.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},n.prototype.execute=function(){var t,n,r=this,a=r.nodes,u=r.edges,s=a.length;if(0!==s){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var c=r.center;if(1===s)return a[0].x=c[0],a[0].y=c[1],void(null===(n=r.onLayoutEnd)||void 0===n||n.call(r));var l,d=r.nodeSize,p=r.nodeSpacing,v=[],g=0;l=i(d)?Math.max(d[0],d[1]):d,i(p)?g=Math.max(p[0],p[1]):o(p)&&(g=p),a.forEach((function(t){v.push(t);var e=l;i(t.size)?e=Math.max(t.size[0],t.size[1]):o(t.size)?e=t.size:f(t.size)&&(e=Math.max(t.size.width,t.size.height)),l=Math.max(l,e),m(p)&&(g=Math.max(p(t),g))})),r.clockwise=void 0!==r.counterclockwise?!r.counterclockwise:r.clockwise;var y={},b={};if(v.forEach((function(t,e){y[t.id]=t,b[t.id]=e})),!("degree"!==r.sortBy&&e(r.sortBy)&&void 0!==v[0][r.sortBy]||(r.sortBy="degree",o(a[0].degree)))){var _=h(a.length,b,u);v.forEach((function(t,e){t.degree=_[e]}))}v.sort((function(t,e){return e[r.sortBy]-t[r.sortBy]})),r.maxValueNode=v[0],r.maxLevelDiff=r.maxLevelDiff||r.maxValueNode[r.sortBy]/4;var x=[[]],w=x[0];v.forEach((function(t){if(w.length>0){var e=Math.abs(w[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(w=[],x.push(w))}w.push(t)}));var E=l+(g||r.minNodeSpacing);if(!r.preventOverlap){var S=x.length>0&&x[0].length>1,A=(Math.min(r.width,r.height)/2-E)/(x.length+(S?1:0));E=Math.min(E,A)}var T=0;if(x.forEach((function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var i=Math.cos(n)-Math.cos(0),o=Math.sin(n)-Math.sin(0),a=Math.sqrt(E*E/(i*i+o*o));T=Math.max(a,T)}t.r=T,T+=E})),r.equidistant){for(var I=0,N=0,O=0;O<x.length;O++){var C=x[O].r-N;I=Math.max(I,C)}N=0,x.forEach((function(t,e){0===e&&(N=t.r),t.r=N,N+=I}))}return x.forEach((function(t){var e=t.dTheta,n=t.r;t.forEach((function(t,i){var o=r.startAngle+(r.clockwise?1:-1)*e*i;t.x=c[0]+n*Math.cos(o),t.y=c[1]+n*Math.sin(o)}))})),r.onLayoutEnd&&r.onLayoutEnd(),{nodes:a,edges:u}}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},n.prototype.getType=function(){return"concentric"},n}(t),If=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nf=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.linkDistance=50,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return If(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=void 0===n?[]:n,i=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var o=t.linkDistance,a=v({nodes:e,edges:r},!1),u=p(a);t.handleInfinity(u);var s,c,f=(s=o,c=[],u.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*s)})),c.push(e)})),c);t.scaledDistances=f;var l=t.runMDS();return t.positions=l,l.forEach((function(t,n){e[n].x=t[0]+i[0],e[n].y=t[1]+i[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.runMDS=function(){var t=this.scaledDistances,e=pf.mul(pf.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);var o=new yf(e),a=pf.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return pf.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,i){n===1/0&&(t[r][i]=e)}))}))},e.prototype.getType=function(){return"mds"},e}(t),Of=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cf=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.animate=!0,n.updateCfg(e),n}return Of(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=this,i=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),i&&0!==i.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var a=r.center;if(1===i.length)return i[0].x=a[0],i[0].y=a[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var u={},s={};return i.forEach((function(t,e){o(t.x)||(t.x=Math.random()*n.width),o(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),r.nodeMap=u,r.nodeIdxMap=s,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,u=e.animate,s={};if(a&&n.forEach((function(t){void 0===s[t.cluster]&&(s[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})})),o||!u){for(var c=0;c<i;c++)e.runOneStep(s);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var f=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(s),++f>=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var i=n.edges,a=n.center,u=n.gravity,s=n.speed,c=n.clustering,f=n.height*n.width,l=Math.sqrt(f)/10,d=f/(r.length+1),h=Math.sqrt(d),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,i,p,h,d),c){for(var v in t)t[v].cx=0,t[v].cy=0,t[v].count=0;for(var v in r.forEach((function(e){var n=t[e.cluster];o(e.x)&&(n.cx+=e.x),o(e.y)&&(n.cy+=e.y),n.count++})),t)t[v].cx/=t[v].count,t[v].cy/=t[v].count;var g=n.clusterGravity||u;r.forEach((function(e,n){if(o(e.x)&&o(e.y)){var r=t[e.cluster],i=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),a=h*g;p[n].x-=a*(e.x-r.cx)/i,p[n].y-=a*(e.y-r.cy)/i}}))}r.forEach((function(t,e){if(o(t.x)&&o(t.y)){var n=.01*h*u;p[e].x-=n*(t.x-a[0]),p[e].y-=n*(t.y-a[1])}})),r.forEach((function(t,e){if(o(t.fx)&&o(t.fy))return t.x=t.fx,void(t.y=t.fy);if(o(t.x)&&o(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(l*(s/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,a){if(i!==a&&o(r.x)&&o(t.x)&&o(r.y)&&o(t.y)){var u=r.x-t.x,s=r.y-t.y,c=u*u+s*s;if(0===c){c=1;var f=i>a?1:-1;u=.01*f,s=.01*f}var l=n/c;e[i].x+=u*l,e[i].y+=s*l}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var i=d(t,"source"),a=d(t,"target");if(i&&a){var u=r.nodeIdxMap[i],s=r.nodeIdxMap[a];if(u!==s){var c=r.nodeMap[i],f=r.nodeMap[a];if(o(f.x)&&o(c.x)&&o(f.y)&&o(c.y)){var l=f.x-c.x,h=f.y-c.y,p=Math.sqrt(l*l+h*h),v=p*p/n;e[s].x-=l/p*v,e[s].y-=h/p*v,e[u].x+=l/p*v,e[u].y+=h/p*v}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(t);function kf(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Df(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Rf(t,e,n){return e&&Mf(t.prototype,e),n&&Mf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pf(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}n(8892);var Gf=n(2087),Lf=n.n(Gf);function jf(t,e,n,r,i,o,a){try{var u=t[o](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,i)}function Uf(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){jf(o,r,i,a,u,"next",t)}function u(t){jf(o,r,i,a,u,"throw",t)}a(void 0)}))}}var Ff=1;function Bf(){return Ff++}var zf=function t(e){Df(this,t)},Vf=function(){function t(e){Df(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return Rf(t,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,e){this.lookup[t]=this.components.length;var n=new this.clazz(e||{});return this.components.push(n),this.entities.push(t),n}},{key:"remove",value:function(t){var e=this.lookup[t];e>-1&&e<this.components.length-1&&(this.components[e]=this.components[this.components.length-1],this.entities[e]=this.entities[this.entities.length-1],this.lookup[this.entities[e]]=e),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var e=this.lookup[t];if(e>-1){var n=this.entities[e];if(e<this.components.length-1){for(var r=e+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=e+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(t,e){if(t!==e){for(var n=this.components[t],r=this.entities[t],i=t<e?1:-1,o=t;o!==e;o+=i){var a=o+i;this.components[o]=this.components[a],this.entities[o]=this.entities[a],this.lookup[this.entities[o]]=o}this.components[e]=n,this.entities[e]=r,this.lookup[r]=e}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var e=this.lookup[t];return e>-1?this.components[e]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r);if(this.lookup[i]===t)return i}return-1}},{key:"find",value:function(t){for(var e=0;e<this.getCount();e++){var n=this.getComponent(e);if(t(n,e))return n}return null}},{key:"findIndex",value:function(t){for(var e=0;e<this.getCount();e++)if(t(this.getComponent(e),e))return e;return-1}},{key:"forEach",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r),o=this.lookup[i];t(i,this.getComponent(o))}}},{key:"forEachAsync",value:(e=Uf(Lf().mark((function t(e){var n,r,i,o,a;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.lookup);case 1:if(!(n<r.length)){t.next=10;break}return i=r[n],o=Number(i),a=this.lookup[o],t.next=7,e(o,this.getComponent(a));case 7:n++,t.next=1;break;case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"map",value:function(t){for(var e=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],o=Number(i),a=this.lookup[o];e.push(t(o,this.getComponent(a)))}return e}}]),t}();function Wf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hf(t,e){if(t){if("string"==typeof t)return Wf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wf(t,e):void 0}}function Xf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){u=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}}(t,e)||Hf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var qf=n(9311),Yf={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),Geometry:Symbol("Geometry"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),Material:Symbol("Material"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter"),Light:Symbol("Light")},Kf=function t(){Df(this,t),this.index=void 0},Zf=function t(){Df(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},$f=function(){function t(){Df(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return Rf(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){var n=this.writes.find((function(t){return t.index===e.index}));if(n)return e;var r=t.getResourceNode(e);r.resource.version++,r.resource.imported&&(this.hasSideEffect=!0);var i=t.createResourceNode(r.resource);return t.getResourceNode(i).writer=this,this.writes.push(i),i}}]),t}();function Jf(t,e){return Jf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Jf(t,e)}function Qf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jf(t,e)}function tl(t){return tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tl(t)}function el(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nl(t,e){if(e&&("object"===tl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return el(t)}function rl(t){return rl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},rl(t)}var il,ol,al,ul,sl,cl,fl=function(t){Qf(i,(function t(){Df(this,t),this.first=void 0,this.last=void 0}));var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){var t;Df(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=r.call.apply(r,[this].concat(n))).version=0,t.refs=0,t.name=void 0,t.imported=void 0,t.priority=void 0,t.discardStart=!0,t.discardEnd=!1,t.descriptor=void 0,t.resource=void 0,t}return Rf(i,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){this.imported}}]),i}(),ll=function t(){Df(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function dl(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return hl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function hl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var pl=(il=(0,qf.b2)(),ol=(0,qf.f3)(Yf.RenderEngine),il((cl=function(){function t(){Df(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],kf(this,"engine",sl,this)}var e,n;return Rf(t,[{key:"execute",value:(n=Uf(Lf().mark((function t(e){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.compile(),t.next=3,this.executePassNodes(e);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.frameGraphPasses.forEach((function(t){t.tearDown&&t.tearDown()})),this.reset()}},{key:"addPass",value:function(t,e,n,r){var i=new Zf;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new $f;return o.name=t,this.passNodes.push(o),this.frameGraphPasses.push(i),e(this,o,i),i}},{key:"getPass",value:function(t){return this.frameGraphPasses.find((function(e){return e.name===t}))}},{key:"compile",value:function(){var t,e=this,n=dl(this.passNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.refCount=r.writes.length+(r.hasSideEffect?1:0),r.reads.forEach((function(t){e.resourceNodes[t.index].readerCount++}))}}catch(t){n.e(t)}finally{n.f()}var i,o=[],a=dl(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var u=i.value;0===u.readerCount&&o.push(u)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var s=o.pop(),c=s&&s.writer;if(c&&0==--c.refCount){var f,l=dl(c.reads);try{for(l.s();!(f=l.n()).done;){var d=f.value,h=this.resourceNodes[d.index];0==--h.readerCount&&o.push(h)}}catch(t){l.e(t)}finally{l.f()}}}this.resourceNodes.forEach((function(t){t.resource.refs+=t.readerCount}));var p,v=dl(this.passNodes);try{for(v.s();!(p=v.n()).done;){var g=p.value;if(g.refCount){var y,m=dl(g.reads);try{for(m.s();!(y=m.n()).done;){var b=y.value,_=this.resourceNodes[b.index].resource;_.first=_.first?_.first:g,_.last=g}}catch(t){m.e(t)}finally{m.f()}var x,w=dl(g.writes);try{for(w.s();!(x=w.n()).done;){var E=x.value,S=this.resourceNodes[E.index].resource;S.first=S.first?S.first:g,S.last=g}}catch(t){w.e(t)}finally{w.f()}}}}catch(t){v.e(t)}finally{v.f()}for(var A=0;A<2;A++){var T,I=dl(this.resourceNodes);try{for(I.s();!(T=I.n()).done;){var N=T.value.resource;if(N.priority===A&&N.refs){var O=N.first,C=N.last;O&&C&&(O.devirtualize.push(N),C.destroy.push(N))}}}catch(t){I.e(t)}finally{I.f()}}}},{key:"executePassNodes",value:(e=Uf(Lf().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,d,h,p;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=dl(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=Xf(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}u=dl(a.devirtualize);try{for(u.s();!(s=u.n()).done;)s.value.preExecuteDevirtualize(this.engine)}catch(t){u.e(t)}finally{u.f()}c=dl(a.destroy);try{for(c.s();!(f=c.n()).done;)f.value.preExecuteDestroy(this.engine)}catch(t){c.e(t)}finally{c.f()}return t.next=12,this.frameGraphPasses[o].execute(this,this.frameGraphPasses[o],e);case 12:l=dl(a.devirtualize);try{for(l.s();!(d=l.n()).done;)d.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}h=dl(a.destroy);try{for(h.s();!(p=h.n()).done;)p.value.postExecuteDestroy(this.engine)}catch(t){h.e(t)}finally{h.f()}case 16:t.next=3;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:this.reset();case 27:case"end":return t.stop()}}),t,this,[[1,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var e=new ll;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new Kf;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new fl;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new fl;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"present",value:function(t){this.addPass("Present",(function(e,n){n.read(t),n.hasSideEffect=!0}),Uf(Lf().mark((function t(){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),sl=Pf((ul=cl).prototype,"engine",[ol],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),al=ul))||al);function vl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gl=1e-6,yl="undefined"!=typeof Float32Array?Float32Array:Array;function ml(){var t=new yl(4);return yl!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function bl(t,e,n,r){var i=new yl(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function _l(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function xl(){var t=new yl(9);return yl!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function wl(){var t=new yl(3);return yl!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function El(t){var e=new yl(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Sl(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Al(t,e,n){var r=new yl(3);return r[0]=t,r[1]=e,r[2]=n,r}function Tl(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Il(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Nl(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Ol(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Cl(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function kl(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Dl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ml(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function Rl(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function Pl(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),ml();var Gl=Ol,Ll=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},jl=Sl,Ul=(wl(),9007199254740991),Fl={};Fl["[object Float32Array]"]=Fl["[object Float64Array]"]=Fl["[object Int8Array]"]=Fl["[object Int16Array]"]=Fl["[object Int32Array]"]=Fl["[object Uint8Array]"]=Fl["[object Uint8ClampedArray]"]=Fl["[object Uint16Array]"]=Fl["[object Uint32Array]"]=!0,Fl["[object Arguments]"]=Fl["[object Array]"]=Fl["[object ArrayBuffer]"]=Fl["[object Boolean]"]=Fl["[object DataView]"]=Fl["[object Date]"]=Fl["[object Error]"]=Fl["[object Function]"]=Fl["[object Map]"]=Fl["[object Number]"]=Fl["[object Object]"]=Fl["[object RegExp]"]=Fl["[object Set]"]=Fl["[object String]"]=Fl["[object WeakMap]"]=!1;var Bl=Object.prototype.toString,zl=function(t){return function(t){return!!t&&"object"===tl(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ul}(t.length)&&!!Fl[Bl.call(t)]};function Vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vl(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Hl,Xl,ql,Yl,Kl,Zl,$l,Jl,Ql,td=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(t){var e;return Df(this,i),(e=r.call(this,t)).dirty=!0,e.attributes=[],e.indices=void 0,e.indicesBuffer=void 0,e.vertexCount=0,e.maxInstancedCount=void 0,e.aabb=void 0,e.entity=void 0,Object.assign(el(e),t),e}return Rf(i,[{key:"setAttribute",value:function(t,e,n,r){var i=this.attributes.find((function(e){return e.name===t}));return i?(i.data=e,i.dirty=!0):this.attributes.push(Wl(Wl({dirty:!0,name:t,data:e},n),{},{bufferGetter:r})),this.dirty=!0,this}},{key:"setIndex",value:function(t){return this.indices=new Uint32Array(t.buffer?t.buffer:t),this.dirty=!0,this}},{key:"applyMatrix",value:function(t){var e,n,r,i,o,a,u,s,c,f,l,d,h,p,v,g,y,m,b,_,x,w,E,S,A,T,I,N,O,C,k,D=this.attributes.find((function(t){return"position"===t.name})),M=this.attributes.find((function(t){return"normal"===t.name}));if(D&&(D.dirty=!0,D.data&&D.data.length))for(var R=0;R<D.data.length;R+=3){var P=bl(D.data[R],D.data[R+1],D.data[R+2],1);_l(P,P,t),zl(D.data)?D.data.set([P[0],P[1],P[2]],R):(D.data[R]=P[0],D.data[R+1]=P[1],D.data[R+2]=P[2])}if(M){var G=(e=xl(),r=(n=t)[0],i=n[1],o=n[2],a=n[3],u=n[4],s=n[5],c=n[6],f=n[7],l=n[8],d=n[9],h=n[10],p=n[11],v=n[12],g=n[13],y=n[14],m=n[15],(k=(b=r*s-i*u)*(C=h*m-p*y)-(_=r*c-o*u)*(O=d*m-p*g)+(x=r*f-a*u)*(N=d*y-h*g)+(w=i*c-o*s)*(I=l*m-p*v)-(E=i*f-a*s)*(T=l*y-h*v)+(S=o*f-a*c)*(A=l*g-d*v))?(k=1/k,e[0]=(s*C-c*O+f*N)*k,e[1]=(c*I-u*C-f*T)*k,e[2]=(u*O-s*I+f*A)*k,e[3]=(o*O-i*C-a*N)*k,e[4]=(r*C-o*I+a*T)*k,e[5]=(i*I-r*O-a*A)*k,e[6]=(g*S-y*E+m*w)*k,e[7]=(y*x-v*S-m*_)*k,e[8]=(v*E-g*x+m*b)*k,e):null);if(M.data&&M.data.length)for(var L=0;L<M.data.length;L+=3){var j=Al(M.data[L],M.data[L+1],M.data[L+2]);Pl(j,j,G),kl(j,j),zl(M.data)?M.data.set([j[0],j[1],j[2]],L):(M.data[L]=j[0],M.data[L+1]=j[1],M.data[L+2]=j[2])}}}}]),i}(zf);!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(Hl||(Hl={}));var ed=(Xl=(0,qf.b2)(),ql=(0,qf.f3)(Yf.GeometryComponentManager),Yl=(0,qf.f3)(Yf.RenderEngine),Xl((Ql=function(){function t(){Df(this,t),kf(this,"geometry",$l,this),kf(this,"engine",Jl,this)}var e;return Rf(t,[{key:"execute",value:(e=Uf(Lf().mark((function t(){var e=this;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.geometry.forEach((function(t,n){n.dirty&&(n.attributes.forEach((function(t){var n;t.dirty&&t.data&&(t.buffer?null===(n=t.buffer)||void 0===n||n.subData({data:t.data,offset:0}):t.buffer=e.engine.createBuffer({data:t.data,type:Hl.FLOAT}),t.dirty=!1)})),n.indices&&(n.indicesBuffer?n.indicesBuffer.subData({data:n.indices,offset:0}):n.indicesBuffer=e.engine.createElements({data:n.indices,count:n.indices.length,type:Hl.UNSIGNED_INT,usage:Hl.STATIC_DRAW})),n.dirty=!1)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(t,e){e.indicesBuffer&&e.indicesBuffer.destroy(),e.attributes.forEach((function(t){t.buffer&&t.buffer.destroy()}))})),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=Bf();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Bf();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),$l=Pf((Zl=Ql).prototype,"geometry",[ql],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jl=Pf(Zl.prototype,"engine",[Yl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kl=Zl))||Kl);function nd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function rd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nd(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var id,od,ad,ud,sd,cd,fd,ld,dd,hd,pd=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(t){var e;return Df(this,i),(e=r.call(this,t)).vertexShaderGLSL=void 0,e.fragmentShaderGLSL=void 0,e.defines={},e.dirty=!0,e.uniforms=[],e.cull={enable:!0,face:Hl.BACK},e.depth={enable:!0},e.blend=void 0,e.entity=void 0,e.type=void 0,Object.assign(el(e),t),e}return Rf(i,[{key:"setDefines",value:function(t){return this.defines=rd(rd({},this.defines),t),this}},{key:"setCull",value:function(t){return this.cull=t,this}},{key:"setDepth",value:function(t){return this.depth=t,this}},{key:"setBlend",value:function(t){return this.blend=t,this}},{key:"setUniform",value:function(t,e){var n=this;if("string"!=typeof t)return Object.keys(t).forEach((function(e){return n.setUniform(e,t[e])})),this;var r=this.uniforms.find((function(e){return e.name===t}));return r?(r.dirty=!0,r.data=e):this.uniforms.push({name:t,dirty:!0,data:e}),this.dirty=!0,this}}]),i}(zf);function vd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vd(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var yd,md=(id=(0,qf.b2)(),od=(0,qf.f3)(Yf.MaterialComponentManager),ad=(0,qf.f3)(Yf.RenderEngine),ud=(0,qf.f3)(Yf.ShaderModuleService),id((hd=function(){function t(){Df(this,t),kf(this,"material",fd,this),kf(this,"engine",ld,this),kf(this,"shaderModule",dd,this)}var e;return Rf(t,[{key:"execute",value:(e=Uf(Lf().mark((function t(){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createShaderMaterial",value:function(t){var e=Bf(),n=t.vertexShader,r=t.fragmentShader,i=[];if(!this.engine.supportWebGPU){var o="material-".concat(e);this.shaderModule.registerModule(o,{vs:t.vertexShader,fs:t.fragmentShader});var a=this.shaderModule.getModule(o);n=a.vs,r=a.fs,a.uniforms&&(i=Object.keys(a.uniforms).map((function(t){return{dirty:!0,name:t,data:a.uniforms[t]}})))}return this.material.create(e,gd(gd({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),fd=Pf((cd=hd).prototype,"material",[od],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ld=Pf(cd.prototype,"engine",[ad],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dd=Pf(cd.prototype,"shaderModule",[ud],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sd=cd))||sd);!function(t){t[t.Standard=0]="Standard"}(yd||(yd={}));var bd=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(t){var e;return Df(this,i),(e=r.call(this,t)).strategy=yd.Standard,e.visibilityPlaneMask=0,e.visible=!1,Object.assign(el(e),t),e}return i}(zf),_d=function(){function t(e,n){Df(this,t),this.center=void 0,this.halfExtents=void 0,this.min=wl(),this.max=wl(),this.update(e,n)}return Rf(t,[{key:"update",value:function(t,e){this.center=t||wl(),this.halfExtents=e||Al(.5,.5,.5),this.min=Gl(this.min,this.center,this.halfExtents),this.max=Nl(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Nl(this.center,e,t),Cl(this.center,this.center,.5),Gl(this.halfExtents,e,t),Cl(this.halfExtents,this.halfExtents,.5),Tl(this.min,t),Tl(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],u=o[1],s=o[2],c=n-a,f=n+a,l=r-u,d=r+u,h=i-s,p=i+s,v=t.center,g=v[0],y=v[1],m=v[2],b=t.halfExtents,_=b[0],x=b[1],w=b[2],E=g-_,S=g+_,A=y-x,T=y+x,I=m-w,N=m+w;E<c&&(c=E),S>f&&(f=S),A<l&&(l=A),T>d&&(d=T),I<h&&(h=I),N>p&&(p=N),e[0]=.5*(c+f),e[1]=.5*(l+d),e[2]=.5*(h+p),o[0]=.5*(f-c),o[1]=.5*(d-l),o[2]=.5*(p-h),this.min[0]=c,this.min[1]=l,this.min[2]=h,this.max[0]=f,this.max[1]=d,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Tl(wl(),this.min):272===t.pnVertexFlag?Al(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?Al(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?Al(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?Al(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?Al(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?Al(this.max[0],this.max[1],this.min[2]):Al(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Tl(wl(),this.max):272===t.pnVertexFlag?Al(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?Al(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?Al(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?Al(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?Al(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?Al(this.min[0],this.min[1],this.max[2]):Al(this.min[0],this.min[1],this.min[2])}}]),t}();var xd,wd=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(t){var e;return Df(this,i),(e=r.call(this,t)).material=void 0,e.geometry=void 0,e.aabb=new _d,e.aabbDirty=!0,e.model=void 0,e.visible=!0,e.children=[],Object.assign(el(e),t),e}return i}(zf),Ed=function(){function t(e,n){Df(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||Al(0,1,0),this.updatePNVertexFlag()}return Rf(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return Dl(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/jl(this.normal);Cl(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&Ml(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(xd||(xd={}));var Sd,Ad,Td,Id,Nd,Od,Cd,kd,Dd,Md,Rd,Pd,Gd,Ld,jd=function(){function t(e){if(Df(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new Ed)}return Rf(t,[{key:"extractFromVPMatrix",value:function(t){var e=Xf(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],y=e[15];Il(this.planes[0].normal,o-n,c-a,h-f),this.planes[0].distance=-(y-p),Il(this.planes[1].normal,o+n,c+a,h+f),this.planes[1].distance=-(y+p),Il(this.planes[2].normal,o+r,c+u,h+l),this.planes[2].distance=-(y+v),Il(this.planes[3].normal,o-r,c-u,h-l),this.planes[3].distance=-(y-v),Il(this.planes[4].normal,o-i,c-s,h-d),this.planes[4].distance=-(y-g),Il(this.planes[5].normal,o+i,c+s,h+d),this.planes[5].distance=-(y+g),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}();function Ud(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Fd(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fd(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Fd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Bd=(Sd=(0,qf.b2)(),Ad=(0,qf.f3)(Yf.MeshComponentManager),Td=(0,qf.f3)(Yf.CullableComponentManager),Id=(0,qf.f3)(Yf.GeometryComponentManager),Nd=(0,qf.f3)(Yf.HierarchyComponentManager),Od=(0,qf.f3)(Yf.TransformComponentManager),Sd((Ld=function(){function t(){Df(this,t),kf(this,"mesh",Dd,this),kf(this,"cullable",Md,this),kf(this,"geometry",Rd,this),kf(this,"hierarchy",Pd,this),kf(this,"transform",Gd,this),this.planes=void 0}var e;return Rf(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=Uf(Lf().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,d,h,p,v,g,y,m,b,_,x,w;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Ud(e);try{for(n.s();!(r=n.n()).done;){i=r.value,o=i.getScene(),a=i.getCamera(),u=Ud(o.getEntities());try{for(u.s();!(s=u.n()).done;)c=s.value,(f=this.mesh.getComponentByEntity(c))&&(l=this.hierarchy.getComponentByEntity(c),d=this.cullable.getComponentByEntity(c),h=f.geometry,p=this.transform.getComponentByEntity(c),h&&h.aabb&&p&&f.aabbDirty&&(v=p.worldTransform,g=h.aabb,y=g.center,m=g.halfExtents,b=Rl(wl(),y,v),E=v,(S=xl())[0]=E[0],S[1]=E[1],S[2]=E[2],S[3]=E[4],S[4]=E[5],S[5]=E[6],S[6]=E[8],S[7]=E[9],S[8]=E[10],_=S,x=Pl(wl(),m,_),f.aabb.update(b,x),f.aabbDirty=!1),d&&h&&(w=this.cullable.getComponentByEntity((null==l?void 0:l.parentID)||-1),d.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(f.aabb,(null==w?void 0:w.visibilityPlaneMask)||xd.INDETERMINATE,this.planes||a.getFrustum().planes),d.visible=d.visibilityPlaneMask!==xd.OUTSIDE))}catch(t){u.e(t)}finally{u.f()}}}catch(t){n.e(t)}finally{n.f()}case 2:case"end":return t.stop()}var E,S}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n){if(e===xd.OUTSIDE||e===xd.INSIDE)return e;for(var r=xd.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var u=n[i],s=u.normal,c=u.distance;if(Dl(s,t.getNegativeFarPoint(n[i]))+c>0)return xd.OUTSIDE;Dl(s,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),Dd=Pf((kd=Ld).prototype,"mesh",[Ad],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Md=Pf(kd.prototype,"cullable",[Td],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rd=Pf(kd.prototype,"geometry",[Id],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pd=Pf(kd.prototype,"hierarchy",[Nd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gd=Pf(kd.prototype,"transform",[Od],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cd=kd))||Cd);function zd(){var t=new yl(16);return yl!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Vd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Wd(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Hd(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],y=e[15],m=n*u-r*a,b=n*s-i*a,_=n*c-o*a,x=r*s-i*u,w=r*c-o*u,E=i*c-o*s,S=f*v-l*p,A=f*g-d*p,T=f*y-h*p,I=l*g-d*v,N=l*y-h*v,O=d*y-h*g,C=m*O-b*N+_*I+x*T-w*A+E*S;return C?(C=1/C,t[0]=(u*O-s*N+c*I)*C,t[1]=(i*N-r*O-o*I)*C,t[2]=(v*E-g*w+y*x)*C,t[3]=(d*w-l*E-h*x)*C,t[4]=(s*T-a*O-c*A)*C,t[5]=(n*O-i*T+o*A)*C,t[6]=(g*_-p*E-y*b)*C,t[7]=(f*E-d*_+h*b)*C,t[8]=(a*N-u*T+c*S)*C,t[9]=(r*T-n*N-o*S)*C,t[10]=(p*w-v*_+y*m)*C,t[11]=(l*_-f*w-h*m)*C,t[12]=(u*A-a*I-s*S)*C,t[13]=(n*I-r*A+i*S)*C,t[14]=(v*b-p*x-g*m)*C,t[15]=(f*x-l*b+d*m)*C,t):null}function Xd(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],d=e[9],h=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],_=n[1],x=n[2],w=n[3];return t[0]=b*r+_*u+x*l+w*v,t[1]=b*i+_*s+x*d+w*g,t[2]=b*o+_*c+x*h+w*y,t[3]=b*a+_*f+x*p+w*m,b=n[4],_=n[5],x=n[6],w=n[7],t[4]=b*r+_*u+x*l+w*v,t[5]=b*i+_*s+x*d+w*g,t[6]=b*o+_*c+x*h+w*y,t[7]=b*a+_*f+x*p+w*m,b=n[8],_=n[9],x=n[10],w=n[11],t[8]=b*r+_*u+x*l+w*v,t[9]=b*i+_*s+x*d+w*g,t[10]=b*o+_*c+x*h+w*y,t[11]=b*a+_*f+x*p+w*m,b=n[12],_=n[13],x=n[14],w=n[15],t[12]=b*r+_*u+x*l+w*v,t[13]=b*i+_*s+x*d+w*g,t[14]=b*o+_*c+x*h+w*y,t[15]=b*a+_*f+x*p+w*m,t}function qd(t,e,n){var r,i,o,a,u,s,c,f,l,d,h,p,v=n[0],g=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*y+e[12],t[13]=e[1]*v+e[5]*g+e[9]*y+e[13],t[14]=e[2]*v+e[6]*g+e[10]*y+e[14],t[15]=e[3]*v+e[7]*g+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],d=e[9],h=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=c,t[7]=f,t[8]=l,t[9]=d,t[10]=h,t[11]=p,t[12]=r*v+u*g+l*y+e[12],t[13]=i*v+s*g+d*y+e[13],t[14]=o*v+c*g+h*y+e[14],t[15]=a*v+f*g+p*y+e[15]),t}function Yd(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Kd(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],u=e[6],s=e[8],c=e[9],f=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,u),t[2]=Math.hypot(s,c,f),t}function Zd(t,e){var n=new yl(3);Kd(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,u=e[1]*i,s=e[2]*o,c=e[4]*r,f=e[5]*i,l=e[6]*o,d=e[8]*r,h=e[9]*i,p=e[10]*o,v=a+f+p,g=0;return v>0?(g=2*Math.sqrt(v+1),t[3]=.25*g,t[0]=(l-h)/g,t[1]=(d-s)/g,t[2]=(u-c)/g):a>f&&a>p?(g=2*Math.sqrt(1+a-f-p),t[3]=(l-h)/g,t[0]=.25*g,t[1]=(u+c)/g,t[2]=(d+s)/g):f>p?(g=2*Math.sqrt(1+f-a-p),t[3]=(d-s)/g,t[0]=(u+c)/g,t[1]=.25*g,t[2]=(l+h)/g):(g=2*Math.sqrt(1+p-a-f),t[3]=(u-c)/g,t[0]=(d+s)/g,t[1]=(l+h)/g,t[2]=.25*g),t}function $d(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,c=n*a,f=r*a,l=r*u,d=i*a,h=i*u,p=i*s,v=o*a,g=o*u,y=o*s;return t[0]=1-l-p,t[1]=f+y,t[2]=d-g,t[3]=0,t[4]=f-y,t[5]=1-c-p,t[6]=h+v,t[7]=0,t[8]=d+g,t[9]=h-v,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}var Jd,Qd,th,eh,nh,rh,ih,oh,ah,uh,sh,ch,fh,lh,dh,hh,ph,vh,gh,yh,mh,bh,_h,xh;function wh(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Eh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Eh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Sh,Ah,Th,Ih,Nh,Oh,Ch,kh,Dh,Mh,Rh,Ph,Gh,Lh=(Jd=(0,qf.b2)(),Qd=(0,qf.f3)(Yf.MeshComponentManager),th=(0,qf.f3)(Yf.GeometryComponentManager),eh=(0,qf.f3)(Yf.MaterialComponentManager),nh=(0,qf.f3)(Yf.CullableComponentManager),rh=(0,qf.f3)(Yf.TransformComponentManager),ih=(0,qf.f3)(Yf.HierarchyComponentManager),oh=(0,qf.f3)(Yf.Systems),ah=(0,qf.t6)(Yf.FrameGraphSystem),uh=(0,qf.f3)(Yf.RenderEngine),sh=(0,qf.f3)(Yf.ResourcePool),Jd((xh=_h=function(){function t(){var e=this;Df(this,t),kf(this,"mesh",lh,this),kf(this,"geometry",dh,this),kf(this,"material",hh,this),kf(this,"cullable",ph,this),kf(this,"transform",vh,this),kf(this,"hierarchy",gh,this),kf(this,"frameGraphSystem",yh,this),kf(this,"engine",mh,this),kf(this,"resourcePool",bh,this),this.modelCache={},this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Hl.RENDER_ATTACHMENT|Hl.SAMPLED|Hl.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=Uf(Lf().mark((function t(n,r,i){var o,a,u,s,c,f;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),u=wh(i),t.prev=3,u.s();case 5:if((s=u.n()).done){t.next=11;break}return c=s.value,t.next=9,e.initView(c);case 9:t.next=5;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),u.e(t.t0);case 16:return t.prev=16,u.f(),t.finish(16);case 19:f=e.engine.getCanvas(),a.resize({width:f.width,height:f.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:a,color:i[0].getClearColor(),depth:1}),e.engine.useFramebuffer(a,(function(){var t,n=wh(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.renderView(r)}}catch(t){n.e(t)}finally{n.f()}}));case 24:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,n,r){return t.apply(this,arguments)}}()}var e,n;return Rf(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=Xd(zd(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,u=o.y,s=o.width,c=o.height;this.engine.viewport({x:a,y:u,width:s,height:c});var f,l=wh(e.getEntities());try{for(l.s();!(f=l.n()).done;){var d=f.value;this.renderMesh(d,{camera:n,view:t,viewMatrix:r})}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderMesh",value:function(t,e){var n=e.camera,r=e.view,i=e.viewMatrix,o=this.mesh.getComponentByEntity(t);if(o&&o.visible){var a=o.material,u=o.geometry;if(u&&!u.dirty&&a){var s=this.transform.getComponentByEntity(t),c=Xd(zd(),i,s.worldTransform),f=r.getViewport(),l=f.width,d=f.height;a.setUniform({projectionMatrix:n.getPerspective(),modelViewMatrix:c,modelMatrix:s.worldTransform,viewMatrix:i,cameraPosition:n.getPosition(),u_viewport:[l,d]}),o.model&&(o.model.draw({uniforms:a.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{})}),a.uniforms.forEach((function(t){t.dirty=!1})),a.dirty=!1)}}}},{key:"initMesh",value:(n=Uf(Lf().mark((function t(e,n){var r,i,o,a,u,s,c,f;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.mesh.getComponentByEntity(e)){t.next=3;break}return t.abrupt("return");case 3:if(i=r.material,(o=r.geometry)&&!o.dirty&&i){t.next=7;break}return t.abrupt("return");case 7:if(r.model){t.next=24;break}if(a="m-".concat(i.entity,"-g-").concat(o.entity),!this.modelCache[a]){t.next=12;break}return r.model=this.modelCache[a],t.abrupt("return");case 12:return i.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),u=this.engine,s=u.createModel,c=u.createAttribute,f={vs:i.vertexShaderGLSL,fs:i.fragmentShaderGLSL,defines:i.defines,attributes:o.attributes.reduce((function(t,e){return e.data&&e.buffer&&(t[e.name]=c({buffer:e.buffer,attributes:e.attributes,arrayStride:e.arrayStride,stepMode:e.stepMode,divisor:"vertex"===e.stepMode?0:1})),t}),{}),uniforms:i.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{}),scissor:{enable:!0,box:function(){return n.getViewport()}}},i.cull&&(f.cull=i.cull),i.depth&&(f.depth=i.depth),i.blend&&(f.blend=i.blend),o.indicesBuffer&&(f.elements=o.indicesBuffer),o.maxInstancedCount&&(f.instances=o.maxInstancedCount,f.count=o.vertexCount||3),t.next=22,s(f);case 22:r.model=t.sent,this.modelCache[a]=r.model;case 24:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"initView",value:(e=Uf(Lf().mark((function t(e){var n,r,i,o;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=wh(n.getEntities()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=i.value,t.next=8,this.initMesh(o,e);case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[2,12,15,18]])}))),function(t){return e.apply(this,arguments)})}]),t}(),_h.IDENTIFIER="Render Pass",lh=Pf((fh=xh).prototype,"mesh",[Qd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dh=Pf(fh.prototype,"geometry",[th],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hh=Pf(fh.prototype,"material",[eh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ph=Pf(fh.prototype,"cullable",[nh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vh=Pf(fh.prototype,"transform",[rh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gh=Pf(fh.prototype,"hierarchy",[ih],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yh=Pf(fh.prototype,"frameGraphSystem",[oh,ah],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mh=Pf(fh.prototype,"engine",[uh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bh=Pf(fh.prototype,"resourcePool",[sh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ch=fh))||ch);function jh(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Uh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Uh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Fh,Bh,zh,Vh,Wh,Hh,Xh,qh,Yh,Kh,Zh,$h,Jh,Qh,tp,ep,np,rp,ip,op,ap,up,sp=(Sh=(0,qf.b2)(),Ah=(0,qf.f3)(Yf.RenderEngine),Th=(0,qf.f3)(Yf.ResourcePool),Ih=(0,qf.f3)(Yf.RenderPassFactory),Nh=(0,qf.f3)(Yf.MeshComponentManager),Sh((Gh=Ph=function(){function t(){var e=this;Df(this,t),kf(this,"engine",kh,this),kf(this,"resourcePool",Dh,this),kf(this,"renderPassFactory",Mh,this),kf(this,"mesh",Rh,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,e,n){var r=t.createRenderTarget(e,"picking fbo",{width:1,height:1});n.data={output:e.write(t,r)},e.hasSideEffect=!0},this.execute=function(){var t=Uf(Lf().mark((function t(n,r,i){var o,a,u;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views=i,!e.alreadyInRendering){t.next=3;break}return t.abrupt("return");case 3:o=jh(i);try{for(u=function(){var t=a.value,i=t.getViewport(),o=i.width,u=i.height;e.alreadyInRendering=!0;var s=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(s.resource),e.pickingFBO.resize({width:o,height:u}),e.engine.useFramebuffer(e.pickingFBO,(function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n,r=e.renderPassFactory(Lh.IDENTIFIER),i=[],o=jh(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,u=e.mesh.getComponentByEntity(a);u.material.setUniform("u_PickingStage",1),i.push(u)}}catch(t){o.e(t)}finally{o.f()}r.renderView(t),i.forEach((function(t){t.material.setUniform("u_PickingStage",2)})),e.alreadyInRendering=!1}))},o.s();!(a=o.n()).done;)u()}catch(t){o.e(t)}finally{o.f()}case 5:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),this.pick=function(t,n){var r,i,o=t.x,a=t.y,u=e.engine,s=u.readPixels,c=u.useFramebuffer,f=n.getViewport(),l=f.width,d=f.height,h=o*window.devicePixelRatio,p=a*window.devicePixelRatio;if(!(h>l||h<0||p>d||p<0))return c(e.pickingFBO,(function(){var t;0===(r=s({x:Math.round(h),y:Math.round(d-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(t=Xf(r,3),i=t[0]+256*t[1]+65536*t[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return Rf(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=jh(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",2),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),Ph.IDENTIFIER="PixelPicking Pass",kh=Pf((Ch=Gh).prototype,"engine",[Ah],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Dh=Pf(Ch.prototype,"resourcePool",[Th],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mh=Pf(Ch.prototype,"renderPassFactory",[Ih],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rh=Pf(Ch.prototype,"mesh",[Nh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oh=Ch))||Oh),cp=(Fh=(0,qf.b2)(),Bh=(0,qf.f3)(Yf.RenderEngine),zh=(0,qf.f3)(Yf.ResourcePool),Fh((Yh=qh=function t(){var e=this;Df(this,t),kf(this,"engine",Hh,this),kf(this,"resourcePool",Xh,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Lh.IDENTIFIER);if(r){var i=t.createRenderTarget(e,"render to screen",{width:1,height:1});n.data={input:e.read(r.data.output),output:e.write(t,i)}}},this.execute=function(){var t=Uf(Lf().mark((function t(n,r){var i,o,a,u,s,c,f;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,u=i.createBuffer,e.model){t.next=6;break}return t.next=4,o({vs:e.engine.supportWebGPU?"layout(location = 0) in vec2 a_Position;\nlayout(location = 0) out vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}":"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\n\nlayout(location = 0) in vec2 v_UV;\nlayout(location = 0) out vec4 outColor;\n\nvoid main() {\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\n}":"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}",attributes:{a_Position:a({buffer:u({data:[-4,-4,4,-4,0,4],type:Hl.FLOAT}),size:2,arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:s=t.sent,e.model=s;case 6:c=n.getResourceNode(r.data.input),f=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,(function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:f}})}));case 9:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},qh.IDENTIFIER="Copy Pass",Hh=Pf((Wh=Yh).prototype,"engine",[Bh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xh=Pf(Wh.prototype,"resourcePool",[zh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vh=Wh))||Vh),fp=(Kh=(0,qf.b2)(),Zh=(0,qf.f3)(Yf.Systems),$h=(0,qf.t6)(Yf.FrameGraphSystem),Jh=(0,qf.f3)(Yf.RenderPassFactory),Qh=(0,qf.f3)(Yf.ConfigService),tp=(0,qf.f3)(Yf.ResourcePool),Kh((up=function(){function t(){Df(this,t),kf(this,"frameGraphSystem",rp,this),kf(this,"renderPassFactory",ip,this),kf(this,"configService",op,this),kf(this,"resourcePool",ap,this)}var e;return Rf(t,[{key:"execute",value:(e=Uf(Lf().mark((function t(e){var n,r,i,o,a,u,s,c;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Lh.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Lh.IDENTIFIER,r,i),o=this.renderPassFactory(cp.IDENTIFIER),a=o.setup,u=o.execute,s=o.tearDown,c=this.frameGraphSystem.addPass(cp.IDENTIFIER,a,u,s),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(sp.IDENTIFIER).pick(t,e)}}]),t}(),rp=Pf((np=up).prototype,"frameGraphSystem",[Zh,$h],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ip=Pf(np.prototype,"renderPassFactory",[Jh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),op=Pf(np.prototype,"configService",[Qh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ap=Pf(np.prototype,"resourcePool",[tp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ep=np))||ep);var lp,dp,hp,pp,vp,gp,yp,mp,bp,_p,xp=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(t){var e;return Df(this,i),(e=r.call(this,t)).parentID=void 0,Object.assign(el(e),t),e}return i}(zf),wp=(lp=(0,qf.b2)(),dp=(0,qf.f3)(Yf.HierarchyComponentManager),hp=(0,qf.f3)(Yf.TransformComponentManager),pp=(0,qf.f3)(Yf.MeshComponentManager),lp((_p=function(){function t(){Df(this,t),kf(this,"hierarchy",yp,this),kf(this,"transform",mp,this),kf(this,"mesh",bp,this)}var e;return Rf(t,[{key:"execute",value:(e=Uf(Lf().mark((function t(){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){(n.isDirty()||n.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(e)),n.updateTransform())}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e});var r=this.mesh.getComponentByEntity(e);if(this.setMeshAABBDirty(r),r&&-1===r.children.indexOf(t)&&r.children.push(t),this.hierarchy.getCount()>1)for(var i=this.hierarchy.getCount()-1;i>0;--i)for(var o=this.hierarchy.getEntity(i),a=0;a<i;++a)if(this.hierarchy.getComponent(a).parentID===o){this.hierarchy.moveItem(i,a),++i;break}this.hierarchy.getComponentByEntity(t);var u=this.transform.getComponentByEntity(e);null===u&&(u=this.transform.create(e));var s=this.transform.getComponentByEntity(t);null===s&&(s=this.transform.create(t),u=this.transform.getComponentByEntity(e)),s.parent=u,!n&&u&&(s.matrixTransform(Hd(zd(),u.worldTransform)),s.updateTransform()),u&&s.updateTransformWithParent(u)}},{key:"detach",value:function(t){var e=this.hierarchy.getComponentByEntity(t);if(null!==e){var n=this.transform.getComponentByEntity(t);null!==n&&(n.parent=null,n.applyTransform()),this.hierarchy.removeKeepSorted(t);var r=this.mesh.getComponentByEntity(e.parentID);if(r){var i=r.children.indexOf(t);r.children.splice(i,1)}this.setMeshAABBDirty(r)}}},{key:"detachChildren",value:function(t){var e=this.mesh.getComponentByEntity(t);e&&(e.children=[]);for(var n=0;n<this.hierarchy.getCount();){var r;if((null===(r=this.hierarchy.getComponent(n))||void 0===r?void 0:r.parentID)===t){var i=this.hierarchy.getEntity(n);this.detach(i)}else++n}}},{key:"setMeshAABBDirty",value:function(t){t&&(t.aabbDirty=!0)}}]),t}(),yp=Pf((gp=_p).prototype,"hierarchy",[dp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mp=Pf(gp.prototype,"transform",[hp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bp=Pf(gp.prototype,"mesh",[pp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vp=gp))||vp);function Ep(){var t=new yl(4);return yl!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Sp(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Ap(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],s=n[1],c=n[2],f=n[3];return t[0]=r*f+a*u+i*c-o*s,t[1]=i*f+a*s+o*u-r*c,t[2]=o*f+a*c+r*s-i*u,t[3]=a*f-r*u-i*s-o*c,t}function Tp(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,u=a?1/a:0;return t[0]=-n*u,t[1]=-r*u,t[2]=-i*u,t[3]=o*u,t}function Ip(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),u=Math.sin(n),s=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=o*s*f-a*u*c,t[1]=a*u*f+o*s*c,t[2]=a*s*c-o*u*f,t[3]=a*s*f+o*u*c,t}var Np=bl,Op=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Cp=Ap,kp=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};wl(),Al(1,0,0),Al(0,1,0),Ep(),Ep(),xl();var Dp=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(t){var e,n,o,a,u,s,c,f,l,d,h,p,v,g,y;return Df(this,i),(e=r.call(this,t)).dirtyFlag=void 0,e.localDirtyFlag=void 0,e.parent=null,e.localPosition=Al(0,0,0),e.localRotation=Np(0,0,0,1),e.localScale=Al(1,1,1),e.localTransform=zd(),e.position=Al(0,0,0),e.rotation=Np(0,0,0,1),e.scaling=Al(1,1,1),e.worldTransform=zd(),e.matrixTransform=(n=zd(),function(t){Xd(n,e.getLocalTransform(),t),Kd(e.localScale,n),Yd(e.localPosition,n),Zd(e.localRotation,n)}),e.rotateRollPitchYaw=(o=Ep(),a=Ep(),u=Ep(),function(t,n,r){e.setDirty(),Ip(o,t,0,0),Ip(a,0,n,0),Ip(u,0,0,r),Ap(e.localRotation,o,e.localRotation),Ap(e.localRotation,e.localRotation,a),Ap(e.localRotation,u,e.localRotation),kp(e.localRotation,e.localRotation)}),e.lerp=(s=wl(),c=Ep(),f=wl(),l=wl(),d=Ep(),h=wl(),function(t,n,r){e.setDirty(),Kd(s,t.worldTransform),Yd(f,t.worldTransform),Zd(c,t.worldTransform),Kd(l,n.worldTransform),Yd(h,n.worldTransform),Zd(d,n.worldTransform),Ml(e.localScale,s,l,r),function(t,e,n,r){var i,o,a,u,s,c=e[0],f=e[1],l=e[2],d=e[3],h=n[0],p=n[1],v=n[2],g=n[3];(o=c*h+f*p+l*v+d*g)<0&&(o=-o,h=-h,p=-p,v=-v,g=-g),1-o>gl?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(u=1-r,s=r),t[0]=u*c+s*h,t[1]=u*f+s*p,t[2]=u*l+s*v,t[3]=u*d+s*g}(e.localRotation,c,d,r),Ml(e.localPosition,f,h,r)}),e.translate=(y=wl(),function(t){return Nl(y,e.getPosition(),t),e.setPosition(y),e.setDirty(!0),el(e)}),e.translateLocal=function(t){return function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],s=e[1],c=e[2],f=i*c-o*s,l=o*u-r*c,d=r*s-i*u,h=i*d-o*l,p=o*f-r*d,v=r*l-i*f,g=2*a;f*=g,l*=g,d*=g,h*=2,p*=2,v*=2,t[0]=u+f+h,t[1]=s+l+p,t[2]=c+d+v}(t,t,e.localRotation),Nl(e.localPosition,e.localPosition,t),e.setLocalDirty(!0),el(e)},e.setPosition=(p=zd(),function(t){return e.position=t,e.setLocalDirty(!0),null===e.parent?Tl(e.localPosition,t):(Vd(p,e.parent.worldTransform),Hd(p,p),Rl(e.localPosition,t,p)),el(e)}),e.rotate=(v=Ep(),function(t){if(null===e.parent)Ap(e.localRotation,e.localRotation,t),kp(e.localRotation,e.localRotation);else{var n=e.getRotation(),r=e.parent.getRotation();Op(v,r),Tp(v,v),Ap(v,v,t),Ap(e.localRotation,t,n),kp(e.localRotation,e.localRotation)}return e.setLocalDirty(),el(e)}),e.rotateLocal=function(t){return Ap(e.localRotation,e.localRotation,t),kp(e.localRotation,e.localRotation),e.setLocalDirty(!0),el(e)},e.setRotation=(g=Ep(),function(t){return null===e.parent?Op(e.localRotation,t):(Op(g,e.parent.getRotation()),Tp(g,g),Op(e.localRotation,g),Cp(e.localRotation,e.localRotation,t)),e.setLocalDirty(!0),el(e)}),e}return Rf(i,[{key:"setLocalPosition",value:function(t){Tl(this.localPosition,t),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(t){Tl(this.localScale,t),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(t){return Op(this.localRotation,t),this.setLocalDirty(!0),this}},{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=i.DIRTY:this.dirtyFlag&=~i.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?(this.localDirtyFlag|=i.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~i.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&null===this.parent&&(Vd(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){Xd(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),Kd(this.localScale,this.worldTransform),Yd(this.localPosition,this.worldTransform),Zd(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=Al(0,0,0),this.localRotation=Np(0,0,0,1),this.localScale=Al(1,1,1)}},{key:"scaleLocal",value:function(t){return this.setLocalDirty(),e=this.localScale,n=this.localScale,r=t,e[0]=n[0]*r[0],e[1]=n[1]*r[1],e[2]=n[2]*r[2],this;var e,n,r}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(function(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=e[3],s=i+i,c=o+o,f=a+a,l=i*s,d=i*c,h=i*f,p=o*c,v=o*f,g=a*f,y=u*s,m=u*c,b=u*f,_=r[0],x=r[1],w=r[2];t[0]=(1-(p+g))*_,t[1]=(d+b)*_,t[2]=(h-m)*_,t[3]=0,t[4]=(d-b)*x,t[5]=(1-(l+g))*x,t[6]=(v+y)*x,t[7]=0,t[8]=(h+m)*w,t[9]=(v-y)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1}(this.localTransform,this.localRotation,this.localPosition,this.localScale),this.setLocalDirty(!1)),this.localTransform}},{key:"getWorldTransform",value:function(){return this.isLocalDirty()||this.isDirty()?(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform):this.worldTransform}},{key:"getPosition",value:function(){return Yd(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return Zd(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return Kd(this.scaling,this.worldTransform),this.scaling}}]),i}(zf);Dp.DIRTY=1;var Mp,Rp,Pp,Gp,Lp,jp,Up=n(1922),Fp=(Mp=(0,qf.b2)(),Rp=(0,qf.f3)(Yf.RenderEngine),Mp((jp=function(){function t(){Df(this,t),kf(this,"engine",Lp,this),this.resourcePool={}}return Rf(t,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var e=t.descriptor,n=e.width,r=e.height,i=e.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:n,height:r,wrapS:Hl.CLAMP_TO_EDGE,wrapT:Hl.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),Lp=Pf((Gp=jp).prototype,"engine",[Rp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pp=Gp))||Pp);var Bp,zp,Vp,Wp,Hp=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(t){var e;return Df(this,i),(e=r.call(this,t)).name=void 0,e.name=t.name||"",e}return i}(zf),Xp=(0,qf.b2)()((zp=function(){function t(){Df(this,t),this.config=void 0}return Rf(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}(),Bp=zp))||Bp;!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(Wp||(Wp={}));var qp,Yp,Kp=(0,qf.b2)()(Vp=function(){function t(){Df(this,t)}return Rf(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||Vp,Zp=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function $p(t){var e={};return{content:t=t.replace(Zp,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:e}}function Jp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jp(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tv=/precision\s+(high|low|medium)p\s+float/,ev=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,nv=(0,qf.b2)()((Yp=function(){function t(){Df(this,t),this.moduleCache={},this.rawContentCache={}}return Rf(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n // compares only in highlight stage\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color) {\n bool selected = bool(v_PickingResult.a);\n\n if (selected) {\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(resultRGB, color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n return filterPickingColor(filterHighlightColor(color));\n}\n"}),this.registerModule("sdf2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=void 0===n?"":n,i=e.fs,o=void 0===i?"":i,a=e.uniforms,u=$p(r),s=u.content,c=u.uniforms,f=$p(o),l=f.content,d=f.uniforms;this.rawContentCache[t]={fs:l,uniforms:Qp(Qp(Qp({},c),d),a),vs:s}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n,r=this.rawContentCache[t].vs||"",i=this.rawContentCache[t].fs||"",o=this.processModule(r,[],"vs"),a=o.content,u=o.includeList,s=this.processModule(i,[],"fs"),c=s.content,f=s.includeList,l=c,d=(n=u.concat(f).concat(t),n.filter((function(t,e,n){return n.indexOf(t)===e}))).reduce((function(t,n){return Qp(Qp({},t),e.rawContentCache[n].uniforms)}),{});return tv.test(c)||(l="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+c),this.moduleCache[t]={fs:l.trim(),uniforms:d,vs:a.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(ev,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a||"",e,n).content})),includeList:e}}}]),t}(),qp=Yp))||qp,rv=new qf.W2;function iv(){var t=new qf.W2;return t.parent=rv,t.bind(Yf.Systems).to(wp).inSingletonScope().whenTargetNamed(Yf.SceneGraphSystem),t.bind(Yf.Systems).to(pl).inSingletonScope().whenTargetNamed(Yf.FrameGraphSystem),t.bind(Yf.Systems).to(Bd).inSingletonScope().whenTargetNamed(Yf.MeshSystem),t.bind(Yf.Systems).to(ed).inSingletonScope().whenTargetNamed(Yf.GeometrySystem),t.bind(Yf.Systems).to(md).inSingletonScope().whenTargetNamed(Yf.MaterialSystem),t.bind(Yf.Systems).to(fp).inSingletonScope().whenTargetNamed(Yf.RendererSystem),t.bind(Yf.ResourcePool).to(Fp).inSingletonScope(),t.bind(Yf.ConfigService).to(Xp).inSingletonScope(),t.bind(Yf.InteractorService).to(Kp).inSingletonScope(),t.bind(Yf.RenderPass).to(Lh).inSingletonScope().whenTargetNamed(Lh.IDENTIFIER),t.bind(Yf.RenderPass).to(cp).inSingletonScope().whenTargetNamed(cp.IDENTIFIER),t.bind(Yf.RenderPass).to(sp).inSingletonScope().whenTargetNamed(sp.IDENTIFIER),t.bind(Yf.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(Yf.RenderPass,e)}})),t}function ov(t){for(var e=new _d,n=Al(t[0],t[1],t[2]),r=Al(t[0],t[1],t[2]),i=3;i<t.length;){var o=t[i++],a=t[i++],u=t[i++];o<n[0]&&(n[0]=o),a<n[1]&&(n[1]=a),u<n[2]&&(n[2]=u),o>r[0]&&(r[0]=o),a>r[1]&&(r[1]=a),u>r[2]&&(r[2]=u)}return e.setMinMax(n,r),e}(0,Up.Z)(rv,!1),rv.bind(Yf.ShaderModuleService).to(nv).inSingletonScope(),rv.bind(Yf.NameComponentManager).toConstantValue(new Vf(Hp)),rv.bind(Yf.HierarchyComponentManager).toConstantValue(new Vf(xp)),rv.bind(Yf.TransformComponentManager).toConstantValue(new Vf(Dp)),rv.bind(Yf.MeshComponentManager).toConstantValue(new Vf(wd)),rv.bind(Yf.CullableComponentManager).toConstantValue(new Vf(bd)),rv.bind(Yf.GeometryComponentManager).toConstantValue(new Vf(td)),rv.bind(Yf.MaterialComponentManager).toConstantValue(new Vf(pd));var av,uv,sv,cv,fv,lv="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);function dv(t){return"number"==typeof t}function hv(t){return void 0===t?0:t>360||t<-360?t%360:t}function pv(t,e,n){return dv(t)?Al(t,e,n):3===t.length?El(t):Al(t[0],t[1],t[2])}wl(),wl(),wl(),wl(),wl(),wl(),n(2697),n(1894),n(1186),n(5275),n(2862),n(9633),function(t){t.Normal="normal",t.PostProcessing="post-processing"}(av||(av={})),n(7222),n(5965),n(2391),n(3945),n(7294),n(9586),function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(uv||(uv={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(sv||(sv={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}(cv||(cv={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(fv||(fv={}));var vv,gv,yv,mv,bv,_v,xv,wv,Ev,Sv,Av=function(){function t(e,n){var r,i;Df(this,t),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=(r=n.matrix,(i=new yl(16))[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i),this.right=El(n.right),this.up=El(n.up),this.forward=El(n.forward),this.position=El(n.position),this.focalPoint=El(n.focalPoint),this.distanceVector=El(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return Rf(t,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=Vd(t.matrix,this.matrix),t.right=Tl(t.right,this.right),t.up=Tl(t.up,this.up),t.forward=Tl(t.forward,this.forward),t.position=Tl(t.position,this.position),t.focalPoint=Tl(t.focalPoint,this.focalPoint),t.distanceVector=Tl(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),t}();!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(wv||(wv={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(Ev||(Ev={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(Sv||(Sv={}));var Tv,Iv,Nv,Ov,Cv,kv,Dv,Mv=Math.PI/180,Rv=180/Math.PI,Pv=(vv=(0,qf.b2)(),gv=(0,qf.f3)(Yf.InteractorService),vv((xv=_v=function(){function t(){Df(this,t),this.matrix=zd(),this.right=Al(1,0,0),this.up=Al(0,1,0),this.forward=Al(0,0,1),this.position=Al(0,0,1),this.focalPoint=Al(0,0,0),this.distanceVector=Al(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.rotateWorld=!1,kf(this,"interactor",bv,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=zd(),this.view=void 0,this.following=void 0,this.type=wv.EXPLORING,this.trackingMode=Ev.DEFAULT,this.projectionMode=Sv.PERSPECTIVE,this.frustum=new jd,this.landmarks=[],this.landmarkAnimationID=void 0}return Rf(t,[{key:"clone",value:function(){var e=new t;return e.setType(this.type,void 0),e.interactor=this.interactor,e}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,e){return this.type=t,this.type===wv.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===wv.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==wv.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return Hd(zd(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===Sv.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Sv.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,e,n,r){return this.projectionMode=Sv.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,function(t,e,n,r,i){var o,a=1/Math.tan(e/2);t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r)}(this.perspective,this.fov*Mv,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=Sv.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var a=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),s=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,f=s-a,l=s+a,d=c+u,h=c-u;if(void 0!==this.view&&this.view.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l=(f+=p*this.view.offsetX)+p*this.view.width,h=(d-=v*this.view.offsetY)-v*this.view.height}return function(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),c=1/(o-a);t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*s,t[14]=(a+o)*c,t[15]=1}(this.perspective,f,l,d,h,i,o),this}},{key:"setPosition",value:function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,e,n){var r=Al(0,1,0);if(this.focalPoint=pv(t,e,n),this.trackingMode===Ev.CINEMATIC){var i=Ol(wl(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Sl(i),a=Math.asin(e/o)*Rv,u=90+Math.atan2(n,t)*Rv,s=zd();!function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],c=e[8],f=e[9],l=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-f*r,t[2]=u*i-l*r,t[3]=s*i-d*r,t[8]=o*r+c*i,t[9]=a*r+f*i,t[10]=u*r+l*i,t[11]=s*r+d*i}(s,s,u*Mv),function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],u=e[6],s=e[7],c=e[8],f=e[9],l=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+f*r,t[6]=u*i+l*r,t[7]=s*i+d*r,t[8]=c*i-o*r,t[9]=f*i-a*r,t[10]=l*i-u*r,t[11]=d*i-s*r}(s,s,a*Mv),r=Rl(wl(),[0,1,0],s)}return Hd(this.matrix,function(t,e,n,r){var i,o,a,u,s,c,f,l,d,h,p=e[0],v=e[1],g=e[2],y=r[0],m=r[1],b=r[2],_=n[0],x=n[1],w=n[2];return Math.abs(p-_)<gl&&Math.abs(v-x)<gl&&Math.abs(g-w)<gl?Wd(t):(f=p-_,l=v-x,d=g-w,i=m*(d*=h=1/Math.hypot(f,l,d))-b*(l*=h),o=b*(f*=h)-y*d,a=y*l-m*f,(h=Math.hypot(i,o,a))?(i*=h=1/h,o*=h,a*=h):(i=0,o=0,a=0),u=l*a-d*o,s=d*i-f*a,c=f*o-l*i,(h=Math.hypot(u,s,c))?(u*=h=1/h,s*=h,c*=h):(u=0,s=0,c=0),t[0]=i,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=s,t[6]=l,t[7]=0,t[8]=a,t[9]=c,t[10]=d,t[11]=0,t[12]=-(i*p+o*v+a*g),t[13]=-(u*p+s*v+c*g),t[14]=-(f*p+l*v+d*g),t[15]=1,t)}(zd(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var e=wl();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this}}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=hv(t),this.computeMatrix(),this._getAxes(),this.type===wv.ORBITING||this.type===wv.EXPLORING?this._getPosition():this.type===wv.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=hv(t),this.computeMatrix(),this._getAxes(),this.type===wv.ORBITING||this.type===wv.EXPLORING?this._getPosition():this.type===wv.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=hv(t),this.computeMatrix(),this._getAxes(),this.type===wv.ORBITING||this.type===wv.EXPLORING?this._getPosition():this.type===wv.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===wv.EXPLORING){t=hv(t),e=hv(e),n=hv(n);var r=Sp(Ep(),[1,0,0],(this.rotateWorld?1:-1)*e*Mv),i=Sp(Ep(),[0,1,0],(this.rotateWorld?1:-1)*t*Mv),o=Sp(Ep(),[0,0,1],n*Mv),a=Ap(Ep(),i,r);a=Ap(Ep(),a,o);var u=$d(zd(),a);qd(this.matrix,this.matrix,[0,0,-this.distance]),Xd(this.matrix,this.matrix,u),qd(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=hv(e),this.relAzimuth=hv(t),this.relRoll=hv(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===wv.ORBITING||this.type===wv.EXPLORING?this._getPosition():this.type===wv.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=pv(t,e,0),r=El(this.position);return Nl(r,r,Cl(wl(),this.right,n[0])),Nl(r,r,Cl(wl(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=El(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===wv.ORBITING||this.type===wv.EXPLORING?this._getDistance():this.type===wv.TRACKING&&Nl(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(t,e){var n=this.clone();n.setPosition(e.position),n.setFocalPoint(e.focalPoint),void 0!==e.roll&&n.setRoll(e.roll);var r=new Av(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new Av(t,this);return this.landmarks.push(e),this}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===n)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var i,o=r.getPosition(),a=r.getFocalPoint(),u=r.getRoll(),s=function t(r){void 0===i&&(i=r);var s,c=r-i,f=(1-Math.cos(c/n*Math.PI))/2,l=wl(),d=wl();if(Ml(l,e.focalPoint,a,f),Ml(d,e.position,o,f),s=e.roll*(1-f)+u*f,e.setFocalPoint(l),e.setPosition(d),e.setRoll(s),e.computeMatrix(),!(Ll(l,a)+Ll(d,o)>.01))return e.setFocalPoint(l),e.setPosition(d),e.setRoll(s),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(s)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=Sp(Ep(),[0,0,1],this.roll*Mv);Wd(this.matrix),t=Sp(Ep(),[1,0,0],(this.rotateWorld&&this.type!==wv.TRACKING||this.type===wv.TRACKING?1:-1)*this.elevation*Mv),e=Sp(Ep(),[0,1,0],(this.rotateWorld&&this.type!==wv.TRACKING||this.type===wv.TRACKING?1:-1)*this.azimuth*Mv);var r=Ap(Ep(),e,t);r=Ap(Ep(),r,n);var i=$d(zd(),r);this.type===wv.ORBITING||this.type===wv.EXPLORING?(qd(this.matrix,this.matrix,this.focalPoint),Xd(this.matrix,this.matrix,i),qd(this.matrix,this.matrix,[0,0,this.distance])):this.type===wv.TRACKING&&(qd(this.matrix,this.matrix,this.position),Xd(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=pv(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){Tl(this.right,pv(_l(ml(),[1,0,0,0],this.matrix))),Tl(this.up,pv(_l(ml(),[0,1,0,0],this.matrix))),Tl(this.forward,pv(_l(ml(),[0,0,1,0],this.matrix))),kl(this.right,this.right),kl(this.up,this.up),kl(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Sl(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===wv.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*Rv,this.azimuth=Math.atan2(-t,-n)*Rv):(this.elevation=-Math.asin(e/r)*Rv,this.azimuth=-Math.atan2(-t,-n)*Rv)}},{key:"_getPosition",value:function(){Tl(this.position,pv(_l(ml(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;Pl(this.distanceVector,[0,0,-this.distance],(t=xl(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),Nl(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Ol(wl(),this.focalPoint,this.position),this.distance=Sl(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),_v.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},bv=Pf((mv=xv).prototype,"interactor",[gv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yv=mv))||yv),Gv=(Tv=(0,qf.b2)(),Iv=(0,qf.f3)(Yf.GeometryComponentManager),Tv((Dv=kv=function(){function t(){Df(this,t),this.config=void 0,kf(this,"geometry",Cv,this),this.entity=void 0,this.component=void 0}return Rf(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.component=this.geometry.create(t),this.component.entity=t,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),kv.BOX="box",kv.SPHERE="sphere",kv.PLANE="plane",kv.MERGED="merged",Cv=Pf((Ov=Dv).prototype,"geometry",[Iv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nv=Ov))||Nv),Lv=n(8344);function jv(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var Uv={}.toString;var Fv={};Fv["[object Float32Array]"]=Fv["[object Float64Array]"]=Fv["[object Int8Array]"]=Fv["[object Int16Array]"]=Fv["[object Int32Array]"]=Fv["[object Uint8Array]"]=Fv["[object Uint8ClampedArray]"]=Fv["[object Uint16Array]"]=Fv["[object Uint32Array]"]=!0,Fv["[object Arguments]"]=Fv["[object Array]"]=Fv["[object ArrayBuffer]"]=Fv["[object Boolean]"]=Fv["[object DataView]"]=Fv["[object Date]"]=Fv["[object Error]"]=Fv["[object Function]"]=Fv["[object Map]"]=Fv["[object Number]"]=Fv["[object Object]"]=Fv["[object RegExp]"]=Fv["[object Set]"]=Fv["[object String]"]=Fv["[object WeakMap]"]=!1;var Bv,zv,Vv,Wv,Hv,Xv,qv,Yv,Kv=Object.prototype.toString,Zv=function(t){return function(t){return!!t&&"object"===tl(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Fv[Kv.call(t)]};function $v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Jv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$v(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Qv,tg,eg,ng,rg,ig,og,ag,ug,sg,cg,fg,lg,dg,hg,pg,vg,gg,yg,mg,bg,_g,xg,wg,Eg,Sg,Ag,Tg,Ig,Ng,Og,Cg,kg,Dg,Mg,Rg=(Bv=(0,qf.b2)(),zv=(0,qf.f3)(Yf.RenderEngine),Vv=(0,qf.f3)(Yf.ConfigService),Bv((Yv=function(){function t(){Df(this,t),kf(this,"engine",Xv,this),kf(this,"configService",qv,this),this.entity=Bf(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return Rf(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(Jv({canvas:e||jv(),swapChainFormat:Lv.EV.BGRA8Unorm,antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n,r=this;if("string"==typeof t){var i=dv(e)||Zv(e)||(n=e,Array.isArray?Array.isArray(n):function(t,e){return Uv.call(t)==="[object "+e+"]"}(n,"Array"));if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(o)return o.value=e,this;var a=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));a&&(i?(a.data=e,a.isReferer=!1,a.storageClass===cv.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(a.isReferer=!0,a.data=e))}}else Object.keys(t).forEach((function(e){r.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Uf(Lf().mark((function t(){var e,n,r=this,i=arguments;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=Uf(Lf().mark((function t(){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=Uf(Lf().mark((function t(){var e,n,r;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=Jv({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?fv.WGSL:fv.GLSL450:fv.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===cv.StorageBuffer){var n=1;t.type===uv.FloatArray?n=1:t.type===uv.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Xv=Pf((Hv=Yv).prototype,"engine",[zv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qv=Pf(Hv.prototype,"configService",[Vv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wv=Hv))||Wv),Pg=(Qv=(0,qf.b2)(),tg=(0,qf.f3)(Yf.MaterialComponentManager),Qv((og=ig=function(){function t(){Df(this,t),this.config=void 0,kf(this,"material",rg,this),this.entity=void 0,this.component=void 0}return Rf(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t,e){this.entity=t,this.component=this.material.create(t),this.component.entity=t,this.component.type=e,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),ig.BASIC="basic",rg=Pf((ng=og).prototype,"material",[tg],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),eg=ng))||eg),Gg=(ag=(0,qf.b2)(),ug=(0,qf.f3)(Yf.MeshComponentManager),sg=(0,qf.f3)(Yf.CullableComponentManager),cg=(0,qf.f3)(Yf.TransformComponentManager),fg=(0,qf.f3)(Yf.Systems),lg=(0,qf.t6)(Yf.SceneGraphSystem),ag((bg=mg=function(){function t(){Df(this,t),this.attributes={},this.config=void 0,kf(this,"mesh",pg,this),kf(this,"cullable",vg,this),kf(this,"transform",gg,this),kf(this,"sceneGraphSystem",yg,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return Rf(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.onEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setAttributes",value:function(t){var e=this;Object.keys(t).forEach((function(n){void 0!==t[n]&&t[n]!==e.attributes[n]&&(e.onAttributeChanged({name:n,data:t[n]}),e.attributes[n]=t[n])}))}},{key:"setVisible",value:function(t){var e=this;return this.meshComponent.visible=t,this.meshComponent.children.forEach((function(n){var r=e.mesh.getComponentByEntity(n);r&&(r.visible=t)})),this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"onEntityCreated",value:function(){}},{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data;this.meshComponent&&this.meshComponent.material&&this.meshComponent.material.setUniform(this.convertAttributeName2UniformName(e),n)}},{key:"convertAttributeName2UniformName",value:function(t){return t}}]),t}(),mg.POINT="point",mg.LINE="line",mg.GRID="grid",pg=Pf((hg=bg).prototype,"mesh",[ug],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vg=Pf(hg.prototype,"cullable",[sg],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gg=Pf(hg.prototype,"transform",[cg],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yg=Pf(hg.prototype,"sceneGraphSystem",[fg,lg],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dg=hg))||dg),Lg=n(6377),jg=n.n(Lg),Ug=function(){function t(e,n){Df(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,u=n.size,s=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:s||0},u&&(this.attribute.size=u)}return Rf(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Fg=(vl(_g={},Hl.POINTS,"points"),vl(_g,Hl.LINES,"lines"),vl(_g,Hl.LINE_LOOP,"line loop"),vl(_g,Hl.LINE_STRIP,"line strip"),vl(_g,Hl.TRIANGLES,"triangles"),vl(_g,Hl.TRIANGLE_FAN,"triangle fan"),vl(_g,Hl.TRIANGLE_STRIP,"triangle strip"),_g),Bg=(vl(xg={},Hl.STATIC_DRAW,"static"),vl(xg,Hl.DYNAMIC_DRAW,"dynamic"),vl(xg,Hl.STREAM_DRAW,"stream"),xg),zg=(vl(wg={},Hl.BYTE,"int8"),vl(wg,Hl.UNSIGNED_INT,"int16"),vl(wg,Hl.INT,"int32"),vl(wg,Hl.UNSIGNED_BYTE,"uint8"),vl(wg,Hl.UNSIGNED_SHORT,"uint16"),vl(wg,Hl.UNSIGNED_INT,"uint32"),vl(wg,Hl.FLOAT,"float"),wg),Vg=(vl(Eg={},Hl.ALPHA,"alpha"),vl(Eg,Hl.LUMINANCE,"luminance"),vl(Eg,Hl.LUMINANCE_ALPHA,"luminance alpha"),vl(Eg,Hl.RGB,"rgb"),vl(Eg,Hl.RGBA,"rgba"),vl(Eg,Hl.RGBA4,"rgba4"),vl(Eg,Hl.RGB5_A1,"rgb5 a1"),vl(Eg,Hl.RGB565,"rgb565"),vl(Eg,Hl.DEPTH_COMPONENT,"depth"),vl(Eg,Hl.DEPTH_STENCIL,"depth stencil"),Eg),Wg=(vl(Sg={},Hl.DONT_CARE,"dont care"),vl(Sg,Hl.NICEST,"nice"),vl(Sg,Hl.FASTEST,"fast"),Sg),Hg=(vl(Ag={},Hl.NEAREST,"nearest"),vl(Ag,Hl.LINEAR,"linear"),vl(Ag,Hl.LINEAR_MIPMAP_LINEAR,"mipmap"),vl(Ag,Hl.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),vl(Ag,Hl.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),vl(Ag,Hl.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),Ag),Xg=(vl(Tg={},Hl.REPEAT,"repeat"),vl(Tg,Hl.CLAMP_TO_EDGE,"clamp"),vl(Tg,Hl.MIRRORED_REPEAT,"mirror"),Tg),qg=(vl(Ig={},Hl.NONE,"none"),vl(Ig,Hl.BROWSER_DEFAULT_WEBGL,"browser"),Ig),Yg=(vl(Ng={},Hl.NEVER,"never"),vl(Ng,Hl.ALWAYS,"always"),vl(Ng,Hl.LESS,"less"),vl(Ng,Hl.LEQUAL,"lequal"),vl(Ng,Hl.GREATER,"greater"),vl(Ng,Hl.GEQUAL,"gequal"),vl(Ng,Hl.EQUAL,"equal"),vl(Ng,Hl.NOTEQUAL,"notequal"),Ng),Kg=(vl(Og={},Hl.FUNC_ADD,"add"),vl(Og,Hl.MIN_EXT,"min"),vl(Og,Hl.MAX_EXT,"max"),vl(Og,Hl.FUNC_SUBTRACT,"subtract"),vl(Og,Hl.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Og),Zg=(vl(Cg={},Hl.ZERO,"zero"),vl(Cg,Hl.ONE,"one"),vl(Cg,Hl.SRC_COLOR,"src color"),vl(Cg,Hl.ONE_MINUS_SRC_COLOR,"one minus src color"),vl(Cg,Hl.SRC_ALPHA,"src alpha"),vl(Cg,Hl.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),vl(Cg,Hl.DST_COLOR,"dst color"),vl(Cg,Hl.ONE_MINUS_DST_COLOR,"one minus dst color"),vl(Cg,Hl.DST_ALPHA,"dst alpha"),vl(Cg,Hl.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),vl(Cg,Hl.CONSTANT_COLOR,"constant color"),vl(Cg,Hl.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),vl(Cg,Hl.CONSTANT_ALPHA,"constant alpha"),vl(Cg,Hl.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),vl(Cg,Hl.SRC_ALPHA_SATURATE,"src alpha saturate"),Cg),$g=(vl(kg={},Hl.NEVER,"never"),vl(kg,Hl.ALWAYS,"always"),vl(kg,Hl.LESS,"less"),vl(kg,Hl.LEQUAL,"lequal"),vl(kg,Hl.GREATER,"greater"),vl(kg,Hl.GEQUAL,"gequal"),vl(kg,Hl.EQUAL,"equal"),vl(kg,Hl.NOTEQUAL,"notequal"),kg),Jg=(vl(Dg={},Hl.ZERO,"zero"),vl(Dg,Hl.KEEP,"keep"),vl(Dg,Hl.REPLACE,"replace"),vl(Dg,Hl.INVERT,"invert"),vl(Dg,Hl.INCR,"increment"),vl(Dg,Hl.DECR,"decrement"),vl(Dg,Hl.INCR_WRAP,"increment wrap"),vl(Dg,Hl.DECR_WRAP,"decrement wrap"),Dg),Qg=(vl(Mg={},Hl.FRONT,"front"),vl(Mg,Hl.BACK,"back"),Mg),ty=function(){function t(e,n){Df(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Bg[i||Hl.STATIC_DRAW],type:zg[o||Hl.UNSIGNED_BYTE]})}return Rf(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}();function ey(t){return function(t){if(Array.isArray(t))return Wf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Hf(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ny={};ny["[object Float32Array]"]=ny["[object Float64Array]"]=ny["[object Int8Array]"]=ny["[object Int16Array]"]=ny["[object Int32Array]"]=ny["[object Uint8Array]"]=ny["[object Uint8ClampedArray]"]=ny["[object Uint16Array]"]=ny["[object Uint32Array]"]=!0,ny["[object Arguments]"]=ny["[object Array]"]=ny["[object ArrayBuffer]"]=ny["[object Boolean]"]=ny["[object DataView]"]=ny["[object Date]"]=ny["[object Error]"]=ny["[object Function]"]=ny["[object Map]"]=ny["[object Number]"]=ny["[object Object]"]=ny["[object RegExp]"]=ny["[object Set]"]=ny["[object String]"]=ny["[object WeakMap]"]=!1;var ry=Object.prototype.toString,iy=function(t){return function(t){return!!t&&"object"===tl(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!ny[ry.call(t)]};function oy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ay(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?oy(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oy(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var uy=0,sy=function(){function t(e,n){var r=this;Df(this,t),this.reGl=e,this.context=n,this.entity=Bf(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,o=t.data,a=t.isReferer,u=t.storageClass;if(u===cv.StorageBuffer){if(a)r.textureCache[e]={data:void 0},i["".concat(e,"Size")]=function(){return o.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,o);var s=r.textureCache[e],c=s.textureWidth,f=s.isOutput;i["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,o)))}i[e]=function(){return r.textureCache[e].texture}}else if(u===cv.Uniform){if(o&&(Array.isArray(o)||iy(o))&&o.length>16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var o=this.getOuputDataTexture(),a=o.textureWidth,u=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=u,this.context.output.textureSize=[a,a];var s={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return Rf(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Uf(Lf().mark((function t(){var e,n,r,i,o,a,u,s,c=this;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,u=[],4!==i)for(s=0;s<e.length;s+=4)1===i?u.push(e[s]):2===i?u.push(e[s],e[s+1]):u.push(e[s],e[s+1],e[s+2]);else u=e;return t.abrupt("return",new a(u.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),i=r.texture,o=r.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return ay(ay({},t),{},{id:uy++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===uv.Vector4FloatArray&&(r=4);for(var i=[],o=0;o<n.length;o+=r)1===r?i.push(n[o],0,0,0):2===r?i.push(n[o],n[o+1],0,0):3===r?i.push(n[o],n[o+1],n[o+2],0):4===r&&i.push(n[o],n[o+1],n[o+2],n[o+3]);var a=n.length,u=Math.ceil(a/r),s=Math.ceil(Math.sqrt(u)),c=s*s;u<c&&i.push.apply(i,ey(new Array(4*(c-u)).fill(0)));var f=this.reGl.texture({width:s,height:s,data:i,type:"float"});return{id:uy++,data:i,originalDataLength:a,typedArrayConstructor:iy(n)?n.constructor:void 0,textureWidth:s,texture:f,texelCount:u,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),cy=function(){function t(e,n){Df(this,t),this.elements=void 0;var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:Bg[i||Hl.STATIC_DRAW],type:zg[o||Hl.UNSIGNED_BYTE],count:a})}return Rf(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),fy=function(){function t(e,n){Df(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,u=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(u.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(u.color=o.get()),this.framebuffer=e.framebuffer(u)}return Rf(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}();function ly(t){var e={};return Object.keys(t).forEach((function(n){dy(n,t[n],e,"")})),e}function dy(t,e,n,r){var i,o;null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||iy(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(o=tl(i=e),null==i||"object"!==o&&"function"!==o||Object.keys(e).forEach((function(i){dy(i,e[i],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,i){Object.keys(e).forEach((function(o){dy(o,e[o],n,"".concat(r&&r+".").concat(t,"[").concat(i,"]"))}))})))}function hy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function py(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hy(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hy(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var vy,gy,yy,my=function(){function t(e,n){Df(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,i=n.fs,o=n.defines,a=n.attributes,u=n.uniforms,s=n.primitive,c=n.count,f=n.elements,l=n.depth,d=n.blend,h=n.stencil,p=n.cull,v=n.instances,g=n.scissor,y=n.viewport,m={};u&&(this.uniforms=ly(u),Object.keys(u).forEach((function(t){m[t]=e.prop(t)})));var b={};Object.keys(a).forEach((function(t){b[t]=a[t].get()}));var _=o&&this.generateDefines(o)||"",x={attributes:b,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(_,"\n").concat(i),uniforms:m,vert:"\n".concat(_,"\n").concat(r),primitive:Fg[void 0===s?Hl.TRIANGLES:s]};v&&(x.instances=v),c&&(x.count=c),f&&(x.elements=f.get()),g&&(x.scissor=g),y&&(x.viewport=y),this.initDepthDrawParams({depth:l},x),this.initBlendDrawParams({blend:d},x),this.initStencilDrawParams({stencil:h},x),this.initCullDrawParams({cull:p},x),this.drawCommand=e(x)}return Rf(t,[{key:"addUniforms",value:function(t){this.uniforms=py(py({},this.uniforms),ly(t))}},{key:"draw",value:function(t){var e=py(py({},this.uniforms),ly(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=tl(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:"string"===r||(n[t]=e[t].get())})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Yg[n.func||Hl.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,i=n.func,o=n.equation,a=n.color,u=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:Zg[i&&i.srcRGB||Hl.SRC_ALPHA],srcAlpha:Zg[i&&i.srcAlpha||Hl.SRC_ALPHA],dstRGB:Zg[i&&i.dstRGB||Hl.ONE_MINUS_SRC_ALPHA],dstAlpha:Zg[i&&i.dstAlpha||Hl.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Kg[o&&o.rgb||Hl.FUNC_ADD],alpha:Kg[o&&o.alpha||Hl.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,i=n.mask,o=void 0===i?-1:i,a=n.func,u=void 0===a?{cmp:Hl.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Hl.KEEP,zfail:Hl.KEEP,zpass:Hl.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Hl.KEEP,zfail:Hl.KEEP,zpass:Hl.KEEP}:f;e.stencil={enable:!!r,mask:o,func:py(py({},u),{},{cmp:$g[u.cmp]}),opFront:{fail:Jg[c.fail],zfail:Jg[c.zfail],zpass:Jg[c.zpass]},opBack:{fail:Jg[l.fail],zfail:Jg[l.zfail],zpass:Jg[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?Hl.BACK:i;e.cull={enable:!!r,face:Qg[o]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),by=function(){function t(e,n){Df(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,i=n.type,o=void 0===i?Hl.UNSIGNED_BYTE:i,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Hl.RGBA:f,d=n.mipmap,h=void 0!==d&&d,p=n.wrapS,v=void 0===p?Hl.CLAMP_TO_EDGE:p,g=n.wrapT,y=void 0===g?Hl.CLAMP_TO_EDGE:g,m=n.aniso,b=void 0===m?0:m,_=n.alignment,x=void 0===_?1:_,w=n.premultiplyAlpha,E=void 0!==w&&w,S=n.mag,A=void 0===S?Hl.NEAREST:S,T=n.min,I=void 0===T?Hl.NEAREST:T,N=n.colorSpace,O=void 0===N?Hl.BROWSER_DEFAULT_WEBGL:N;this.width=a,this.height=u;var C={width:a,height:u,type:zg[o],format:Vg[l],wrapS:Xg[v],wrapT:Xg[y],mag:Hg[A],min:Hg[I],alignment:x,flipY:c,colorSpace:qg[O],premultiplyAlpha:E,aniso:b};r&&(C.data=r),"number"==typeof h?C.mipmap=Wg[h]:"boolean"==typeof h&&(C.mipmap=h),this.texture=e.texture(C)}return Rf(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),_y=(0,qf.b2)()((gy=function(){function t(){var e=this;Df(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Uf(Lf().mark((function t(n){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms){t.next=3;break}return t.next=3,Promise.all(Object.keys(n.uniforms).map(function(){var t=Uf(Lf().mark((function t(e){var r;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms[e]||void 0===n.uniforms[e].load){t.next=5;break}return t.next=3,n.uniforms[e].load();case 3:r=t.sent,n.uniforms[e]=r;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",new my(e.gl,n));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Ug(e.gl,t)},this.createBuffer=function(t){return new ty(e.gl,t)},this.createElements=function(t){return new cy(e.gl,t)},this.createTexture2D=function(t){return new by(e.gl,t)},this.createFramebuffer=function(t){return new fy(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Uf(Lf().mark((function t(n){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new sy(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,u={color:n,depth:r,stencil:i};u.framebuffer=null===a?a:a.get(),e.gl.clear(u)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Hl.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Hl.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,i,o),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return Rf(t,[{key:"init",value:(e=Uf(Lf().mark((function t(e){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){jg()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}(),vy=gy))||vy;function xy(t,e){return new Promise((function(e,n){!function(t,e,n,r){if("undefined"!=typeof window){var i=document.getElementsByTagName("head")[0],o=document.createElement("script");o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),o.onload=function(){e&&e()},o.onerror=function(e){n&&n("Unable to load script '".concat(t,"'"),e)},i.appendChild(o)}}(t,(function(){e()}),(function(t,e){n(e)}))}))}function wy(){return Ey.apply(this,arguments)}function Ey(){return(Ey=Uf(Lf().mark((function t(){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!yy){t.next=2;break}return t.abrupt("return",yy);case 2:return t.next=4,xy("https://preview.babylonjs.com/glslang/glslang.js");case 4:return yy=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",yy);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Sy,Ay,Ty,Iy,Ny,Oy,Cy,ky=function(){function t(e,n){Df(this,t),this.engine=e,this.options=n,this.attribute=void 0,this.buffer=void 0;var r=n,i=r.buffer,o=r.offset,a=r.stride,u=r.normalized,s=r.size,c=r.divisor,f=r.arrayStride,l=r.attributes,d=r.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:o||0,stride:a||0,normalized:u||!1,divisor:c||0,arrayStride:f||0,attributes:l,stepMode:d||"vertex"},s&&(this.attribute.size=s)}return Rf(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Dy=function(){function t(e,n){Df(this,t),this.engine=e,this.options=n,this.buffer=void 0;var r=n,i=r.data,o=r.usage;r.type,this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,o||Lv.FB.Vertex|Lv.FB.CopyDst)}return Rf(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.setSubData(this.buffer,n,e instanceof Array?new Float32Array(e):e)}},{key:"createBuffer",value:function(t,e){var n=t.byteLength%4,r={size:t.byteLength+n,usage:e},i=this.engine.device.createBuffer(r);return this.setSubData(i,0,t),i}},{key:"setSubData",value:function(t,e,n){(lv?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),My=function(){function t(e,n){Df(this,t),this.engine=e,this.context=n,this.entity=Bf(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}var e,n,r;return Rf(t,[{key:"init",value:(r=Uf(Lf().mark((function t(){var e,n,r,i,o,a,u,s=this;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:e=t.sent,n=e.computeStage,r=this.context.uniforms.filter((function(t){return t.storageClass===cv.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===cv.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,u=[],i.forEach((function(t){if("number"==typeof t.data)s.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,u.push(t.data);else{var e,n=(null===(e=t.data)||void 0===e?void 0:e.length)||1;3===n&&(n=4,t.data.push(0));var r=a/4%4;if(r>0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,u.push(0)),u.push.apply(u,ey(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,u.push(0);u.push.apply(u,ey(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new Dy(this.engine,{data:u instanceof Array?new Float32Array(u):u,usage:Lv.FB.Uniform|Lv.FB.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;null!==t.data&&(t.type!==uv.Vector4FloatArray&&t.type!==uv.FloatArray||(t.name===s.context.output.name?(e=new Dy(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Lv.FB.Storage|Lv.FB.CopyDst|Lv.FB.CopySrc}),s.outputBuffer=e,s.context.output={name:t.name,length:isFinite(Number(t.data))?1:t.data.length,typedArrayConstructor:Float32Array,gpuBuffer:e.get()}):t.isReferer?t.data.model&&t.data.model.outputBuffer&&(e=t.data.model.outputBuffer):e=new Dy(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Lv.FB.Storage|Lv.FB.CopyDst|Lv.FB.CopySrc}),s.vertexBuffers[t.name]=e,s.bindGroupEntries.push({binding:o,resource:{name:t.name,refer:e?void 0:t.data,buffer:e?e.get():void 0}}),o++))})),this.computePipeline=this.engine.device.createComputePipeline({computeStage:n}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach((function(e){return t.vertexBuffers[e].destroy()}))}},{key:"readData",value:(n=Uf(Lf().mark((function t(){var e,n,r,i,o,a,u,s,c;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.context.output)){t.next=16;break}if(n=e.length,r=e.typedArrayConstructor,!(i=e.gpuBuffer)){t.next=16;break}return o=n*r.BYTES_PER_ELEMENT,a=this.engine.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),(u=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(lv?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([u.finish()]),t.next=12,a.mapAsync(Lv.gc.Read);case 12:return s=a.getMappedRange(),c=new r(s.slice(0)),a.unmap(),t.abrupt("return",c);case 16:return t.abrupt("return",new Float32Array);case 17:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"run",value:function(){var t;this.engine.currentComputePass&&(this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,ey(this.context.dispatch)))}},{key:"updateBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.vertexBuffers[t];r&&r.subData({data:e,offset:n})}},{key:"updateUniform",value:function(t,e){var n=this.uniformGPUBufferLayout.find((function(e){return e.name===t}));n&&this.uniformBuffer.subData({data:Number.isFinite(e)?new Float32Array([e]):new Float32Array(e),offset:n.offset})}},{key:"confirmInput",value:function(t,e){var n=this.vertexBuffers[e],r=t.outputBuffer;if(n&&r&&n!==r){var i=this.engine.device.createCommandEncoder(),o=t.context.output,a=o.length*o.typedArrayConstructor.BYTES_PER_ELEMENT;i.copyBufferToBuffer(r.get(),0,n.get(),0,a),(lv?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([i.finish()])}}},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"compileComputePipelineStageDescriptor",value:(e=Uf(Lf().mark((function t(e){var n;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e,this.engine.options.useWGSL){t.next=6;break}return t.next=5,this.compileShaderToSpirV(e,"compute","#version 450\n");case 5:n=t.sent;case 6:return t.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:lv}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),Ry=function(){function t(e,n){Df(this,t),this.engine=e,this.options=n,this.indexCount=void 0,this.buffer=void 0;var r=n,i=r.data,o=(r.usage,r.type,r.count);this.indexCount=o||0,this.buffer=new Dy(e,{data:i instanceof Array?new Uint16Array(i):i,usage:Lv.FB.Index|Lv.FB.CopyDst})}return Rf(t,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Py=function(){function t(e,n){Df(this,t),this.engine=e,this.options=n,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var r=n,i=(r.width,r.height,r.color),o=(r.colors,r.depth);r.stencil,i&&(this.colorTexture=i),o&&(this.depthTexture=o)}return Rf(t,[{key:"get",value:function(){var t,e;return{color:null===(t=this.colorTexture)||void 0===t?void 0:t.get(),depth:null===(e=this.depthTexture)||void 0===e?void 0:e.get()}}},{key:"destroy",value:function(){var t,e;null===(t=this.colorTexture)||void 0===t||t.destroy(),null===(e=this.depthTexture)||void 0===e||e.destroy()}},{key:"resize",value:function(t){var e,n,r=t.width,i=t.height;r===this.width&&i===this.height||(null===(e=this.colorTexture)||void 0===e||e.resize({width:r,height:i}),null===(n=this.depthTexture)||void 0===n||n.resize({width:r,height:i})),this.width=r,this.height=i}}]),t}(),Gy=(vl(Sy={},Hl.POINTS,Lv.YV.PointList),vl(Sy,Hl.LINES,Lv.YV.LineList),vl(Sy,Hl.LINE_LOOP,Lv.YV.LineList),vl(Sy,Hl.LINE_STRIP,Lv.YV.LineStrip),vl(Sy,Hl.TRIANGLES,Lv.YV.TriangleList),vl(Sy,Hl.TRIANGLE_FAN,Lv.YV.TriangleList),vl(Sy,Hl.TRIANGLE_STRIP,Lv.YV.TriangleStrip),Sy),Ly=(vl(Ay={},Hl.NEVER,Lv.wb.Never),vl(Ay,Hl.ALWAYS,Lv.wb.Always),vl(Ay,Hl.LESS,Lv.wb.Less),vl(Ay,Hl.LEQUAL,Lv.wb.LessEqual),vl(Ay,Hl.GREATER,Lv.wb.Greater),vl(Ay,Hl.GEQUAL,Lv.wb.GreaterEqual),vl(Ay,Hl.EQUAL,Lv.wb.Equal),vl(Ay,Hl.NOTEQUAL,Lv.wb.NotEqual),Ay),jy=(vl(Ty={},Hl.FUNC_ADD,Lv.db.Add),vl(Ty,Hl.MIN_EXT,Lv.db.Min),vl(Ty,Hl.MAX_EXT,Lv.db.Max),vl(Ty,Hl.FUNC_SUBTRACT,Lv.db.Subtract),vl(Ty,Hl.FUNC_REVERSE_SUBTRACT,Lv.db.ReverseSubtract),Ty),Uy=(vl(Iy={},Hl.ZERO,Lv.zi.Zero),vl(Iy,Hl.ONE,Lv.zi.One),vl(Iy,Hl.SRC_COLOR,Lv.zi.SrcColor),vl(Iy,Hl.ONE_MINUS_SRC_COLOR,Lv.zi.OneMinusSrcColor),vl(Iy,Hl.SRC_ALPHA,Lv.zi.SrcAlpha),vl(Iy,Hl.ONE_MINUS_SRC_ALPHA,Lv.zi.OneMinusSrcAlpha),vl(Iy,Hl.DST_COLOR,Lv.zi.DstColor),vl(Iy,Hl.ONE_MINUS_DST_COLOR,Lv.zi.OneMinusDstColor),vl(Iy,Hl.DST_ALPHA,Lv.zi.DstAlpha),vl(Iy,Hl.ONE_MINUS_DST_ALPHA,Lv.zi.OneMinusDstAlpha),vl(Iy,Hl.CONSTANT_COLOR,Lv.zi.BlendColor),vl(Iy,Hl.ONE_MINUS_CONSTANT_COLOR,Lv.zi.OneMinusBlendColor),vl(Iy,Hl.SRC_ALPHA_SATURATE,Lv.zi.SrcAlphaSaturated),Iy),Fy=(vl(Ny={},Hl.ALPHA,"r8unorm"),vl(Ny,Hl.RGBA,"rgba8unorm"),vl(Ny,Hl.DEPTH_COMPONENT,"depth32float"),vl(Ny,Hl.DEPTH_STENCIL,"depth24plus-stencil8"),Ny),By=(vl(Oy={},Hl.NEAREST,"nearest"),vl(Oy,Hl.LINEAR,"linear"),Oy),zy=(vl(Cy={},Hl.REPEAT,"repeat"),vl(Cy,Hl.CLAMP_TO_EDGE,"clamp-to-edge"),vl(Cy,Hl.MIRRORED_REPEAT,"mirror-repeat"),Cy);function Vy(t){var e=t.cull;return e&&e.enable?e.face?e.face===Hl.FRONT?Lv.Wf.Front:Lv.Wf.Back:void 0:Lv.Wf.None}function Wy(t){var e=t.depth,n=(t.stencil,{compare:Lv.wb.Always,depthFailOp:Lv.xS.Keep,failOp:Lv.xS.Keep,passOp:Lv.xS.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Ly[(null==e?void 0:e.func)||Hl.ALWAYS],format:Lv.EV.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function Hy(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:Uy[n&&n.func&&n.func.srcAlpha||Hl.ONE],dstFactor:Uy[n&&n.func&&n.func.dstAlpha||Hl.ZERO],operation:jy[n&&n.equation&&n.equation.alpha||Hl.FUNC_ADD]},colorBlend:{srcFactor:Uy[n&&n.func&&n.func.srcRGB||Hl.ONE],dstFactor:Uy[n&&n.func&&n.func.dstRGB||Hl.ZERO],operation:jy[n&&n.equation&&n.equation.rgb||Hl.FUNC_ADD]},writeMask:Lv.Yw.All}]}function Xy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qy(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xy(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xy(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Yy(t){for(var e=0,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=r;o<a.length;o++){var u=a[o];e+=u.length}for(var s=new t(e),c=0,f=0,l=r;f<l.length;f++){var d=l[f];s.set(d,c),c+=d.length}return s}var Ky,Zy,$y,Jy=function(){function t(e,n){Df(this,t),this.engine=e,this.options=n,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}var e,n;return Rf(t,[{key:"init",value:(n=Uf(Lf().mark((function t(){var e,n,r,i,o,a,u,s,c,f,l,d,h,p,v,g,y=this;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options,n=e.vs,r=e.fs,i=e.attributes,o=e.uniforms,a=e.primitive,e.count,u=e.elements,s=e.depth,c=e.blend,f=e.stencil,l=e.cull,e.instances,t.next=3,this.compilePipelineStageDescriptor(n,r,null);case 3:d=t.sent,h=d.vertexStage,p=d.fragmentStage,o&&this.buildUniformBindGroup(o),u&&(this.indexBuffer=u.get(),this.indexCount=u.indexCount),v={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,u=r.attributes;return y.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:u}}))},g={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:Gy[a||Hl.TRIANGLES],rasterizationState:qy(qy({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:Vy({cull:l})}),depthStencilState:Wy({depth:s,stencil:f}),colorStates:Hy({blend:c},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:h,fragmentStage:p,vertexState:v},this.renderPipeline=this.engine.device.createRenderPipeline(g);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addUniforms",value:function(t){this.uniforms=qy(qy({},this.uniforms),ly(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=qy(qy({},this.uniforms),ly(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=tl(r[t]);if("boolean"===n||"number"===n||Array.isArray(r[t])||r[t].BYTES_PER_ELEMENT){var o,a=null===(o=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===o?void 0:o.offset;null!==a&&e.uniformBuffer.subData({data:r[t],offset:a})}else{var u,s=null===(u=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===u?void 0:u.offset;if(null!==s){var c=r[t].get(),f=c.color||c,l=f.texture,d=f.sampler;d&&(i.push({binding:s,resource:d}),s++),i.push({binding:s,resource:l.createView()})}}})),this.uniformBuffer&&(i[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:i}),this.renderPipeline&&n.setPipeline(this.renderPipeline),n.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&n.setIndexBuffer(this.indexBuffer.get(),Lv.iD.Uint32,0),Object.keys(this.attributeCache).forEach((function(t,r){n.setVertexBuffer(0+r,e.attributeCache[t].get().buffer,0)})),this.indexBuffer?n.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):n.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:(e=Uf(Lf().mark((function t(e,n,r){var i,o,a;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i="#version 450\n",o=e,a=n,this.engine.options.useWGSL){t.next=10;break}return t.next=6,this.compileShaderToSpirV(e,"vertex",i);case 6:return o=t.sent,t.next=9,this.compileShaderToSpirV(n,"fragment",i);case 9:a=t.sent;case 10:return t.abrupt("return",this.createPipelineStageDescriptor(o,a));case 11:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"createPipelineStageDescriptor",value:function(t,e){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:lv}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:lv}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:Lv.zX.CCW,cullMode:Lv.Wf.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=Yy.apply(void 0,[Float32Array].concat(ey(Object.keys(t).map((function(r){return t[r]?(e.uniformGPUBufferLayout.push({name:r,offset:n}),n+=4*(t[r].length||1),t[r]):[]}))))),i=[],o=!1;r.length&&(o=!0,i.push({binding:0,visibility:Lv.$X.Fragment|Lv.$X.Vertex,type:Lv.$l.UniformBuffer})),Object.keys(t).filter((function(e){return null===t[e]})).forEach((function(t,n){e.uniformGPUBufferLayout.push({name:t,offset:2*n+(o?1:0)}),i.push({binding:2*n+(o?1:0),visibility:Lv.$X.Fragment,type:Lv.$l.Sampler},{binding:2*n+(o?1:0)+1,visibility:Lv.$X.Fragment,type:Lv.$l.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new Dy(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:Lv.FB.Uniform|Lv.FB.CopyDst}))}}]),t}(),Qy=function(){function t(e,n){Df(this,t),this.engine=e,this.options=n,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return Rf(t,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var e=t.width,n=t.height;e===this.width&&n===this.height||(this.destroy(),this.createTexture()),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,e=(void 0===(t.data,t.type)&&Hl.UNSIGNED_BYTE,t.width),n=t.height,r=(t.flipY,t.format),i=void 0===r?Hl.RGBA:r,o=(t.mipmap,t.wrapS),a=void 0===o?Hl.CLAMP_TO_EDGE:o,u=t.wrapT,s=void 0===u?Hl.CLAMP_TO_EDGE:u,c=t.aniso,f=void 0===c?0:c,l=(t.alignment,t.premultiplyAlpha,t.mag),d=void 0===l?Hl.NEAREST:l,h=t.min,p=void 0===h?Hl.NEAREST:h,v=(void 0===t.colorSpace&&Hl.BROWSER_DEFAULT_WEBGL,t.usage);this.width=e,this.height=n,this.texture=this.engine.device.createTexture({size:[e,n,1],mipLevelCount:1,sampleCount:1,dimension:Lv.kd.E2d,format:Fy[i],usage:v||Lv.v2.Sampled|Lv.v2.CopyDst}),(!v||v&Lv.v2.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:zy[a],addressModeV:zy[s],addressModeW:zy[a],magFilter:By[d],minFilter:By[p],maxAnisotropy:f}))}}]),t}(),tm=(0,qf.b2)()((Zy=function(){function t(){var e=this;Df(this,t),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){t.framebuffer;var n=t.color,r=t.depth,i=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,n||null,!!r,!!i)):(e.mainColorAttachments[0].loadValue=n||Lv.Ws.Load,e.mainDepthAttachment.depthLoadValue=r||Lv.Ws.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:Lv.Ws.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=Uf(Lf().mark((function t(n){var r;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Jy(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new ky(e,t)},this.createBuffer=function(t){return new Dy(e,t)},this.createElements=function(t){return new Ry(e,t)},this.createTexture2D=function(t){return new Qy(e,t)},this.createFramebuffer=function(t){return new Py(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:Lv.p_.E2d,arrayLayerCount:1,aspect:Lv.H7.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=Uf(Lf().mark((function t(n){var r;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new My(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.currentRenderPass?e.transientViewport.x!==1/0?e.getCurrentRenderPass().setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1):n===e.cachedViewport.x&&r===e.cachedViewport.y&&i===e.cachedViewport.width&&o===e.cachedViewport.height||(e.cachedViewport={x:n,y:r,width:i,height:o},e.getCurrentRenderPass().setViewport(n,r,i,o,0,1)):e.transientViewport={x:n,y:r,width:i,height:o}},this.readPixels=function(t){throw new Error("Method not implemented.")}}var e,n;return Rf(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=Uf(Lf().mark((function t(e){return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e.canvas,this.options=e,this.useWGSL=!!e.useWGSL,this.mainPassSampleCount=e.antialiasing?this.defaultSampleCount:1,t.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"setScissor",value:function(t){throw new Error("Method not implemented.")}},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach((function(t){return t.destroy()})),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),lv?this.device.getQueue().submit(this.commandBuffers.filter((function(t){return t}))):this.device.defaultQueue.submit(this.commandBuffers.filter((function(t){return t})))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:(e=Uf(Lf().mark((function t(){var e,n;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,wy();case 2:return this.glslang=t.sent,t.next=5,null===(e=navigator)||void 0===e||null===(n=e.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=t.sent,t.next=8,this.adapter.requestDevice();case 8:this.device=t.sent;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(lv?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:Lv.v2.OutputAttachment|Lv.v2.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Lv.kd.E2d,format:Lv.EV.BGRA8Unorm,usage:Lv.v2.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:lv?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:Lv.EG.Store}]}else this.mainColorAttachments=[{attachment:lv?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:Lv.EG.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Lv.kd.E2d,format:lv?"depth32float-stencil8":Lv.EV.Depth24PlusStencil8,usage:Lv.v2.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:lv?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:Lv.EG.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:Lv.EG.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=lv?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=lv?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=null===(r=t.get().color)||void 0===r?void 0:r.texture;u&&(o=u.createView(this.currentRenderTargetViewDescriptor));var s,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(s=c.createView());var f=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:Lv.Ws.Load,storeOp:Lv.EG.Store}],depthStencilAttachment:c&&s?{attachment:s,depthLoadValue:n?this.clearDepthValue:Lv.Ws.Load,depthStoreOp:Lv.EG.Store,stencilLoadValue:a?this.clearStencilValue:Lv.Ws.Load,stencilStoreOp:Lv.EG.Store}:void 0});this.currentRenderPass=f,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&null!==this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),t}(),Ky=Zy))||Ky;var em,nm=4/64,rm=(0,qf.b2)()($y=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){return Df(this,i),r.apply(this,arguments)}return Rf(i,[{key:"onEntityCreated",value:function(){var t=this.config,e=t.widthSegments,n=void 0===e?1:e,r=t.heightSegments,i=void 0===r?1:r,o=t.depthSegments,a=void 0===o?1:o,u=t.halfExtents,s=n,c=i,f=a,l=Xf(void 0===u?Al(.5,.5,.5):u,3),d=l[0],h=l[1],p=l[2],v=[Al(-d,-h,p),Al(d,-h,p),Al(d,h,p),Al(-d,h,p),Al(d,-h,-p),Al(-d,-h,-p),Al(-d,h,-p),Al(d,h,-p)],g=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],y=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],m=[],b=[],_=[],x=[],w=[],E=0,S=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var u=wl(),s=wl(),c=wl(),f=wl();Ml(u,v[g[t][0]],v[g[t][1]],o/e),Ml(s,v[g[t][0]],v[g[t][2]],a/n),Gl(c,s,v[g[t][0]]),Nl(f,u,c),r=o/e,i=a/n,m.push(f[0],f[1],f[2]),b.push(y[t][0],y[t][1],y[t][2]),_.push(r,i),r=.875*(r/=3)+nm,i=.875*(i/=3)+nm,r+=t%3/3,i+=Math.floor(t/3)/3,x.push(r,i),o<e&&a<n&&(w.push(E+n+1,E+1,E),w.push(E+n+1,E+n+2,E+1)),E++}};S(0,s,c),S(1,s,c),S(2,s,f),S(3,s,f),S(4,f,c),S(5,f,c);var A=ov(m),T=this.getComponent();T.indices=Uint32Array.from(w),T.aabb=A,T.vertexCount=E,T.attributes=[{dirty:!0,name:"position",data:Float32Array.from(m),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(b),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(_),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Gv))||$y;var im,om=(0,qf.b2)()(em=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){return Df(this,i),r.apply(this,arguments)}return Rf(i,[{key:"onEntityCreated",value:function(){var t=this.config.geometries,e=void 0===t?[]:t,n=this.getComponent();n.aabb=new _d;var r=[],i=[],o=0;e.forEach((function(t){var e=t.aabb,a=t.indices,u=t.vertexCount,s=t.attributes;n.aabb.add(e),n.vertexCount+=u,a&&i.push.apply(i,ey(a.map((function(t){return t+o})))),o+=u,s.forEach((function(t,e){r[e]?t.data&&(dv(t.data)?r[e].push(t.data):Zv(t.data)?r[e].data=function(t,e){if(!t&&!e)throw new Error("Please specify valid arguments for parameters a and b.");if(!e||0===e.length)return t;if(!t||0===t.length)return e;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(e))throw new Error("The types of the two arguments passed for parameters a and b do not match.");var n=new t.constructor(t.length+e.length);return n.set(t),n.set(e,t.length),n}(r[e].data,t.data):r[e].data=r[e].data.concat(t.data)):(r[e]=t,r[e].dirty=!0)}))})),n.attributes=r,n.indices=Uint32Array.from(i),n.dirty=!0}}]),i}(Gv))||em;var am,um=(0,qf.b2)()(im=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){return Df(this,i),r.apply(this,arguments)}return Rf(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.halfExtents,n=void 0===e?[.5,.5]:e,r=t.widthSegments,i=void 0===r?5:r,o=t.lengthSegments,a=void 0===o?5:o,u=[],s=[],c=[],f=[],l=0,d=0;d<=i;d++)for(var h=0;h<=a;h++){var p=-n[0]+2*n[0]*d/i,v=-(-n[1]+2*n[1]*h/a),g=d/i,y=h/a;u.push(p,0,v),s.push(0,1,0),c.push(g,y),d<i&&h<a&&(f.push(l+a+1,l+1,l),f.push(l+a+1,l+a+2,l+1)),l++}var m=ov(u),b=this.getComponent();b.indices=Uint32Array.from(f),b.aabb=m,b.vertexCount=l,b.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Gv))||im;var sm,cm,fm,lm,dm,hm,pm,vm,gm=(0,qf.b2)()(am=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){return Df(this,i),r.apply(this,arguments)}return Rf(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.radius,n=void 0===e?.5:e,r=t.latitudeBands,i=void 0===r?16:r,o=t.longitudeBands,a=void 0===o?16:o,u=[],s=[],c=[],f=[],l=0;l<=i;l++)for(var d=l*Math.PI/i,h=Math.sin(d),p=Math.cos(d),v=0;v<=a;v++){var g=2*v*Math.PI/a-Math.PI/2,y=Math.sin(g),m=Math.cos(g)*h,b=p,_=y*h,x=1-v/a,w=1-l/i;u.push(m*n,b*n,_*n),s.push(m,b,_),c.push(x,w)}for(var E=0;E<i;++E)for(var S=0;S<a;++S){var A=E*(a+1)+S,T=A+a+1;f.push(A+1,T,A),f.push(A+1,T+1,T)}var I=ov(u),N=this.getComponent();N.indices=Uint32Array.from(f),N.aabb=I,N.vertexCount=u.length/3,N.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Gv))||am;var ym,mm,bm,_m,xm,wm,Em,Sm,Am,Tm,Im,Nm,Om=(sm=(0,qf.b2)(),cm=(0,qf.f3)(Yf.RenderEngine),fm=(0,qf.f3)(Yf.ShaderModuleService),sm((vm=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){var t;Df(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return kf(t=r.call.apply(r,[this].concat(n)),"engine",hm,el(t)),kf(t,"shaderModuleService",pm,el(t)),t}return Rf(i,[{key:"onEntityCreated",value:function(){var t=this.getComponent(),e=this.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform Uniforms {\n vec4 color;\n mat4 projectionMatrix;\n mat4 modelViewMatrix;\n} uniforms;\n\nlayout(location = 0) in vec3 position;\n// layout(location = 1) in vec3 barycentric;\n\nlayout(location = 0) out vec4 fragColor;\n// layout(location = 1) out vec3 v_Barycentric;\n\nvoid main() {\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\n fragColor = uniforms.color;\n // v_Barycentric = barycentric;\n}":'attribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform vec4 color;\n\nvarying vec4 fragColor;\n\n#pragma include "uv.vert.declaration"\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n fragColor = color;\n\n #pragma include "uv.vert.main"\n}',n=this.engine.supportWebGPU?"// layout(set = 0, binding = 1) uniform WireframeUniforms {\n// float lineWidth;\n// vec4 lineColor;\n// } wireframe;\n\nlayout(location = 0) in vec4 fragColor;\n// layout(location = 1) in vec3 v_Barycentric;\n\nlayout(location = 0) out vec4 outColor;\n\n// wireframe\n// float edgeFactor() {\n// vec3 d = fwidth(v_Barycentric);\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\n// return min(min(a3.x, a3.y), a3.z);\n// }\n\nvoid main() {\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\n outColor = fragColor;\n}":'varying vec4 fragColor;\n\n#pragma include "uv.frag.declaration"\n#pragma include "map.frag.declaration"\n\nvoid main() {\n vec4 diffuseColor = fragColor;\n\n #pragma include "map.frag.main"\n\n gl_FragColor = diffuseColor;\n}';this.shaderModuleService.registerModule("material-basic",{vs:e,fs:n});var r=this.shaderModuleService.getModule("material-basic"),i=r.vs,o=r.fs,a=r.uniforms;t.vertexShaderGLSL=i,t.fragmentShaderGLSL=o,t.setUniform(a),this.config.map&&(t.setDefines({USE_UV:1,USE_MAP:1}),t.setUniform({map:this.config.map,uvTransform:xl()}))}}]),i}(Pg),hm=Pf((dm=vm).prototype,"engine",[cm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pm=Pf(dm.prototype,"shaderModuleService",[fm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lm=dm))||lm);var Cm,km,Dm,Mm,Rm,Pm,Gm,Lm,jm,Um,Fm,Bm,zm=(ym=(0,qf.b2)(),mm=(0,qf.f3)(Yf.Systems),bm=(0,qf.t6)(Yf.MaterialSystem),_m=(0,qf.f3)(Yf.Systems),xm=(0,qf.t6)(Yf.GeometrySystem),wm=(0,qf.f3)(Yf.ShaderModuleService),ym((Nm=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){var t;Df(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return kf(t=r.call.apply(r,[this].concat(n)),"materialSystem",Am,el(t)),kf(t,"geometrySystem",Tm,el(t)),kf(t,"shaderModuleService",Im,el(t)),t}return Rf(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("gridColor"===e?(r.material.setUniform("u_GridColor",n),r.material.setUniform("u_GridColor2",n)):"gridSize"===e&&(r.material.setUniform("u_GridSize",n),r.material.setUniform("u_GridSize2",n)))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:"attribute vec3 a_Position;\n\nvarying vec3 v_Position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvoid main() {\n v_Position = a_Position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.);\n}",fs:"// generate grid, borrow from clay.gl viewer\n// @see https://github.com/pissang/clay-viewer/blob/master/src/graphic/ground.glsl\n#extension GL_OES_standard_derivatives : enable\n\nvarying vec3 v_Position;\n// varying vec3 v_Normal;\n\nuniform float u_GridSize : 5;\nuniform float u_GridSize2 : .5;\nuniform vec4 u_GridColor : [0, 0, 0, 1];\nuniform vec4 u_GridColor2 : [0.3, 0.3, 0.3, 1];\nuniform bool u_GridEnabled : true;\n\n// uniform vec3 u_LightDirection;\n// uniform vec3 u_LightColor;\n// uniform vec3 u_Camera;\n\nvoid main() {\n // vec3 n = v_Normal;\n // vec3 l = normalize(u_LightDirection);\n // float NdotL = clamp(dot(n, l), 0.001, 1.0);\n\n gl_FragColor = vec4(1.);\n\n if (u_GridEnabled) {\n float wx = v_Position.x;\n float wz = v_Position.z;\n // float x0 = abs(fract(wx / u_GridSize - 0.5) - 0.5) / fwidth(wx) * u_GridSize / 2.0;\n // float z0 = abs(fract(wz / u_GridSize - 0.5) - 0.5) / fwidth(wz) * u_GridSize / 2.0;\n\n float x1 = abs(fract(wx / u_GridSize2 - 0.5) - 0.5) / fwidth(wx) * u_GridSize2;\n float z1 = abs(fract(wz / u_GridSize2 - 0.5) - 0.5) / fwidth(wz) * u_GridSize2;\n\n // float v0 = 1.0 - clamp(min(x0, z0), 0.0, 1.0);\n float v1 = 1.0 - clamp(min(x1, z1), 0.0, 1.0);\n // if (v0 > 0.1) {\n // gl_FragColor = mix(gl_FragColor, u_GridColor, v0);\n // }\n // else {\n gl_FragColor = mix(gl_FragColor, u_GridColor2, v1);\n // }\n }\n\n // float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n);\n // vec3 diffuseColor = u_LightColor * NdotL * shadowFactor;\n\n // gl_FragColor.rgb *= diffuseColor;\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n});this.setMaterial(i);var o=this.geometrySystem.createBufferGeometry({vertexCount:4});this.setGeometry(o),i.setCull({enable:!1,face:Hl.BACK}).setDepth({enable:!0,func:Hl.LESS}),i.setUniform(r),this.setAttributes({gridColor:this.config.gridColor,gridSize:this.config.gridSize}),o.setIndex([0,3,2,2,1,0]),o.setAttribute("a_Position",Float32Array.from([-4,-1,-4,4,-1,-4,4,-1,4,-4,-1,4]),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})}}]),i}(Gg),Am=Pf((Sm=Nm).prototype,"materialSystem",[mm,bm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tm=Pf(Sm.prototype,"geometrySystem",[_m,xm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Im=Pf(Sm.prototype,"shaderModuleService",[wm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Em=Sm))||Em),Vm=n(7801),Wm=n(1739);function Hm(t,e,n,r,i){Xm(e,r,-i),Xm(e,r,i),t.push(n),t.push(n)}function Xm(t,e,n){t.push([[e[0],e[1]],n])}var qm,Ym,Km,Zm,$m,Jm,Qm,tb,eb,nb,rb,ib,ob=(Cm=(0,qf.b2)(),km=(0,qf.f3)(Yf.Systems),Dm=(0,qf.t6)(Yf.MaterialSystem),Mm=(0,qf.f3)(Yf.Systems),Rm=(0,qf.t6)(Yf.GeometrySystem),Pm=(0,qf.f3)(Yf.ShaderModuleService),Cm((Bm=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){var t;Df(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return kf(t=r.call.apply(r,[this].concat(n)),"materialSystem",jm,el(t)),kf(t,"geometrySystem",Um,el(t)),kf(t,"shaderModuleService",Fm,el(t)),t.vertexCount=void 0,t}return Rf(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();if(r&&r.material)switch(e){case"dashArray":r.material.setUniform("u_dash_array",n);break;case"dashOffset":r.material.setUniform("u_dash_offset",n);break;case"dashRatio":r.material.setUniform("u_dash_ratio",n);break;case"thickness":r.material.setUniform("u_thickness",n);break;case"color":var i=new Array(this.vertexCount).fill(void 0).map((function(){return n})).reduce((function(t,e){return[].concat(ey(t),ey(e))}),[]);r.geometry.setAttribute("a_color",Float32Array.from(i),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]})}}},{key:"onEntityCreated",value:function(){var t=this;this.shaderModuleService.registerModule("line",{vs:"attribute vec2 a_pos;\nattribute vec4 a_color;\nattribute float a_line_miter;\nattribute vec2 a_line_normal;\nattribute float a_counters;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float u_thickness : 0.02;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n v_color = a_color;\n v_counters = a_counters;\n\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\n\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\n\n v_normal = vec2(normal * sign(a_line_miter));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\n}\n",fs:"uniform float u_dash_array : 0.02;\nuniform float u_dash_offset : 0;\nuniform float u_dash_ratio : 0;\nuniform float u_thickness : 0.02;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\n\n gl_FragColor = v_color;\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\n}"});var e=this.shaderModuleService.getModule("line"),n=e.vs,r=e.fs,i=e.uniforms,o=this.materialSystem.createShaderMaterial({vertexShader:n,fragmentShader:r}),a=function(t,e,n){for(var r=[0,0],i=[0,0],o=[0,0],a=[0,0],u=-1,s=!1,c=null,f=(0,Vm.create)(),l=0,d=[],h=[],p=[],v=[0,0],g=t.length,y=1;y<g;y++){var m=l,b=t[y-1],_=t[y],x=y<t.length-1?t[y+1]:null;if(v.push(y/g,y/g),(0,Wm.o7)(r,_,b),c||(c=[0,0],(0,Wm.mJ)(c,r)),s||(s=!0,Hm(h,d,b,c,1)),p.push([m+0,m+1,m+2]),x){(0,Wm.o7)(i,x,_);var w=(0,Wm.x7)(o,a,r,i,1),E=(0,Vm.dot)(o,c)<0?-1:1,S=w>3;if(!isFinite(w)){(0,Wm.mJ)(c,r),Hm(h,d,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2,u=E;continue}S?(w=3,v.push(y/g),Xm(d,c,-E),h.push(_),Xm(d,a,w*E),h.push(_),p.push(u!==-E?[m,m+2,m+3]:[m+2,m+1,m+3]),p.push([m+2,m+3,m+4]),(0,Wm.mJ)(f,i),(0,Vm.copy)(c,f),Xm(d,c,-E),h.push(_),l+=3):(Hm(h,d,_,a,w),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),E=-1,(0,Vm.copy)(c,a),l+=2),u=E}else(0,Wm.mJ)(c,r),Hm(h,d,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2}return{normals:d,attrIndex:p,attrPos:h,attrCounters:v}}(this.config.points),u=a.normals,s=a.attrIndex,c=a.attrPos,f=a.attrCounters,l=c.length;this.vertexCount=l;var d=this.geometrySystem.createBufferGeometry({vertexCount:l});this.setMaterial(o),this.setGeometry(d),o.setCull({enable:!1,face:Hl.BACK}).setUniform(i),this.setAttributes({dashArray:this.config.dashArray,dashOffset:this.config.dashOffset,dashRatio:this.config.dashRatio,thickness:this.config.thickness});var h=[],p=[];u.forEach((function(t){var e=t[0],n=t[1];h.push([e[0],e[1]]),p.push(n)})),d.setIndex(s.reduce((function(t,e){return[].concat(ey(t),ey(e))}),[])),d.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(ey(t),ey(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var v=new Array(l).fill(void 0).map((function(){return ey(t.config.color)})).reduce((function(t,e){return[].concat(ey(t),ey(e))}),[]);d.setAttribute("a_color",Float32Array.from(v),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),d.setAttribute("a_line_miter",Float32Array.from(p),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),d.setAttribute("a_line_normal",Float32Array.from(h.reduce((function(t,e){return[].concat(ey(t),ey(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),d.setAttribute("a_counters",Float32Array.from(f),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]})}}]),i}(Gg),jm=Pf((Lm=Bm).prototype,"materialSystem",[km,Dm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Um=Pf(Lm.prototype,"geometrySystem",[Mm,Rm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fm=Pf(Lm.prototype,"shaderModuleService",[Pm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gm=Lm))||Gm);function ab(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var ub,sb,cb,fb,lb,db,hb,pb,vb,gb,yb=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],mb=(qm=(0,qf.b2)(),Ym=(0,qf.f3)(Yf.Systems),Km=(0,qf.t6)(Yf.MaterialSystem),Zm=(0,qf.f3)(Yf.Systems),$m=(0,qf.t6)(Yf.GeometrySystem),Jm=(0,qf.f3)(Yf.ShaderModuleService),qm((ib=function(t){Qf(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=rl(e);if(n){var i=rl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return nl(this,t)});function i(){var t;Df(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return kf(t=r.call.apply(r,[this].concat(n)),"materialSystem",eb,el(t)),kf(t,"geometrySystem",nb,el(t)),kf(t,"shaderModuleService",rb,el(t)),t}return Rf(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("strokeWidth"===e?r.material.setUniform("u_stroke_width",n):"strokeColor"===e?r.material.setUniform("u_stroke_color",n):"strokeOpacity"===e?r.material.setUniform("u_stroke_opacity",n):"opacity"===e?r.material.setUniform("u_opacity",n):"blur"===e&&r.material.setUniform("u_blur",n))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:'attribute vec2 position;\nattribute vec4 color;\nattribute float shape;\nattribute vec2 offset;\nattribute float size;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nuniform float u_stroke_width : 0.01;\nuniform float u_device_pixel_ratio;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include "picking"\n\nvoid main() {\n v_color = color;\n v_radius = size;\n\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\n\n // construct point coords\n v_data = vec4(position, antialiasblur, shape);\n\n gl_Position = projectionMatrix * modelViewMatrix\n * vec4(position * size + offset, 0.0, 1.0);\n\n setPickingColor(a_PickingColor);\n}',fs:"uniform float u_blur : 0.05;\nuniform float u_opacity : 0.7;\nuniform float u_stroke_width : 0.01;\nuniform vec4 u_stroke_color : [0, 0, 0, 0];\nuniform float u_stroke_opacity : 1;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include \"sdf2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n float antialiasblur = v_data.z;\n float antialiased_blur = -max(u_blur, antialiasblur);\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n // if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n // } else if (shape == 1) {\n // outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n // inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n // } else if (shape == 2) {\n // outer_df = sdBox(v_data.xy, vec2(1.));\n // inner_df = sdBox(v_data.xy, vec2(r));\n // } else if (shape == 3) {\n // outer_df = sdPentagon(v_data.xy, 0.8);\n // inner_df = sdPentagon(v_data.xy, r * 0.8);\n // } else if (shape == 4) {\n // outer_df = sdHexagon(v_data.xy, 0.8);\n // inner_df = sdHexagon(v_data.xy, r * 0.8);\n // } else if (shape == 5) {\n // outer_df = sdOctogon(v_data.xy, 1.0);\n // inner_df = sdOctogon(v_data.xy, r);\n // } else if (shape == 6) {\n // outer_df = sdHexagram(v_data.xy, 0.52);\n // inner_df = sdHexagram(v_data.xy, r * 0.52);\n // } else if (shape == 7) {\n // outer_df = sdRhombus(v_data.xy, vec2(1.0));\n // inner_df = sdRhombus(v_data.xy, vec2(r));\n // } else if (shape == 8) {\n // outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n // inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n // }\n\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n inner_df\n );\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\n\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\n gl_FragColor.a = gl_FragColor.a * opacity_t;\n\n gl_FragColor = filterColor(gl_FragColor);\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n,cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Hl.SRC_ALPHA,dstRGB:Hl.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});i.setUniform(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ab(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ab(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({u_device_pixel_ratio:window.devicePixelRatio},r));var o=this.buildAttributes(),a=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:o.instancedOffsets.length/2,vertexCount:6});a.setIndex([0,2,1,0,3,2]),a.setAttribute("position",Float32Array.from(o.positions),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),a.setAttribute("offset",Float32Array.from(o.instancedOffsets),{arrayStride:8,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),a.setAttribute("color",Float32Array.from(o.instancedColors),{arrayStride:16,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),a.setAttribute("size",Float32Array.from(o.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),a.setAttribute("shape",Float32Array.from(o.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),a.setAttribute("a_PickingColor",Float32Array.from(o.instancedPickingColors),{arrayStride:12,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(i),this.setGeometry(a)}},{key:"buildAttribute",value:function(t,e,n){var r,i,o,a,u;(r=e.instancedPickingColors).push.apply(r,ey([(u=t.id||n)+1&255,u+1>>8&255,u+1>>8>>8&255])),e.instancedShapes.push(yb.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,ey(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,ey(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,ey(t.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var t=this,e={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach((function(n,r){t.buildAttribute(n,e,r)})):this.buildAttribute(this.config,e,0),e}}]),i}(Gg),eb=Pf((tb=ib).prototype,"materialSystem",[Ym,Km],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nb=Pf(tb.prototype,"geometrySystem",[Zm,$m],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rb=Pf(tb.prototype,"shaderModuleService",[Jm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qm=tb))||Qm);function bb(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return _b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_b(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function _b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var xb,wb,Eb,Sb,Ab,Tb,Ib,Nb,Ob,Cb,kb,Db,Mb=(ub=(0,qf.b2)(),sb=(0,qf.f3)(Yf.RenderEngine),cb=(0,qf.f3)(Yf.ShaderModuleService),fb=(0,qf.f3)(Yf.ConfigService),ub((gb=function(){function t(){Df(this,t),this.container=void 0,kf(this,"engine",hb,this),kf(this,"shaderModule",pb,this),kf(this,"configService",vb,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}var e,n;return Rf(t,[{key:"init",value:(n=Uf(Lf().mark((function t(){var e,n,r,i,o;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shaderModule.registerBuiltinModules(),this.shaderModule.registerModule("uv.vert.declaration",{vs:"#ifdef USE_UV\n attribute vec2 uv;\n\t#ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif"}),this.shaderModule.registerModule("uv.vert.main",{vs:"#ifdef USE_UV\n vUv = (uvTransform * vec3(uv, 1)).xy;\n#endif"}),this.shaderModule.registerModule("uv.frag.declaration",{fs:"#if (defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ))\n varying vec2 vUv;\n#endif"}),this.shaderModule.registerModule("map.frag.declaration",{fs:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif"}),this.shaderModule.registerModule("map.frag.main",{fs:"#ifdef USE_MAP\n vec4 texelColor = texture2D(map, vUv);\n // texelColor = mapTexelToLinear(texelColor);\n diffuseColor *= texelColor;\n#endif"}),e=this.container.getAll(Yf.Systems),!(n=this.configService.get()).canvas){t.next=30;break}return t.next=11,this.engine.init({canvas:n.canvas,swapChainFormat:Lv.EV.BGRA8Unorm,antialiasing:!1});case 11:r=bb(e),t.prev=12,r.s();case 14:if((i=r.n()).done){t.next=21;break}if(!(o=i.value).initialize){t.next=19;break}return t.next=19,o.initialize();case 19:t.next=14;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(12),r.e(t.t0);case 26:return t.prev=26,r.f(),t.finish(26);case 29:this.inited=!0;case 30:case"end":return t.stop()}}),t,this,[[12,23,26,29]])}))),function(){return n.apply(this,arguments)})},{key:"render",value:(e=Uf(Lf().mark((function t(){var e,n,r,i,o,a,u,s=arguments;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.inited&&!this.rendering){t.next=2;break}return t.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach((function(t){t()})),this.rendering=!0,this.engine.beginFrame(),e=this.container.getAll(Yf.Systems),n=s.length,r=new Array(n),i=0;i<n;i++)r[i]=s[i];o=bb(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(u=a.value).execute){t.next=15;break}return t.next=15,u.execute(r);case 15:t.next=10;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(8),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return t.stop()}}),t,this,[[8,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"clear",value:function(t){var e=this;return this.inited?this.engine.clear(t):this.pendings.unshift((function(){e.engine.clear(t),e.pendings.shift()})),this}},{key:"setSize",value:function(t){var e=t.width,n=t.height,r=this.engine.getCanvas();return this.size={width:e,height:n},r.width=e,r.height=n,this}},{key:"getSize",value:function(){return this.size}}]),t}(),hb=Pf((db=gb).prototype,"engine",[sb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pb=Pf(db.prototype,"shaderModule",[cb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vb=Pf(db.prototype,"configService",[fb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lb=db))||lb),Rb=(0,qf.b2)()((wb=function(){function t(){Df(this,t),this.entities=[]}return Rf(t,[{key:"getEntities",value:function(){return this.entities}},{key:"addRenderable",value:function(t){return this.addEntity(t.getEntity()),this}},{key:"removeRenderable",value:function(t){return this.removeEntity(t.getEntity()),this}},{key:"addLight",value:function(){}},{key:"addEntity",value:function(t){return-1===this.entities.indexOf(t)&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var e=this.entities.indexOf(t);return this.entities.splice(e,1),this}}]),t}(),xb=wb))||xb,Pb=(0,qf.b2)()((Sb=function(){function t(){Df(this,t),this.cache={}}return Rf(t,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,e){this.cache[t]=e}}]),t}(),Eb=Sb))||Eb;function Gb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lb(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gb(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gb(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var jb,Ub,Fb,Bb,zb,Vb,Wb,Hb,Xb,qb,Yb,Kb,Zb,$b=(Ab=(0,qf.b2)(),Tb=(0,qf.f3)(Pb),Ib=(0,qf.f3)(Yf.RenderEngine),Ab((Db=function(){function t(){Df(this,t),kf(this,"textureCache",Cb,this),kf(this,"engine",kb,this),this.config=void 0,this.loaded=!1,this.texture=void 0}var e;return Rf(t,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:(e=Uf(Lf().mark((function t(){var e=this;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.config.url){t.next=4;break}return t.abrupt("return",new Promise((function(t,n){var r=e.textureCache.get(e.config.url);if(r)t(r);else{var i=new Image;i.crossOrigin="Anonymous",i.src=e.config.url,i.onload=function(){var n=e.engine.createTexture2D(Lb(Lb({},e.config),{},{data:i,width:i.width,height:i.height,flipY:!0}));e.textureCache.set(e.config.url,n),e.texture=n,e.loaded=!0,t(n)},i.onerror=function(){n()}}})));case 4:return this.loaded=!0,this.texture=this.engine.createTexture2D(this.config),t.abrupt("return",this.texture);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Cb=Pf((Ob=Db).prototype,"textureCache",[Tb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kb=Pf(Ob.prototype,"engine",[Ib],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nb=Ob))||Nb),Jb=(jb=(0,qf.b2)(),Ub=(0,qf.f3)(Yf.Systems),Fb=(0,qf.t6)(Yf.RendererSystem),jb((Wb=function(){function t(){Df(this,t),kf(this,"rendererSystem",Vb,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return Rf(t,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),t}(),Vb=Pf((zb=Wb).prototype,"rendererSystem",[Ub,Fb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bb=zb))||Bb);function Qb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function t_(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qb(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qb(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var e_=(Hb=(0,qf.b2)(),Xb=(0,qf.f3)(Yf.ConfigService),Hb((Zb=function(){function t(){Df(this,t),kf(this,"configService",Kb,this),this.container=void 0}var e;return Rf(t,[{key:"getEngine",value:(e=Uf(Lf().mark((function t(){var e,n,r,i;return Lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(Yf.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(t_({canvas:r||jv(),swapChainFormat:Lv.EV.BGRA8Unorm,antialiasing:!1},i));case 4:return t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTransformComponent",value:function(t){return this.container.get(Yf.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(Yf.MeshComponentManager).getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return Bf()}},{key:"createScene",value:function(){return this.container.get(Rb)}},{key:"createCamera",value:function(){return this.container.get(Pv)}},{key:"createView",value:function(){return this.container.get(Jb)}},{key:"createRenderable",value:function(t,e){var n=t?this.container.getNamed(Yf.Renderable,t):this.container.get(Gg),r=Bf();return n.setConfig(e||{}),n.setEntity(r),n}},{key:"createGeometry",value:function(t,e){var n=this.container.getNamed(Yf.Geometry,t),r=Bf();return n.setConfig(e||{}),n.setEntity(r),n.getComponent()}},{key:"createMaterial",value:function(t,e){var n=this.container.getNamed(Yf.Material,t),r=Bf();return n.setConfig(e||{}),n.setEntity(r,t),n.getComponent()}},{key:"createTexture2D",value:function(t){var e=this.container.get($b);return e.setConfig(t),e}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(Yf.Systems,Yf.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(Yf.Systems,Yf.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(Yf.Systems,Yf.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(Rg);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(Mb);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(Yf.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(Yf.RenderEngine).destroy(),this.container.get(Yf.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=iv(),r=navigator.gpu?tm:_y;n.isBound(Yf.RenderEngine)||n.bind(Yf.RenderEngine).to(r).inSingletonScope(),n.bind(Mb).toSelf(),n.bind(Rg).toSelf(),n.bind(Gg).toSelf(),n.bind(Jb).toSelf(),n.bind(Pv).toSelf(),n.bind(Rb).toSelf(),n.bind(t).toSelf(),n.bind(Pb).toSelf(),n.bind($b).toSelf(),n.bind(Yf.Geometry).to(rm).whenTargetNamed(Gv.BOX),n.bind(Yf.Geometry).to(gm).whenTargetNamed(Gv.SPHERE),n.bind(Yf.Geometry).to(um).whenTargetNamed(Gv.PLANE),n.bind(Yf.Geometry).to(om).whenTargetNamed(Gv.MERGED),n.bind(Yf.Material).to(Om).whenTargetNamed(Pg.BASIC),n.bind(Yf.Renderable).to(mb).whenTargetNamed(Gg.POINT),n.bind(Yf.Renderable).to(ob).whenTargetNamed(Gg.LINE),n.bind(Yf.Renderable).to(zm).whenTargetNamed(Gg.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),Kb=Pf((Yb=Zb).prototype,"configService",[Xb],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qb=Yb))||qb),n_=function(t,e){return t?o(t)?function(){return t}:t:function(){return e||1}},r_=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},i_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o_=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},a_=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u_=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.gravity=10,n.speed=1,n.clustering=!1,n.clusterField="cluster",n.clusterGravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return i_(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return o_(this,void 0,void 0,(function(){var t,e,n,r,i,a=this;return a_(this,(function(u){switch(u.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(t,e){o(t.x)||(t.x=Math.random()*a.width),o(t.y)||(t.y=Math.random()*a.height),r[t.id]=t,i[t.id]=e})),t.nodeMap=r,t.nodeIdxMap=i,[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return u.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){return o_(this,void 0,void 0,(function(){var n,r,i,a,u,s=this;return a_(this,(function(c){switch(c.label){case 0:return r=(n=this).nodes,i=n.center,r&&0!==r.length?1===r.length?(r[0].x=i[0],r[0].y=i[1],[2]):(a={},u={},r.forEach((function(t,e){o(t.x)||(t.x=Math.random()*s.width),o(t.y)||(t.y=Math.random()*s.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,[4,n.run(t,e)]):[2];case 1:return c.sent(),[2]}}))}))},e.prototype.run=function(t,e){return o_(this,void 0,void 0,(function(){var n,r,i,a,u,s,c,f,l,h,p,v,g,y,m,b,_,x,w,E,S,A,T,I,N,O,C=this;return a_(this,(function(k){switch(k.label){case 0:for(r=(n=this).nodes,i=n.edges,a=n.maxIteration,u=n.center,s=n.height*n.width,c=Math.sqrt(s)/10,f=s/(r.length+1),l=Math.sqrt(f),h=n.speed,p=n.clustering,D=[n.clusterField],M=r,R=[],P=D.length,G={},M.forEach((function(t){D.forEach((function(e,n){if(void 0===G[t[e]]&&(G[t[e]]=Object.keys(G).length),R.push(G[t[e]]),n===P-1)for(;R.length%4!=0;)R.push(0)}))})),v={array:new Float32Array(R),count:Object.keys(G).length},g=v.array,y=v.count,r.forEach((function(t,e){var n=0,r=0;o(t.fx)&&o(t.fy)&&(n=t.fx||.001,r=t.fy||.001),g[4*e+1]=n,g[4*e+2]=r})),m=r.length,b=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var u=e[o],s=d(u,"source"),c=d(u,"target");r[i[s]].push(i[c]),r[i[c]].push(i[s])}var f=0;for(o=0;o<t.length;o++){var l=n.length,h=r[o],p=h.length;n[4*o+2]=l,n[4*o+3]=h.length,f=Math.max(f,h.length);for(var v=0;v<p;++v){var g=h[v];n.push(+g)}}for(;n.length%4!=0;)n.push(0);return{maxEdgePerVetex:f,array:new Float32Array(n)}}(r,i),_=b.maxEdgePerVetex,x=b.array,w=n.workerEnabled,E=w?e_.create({canvas:t,engineOptions:{supportCompute:!0}}):e_.create({engineOptions:{supportCompute:!0}}),S=n.onLayoutEnd,A=[],T=0;T<y;T++)A.push(0,0,0,0);return I=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2<f32>;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\ndx = dx + param * std::sign;\\ndy = dy + param * std::sign;}}}}\\nreturn vec2<f32>(dx, dy);}\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2<f32>(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\ndx = dx - std::sign * attractiveF;\\ndy = dy - std::sign * attractiveF;}}}\\nreturn vec2<f32>(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([m,1,1]).setBinding({u_Data:x,u_K:l,u_K2:f,u_Gravity:n.gravity,u_ClusterGravity:n.clusterGravity||n.gravity||1,u_Speed:h,u_MaxDisplace:c,u_Clustering:p?1:0,u_Center:u,u_AttributeArray:g,u_ClusterCenters:A,MAX_EDGE_PER_VERTEX:_,VERTEX_COUNT:m}),p&&(N=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([y,1,1]).setBinding({u_Data:x,u_NodeAttributes:g,u_ClusterCenters:A,VERTEX_COUNT:m,CLUSTER_COUNT:y})),O=function(){return o_(C,void 0,void 0,(function(){var n,i;return a_(this,(function(o){switch(o.label){case 0:n=0,o.label=1;case 1:return n<a?[4,I.execute()]:[3,6];case 2:return o.sent(),p?(N.setBinding({u_Data:I}),[4,N.execute()]):[3,4];case 3:o.sent(),I.setBinding({u_ClusterCenters:N}),o.label=4;case 4:I.setBinding({u_MaxDisplace:c*=.99}),o.label=5;case 5:return n++,[3,1];case 6:return[4,I.getOutput()];case 7:return i=o.sent(),t?e.postMessage({type:Nt,vertexEdgeData:i}):r.forEach((function(t,e){var n=i[4*e],r=i[4*e+1];t.x=n,t.y=r})),S&&S(),[2]}}))}))},[4,O()];case 1:return k.sent(),[2]}var D,M,R,P,G}))}))},e.prototype.getType=function(){return"fruchterman-gpu"},e}(t),s_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c_=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},f_=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},l_=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return s_(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return c_(this,void 0,void 0,(function(){var t,e,n,r,i;return f_(this,(function(a){switch(a.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(e,n){o(e.x)||(e.x=Math.random()*t.width),o(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=i,t.nodeStrength=n_(t.nodeStrength,1),t.edgeStrength=n_(t.edgeStrength,1),[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return a.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){var n=this,r=n.nodes,i=n.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=i[0],void(r[0].y=i[1]);var a={},u={};r.forEach((function(t,e){o(t.x)||(t.x=Math.random()*n.width),o(t.y)||(t.y=Math.random()*n.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,n.nodeStrength=n_(n.nodeStrength,1),n.edgeStrength=n_(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return c_(this,void 0,void 0,(function(){var n,r,i,a,u,s,c,f,l,p,v,g,y,m,b,_,x,w,E,S,A,T,I,N,O,C,k,D=this;return f_(this,(function(M){switch(M.label){case 0:for(r=(n=this).nodes,i=n.edges,a=n.maxIteration,n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),u=r.length,n.linkDistance=n_(n.linkDistance),n.edgeStrength=n_(n.edgeStrength),s=function(t,e,n,r){var i=[],o=[],a={},u=0;for(u=0;u<t.length;u++){var s=t[u];a[s.id]=u,i.push(s.x),i.push(s.y),i.push(0),i.push(0),o.push([])}for(u=0;u<e.length;u++){var c=e[u],f=d(c,"source"),l=d(c,"target");o[a[f]].push(a[l]),o[a[f]].push(n(c)),o[a[f]].push(r(c)),o[a[f]].push(0),o[a[l]].push(a[f]),o[a[l]].push(n(c)),o[a[l]].push(r(c)),o[a[l]].push(0)}var h=0;for(u=0;u<t.length;u++){var p=i.length,v=o[u],g=v.length;i[4*u+2]=p+1048576*g/4,i[4*u+3]=0,h=Math.max(h,g/4);for(var y=0;y<g;++y){var m=v[y];i.push(+m)}}for(;i.length%4!=0;)i.push(0);return{maxEdgePerVetex:h,array:new Float32Array(i)}}(r,i,n.linkDistance,n.edgeStrength),c=s.maxEdgePerVetex,f=s.array,n.degrees=h(r.length,n.nodeIdxMap,i),l=[],p=[],v=[],g=[],y=[],m=[],b=[],n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),_=n.gravity,x=n.center,r.forEach((function(t,e){l.push(n.getMass(t)),p.push(n.nodeStrength(t)),n.degrees[e]||(n.degrees[e]=0);var r=[x[0],x[1],_];if(n.getCenter){var i=n.getCenter(t,n.degrees[e]);i&&o(i[0])&&o(i[1])&&o(i[2])&&(r=i)}v.push(r[0]),g.push(r[1]),y.push(r[2]),o(t.fx)&&o(t.fy)?(m.push(t.fx||.001),b.push(t.fy||.001)):(m.push(0),b.push(0))})),w=r_([l,n.degrees,p,m]),E=r_([v,g,y,b]),S=n.workerEnabled,A=S?e_.create({canvas:t,engineOptions:{supportCompute:!0}}):e_.create({engineOptions:{supportCompute:!0}}),T=n.onLayoutEnd,I=[],f.forEach((function(t){I.push(t)})),N=0;N<4;N++)I.push(0);return O=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2<f32>(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.z;\\nvar ay : f32 = vy * attributes2.z;\\nreturn vec2<f32>(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2<f32>(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([u,1,1]).setBinding({u_Data:f,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:w,u_NodeAttributeArray2:E,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:u,u_AveMovement:I,u_interval:n.interval}),C=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([1,1,1]).setBinding({u_Data:f,VERTEX_COUNT:u,u_AveMovement:[0,0,0,0]}),k=function(){return c_(D,void 0,void 0,(function(){var i,o,u;return f_(this,(function(s){switch(s.label){case 0:i=0,s.label=1;case 1:return i<a?[4,O.execute()]:[3,5];case 2:return s.sent(),C.setBinding({u_Data:O}),[4,C.execute()];case 3:s.sent(),o=Math.max(.02,n.interval-.002*i),O.setBinding({u_interval:o,u_AveMovement:C}),s.label=4;case 4:return i++,[3,1];case 5:return[4,O.getOutput()];case 6:return u=s.sent(),t?e.postMessage({type:Nt,vertexEdgeData:u}):r.forEach((function(t,e){var n=u[4*e],r=u[4*e+1];t.x=n,t.y=r})),T&&T(),[2]}}))}))},[4,k()];case 1:return M.sent(),[2]}}))}))},e.prototype.getType=function(){return"gForce-gpu"},e}(t),d_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h_=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return d_(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,i=t.velocityDecay,a=t.comboMap;t.previousLayouted||t.initPos(a);for(var u=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){o(t.x)&&o(t.y)&&(t.x+=r[e].x*i,t.y+=r[e].y*i)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)u();var c=[0,0];e.forEach((function(t){o(t.x)&&o(t.y)&&(c[0]+=t.x,c[1]+=t.y)})),c[0]/=e.length,c[1]/=e.length;var f=[r[0]-c[0],r[1]-c[1]];e.forEach((function(t,e){o(t.x)&&o(t.y)&&(t.x+=f[0],t.y+=f[1])})),t.combos.forEach((function(t){var e=a[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this,e=t.edges,n=t.nodes,r=t.combos,a={},u={},s={};n.forEach((function(t,e){u[t.id]=t,s[t.id]=e})),t.nodeMap=u,t.indexMap=s;var c={};r.forEach((function(t){c[t.id]=t})),t.oriComboMap=c,t.comboMap=t.getComboMap();var l=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||l,t.preventNodeOverlap=t.preventNodeOverlap||l;var h=t.collideStrength;h&&(t.comboCollideStrength=h,t.nodeCollideStrength=h),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(var p=0;p<e.length;++p){var v=d(e[p],"source"),g=d(e[p],"target");a[v]?a[v]++:a[v]=1,a[g]?a[g]++:a[g]=1}var y=[];for(p=0;p<e.length;++p)v=d(e[p],"source"),g=d(e[p],"target"),y[p]=a[v]/(a[v]+a[g]);this.bias=y;var b,_,x=t.nodeSize,w=t.nodeSpacing;if(_=o(w)?function(){return w}:m(w)?w:function(){return 0},this.nodeSpacing=_,x)if(m(x))b=function(t){return x(t)};else if(i(x)){var E=(x[0]>x[1]?x[0]:x[1])/2;b=function(t){return E}}else{var S=x/2;b=function(t){return S}}else b=function(t){return t.size?i(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=b;var A,T=t.comboSpacing;A=o(T)?function(){return T}:m(T)?T:function(){return 0},this.comboSpacing=A;var I,N=t.comboPadding;I=o(N)?function(){return N}:i(N)?function(){return Math.max.apply(null,N)}:m(N)?N:function(){return 0},this.comboPadding=I;var O,C=this.linkDistance;C||(C=10),O=o(C)?function(t){return C}:C,this.linkDistance=O;var k,D=this.edgeStrength;D||(D=1),k=o(D)?function(t){return D}:D,this.edgeStrength=k;var M,R=this.nodeStrength;R||(R=30),M=o(R)?function(t){return R}:R,this.nodeStrength=M},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,i=t[r];r&&i?(e.x=i.cx+100/(n+1),e.y=i.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,i={};return(n||[]).forEach((function(n){var a=[];y(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===i[n.id]){var u={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};i[n.id]=u}var s=n.children;s&&s.forEach((function(t){if(!i[t.id]&&!e[t.id])return!0;a.push(t)}));var c=i[n.id];if(c.cx=0,c.cy=0,0===a.length){c.empty=!0;var f=r[n.id];c.cx=f.x,c.cy=f.y}return a.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=i[t.id];return o(n.cx)&&(c.cx+=n.cx),void(o(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(o(r.x)&&(c.cx+=r.x),o(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=a,!0}))})),i},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,i=this.alpha,a=e.comboTrees,u=e.indexMap,s=e.nodeMap,c=e.comboMap;(a||[]).forEach((function(e){y(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],a=(n.depth+1)/10*.5,f=n.cx,l=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var d=c[e.id];return d&&o(d.cx)&&(n.cx+=d.cx),void(d&&o(d.cy)&&(n.cy+=d.cy))}var h=s[e.id],p=h.x-f||.005,v=h.y-l||.005,g=Math.sqrt(p*p+v*v),y=u[h.id],m=r*i/g*a;t[y].x-=p*m,t[y].y-=v*m,o(h.x)&&(n.cx+=h.x),o(h.y)&&(n.cy+=h.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,i={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(e<r)){var o=t.x-n.x||.005,a=t.y-n.y||.005,u=o*o+a*a,s=Math.sqrt(u);u<1&&(u=s),i["".concat(t.id,"-").concat(n.id)]={vx:o,vy:a,vl2:u,vl:s},i["".concat(n.id,"-").concat(t.id)]={vl2:u,vl:s,vx:-o,vy:-a}}}))})),e.updateComboSizes(n),e.calRepulsive(t,i),e.calAttractive(t,i),e.preventComboOverlap&&e.comboNonOverlapping(t,n)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,r=e.nodeMap,o=e.nodeSize,a=e.comboSpacing,u=e.comboPadding;(n||[]).forEach((function(n){var s=[];y(n,(function(n){if("node"===n.itemType)return!0;var c=t[n.id];if(!c)return!1;var f=n.children;f&&f.forEach((function(e){(t[e.id]||r[e.id])&&s.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=r[t.id];if(!e)return!0;var n=o(e),i=e.x-n,a=e.y-n,u=e.x+n,s=e.y+n;c.minX>i&&(c.minX=i),c.minY>a&&(c.minY=a),c.maxX<u&&(c.maxX=u),c.maxY<s&&(c.maxY=s)}));var l=e.oriComboMap[n.id].size||10;i(l)&&(l=l[0]);var d=Math.max(c.maxX-c.minX,c.maxY-c.minY,l);return c.r=d/2+a(c)/2+u(c),!0}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this,r=n.comboTree,i=n.comboCollideStrength,o=n.indexMap,a=n.nodeMap;y(r,(function(n){if(!e[n.id]&&!a[n.id]&&"comboTreeRoot"!==n.id)return!1;var r=n.children;return r&&r.length>1&&r.forEach((function(n,u){if("node"===n.itemType)return!1;var s=e[n.id];s&&r.forEach((function(r,c){if(u<=c)return!1;if("node"===r.itemType)return!1;var f=e[r.id];if(!f)return!1;var l=s.cx-f.cx||.005,d=s.cy-f.cy||.005,h=l*l+d*d,p=s.r||1,v=f.r||1,g=p+v,y=v*v,m=p*p;if(h<g*g){var b=n.children;if(!b||0===b.length)return!1;var _=r.children;if(!_||0===_.length)return!1;var x=Math.sqrt(h),w=(g-x)/x*i,E=l*w,S=d*w,A=y/(m+y),T=1-A;b.forEach((function(e){if("node"!==e.itemType)return!1;if(a[e.id]){var n=o[e.id];_.forEach((function(e){if("node"!==e.itemType)return!1;if(!a[e.id])return!1;var r=o[e.id];t[n].x+=E*A,t[n].y+=S*A,t[r].x-=E*T,t[r].y-=S*T}))}}))}}))})),!0}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,i=n.width*n.optimizeRangeFactor,o=n.nodeStrength,a=n.alpha,u=n.nodeCollideStrength,s=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,d=n.center;r.forEach((function(h,p){if(h.x&&h.y){if(d){var v=n.gravity,g=h.x-d[0]||.005,y=h.y-d[1]||.005,m=Math.sqrt(g*g+y*y);t[p].x-=g*v*a/m,t[p].y-=y*v*a/m}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var d=e["".concat(h.id,"-").concat(n.id)],v=d.vl2,g=d.vl;if(!(g>i)){var y=e["".concat(h.id,"-").concat(n.id)],m=y.vx,b=y.vy,_=Math.log(Math.abs(n.depth-h.depth)/10)+1||1;_=_<1?1:_,n.comboId!==h.comboId&&(_+=1);var x=_?Math.pow(l,_):1,w=o(n)*a/v*x;if(t[p].x+=m*w,t[p].y+=b*w,p<r&&s){var E=c(h)+f(h)||1,S=c(n)+f(n)||1,A=E+S;if(v<A*A){var T=(A-g)/g*u,I=S*S,N=I/(E*E+I),O=m*T,C=b*T;t[p].x+=O*N,t[p].y+=C*N,N=1-N,t[r].x-=O*N,t[r].y-=C*N}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.edges,i=n.linkDistance,a=n.alpha,u=n.edgeStrength,s=n.bias,c=n.depthAttractiveForceScale;r.forEach((function(r,f){var l=d(r,"source"),h=d(r,"target");if(l&&h&&l!==h){var p=n.indexMap[l],v=n.indexMap[h],g=n.nodeMap[l],y=n.nodeMap[h];if(g&&y){var m=g.depth===y.depth?0:Math.log(Math.abs(g.depth-y.depth)/10);g.comboId===y.comboId&&(m/=2);var b=m?Math.pow(c,m):1;if(g.comboId!==y.comboId&&1===b?b=c/2:g.comboId===y.comboId&&(b=2),o(y.x)&&o(g.x)&&o(y.y)&&o(g.y)){var _=e["".concat(h,"-").concat(l)],x=_.vl,w=_.vx,E=_.vy,S=(x-i(r))/x*a*u(r)*b,A=w*S,T=E*S,I=s[f];t[v].x-=A*I,t[v].y-=T*I,t[p].x+=A*(1-I),t[p].y+=T*(1-I)}}}}))},e.prototype.getType=function(){return"comboForce"},e}(t),p_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v_=function(){return v_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},v_.apply(this,arguments)},g_=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodes=[],n.edges=[],n.combos=[],n.comboEdges=[],n.comboPadding=10,n.comboTrees=[],n.updateCfg(e),n}return p_(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t,e=this,n=e.nodes,r=e.edges,i=e.combos,o=e.comboEdges,a=e.center,u=e.getInnerGraphs(),s={};n.forEach((function(t){s[t.id]=t}));var c={};i.forEach((function(t){c[t.id]=t}));var f=[],l=[],d={},h=!0;this.comboTrees.forEach((function(t){var e=u[t.id],n=v_(v_({},t),{x:e.x||c[t.id].x,y:e.y||c[t.id].y,fx:e.fx||c[t.id].fx,fy:e.fy||c[t.id].fy,mass:e.mass||c[t.id].mass,size:e.size});l.push(n),isNaN(n.x)||0===n.x||isNaN(n.y)||0===n.y?(n.x=100*Math.random(),n.y=100*Math.random()):h=!1,f.push(t.id),y(t,(function(e){return e.id!==t.id&&(d[e.id]=t.id),!0}))})),n.forEach((function(t){if(!t.comboId||!c[t.comboId]){var e=v_({},t);l.push(e),isNaN(e.x)||0===e.x||isNaN(e.y)||0===e.y?(e.x=100*Math.random(),e.y=100*Math.random()):h=!1,f.push(t.id)}}));var p=[];if(r.concat(o).forEach((function(t){var e=d[t.source]||t.source,n=d[t.target]||t.target;e!==n&&f.includes(e)&&f.includes(n)&&p.push({source:e,target:n})})),null==l?void 0:l.length){if(1===l.length)l[0].x=a[0],l[0].y=a[1];else{var v={nodes:l,edges:p},g=this.outerLayout||new D({gravity:1,factor:2,linkDistance:function(t,e,n){var r,i,o=(((null===(r=e.size)||void 0===r?void 0:r[0])||30)+((null===(i=n.size)||void 0===i?void 0:i[0])||30))/2;return Math.min(1.5*o,700)}}),m=null===(t=g.getType)||void 0===t?void 0:t.call(g);g.updateCfg({center:a,kg:5,preventOverlap:!0,animate:!1}),h&&Ot[m]&&(l.length<100?new Nf:new I).layout(v),g.layout(v)}l.forEach((function(t){var e=u[t.id];if(e)e.visited=!0,e.x=t.x,e.y=t.y,e.nodes.forEach((function(e){e.x+=t.x,e.y+=t.y}));else{var n=s[t.id];n&&(n.x=t.x,n.y=t.y)}}))}for(var b=Object.keys(u),_=function(t){var e=b[t],n=u[e];if(!n)return"continue";n.nodes.forEach((function(t){n.visited||(t.x+=n.x||0,t.y+=n.y||0),s[t.id]&&(s[t.id].x=t.x,s[t.id].y=t.y)})),c[e]&&(c[e].x=n.x,c[e].y=n.y)},x=b.length-1;x>=0;x--)_(x);return{nodes:n,edges:r,combos:i,comboEdges:o}},e.prototype.getInnerGraphs=function(){var t=this,e=t.comboTrees,n=t.nodeSize,r=t.edges,a=t.comboPadding,u=t.spacing,s={},c=this.innerLayout||new Tf({sortBy:"id"});return c.center=[0,0],c.preventOverlap=!0,c.nodeSpacing=u,(e||[]).forEach((function(t){y(t,(function(t){var e,u=(null==a?void 0:a(t))||10;if(i(u)&&(u=Math.max.apply(Math,u)),null===(e=t.children)||void 0===e?void 0:e.length){var f=t.children.map((function(t){return"combo"===t.itemType?s[t.id]:v_({},t)})),l=f.map((function(t){return t.id})),d={nodes:f,edges:r.filter((function(t){return l.includes(t.source)&&l.includes(t.target)}))},h=1/0;f.forEach((function(t){var e;t.size||(t.size=(null===(e=s[t.id])||void 0===e?void 0:e.size)||(null==n?void 0:n(t))||[30,30]),o(t.size)&&(t.size=[t.size,t.size]),h>t.size[0]&&(h=t.size[0]),h>t.size[1]&&(h=t.size[1])})),c.layout(d);var p=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;return t.forEach((function(t){e>t.x&&(e=t.x),n>t.y&&(n=t.y),r<t.x&&(r=t.x),i<t.y&&(i=t.y)})),{minX:e,minY:n,maxX:r,maxY:i}}(f),v=p.minX,g=p.minY,y=p.maxX,m=p.maxY,b=Math.max(y-v,m-g,h)+2*u;s[t.id]={id:t.id,nodes:f,size:[b,b]}}else if("combo"===t.itemType){var _=u?[2*u,2*u]:[30,30];s[t.id]={id:t.id,nodes:[],size:_}}return!0}))})),s},e.prototype.initVals=function(){var t,e,n=this,r=n.nodeSize,a=n.spacing;if(e=o(a)?function(){return a}:m(a)?a:function(){return 0},this.spacing=e,r)if(m(r))t=function(t){var n=r(t),o=e(t);return i(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+o)/2:((n||10)+o)/2};else if(i(r)){var u=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return u+e(t)/2}}else{var s=r/2;t=function(t){return s+e(t)/2}}else t=function(t){var n=e(t);return t.size?i(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+n)/2:f(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+n)/2:(t.size+n)/2:10+n/2};this.nodeSize=t;var c,l=n.comboPadding;c=o(l)?function(){return l}:i(l)?function(){return Math.max.apply(null,l)}:m(l)?l:function(){return 0},this.comboPadding=c},e.prototype.getType=function(){return"comboCombined"},e}(t),y_=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();const m_=y_;const b_=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();var __=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t)))},t}();const x_=__;var w_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E_=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return w_(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,a=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var u=[],s=e.length,c=0;c<s;c+=1){var l=e[c],d=10,h=10;o(l.size)&&(d=l.size,h=l.size),i(l.size)?(isNaN(l.size[0])||(d=l.size[0]),isNaN(l.size[1])||(h=l.size[1])):f(l.size)&&(d=l.size.width,h=l.size.height),t.getWidth&&!isNaN(t.getWidth(l))&&(h=t.getWidth(l)),t.getHeight&&!isNaN(t.getHeight(l))&&(d=t.getHeight(l));var p=Math.max(d,h);u.push(p)}void 0===t.barnesHut&&s>250&&(t.barnesHut=!0),void 0===t.prune&&s>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(a=100,s<=200&&s>100?a=500:s>200&&(a=950),this.maxIteration=a):(a=250,s<=200&&s>100?a=1e3:s>200&&(a=1200),this.maxIteration=a),t.kr||(t.kr=50,s>100&&s<=500?t.kr=20:s>500&&(t.kr=1)),t.kg||(t.kg=20,s>100&&s<=500?t.kg=10:s>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(u),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,i=e.nodes,o=n.filter((function(t){return d(t,"source")!==d(t,"target")})),a=i.length,u=o.length,s=[],c={},f={},l=[],h=0;h<a;h+=1)c[i[h].id]=h,s[h]=0,(void 0===i[h].x||isNaN(i[h].x))&&(i[h].x=1e3*Math.random()),(void 0===i[h].y||isNaN(i[h].y))&&(i[h].y=1e3*Math.random()),l.push({x:i[h].x,y:i[h].y});for(h=0;h<u;h+=1){for(var p=void 0,v=void 0,g=0,y=0,m=0;m<a;m+=1){var b=d(o[h],"source"),_=d(o[h],"target");i[m].id===b?(p=i[m],g=m):i[m].id===_&&(v=i[m],y=m),f[h]={sourceIdx:g,targetIdx:y}}p&&(s[c[p.id]]+=1),v&&(s[c[v.id]]+=1)}var x=r;if(i=this.iterate(x,c,f,u,s,t),e.prune){for(m=0;m<u;m+=1)s[f[m].sourceIdx]<=1?(i[f[m].sourceIdx].x=i[f[m].targetIdx].x,i[f[m].sourceIdx].y=i[f[m].targetIdx].y):s[f[m].targetIdx]<=1&&(i[f[m].targetIdx].x=i[f[m].sourceIdx].x,i[f[m].targetIdx].y=i[f[m].sourceIdx].y);e.prune=!1,e.barnesHut=!1,x=100,i=this.iterate(x,c,f,u,s,t)}return i},e.prototype.iterate=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.kr,c=a.preventOverlap,f=a.barnesHut,l=u.length,d=0,h=t,p=[],v=[],g=[],y=0;y<l;y+=1)if(p[2*y]=0,p[2*y+1]=0,f){var m={id:y,rx:u[y].x,ry:u[y].y,mass:1,g:s,degree:i[y]};g[y]=new m_(m)}for(;h>0;){for(y=0;y<l;y+=1)v[2*y]=p[2*y],v[2*y+1]=p[2*y+1],p[2*y]=0,p[2*y+1]=0;p=this.getAttrForces(h,50,r,e,n,i,o,p),p=f&&(c&&h>50||!c)?this.getOptRepGraForces(p,g,i):this.getRepGraForces(h,50,p,100,o,i);var b=this.updatePos(p,v,d,i);u=b.nodes,d=b.sg,h--,a.tick&&a.tick()}return u},e.prototype.getAttrForces=function(t,e,n,r,i,o,a,u){for(var s=this,c=s.nodes,f=s.preventOverlap,l=s.dissuadeHubs,d=s.mode,h=s.prune,p=0;p<n;p+=1){var v=c[i[p].sourceIdx],g=i[p].sourceIdx,y=c[i[p].targetIdx],m=i[p].targetIdx;if(!h||!(o[g]<=1||o[m]<=1)){var b=[y.x-v.x,y.y-v.y],_=Math.hypot(b[0],b[1]);_=_<1e-4?1e-4:_,b[0]=b[0]/_,b[1]=b[1]/_,f&&t<e&&(_=_-a[g]-a[m]);var x=_,w=x;"linlog"===d&&(w=x=Math.log(1+_)),l&&(x=_/o[g],w=_/o[m]),f&&t<e&&_<=0?(x=0,w=0):f&&t<e&&_>0&&(x=_,w=_),u[2*r[v.id]]+=x*b[0],u[2*r[y.id]]-=w*b[0],u[2*r[v.id]+1]+=x*b[1],u[2*r[y.id]+1]-=w*b[1]}}return u},e.prototype.getRepGraForces=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.preventOverlap,c=a.kr,f=a.kg,l=a.center,d=a.prune,h=u.length,p=0;p<h;p+=1){for(var v=p+1;v<h;v+=1)if(!d||!(o[p]<=1||o[v]<=1)){var g=[u[v].x-u[p].x,u[v].y-u[p].y],y=Math.hypot(g[0],g[1]);y=y<1e-4?1e-4:y,g[0]=g[0]/y,g[1]=g[1]/y,s&&t<e&&(y=y-i[p]-i[v]);var m=c*(o[p]+1)*(o[v]+1)/y;s&&t<e&&y<0?m=r*(o[p]+1)*(o[v]+1):s&&t<e&&0===y?m=0:s&&t<e&&y>0&&(m=c*(o[p]+1)*(o[v]+1)/y),n[2*p]-=m*g[0],n[2*v]+=m*g[0],n[2*p+1]-=m*g[1],n[2*v+1]+=m*g[1]}var b=[u[p].x-l[0],u[p].y-l[1]],_=Math.hypot(b[0],b[1]);b[0]=b[0]/_,b[1]=b[1]/_;var x=f*(o[p]+1);n[2*p]-=x*b[0],n[2*p+1]-=x*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,i=r.nodes,o=r.kg,a=r.center,u=r.prune,s=i.length,c=9e10,f=-9e10,l=9e10,d=-9e10,h=0;h<s;h+=1)u&&n[h]<=1||(e[h].setPos(i[h].x,i[h].y),i[h].x>=f&&(f=i[h].x),i[h].x<=c&&(c=i[h].x),i[h].y>=d&&(d=i[h].y),i[h].y<=l&&(l=i[h].y));var p=Math.max(f-c,d-l),v=new b_({xmid:(f+c)/2,ymid:(d+l)/2,length:p,massCenter:a,mass:s}),g=new x_(v);for(h=0;h<s;h+=1)u&&n[h]<=1||e[h].in(v)&&g.insert(e[h]);for(h=0;h<s;h+=1)if(!(u&&n[h]<=1)){e[h].resetForce(),g.updateForce(e[h]),t[2*h]-=e[h].fx,t[2*h+1]-=e[h].fy;var y=[i[h].x-a[0],i[h].y-a[1]],m=Math.hypot(y[0],y[1]);m=m<1e-4?1e-4:m,y[0]=y[0]/m,y[1]=y[1]/m;var b=o*(n[h]+1);t[2*h]-=b*y[0],t[2*h+1]-=b*y[1]}return t},e.prototype.updatePos=function(t,e,n,r){for(var i=this,o=i.nodes,a=i.ks,u=i.tao,s=i.prune,c=i.ksmax,f=o.length,l=[],d=[],h=0,p=0,v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var g=[t[2*v]-e[2*v],t[2*v+1]-e[2*v+1]],y=Math.hypot(g[0],g[1]),m=[t[2*v]+e[2*v],t[2*v+1]+e[2*v+1]],b=Math.hypot(m[0],m[1]);l[v]=y,d[v]=b/2,h+=(r[v]+1)*l[v],p+=(r[v]+1)*d[v]}var _=n;for(n=u*p/h,0!==_&&(n=n>1.5*_?1.5*_:n),v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var x=a*n/(1+n*Math.sqrt(l[v])),w=Math.hypot(t[2*v],t[2*v+1]),E=c/(w=w<1e-4?1e-4:w),S=(x=x>E?E:x)*t[2*v],A=x*t[2*v+1];o[v].x+=S,o[v].y+=A}return{nodes:o,sg:n}},e}(t),S_=function(){return S_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},S_.apply(this,arguments)},A_=function(){function t(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return t.prototype.init=function(e,n,r){this.cells=[],this.CELL_W=r.CELL_W||t.DEFAULT_CELL_W,this.CELL_H=r.CELL_H||t.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(n/this.CELL_H),t.MIN_DIST=Math.pow(e,2)+Math.pow(n,2);for(var i=0;i<this.columnNum;i++){for(var o=[],a=0;a<this.rowNum;a++){var u={dx:i,dy:a,x:i*this.CELL_W,y:a*this.CELL_H,occupied:!1};o.push(u)}this.cells.push(o)}},t.prototype.findGridByNodeId=function(t){for(var e,n,r=0;r<this.columnNum;r++)for(var i=0;i<this.rowNum;i++)if(this.cells[r][i].node&&(null===(n=null===(e=this.cells[r][i])||void 0===e?void 0:e.node)||void 0===n?void 0:n.id)===t)return{column:r,row:i};return null},t.prototype.sqdist=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},t.prototype.occupyNearest=function(e){for(var n,r=t.MIN_DIST,i=null,o=0;o<this.columnNum;o++)for(var a=0;a<this.rowNum;a++)!this.cells[o][a].occupied&&(n=this.sqdist(e,this.cells[o][a]))<r&&(r=n,i=this.cells[o][a]);return i&&(i.occupied=!0),i},t.prototype.insertColumn=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++){this.cells[n+this.columnNum]=[];for(var r=0;r<this.rowNum;r++)this.cells[n+this.columnNum][r]={dx:n,dy:r,x:n*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null}}for(n=this.columnNum-1;n>t;n--)for(r=0;r<this.rowNum;r++)this.cells[n+e][r]=S_(S_({},this.cells[n][r]),{x:(n+e)*this.CELL_W,y:r*this.CELL_H}),this.cells[n][r]={x:n*this.CELL_W,y:r*this.CELL_H,occupied:!0,node:null};for(r=0;r<this.additionColumn.length;r++)this.additionColumn[r]>=t&&(this.additionColumn[r]+=e);for(n=0;n<e;n++)this.additionColumn.push(t+n+1);this.columnNum+=e}},t.prototype.insertRow=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++)for(var r=0;r<this.columnNum;r++)this.cells[r][n+this.rowNum]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(r=0;r<this.columnNum;r++)for(n=this.rowNum-1;n>t;n--)this.cells[r][n+e]=S_(S_({},this.cells[r][n]),{dx:r,dy:n+e,x:r*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[r][n]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n<this.additionRow.length;n++)this.additionRow[n]>=t&&(this.additionRow[n]+=e);for(r=0;r<e;r++)this.additionRow.push(t+r+1);this.rowNum+=e}},t.prototype.getNodes=function(){for(var t=[],e=0;e<this.columnNum;e++)for(var n=0;n<this.rowNum;n++)this.cells[e][n].node&&t.push(this.cells[e][n]);return t},t.MIN_DIST=50,t.DEFAULT_CELL_W=80,t.DEFAULT_CELL_H=80,t}();const T_=A_;var I_=1e7,N_=1.5707963267948966,O_=new Map,C_=.8;function k_(t,e){var n=(O_.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],i=e.size[0]*e.size[1],o=r>i?e:t,a=r>i?t:e,u=o.x-o.size[0]/2,s=o.y-o.size[1]/2,c=o.x+o.size[0]/2,f=o.y+o.size[1]/2,l=a.x-a.size[0]/2,d=a.y-a.size[1]/2,h=a.x+a.size[0]/2,p=a.y+a.size[1]/2,v=o.x,g=o.y,y=a.x,m=a.y,b=0,_=0;if(c>=l&&h>=u&&f>=d&&p>=s)0===(_=Math.sqrt(Math.pow(y-v,2)+Math.pow(m-g,2)))&&(_=1e-7),b=10/_*100+((c<h?c:h)-(u>l?u:l))*((f<p?f:p)-(s>d?s:d)),b*=I_;else{var x=!1,w=function(t,e,n){var r=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,u=e.x-e.size[0]/2,s=e.y-e.size[1]/2,c=e.x+e.size[0]/2,f=e.y+e.size[1]/2,l=t.x,d=t.y,h=e.x,p=e.y,v=h-l,g=Math.atan2(v,p-d),y=0,m=0,b=0,_=0;g>N_?(m=i-f,y=u-o,b=parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)),_=parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2))):b=_=0<g&&g<=N_?(m=s-a)>(y=u-o)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):g<-N_?(m=i-f)>(y=-(c-r))?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):(m=s-a)>(y=Math.abs(v)>(o-r)/2?r-c:v)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y&&0!==g?(y/Math.sin(g)).toFixed(2):m.toFixed(2));var x=parseFloat(g.toFixed(2)),w=n;return n&&(w=1.1780972450961724<x&&x<1.9634954084936207),{distance:Math.abs(b<_?b:_),isHoriz:w}}(o,a,x);_=w.distance,x=w.isHoriz,_<=10?b+=0!==_?n?10+1e7/_:10+1e8/_:I_:(b+=_,n&&(b+=_*_))}return b}function D_(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];(r.x<0||r.y<0||r.x>1200||r.y>800)&&(e+=1e12);for(var i=n+1;i<t.length;i++)e+=k_(r,t[i])}return e}function M_(t,e,n,r){var i=new Map;n.forEach((function(t,e){i.set(t.id,t)}));var o=r.filter((function(e){return e.source===t.id||e.target===t.id}))||[],a=[];o.forEach((function(e){var n=e.source===t.id?e.target:e.source,r=i.get(n);r&&a.push(r)}));for(var u=!0,s=0;s<a.length;s++){var c=a[s],f=180*Math.atan((t.y-c.y)/(c.x-t.y)),l=180*Math.atan((e.y-c.y)/(c.x-e.y)),d=f>70&&f<110,h=l>70&&l<110;if((f<30||f>150)&&!(l<30||l>150)||f*l<0){u=!1;break}if(d&&!h||f*l<0){u=!1;break}if((c.x-t.x)*(c.x-e.x)<0){u=!1;break}if((c.y-t.y)*(c.y-e.y)<0){u=!1;break}}return u}function R_(t,e){for(var n=!1,r=[10,-10,0,0],i=[0,0,10,-10],o=0;o<t.length;++o)for(var a=t[o],u=P_(a,t),s=0;s<r.length;s++)if(M_(a,{x:a.x+r[s],y:a.y+i[s]},t,e)){a.x+=r[s],a.y+=i[s];var c=P_(a,t),f=Math.random();c<u||f<C_&&f>.1?(u=c,n=!0):(a.x-=r[s],a.y-=i[s])}return C_>.1&&(C_*=.5),n?D_(t):0}function P_(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>1200||t.y+t.size[1]+20>800)&&(n+=1e12);for(var r=0;r<e.length;++r)t.id!==e[r].id&&(n+=k_(t,e[r]));return n}var G_=function(){return G_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},G_.apply(this,arguments)};function L_(t,e){var n=t.nodes,r=t.edges,i=e.width,o=e.height;if(!(null==n?void 0:n.length))return Promise.resolve();var a=[];n.forEach((function(t){if(r.filter((function(e){return e.source===t.id||e.target===t.id})).length>1){var e=G_({},t);delete e.size,a.push(e)}}));var u=[];r.forEach((function(t){var e=a.find((function(e){return e.id===t.source})),n=a.find((function(e){return e.id===t.target}));e&&n&&u.push(t)}));var s=new $n({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:a,edges:u}).nodes;n.forEach((function(t){var e=(s||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||i/2,t.y=(null==e?void 0:e.y)||o/2}));var c=JSON.parse(JSON.stringify(n)),f=JSON.parse(JSON.stringify(r)),l=yt().nodes(c).force("link",wt(f).id((function(t){return t.id})).distance((function(t){return u.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",mt()).force("center",bt(i/2,o/2)).force("x",Tt(i/2)).force("y",It(o/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),d=new Promise((function(t){l.on("end",(function(){n.forEach((function(t){var e=c.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var a=Math.min.apply(Math,n.map((function(t){return t.x}))),u=Math.max.apply(Math,n.map((function(t){return t.x}))),s=Math.min.apply(Math,n.map((function(t){return t.y}))),f=Math.max.apply(Math,n.map((function(t){return t.y}))),l=i/(u-a),d=o/(f-s);n.forEach((function(t){void 0!==t.x&&l<1&&(t.x=(t.x-a)*l),void 0!==t.y&&d<1&&(t.y=(t.y-s)*d)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),function(t,e){if(0===t.length)return{nodes:t,edges:e};t.forEach((function(t){var n=e.filter((function(e){return e.source===t.id||e.target===t.id}));O_.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=O_.get(t.id))||void 0===n?void 0:n.length)-(null===(r=O_.get(e.id))||void 0===r?void 0:r.length)}));for(var n=D_(t),r=20,i=1,o=0,a=0;r>0&&!(++a>=50);){var u=R_(t,e);0!==u&&(o=u),i=o-n,n=o,0===i?--r:r=20}t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}))}(n,r),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,i=e.nodeMinGap,o=1e4,a=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;o=Math.min(e,o),a=Math.min(n,a)}));var u=new T_;u.init(n,r,{CELL_H:a,CELL_W:o}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var s=0;s<t.nodes.length;s++){var c=t.nodes[s],f=u.findGridByNodeId(c.id);if(!f)throw new Error("can not find node cell");var l=f.column,d=f.row;if(c.size[0]+i>o){for(var h=v=Math.ceil((c.size[0]+i)/o)-1,p=0;p<v&&u.additionColumn.indexOf(l+p+1)>-1&&!u.cells[l+p+1][d].node;p++)h--;u.insertColumn(l,h)}if(c.size[1]+i>a){var v;for(h=v=Math.ceil((c.size[1]+i)/a)-1,p=0;p<v&&u.additionRow.indexOf(d+p+1)>-1&&!u.cells[l][d+p+1].node;p++)h--;u.insertRow(d,h)}}for(s=0;s<u.columnNum;s++){var g=function(e){var n=u.cells[s][e];if(n.node){var r=t.nodes.find((function(t){var e;return t.id===(null===(e=null==n?void 0:n.node)||void 0===e?void 0:e.id)}));r&&(r.x=n.x+r.size[0]/2,r.y=n.y+r.size[1]/2)}};for(p=0;p<u.rowNum;p++)g(p)}}({nodes:n,edges:r},e),t()}))}));return d}var j_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),U_=function(t){function e(e){var n=t.call(this)||this;return n.width=300,n.height=300,n.nodeMinGap=50,n.onLayoutEnd=function(){},e&&n.updateCfg(e),n}return j_(e,t),e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;return null==e||e.forEach((function(t){t.size||(t.size=[50,50])})),L_({nodes:e,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then((function(){t.onLayoutEnd&&t.onLayoutEnd()}))},e.prototype.getType=function(){return"er"},e}(t),F_=function(){function t(t){var e=A(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.layoutInstance.init(t)},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}(),B_={force:kt,fruchterman:Cf,forceAtlas2:E_,gForce:D,dagre:$n,dagreCompound:qc,circular:Pt,radial:Sf,concentric:Tf,grid:I,mds:Nf,comboForce:h_,comboCombined:g_,random:O,"gForce-gpu":l_,"fruchterman-gpu":u_,er:U_}})(),r})()}));
3
3
  //# sourceMappingURL=layout.min.js.map