data-structure-typed 1.38.1 → 1.38.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 (763) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +1 -1
  3. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
  4. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  5. package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.d.ts +9 -9
  6. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
  7. package/{lib → dist/cjs}/data-structures/binary-tree/bst.d.ts +4 -4
  8. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
  9. package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
  10. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
  11. package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
  12. package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +1 -0
  13. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -0
  14. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -0
  15. package/dist/cjs/data-structures/graph/index.js.map +1 -0
  16. package/dist/cjs/data-structures/graph/map-graph.js.map +1 -0
  17. package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
  18. package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
  19. package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
  20. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
  21. package/dist/cjs/data-structures/hash/hash-table.js.map +1 -0
  22. package/dist/cjs/data-structures/hash/index.js.map +1 -0
  23. package/dist/cjs/data-structures/hash/tree-map.js.map +1 -0
  24. package/dist/cjs/data-structures/hash/tree-set.js.map +1 -0
  25. package/dist/cjs/data-structures/heap/heap.js.map +1 -0
  26. package/dist/cjs/data-structures/heap/index.js.map +1 -0
  27. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -0
  28. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -0
  29. package/dist/cjs/data-structures/index.js.map +1 -0
  30. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  31. package/dist/cjs/data-structures/linked-list/index.js.map +1 -0
  32. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -0
  33. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -0
  34. package/dist/cjs/data-structures/matrix/index.js.map +1 -0
  35. package/dist/cjs/data-structures/matrix/matrix.js.map +1 -0
  36. package/{lib → dist/cjs}/data-structures/matrix/matrix2d.js +13 -5
  37. package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
  38. package/dist/cjs/data-structures/matrix/navigator.js.map +1 -0
  39. package/dist/cjs/data-structures/matrix/vector2d.js.map +1 -0
  40. package/dist/cjs/data-structures/priority-queue/index.js.map +1 -0
  41. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  42. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  43. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -0
  44. package/dist/cjs/data-structures/queue/deque.js.map +1 -0
  45. package/dist/cjs/data-structures/queue/index.js.map +1 -0
  46. package/dist/cjs/data-structures/queue/queue.js.map +1 -0
  47. package/dist/cjs/data-structures/stack/index.js.map +1 -0
  48. package/dist/cjs/data-structures/stack/stack.js.map +1 -0
  49. package/dist/cjs/data-structures/tree/index.js.map +1 -0
  50. package/dist/cjs/data-structures/tree/tree.js.map +1 -0
  51. package/dist/cjs/data-structures/trie/index.js.map +1 -0
  52. package/dist/cjs/data-structures/trie/trie.js.map +1 -0
  53. package/dist/cjs/index.js.map +1 -0
  54. package/dist/cjs/interfaces/binary-tree.js.map +1 -0
  55. package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
  56. package/dist/{interfaces → cjs/interfaces}/graph.js.map +1 -1
  57. package/dist/{interfaces → cjs/interfaces}/heap.js.map +1 -1
  58. package/dist/cjs/interfaces/index.js.map +1 -0
  59. package/dist/{interfaces → cjs/interfaces}/navigator.js.map +1 -1
  60. package/dist/cjs/interfaces/priority-queue.js.map +1 -0
  61. package/dist/cjs/interfaces/segment-tree.js.map +1 -0
  62. package/dist/cjs/interfaces/singly-linked-list.js.map +1 -0
  63. package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +1 -0
  64. package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  65. package/{lib → dist/cjs}/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  66. package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -0
  67. package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
  68. package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -0
  69. package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +1 -0
  70. package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +1 -0
  71. package/dist/cjs/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
  72. package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +1 -0
  73. package/dist/cjs/types/data-structures/graph/directed-graph.js.map +1 -0
  74. package/dist/cjs/types/data-structures/graph/index.js.map +1 -0
  75. package/dist/cjs/types/data-structures/graph/map-graph.js.map +1 -0
  76. package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +1 -0
  77. package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +1 -0
  78. package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
  79. package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
  80. package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
  81. package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
  82. package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -0
  83. package/dist/cjs/types/data-structures/hash/tree-set.js.map +1 -0
  84. package/dist/cjs/types/data-structures/heap/heap.js.map +1 -0
  85. package/dist/cjs/types/data-structures/heap/index.js.map +1 -0
  86. package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
  87. package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -0
  88. package/dist/cjs/types/data-structures/index.js.map +1 -0
  89. package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  90. package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -0
  91. package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
  92. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
  93. package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
  94. package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -0
  95. package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +1 -0
  96. package/dist/cjs/types/data-structures/matrix/navigator.js.map +1 -0
  97. package/dist/cjs/types/data-structures/matrix/vector2d.js.map +1 -0
  98. package/dist/cjs/types/data-structures/priority-queue/index.js.map +1 -0
  99. package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  100. package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  101. package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +1 -0
  102. package/dist/cjs/types/data-structures/queue/deque.js.map +1 -0
  103. package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
  104. package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
  105. package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
  106. package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
  107. package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
  108. package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
  109. package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
  110. package/dist/cjs/types/data-structures/trie/trie.js.map +1 -0
  111. package/{lib → dist/cjs}/types/helpers.d.ts +1 -1
  112. package/dist/cjs/types/helpers.js.map +1 -0
  113. package/dist/cjs/types/index.js.map +1 -0
  114. package/dist/cjs/types/utils/index.js.map +1 -0
  115. package/dist/{types → cjs/types}/utils/utils.js.map +1 -1
  116. package/dist/cjs/types/utils/validate-type.js.map +1 -0
  117. package/dist/cjs/utils/index.js.map +1 -0
  118. package/dist/cjs/utils/utils.js.map +1 -0
  119. package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.js +10 -4
  120. package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.js +12 -3
  121. package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.d.ts +9 -9
  122. package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.js +66 -49
  123. package/dist/{data-structures → mjs/data-structures}/binary-tree/bst.d.ts +4 -4
  124. package/{lib → dist/mjs}/data-structures/binary-tree/bst.js +42 -40
  125. package/dist/mjs/data-structures/binary-tree/index.js +23 -0
  126. package/dist/mjs/data-structures/binary-tree/rb-tree.js +28 -0
  127. package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.js +17 -10
  128. package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.js +19 -13
  129. package/{lib → dist/mjs}/data-structures/graph/abstract-graph.js +29 -24
  130. package/{lib → dist/mjs}/data-structures/graph/directed-graph.js +22 -14
  131. package/dist/mjs/data-structures/graph/index.js +20 -0
  132. package/{lib → dist/mjs}/data-structures/graph/map-graph.js +14 -5
  133. package/{lib → dist/mjs}/data-structures/graph/undirected-graph.js +19 -13
  134. package/{lib → dist/mjs}/data-structures/hash/coordinate-map.js +6 -2
  135. package/{lib → dist/mjs}/data-structures/hash/coordinate-set.js +6 -2
  136. package/{lib → dist/mjs}/data-structures/hash/hash-map.js +11 -1
  137. package/{lib → dist/mjs}/data-structures/hash/hash-table.js +16 -4
  138. package/dist/mjs/data-structures/hash/index.js +22 -0
  139. package/dist/mjs/data-structures/hash/tree-map.js +6 -0
  140. package/dist/mjs/data-structures/hash/tree-set.js +6 -0
  141. package/{lib → dist/mjs}/data-structures/heap/heap.js +23 -7
  142. package/dist/mjs/data-structures/heap/index.js +19 -0
  143. package/{lib → dist/mjs}/data-structures/heap/max-heap.js +6 -2
  144. package/{lib → dist/mjs}/data-structures/heap/min-heap.js +6 -2
  145. package/dist/mjs/data-structures/index.js +27 -0
  146. package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.js +15 -6
  147. package/dist/mjs/data-structures/linked-list/index.js +19 -0
  148. package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.js +12 -2
  149. package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.js +14 -2
  150. package/dist/mjs/data-structures/matrix/index.js +20 -0
  151. package/{lib → dist/mjs}/data-structures/matrix/matrix.js +6 -1
  152. package/dist/{data-structures → mjs/data-structures}/matrix/matrix2d.js +5 -2
  153. package/{lib → dist/mjs}/data-structures/matrix/navigator.js +14 -2
  154. package/{lib → dist/mjs}/data-structures/matrix/vector2d.js +9 -2
  155. package/dist/mjs/data-structures/priority-queue/index.js +19 -0
  156. package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.js +6 -2
  157. package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.js +6 -2
  158. package/dist/mjs/data-structures/priority-queue/priority-queue.js +17 -0
  159. package/{lib → dist/mjs}/data-structures/queue/deque.js +21 -22
  160. package/dist/mjs/data-structures/queue/index.js +18 -0
  161. package/{lib → dist/mjs}/data-structures/queue/queue.js +11 -5
  162. package/dist/mjs/data-structures/stack/index.js +17 -0
  163. package/{lib → dist/mjs}/data-structures/stack/stack.js +6 -1
  164. package/dist/mjs/data-structures/tree/index.js +17 -0
  165. package/{lib → dist/mjs}/data-structures/tree/tree.js +8 -1
  166. package/dist/mjs/data-structures/trie/index.js +17 -0
  167. package/{lib → dist/mjs}/data-structures/trie/trie.js +12 -2
  168. package/dist/mjs/index.js +20 -0
  169. package/dist/mjs/interfaces/binary-tree.js +2 -0
  170. package/dist/mjs/interfaces/doubly-linked-list.js +2 -0
  171. package/dist/mjs/interfaces/graph.js +2 -0
  172. package/dist/mjs/interfaces/heap.js +2 -0
  173. package/dist/mjs/interfaces/index.js +24 -0
  174. package/dist/mjs/interfaces/navigator.js +2 -0
  175. package/dist/mjs/interfaces/priority-queue.js +2 -0
  176. package/dist/mjs/interfaces/segment-tree.js +2 -0
  177. package/dist/mjs/interfaces/singly-linked-list.js +2 -0
  178. package/dist/mjs/types/data-structures/binary-tree/avl-tree.js +2 -0
  179. package/dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
  180. package/dist/{types → mjs/types}/data-structures/binary-tree/binary-tree.d.ts +1 -1
  181. package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-tree.js +7 -4
  182. package/dist/mjs/types/data-structures/binary-tree/bst.js +2 -0
  183. package/dist/mjs/types/data-structures/binary-tree/index.js +22 -0
  184. package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +8 -0
  185. package/dist/mjs/types/data-structures/binary-tree/segment-tree.js +2 -0
  186. package/dist/mjs/types/data-structures/binary-tree/tree-multiset.js +2 -0
  187. package/dist/mjs/types/data-structures/graph/abstract-graph.js +2 -0
  188. package/dist/mjs/types/data-structures/graph/directed-graph.js +9 -0
  189. package/dist/mjs/types/data-structures/graph/index.js +19 -0
  190. package/dist/mjs/types/data-structures/graph/map-graph.js +2 -0
  191. package/dist/mjs/types/data-structures/graph/undirected-graph.js +2 -0
  192. package/dist/mjs/types/data-structures/hash/coordinate-map.js +2 -0
  193. package/dist/mjs/types/data-structures/hash/coordinate-set.js +2 -0
  194. package/dist/mjs/types/data-structures/hash/hash-map.js +2 -0
  195. package/dist/mjs/types/data-structures/hash/hash-table.js +2 -0
  196. package/dist/mjs/types/data-structures/hash/index.js +2 -0
  197. package/dist/mjs/types/data-structures/hash/tree-map.js +2 -0
  198. package/dist/mjs/types/data-structures/hash/tree-set.js +2 -0
  199. package/dist/mjs/types/data-structures/heap/heap.js +2 -0
  200. package/dist/mjs/types/data-structures/heap/index.js +17 -0
  201. package/dist/mjs/types/data-structures/heap/max-heap.js +2 -0
  202. package/dist/mjs/types/data-structures/heap/min-heap.js +2 -0
  203. package/dist/mjs/types/data-structures/index.js +27 -0
  204. package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +2 -0
  205. package/dist/mjs/types/data-structures/linked-list/index.js +18 -0
  206. package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +2 -0
  207. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +2 -0
  208. package/dist/mjs/types/data-structures/matrix/index.js +17 -0
  209. package/dist/mjs/types/data-structures/matrix/matrix.js +2 -0
  210. package/dist/mjs/types/data-structures/matrix/matrix2d.js +2 -0
  211. package/dist/mjs/types/data-structures/matrix/navigator.js +2 -0
  212. package/dist/mjs/types/data-structures/matrix/vector2d.js +2 -0
  213. package/dist/mjs/types/data-structures/priority-queue/index.js +19 -0
  214. package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +2 -0
  215. package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +2 -0
  216. package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +2 -0
  217. package/dist/mjs/types/data-structures/queue/deque.js +2 -0
  218. package/dist/mjs/types/data-structures/queue/index.js +18 -0
  219. package/dist/mjs/types/data-structures/queue/queue.js +2 -0
  220. package/dist/mjs/types/data-structures/stack/index.js +17 -0
  221. package/dist/mjs/types/data-structures/stack/stack.js +2 -0
  222. package/dist/mjs/types/data-structures/tree/index.js +17 -0
  223. package/dist/mjs/types/data-structures/tree/tree.js +2 -0
  224. package/dist/mjs/types/data-structures/trie/index.js +17 -0
  225. package/dist/mjs/types/data-structures/trie/trie.js +2 -0
  226. package/dist/{types → mjs/types}/helpers.d.ts +1 -1
  227. package/dist/mjs/types/helpers.js +9 -0
  228. package/dist/mjs/types/index.js +19 -0
  229. package/dist/mjs/types/utils/index.js +18 -0
  230. package/dist/mjs/types/utils/utils.js +2 -0
  231. package/dist/mjs/types/utils/validate-type.js +2 -0
  232. package/dist/mjs/utils/index.js +17 -0
  233. package/dist/mjs/utils/utils.js +64 -0
  234. package/dist/umd/index.global.js +27 -0
  235. package/dist/umd/index.global.js.map +1 -0
  236. package/package.json +21 -23
  237. package/src/data-structures/binary-tree/binary-tree.ts +19 -19
  238. package/src/data-structures/binary-tree/bst.ts +7 -7
  239. package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
  240. package/src/types/helpers.ts +1 -1
  241. package/test/integration/index.html +3 -4
  242. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +23 -7
  243. package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +2 -1
  244. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +20 -1
  245. package/test/unit/data-structures/hash/hash-table.test.ts +1 -1
  246. package/test/unit/data-structures/matrix/navigator.test.ts +1 -1
  247. package/test/unit/data-structures/queue/deque.test.ts +1 -1
  248. package/test/unit/data-structures/queue/queue.test.ts +1 -1
  249. package/tsconfig-base.json +27 -0
  250. package/tsconfig-cjs.json +9 -0
  251. package/tsup.config.js +11 -0
  252. package/umd/bundle.min.js +1 -1
  253. package/umd/bundle.min.js.map +1 -1
  254. package/dist/data-structures/binary-tree/avl-tree.js.map +0 -1
  255. package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  256. package/dist/data-structures/binary-tree/binary-tree.js.map +0 -1
  257. package/dist/data-structures/binary-tree/bst.js.map +0 -1
  258. package/dist/data-structures/binary-tree/index.js.map +0 -1
  259. package/dist/data-structures/binary-tree/rb-tree.js.map +0 -1
  260. package/dist/data-structures/binary-tree/segment-tree.js.map +0 -1
  261. package/dist/data-structures/binary-tree/tree-multiset.js.map +0 -1
  262. package/dist/data-structures/graph/abstract-graph.js.map +0 -1
  263. package/dist/data-structures/graph/directed-graph.js.map +0 -1
  264. package/dist/data-structures/graph/index.js.map +0 -1
  265. package/dist/data-structures/graph/map-graph.js.map +0 -1
  266. package/dist/data-structures/graph/undirected-graph.js.map +0 -1
  267. package/dist/data-structures/hash/coordinate-map.js.map +0 -1
  268. package/dist/data-structures/hash/coordinate-set.js.map +0 -1
  269. package/dist/data-structures/hash/hash-map.js.map +0 -1
  270. package/dist/data-structures/hash/hash-table.js.map +0 -1
  271. package/dist/data-structures/hash/index.js.map +0 -1
  272. package/dist/data-structures/hash/tree-map.js.map +0 -1
  273. package/dist/data-structures/hash/tree-set.js.map +0 -1
  274. package/dist/data-structures/heap/heap.js.map +0 -1
  275. package/dist/data-structures/heap/index.js.map +0 -1
  276. package/dist/data-structures/heap/max-heap.js.map +0 -1
  277. package/dist/data-structures/heap/min-heap.js.map +0 -1
  278. package/dist/data-structures/index.js.map +0 -1
  279. package/dist/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  280. package/dist/data-structures/linked-list/index.js.map +0 -1
  281. package/dist/data-structures/linked-list/singly-linked-list.js.map +0 -1
  282. package/dist/data-structures/linked-list/skip-linked-list.js.map +0 -1
  283. package/dist/data-structures/matrix/index.js.map +0 -1
  284. package/dist/data-structures/matrix/matrix.js.map +0 -1
  285. package/dist/data-structures/matrix/matrix2d.js.map +0 -1
  286. package/dist/data-structures/matrix/navigator.js.map +0 -1
  287. package/dist/data-structures/matrix/vector2d.js.map +0 -1
  288. package/dist/data-structures/priority-queue/index.js.map +0 -1
  289. package/dist/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  290. package/dist/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  291. package/dist/data-structures/priority-queue/priority-queue.js.map +0 -1
  292. package/dist/data-structures/queue/deque.js.map +0 -1
  293. package/dist/data-structures/queue/index.js.map +0 -1
  294. package/dist/data-structures/queue/queue.js.map +0 -1
  295. package/dist/data-structures/stack/index.js.map +0 -1
  296. package/dist/data-structures/stack/stack.js.map +0 -1
  297. package/dist/data-structures/tree/index.js.map +0 -1
  298. package/dist/data-structures/tree/tree.js.map +0 -1
  299. package/dist/data-structures/trie/index.js.map +0 -1
  300. package/dist/data-structures/trie/trie.js.map +0 -1
  301. package/dist/index.js.map +0 -1
  302. package/dist/interfaces/binary-tree.js.map +0 -1
  303. package/dist/interfaces/doubly-linked-list.js.map +0 -1
  304. package/dist/interfaces/index.js.map +0 -1
  305. package/dist/interfaces/priority-queue.js.map +0 -1
  306. package/dist/interfaces/segment-tree.js.map +0 -1
  307. package/dist/interfaces/singly-linked-list.js.map +0 -1
  308. package/dist/types/data-structures/binary-tree/avl-tree.js.map +0 -1
  309. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  310. package/dist/types/data-structures/binary-tree/binary-tree.js.map +0 -1
  311. package/dist/types/data-structures/binary-tree/bst.js.map +0 -1
  312. package/dist/types/data-structures/binary-tree/index.js.map +0 -1
  313. package/dist/types/data-structures/binary-tree/rb-tree.js.map +0 -1
  314. package/dist/types/data-structures/binary-tree/segment-tree.js.map +0 -1
  315. package/dist/types/data-structures/binary-tree/tree-multiset.js.map +0 -1
  316. package/dist/types/data-structures/graph/abstract-graph.js.map +0 -1
  317. package/dist/types/data-structures/graph/directed-graph.js.map +0 -1
  318. package/dist/types/data-structures/graph/index.js.map +0 -1
  319. package/dist/types/data-structures/graph/map-graph.js.map +0 -1
  320. package/dist/types/data-structures/graph/undirected-graph.js.map +0 -1
  321. package/dist/types/data-structures/hash/coordinate-map.js.map +0 -1
  322. package/dist/types/data-structures/hash/coordinate-set.js.map +0 -1
  323. package/dist/types/data-structures/hash/hash-map.js.map +0 -1
  324. package/dist/types/data-structures/hash/hash-table.js.map +0 -1
  325. package/dist/types/data-structures/hash/index.js.map +0 -1
  326. package/dist/types/data-structures/hash/tree-map.js.map +0 -1
  327. package/dist/types/data-structures/hash/tree-set.js.map +0 -1
  328. package/dist/types/data-structures/heap/heap.js.map +0 -1
  329. package/dist/types/data-structures/heap/index.js.map +0 -1
  330. package/dist/types/data-structures/heap/max-heap.js.map +0 -1
  331. package/dist/types/data-structures/heap/min-heap.js.map +0 -1
  332. package/dist/types/data-structures/index.js.map +0 -1
  333. package/dist/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  334. package/dist/types/data-structures/linked-list/index.js.map +0 -1
  335. package/dist/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
  336. package/dist/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
  337. package/dist/types/data-structures/matrix/index.js.map +0 -1
  338. package/dist/types/data-structures/matrix/matrix.js.map +0 -1
  339. package/dist/types/data-structures/matrix/matrix2d.js.map +0 -1
  340. package/dist/types/data-structures/matrix/navigator.js.map +0 -1
  341. package/dist/types/data-structures/matrix/vector2d.js.map +0 -1
  342. package/dist/types/data-structures/priority-queue/index.js.map +0 -1
  343. package/dist/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  344. package/dist/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  345. package/dist/types/data-structures/priority-queue/priority-queue.js.map +0 -1
  346. package/dist/types/data-structures/queue/deque.js.map +0 -1
  347. package/dist/types/data-structures/queue/index.js.map +0 -1
  348. package/dist/types/data-structures/queue/queue.js.map +0 -1
  349. package/dist/types/data-structures/stack/index.js.map +0 -1
  350. package/dist/types/data-structures/stack/stack.js.map +0 -1
  351. package/dist/types/data-structures/tree/index.js.map +0 -1
  352. package/dist/types/data-structures/tree/tree.js.map +0 -1
  353. package/dist/types/data-structures/trie/index.js.map +0 -1
  354. package/dist/types/data-structures/trie/trie.js.map +0 -1
  355. package/dist/types/helpers.js.map +0 -1
  356. package/dist/types/index.js.map +0 -1
  357. package/dist/types/utils/index.js.map +0 -1
  358. package/dist/types/utils/validate-type.js.map +0 -1
  359. package/dist/utils/index.js.map +0 -1
  360. package/dist/utils/utils.js.map +0 -1
  361. package/lib/data-structures/binary-tree/index.js +0 -7
  362. package/lib/data-structures/binary-tree/rb-tree.js +0 -22
  363. package/lib/data-structures/graph/index.js +0 -4
  364. package/lib/data-structures/hash/index.js +0 -6
  365. package/lib/data-structures/hash/tree-map.js +0 -2
  366. package/lib/data-structures/hash/tree-set.js +0 -2
  367. package/lib/data-structures/heap/index.js +0 -3
  368. package/lib/data-structures/index.js +0 -11
  369. package/lib/data-structures/linked-list/index.js +0 -3
  370. package/lib/data-structures/matrix/index.js +0 -4
  371. package/lib/data-structures/priority-queue/index.js +0 -3
  372. package/lib/data-structures/priority-queue/priority-queue.js +0 -13
  373. package/lib/data-structures/queue/index.js +0 -2
  374. package/lib/data-structures/stack/index.js +0 -1
  375. package/lib/data-structures/tree/index.js +0 -1
  376. package/lib/data-structures/trie/index.js +0 -1
  377. package/lib/index.js +0 -4
  378. package/lib/interfaces/binary-tree.js +0 -1
  379. package/lib/interfaces/doubly-linked-list.js +0 -1
  380. package/lib/interfaces/graph.js +0 -1
  381. package/lib/interfaces/heap.js +0 -1
  382. package/lib/interfaces/index.js +0 -8
  383. package/lib/interfaces/navigator.js +0 -1
  384. package/lib/interfaces/priority-queue.js +0 -1
  385. package/lib/interfaces/segment-tree.js +0 -1
  386. package/lib/interfaces/singly-linked-list.js +0 -1
  387. package/lib/types/data-structures/binary-tree/avl-tree.js +0 -1
  388. package/lib/types/data-structures/binary-tree/binary-indexed-tree.js +0 -1
  389. package/lib/types/data-structures/binary-tree/bst.js +0 -1
  390. package/lib/types/data-structures/binary-tree/index.js +0 -6
  391. package/lib/types/data-structures/binary-tree/rb-tree.js +0 -5
  392. package/lib/types/data-structures/binary-tree/segment-tree.js +0 -1
  393. package/lib/types/data-structures/binary-tree/tree-multiset.js +0 -1
  394. package/lib/types/data-structures/graph/abstract-graph.js +0 -1
  395. package/lib/types/data-structures/graph/directed-graph.js +0 -6
  396. package/lib/types/data-structures/graph/index.js +0 -3
  397. package/lib/types/data-structures/graph/map-graph.js +0 -1
  398. package/lib/types/data-structures/graph/undirected-graph.js +0 -1
  399. package/lib/types/data-structures/hash/coordinate-map.js +0 -1
  400. package/lib/types/data-structures/hash/coordinate-set.js +0 -1
  401. package/lib/types/data-structures/hash/hash-map.js +0 -1
  402. package/lib/types/data-structures/hash/hash-table.js +0 -1
  403. package/lib/types/data-structures/hash/index.js +0 -1
  404. package/lib/types/data-structures/hash/tree-map.js +0 -1
  405. package/lib/types/data-structures/hash/tree-set.js +0 -1
  406. package/lib/types/data-structures/heap/heap.js +0 -1
  407. package/lib/types/data-structures/heap/index.js +0 -1
  408. package/lib/types/data-structures/heap/max-heap.js +0 -1
  409. package/lib/types/data-structures/heap/min-heap.js +0 -1
  410. package/lib/types/data-structures/index.js +0 -11
  411. package/lib/types/data-structures/linked-list/doubly-linked-list.js +0 -1
  412. package/lib/types/data-structures/linked-list/index.js +0 -2
  413. package/lib/types/data-structures/linked-list/singly-linked-list.js +0 -1
  414. package/lib/types/data-structures/linked-list/skip-linked-list.js +0 -1
  415. package/lib/types/data-structures/matrix/index.js +0 -1
  416. package/lib/types/data-structures/matrix/matrix.js +0 -1
  417. package/lib/types/data-structures/matrix/matrix2d.js +0 -1
  418. package/lib/types/data-structures/matrix/navigator.js +0 -1
  419. package/lib/types/data-structures/matrix/vector2d.js +0 -1
  420. package/lib/types/data-structures/priority-queue/index.js +0 -3
  421. package/lib/types/data-structures/priority-queue/max-priority-queue.js +0 -1
  422. package/lib/types/data-structures/priority-queue/min-priority-queue.js +0 -1
  423. package/lib/types/data-structures/priority-queue/priority-queue.js +0 -1
  424. package/lib/types/data-structures/queue/deque.js +0 -1
  425. package/lib/types/data-structures/queue/index.js +0 -2
  426. package/lib/types/data-structures/queue/queue.js +0 -1
  427. package/lib/types/data-structures/stack/index.js +0 -1
  428. package/lib/types/data-structures/stack/stack.js +0 -1
  429. package/lib/types/data-structures/tree/index.js +0 -1
  430. package/lib/types/data-structures/tree/tree.js +0 -1
  431. package/lib/types/data-structures/trie/index.js +0 -1
  432. package/lib/types/data-structures/trie/trie.js +0 -1
  433. package/lib/types/helpers.js +0 -6
  434. package/lib/types/index.js +0 -3
  435. package/lib/types/utils/index.js +0 -2
  436. package/lib/types/utils/utils.js +0 -1
  437. package/lib/types/utils/validate-type.js +0 -1
  438. package/lib/utils/index.js +0 -1
  439. package/lib/utils/utils.js +0 -63
  440. /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.d.ts +0 -0
  441. /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.js +0 -0
  442. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
  443. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.js +0 -0
  444. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.js +0 -0
  445. /package/dist/{data-structures → cjs/data-structures}/binary-tree/bst.js +0 -0
  446. /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.d.ts +0 -0
  447. /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.js +0 -0
  448. /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.d.ts +0 -0
  449. /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.js +0 -0
  450. /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.d.ts +0 -0
  451. /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.js +0 -0
  452. /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.d.ts +0 -0
  453. /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.js +0 -0
  454. /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.d.ts +0 -0
  455. /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.js +0 -0
  456. /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.d.ts +0 -0
  457. /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.js +0 -0
  458. /package/dist/{data-structures → cjs/data-structures}/graph/index.d.ts +0 -0
  459. /package/dist/{data-structures → cjs/data-structures}/graph/index.js +0 -0
  460. /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.d.ts +0 -0
  461. /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.js +0 -0
  462. /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.d.ts +0 -0
  463. /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.js +0 -0
  464. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.d.ts +0 -0
  465. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.js +0 -0
  466. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.d.ts +0 -0
  467. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.js +0 -0
  468. /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.d.ts +0 -0
  469. /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.js +0 -0
  470. /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.d.ts +0 -0
  471. /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.js +0 -0
  472. /package/dist/{data-structures → cjs/data-structures}/hash/index.d.ts +0 -0
  473. /package/dist/{data-structures → cjs/data-structures}/hash/index.js +0 -0
  474. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.d.ts +0 -0
  475. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.js +0 -0
  476. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.d.ts +0 -0
  477. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.js +0 -0
  478. /package/dist/{data-structures → cjs/data-structures}/heap/heap.d.ts +0 -0
  479. /package/dist/{data-structures → cjs/data-structures}/heap/heap.js +0 -0
  480. /package/dist/{data-structures → cjs/data-structures}/heap/index.d.ts +0 -0
  481. /package/dist/{data-structures → cjs/data-structures}/heap/index.js +0 -0
  482. /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.d.ts +0 -0
  483. /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.js +0 -0
  484. /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.d.ts +0 -0
  485. /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.js +0 -0
  486. /package/dist/{data-structures → cjs/data-structures}/index.d.ts +0 -0
  487. /package/dist/{data-structures → cjs/data-structures}/index.js +0 -0
  488. /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
  489. /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.js +0 -0
  490. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.d.ts +0 -0
  491. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.js +0 -0
  492. /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.d.ts +0 -0
  493. /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.js +0 -0
  494. /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.d.ts +0 -0
  495. /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.js +0 -0
  496. /package/dist/{data-structures → cjs/data-structures}/matrix/index.d.ts +0 -0
  497. /package/dist/{data-structures → cjs/data-structures}/matrix/index.js +0 -0
  498. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.d.ts +0 -0
  499. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.js +0 -0
  500. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix2d.d.ts +0 -0
  501. /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.d.ts +0 -0
  502. /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.js +0 -0
  503. /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.d.ts +0 -0
  504. /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.js +0 -0
  505. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.d.ts +0 -0
  506. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.js +0 -0
  507. /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
  508. /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.js +0 -0
  509. /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
  510. /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.js +0 -0
  511. /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.d.ts +0 -0
  512. /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.js +0 -0
  513. /package/dist/{data-structures → cjs/data-structures}/queue/deque.d.ts +0 -0
  514. /package/dist/{data-structures → cjs/data-structures}/queue/deque.js +0 -0
  515. /package/dist/{data-structures → cjs/data-structures}/queue/index.d.ts +0 -0
  516. /package/dist/{data-structures → cjs/data-structures}/queue/index.js +0 -0
  517. /package/dist/{data-structures → cjs/data-structures}/queue/queue.d.ts +0 -0
  518. /package/dist/{data-structures → cjs/data-structures}/queue/queue.js +0 -0
  519. /package/dist/{data-structures → cjs/data-structures}/stack/index.d.ts +0 -0
  520. /package/dist/{data-structures → cjs/data-structures}/stack/index.js +0 -0
  521. /package/dist/{data-structures → cjs/data-structures}/stack/stack.d.ts +0 -0
  522. /package/dist/{data-structures → cjs/data-structures}/stack/stack.js +0 -0
  523. /package/dist/{data-structures → cjs/data-structures}/tree/index.d.ts +0 -0
  524. /package/dist/{data-structures → cjs/data-structures}/tree/index.js +0 -0
  525. /package/dist/{data-structures → cjs/data-structures}/tree/tree.d.ts +0 -0
  526. /package/dist/{data-structures → cjs/data-structures}/tree/tree.js +0 -0
  527. /package/dist/{data-structures → cjs/data-structures}/trie/index.d.ts +0 -0
  528. /package/dist/{data-structures → cjs/data-structures}/trie/index.js +0 -0
  529. /package/dist/{data-structures → cjs/data-structures}/trie/trie.d.ts +0 -0
  530. /package/dist/{data-structures → cjs/data-structures}/trie/trie.js +0 -0
  531. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  532. /package/dist/{index.js → cjs/index.js} +0 -0
  533. /package/dist/{interfaces → cjs/interfaces}/binary-tree.d.ts +0 -0
  534. /package/dist/{interfaces → cjs/interfaces}/binary-tree.js +0 -0
  535. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.d.ts +0 -0
  536. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.js +0 -0
  537. /package/dist/{interfaces → cjs/interfaces}/graph.d.ts +0 -0
  538. /package/dist/{interfaces → cjs/interfaces}/graph.js +0 -0
  539. /package/dist/{interfaces → cjs/interfaces}/heap.d.ts +0 -0
  540. /package/dist/{interfaces → cjs/interfaces}/heap.js +0 -0
  541. /package/dist/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  542. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  543. /package/dist/{interfaces → cjs/interfaces}/navigator.d.ts +0 -0
  544. /package/dist/{interfaces → cjs/interfaces}/navigator.js +0 -0
  545. /package/dist/{interfaces → cjs/interfaces}/priority-queue.d.ts +0 -0
  546. /package/dist/{interfaces → cjs/interfaces}/priority-queue.js +0 -0
  547. /package/dist/{interfaces → cjs/interfaces}/segment-tree.d.ts +0 -0
  548. /package/dist/{interfaces → cjs/interfaces}/segment-tree.js +0 -0
  549. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.d.ts +0 -0
  550. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.js +0 -0
  551. /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  552. /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.js +0 -0
  553. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  554. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
  555. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-tree.js +0 -0
  556. /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.d.ts +0 -0
  557. /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.js +0 -0
  558. /package/dist/{types → cjs/types}/data-structures/binary-tree/index.d.ts +0 -0
  559. /package/dist/{types → cjs/types}/data-structures/binary-tree/index.js +0 -0
  560. /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  561. /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.js +0 -0
  562. /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  563. /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.js +0 -0
  564. /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  565. /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.js +0 -0
  566. /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.d.ts +0 -0
  567. /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.js +0 -0
  568. /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.d.ts +0 -0
  569. /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.js +0 -0
  570. /package/dist/{types → cjs/types}/data-structures/graph/index.d.ts +0 -0
  571. /package/dist/{types → cjs/types}/data-structures/graph/index.js +0 -0
  572. /package/dist/{types → cjs/types}/data-structures/graph/map-graph.d.ts +0 -0
  573. /package/dist/{types → cjs/types}/data-structures/graph/map-graph.js +0 -0
  574. /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.d.ts +0 -0
  575. /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.js +0 -0
  576. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.d.ts +0 -0
  577. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.js +0 -0
  578. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.d.ts +0 -0
  579. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.js +0 -0
  580. /package/dist/{types → cjs/types}/data-structures/hash/hash-map.d.ts +0 -0
  581. /package/dist/{types → cjs/types}/data-structures/hash/hash-map.js +0 -0
  582. /package/dist/{types → cjs/types}/data-structures/hash/hash-table.d.ts +0 -0
  583. /package/dist/{types → cjs/types}/data-structures/hash/hash-table.js +0 -0
  584. /package/dist/{types → cjs/types}/data-structures/hash/index.d.ts +0 -0
  585. /package/dist/{types → cjs/types}/data-structures/hash/index.js +0 -0
  586. /package/dist/{types → cjs/types}/data-structures/hash/tree-map.d.ts +0 -0
  587. /package/dist/{types → cjs/types}/data-structures/hash/tree-map.js +0 -0
  588. /package/dist/{types → cjs/types}/data-structures/hash/tree-set.d.ts +0 -0
  589. /package/dist/{types → cjs/types}/data-structures/hash/tree-set.js +0 -0
  590. /package/dist/{types → cjs/types}/data-structures/heap/heap.d.ts +0 -0
  591. /package/dist/{types → cjs/types}/data-structures/heap/heap.js +0 -0
  592. /package/dist/{types → cjs/types}/data-structures/heap/index.d.ts +0 -0
  593. /package/dist/{types → cjs/types}/data-structures/heap/index.js +0 -0
  594. /package/dist/{types → cjs/types}/data-structures/heap/max-heap.d.ts +0 -0
  595. /package/dist/{types → cjs/types}/data-structures/heap/max-heap.js +0 -0
  596. /package/dist/{types → cjs/types}/data-structures/heap/min-heap.d.ts +0 -0
  597. /package/dist/{types → cjs/types}/data-structures/heap/min-heap.js +0 -0
  598. /package/dist/{types → cjs/types}/data-structures/index.d.ts +0 -0
  599. /package/dist/{types → cjs/types}/data-structures/index.js +0 -0
  600. /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  601. /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.js +0 -0
  602. /package/dist/{types → cjs/types}/data-structures/linked-list/index.d.ts +0 -0
  603. /package/dist/{types → cjs/types}/data-structures/linked-list/index.js +0 -0
  604. /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  605. /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.js +0 -0
  606. /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  607. /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.js +0 -0
  608. /package/dist/{types → cjs/types}/data-structures/matrix/index.d.ts +0 -0
  609. /package/dist/{types → cjs/types}/data-structures/matrix/index.js +0 -0
  610. /package/dist/{types → cjs/types}/data-structures/matrix/matrix.d.ts +0 -0
  611. /package/dist/{types → cjs/types}/data-structures/matrix/matrix.js +0 -0
  612. /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.d.ts +0 -0
  613. /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.js +0 -0
  614. /package/dist/{types → cjs/types}/data-structures/matrix/navigator.d.ts +0 -0
  615. /package/dist/{types → cjs/types}/data-structures/matrix/navigator.js +0 -0
  616. /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.d.ts +0 -0
  617. /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.js +0 -0
  618. /package/dist/{types → cjs/types}/data-structures/priority-queue/index.d.ts +0 -0
  619. /package/dist/{types → cjs/types}/data-structures/priority-queue/index.js +0 -0
  620. /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  621. /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.js +0 -0
  622. /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  623. /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.js +0 -0
  624. /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  625. /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.js +0 -0
  626. /package/dist/{types → cjs/types}/data-structures/queue/deque.d.ts +0 -0
  627. /package/dist/{types → cjs/types}/data-structures/queue/deque.js +0 -0
  628. /package/dist/{types → cjs/types}/data-structures/queue/index.d.ts +0 -0
  629. /package/dist/{types → cjs/types}/data-structures/queue/index.js +0 -0
  630. /package/dist/{types → cjs/types}/data-structures/queue/queue.d.ts +0 -0
  631. /package/dist/{types → cjs/types}/data-structures/queue/queue.js +0 -0
  632. /package/dist/{types → cjs/types}/data-structures/stack/index.d.ts +0 -0
  633. /package/dist/{types → cjs/types}/data-structures/stack/index.js +0 -0
  634. /package/dist/{types → cjs/types}/data-structures/stack/stack.d.ts +0 -0
  635. /package/dist/{types → cjs/types}/data-structures/stack/stack.js +0 -0
  636. /package/dist/{types → cjs/types}/data-structures/tree/index.d.ts +0 -0
  637. /package/dist/{types → cjs/types}/data-structures/tree/index.js +0 -0
  638. /package/dist/{types → cjs/types}/data-structures/tree/tree.d.ts +0 -0
  639. /package/dist/{types → cjs/types}/data-structures/tree/tree.js +0 -0
  640. /package/dist/{types → cjs/types}/data-structures/trie/index.d.ts +0 -0
  641. /package/dist/{types → cjs/types}/data-structures/trie/index.js +0 -0
  642. /package/dist/{types → cjs/types}/data-structures/trie/trie.d.ts +0 -0
  643. /package/dist/{types → cjs/types}/data-structures/trie/trie.js +0 -0
  644. /package/dist/{types → cjs/types}/helpers.js +0 -0
  645. /package/dist/{types → cjs/types}/index.d.ts +0 -0
  646. /package/dist/{types → cjs/types}/index.js +0 -0
  647. /package/dist/{types → cjs/types}/utils/index.d.ts +0 -0
  648. /package/dist/{types → cjs/types}/utils/index.js +0 -0
  649. /package/dist/{types → cjs/types}/utils/utils.d.ts +0 -0
  650. /package/dist/{types → cjs/types}/utils/utils.js +0 -0
  651. /package/dist/{types → cjs/types}/utils/validate-type.d.ts +0 -0
  652. /package/dist/{types → cjs/types}/utils/validate-type.js +0 -0
  653. /package/dist/{utils → cjs/utils}/index.d.ts +0 -0
  654. /package/dist/{utils → cjs/utils}/index.js +0 -0
  655. /package/dist/{utils → cjs/utils}/utils.d.ts +0 -0
  656. /package/dist/{utils → cjs/utils}/utils.js +0 -0
  657. /package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  658. /package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  659. /package/{lib → dist/mjs}/data-structures/binary-tree/index.d.ts +0 -0
  660. /package/{lib → dist/mjs}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  661. /package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  662. /package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  663. /package/{lib → dist/mjs}/data-structures/graph/abstract-graph.d.ts +0 -0
  664. /package/{lib → dist/mjs}/data-structures/graph/directed-graph.d.ts +0 -0
  665. /package/{lib → dist/mjs}/data-structures/graph/index.d.ts +0 -0
  666. /package/{lib → dist/mjs}/data-structures/graph/map-graph.d.ts +0 -0
  667. /package/{lib → dist/mjs}/data-structures/graph/undirected-graph.d.ts +0 -0
  668. /package/{lib → dist/mjs}/data-structures/hash/coordinate-map.d.ts +0 -0
  669. /package/{lib → dist/mjs}/data-structures/hash/coordinate-set.d.ts +0 -0
  670. /package/{lib → dist/mjs}/data-structures/hash/hash-map.d.ts +0 -0
  671. /package/{lib → dist/mjs}/data-structures/hash/hash-table.d.ts +0 -0
  672. /package/{lib → dist/mjs}/data-structures/hash/index.d.ts +0 -0
  673. /package/{lib → dist/mjs}/data-structures/hash/tree-map.d.ts +0 -0
  674. /package/{lib → dist/mjs}/data-structures/hash/tree-set.d.ts +0 -0
  675. /package/{lib → dist/mjs}/data-structures/heap/heap.d.ts +0 -0
  676. /package/{lib → dist/mjs}/data-structures/heap/index.d.ts +0 -0
  677. /package/{lib → dist/mjs}/data-structures/heap/max-heap.d.ts +0 -0
  678. /package/{lib → dist/mjs}/data-structures/heap/min-heap.d.ts +0 -0
  679. /package/{lib → dist/mjs}/data-structures/index.d.ts +0 -0
  680. /package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  681. /package/{lib → dist/mjs}/data-structures/linked-list/index.d.ts +0 -0
  682. /package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  683. /package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  684. /package/{lib → dist/mjs}/data-structures/matrix/index.d.ts +0 -0
  685. /package/{lib → dist/mjs}/data-structures/matrix/matrix.d.ts +0 -0
  686. /package/{lib → dist/mjs}/data-structures/matrix/matrix2d.d.ts +0 -0
  687. /package/{lib → dist/mjs}/data-structures/matrix/navigator.d.ts +0 -0
  688. /package/{lib → dist/mjs}/data-structures/matrix/vector2d.d.ts +0 -0
  689. /package/{lib → dist/mjs}/data-structures/priority-queue/index.d.ts +0 -0
  690. /package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  691. /package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  692. /package/{lib → dist/mjs}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  693. /package/{lib → dist/mjs}/data-structures/queue/deque.d.ts +0 -0
  694. /package/{lib → dist/mjs}/data-structures/queue/index.d.ts +0 -0
  695. /package/{lib → dist/mjs}/data-structures/queue/queue.d.ts +0 -0
  696. /package/{lib → dist/mjs}/data-structures/stack/index.d.ts +0 -0
  697. /package/{lib → dist/mjs}/data-structures/stack/stack.d.ts +0 -0
  698. /package/{lib → dist/mjs}/data-structures/tree/index.d.ts +0 -0
  699. /package/{lib → dist/mjs}/data-structures/tree/tree.d.ts +0 -0
  700. /package/{lib → dist/mjs}/data-structures/trie/index.d.ts +0 -0
  701. /package/{lib → dist/mjs}/data-structures/trie/trie.d.ts +0 -0
  702. /package/{lib → dist/mjs}/index.d.ts +0 -0
  703. /package/{lib → dist/mjs}/interfaces/binary-tree.d.ts +0 -0
  704. /package/{lib → dist/mjs}/interfaces/doubly-linked-list.d.ts +0 -0
  705. /package/{lib → dist/mjs}/interfaces/graph.d.ts +0 -0
  706. /package/{lib → dist/mjs}/interfaces/heap.d.ts +0 -0
  707. /package/{lib → dist/mjs}/interfaces/index.d.ts +0 -0
  708. /package/{lib → dist/mjs}/interfaces/navigator.d.ts +0 -0
  709. /package/{lib → dist/mjs}/interfaces/priority-queue.d.ts +0 -0
  710. /package/{lib → dist/mjs}/interfaces/segment-tree.d.ts +0 -0
  711. /package/{lib → dist/mjs}/interfaces/singly-linked-list.d.ts +0 -0
  712. /package/{lib → dist/mjs}/types/data-structures/binary-tree/avl-tree.d.ts +0 -0
  713. /package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  714. /package/{lib → dist/mjs}/types/data-structures/binary-tree/bst.d.ts +0 -0
  715. /package/{lib → dist/mjs}/types/data-structures/binary-tree/index.d.ts +0 -0
  716. /package/{lib → dist/mjs}/types/data-structures/binary-tree/rb-tree.d.ts +0 -0
  717. /package/{lib → dist/mjs}/types/data-structures/binary-tree/segment-tree.d.ts +0 -0
  718. /package/{lib → dist/mjs}/types/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  719. /package/{lib → dist/mjs}/types/data-structures/graph/abstract-graph.d.ts +0 -0
  720. /package/{lib → dist/mjs}/types/data-structures/graph/directed-graph.d.ts +0 -0
  721. /package/{lib → dist/mjs}/types/data-structures/graph/index.d.ts +0 -0
  722. /package/{lib → dist/mjs}/types/data-structures/graph/map-graph.d.ts +0 -0
  723. /package/{lib → dist/mjs}/types/data-structures/graph/undirected-graph.d.ts +0 -0
  724. /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-map.d.ts +0 -0
  725. /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-set.d.ts +0 -0
  726. /package/{lib → dist/mjs}/types/data-structures/hash/hash-map.d.ts +0 -0
  727. /package/{lib → dist/mjs}/types/data-structures/hash/hash-table.d.ts +0 -0
  728. /package/{lib → dist/mjs}/types/data-structures/hash/index.d.ts +0 -0
  729. /package/{lib → dist/mjs}/types/data-structures/hash/tree-map.d.ts +0 -0
  730. /package/{lib → dist/mjs}/types/data-structures/hash/tree-set.d.ts +0 -0
  731. /package/{lib → dist/mjs}/types/data-structures/heap/heap.d.ts +0 -0
  732. /package/{lib → dist/mjs}/types/data-structures/heap/index.d.ts +0 -0
  733. /package/{lib → dist/mjs}/types/data-structures/heap/max-heap.d.ts +0 -0
  734. /package/{lib → dist/mjs}/types/data-structures/heap/min-heap.d.ts +0 -0
  735. /package/{lib → dist/mjs}/types/data-structures/index.d.ts +0 -0
  736. /package/{lib → dist/mjs}/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  737. /package/{lib → dist/mjs}/types/data-structures/linked-list/index.d.ts +0 -0
  738. /package/{lib → dist/mjs}/types/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  739. /package/{lib → dist/mjs}/types/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  740. /package/{lib → dist/mjs}/types/data-structures/matrix/index.d.ts +0 -0
  741. /package/{lib → dist/mjs}/types/data-structures/matrix/matrix.d.ts +0 -0
  742. /package/{lib → dist/mjs}/types/data-structures/matrix/matrix2d.d.ts +0 -0
  743. /package/{lib → dist/mjs}/types/data-structures/matrix/navigator.d.ts +0 -0
  744. /package/{lib → dist/mjs}/types/data-structures/matrix/vector2d.d.ts +0 -0
  745. /package/{lib → dist/mjs}/types/data-structures/priority-queue/index.d.ts +0 -0
  746. /package/{lib → dist/mjs}/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  747. /package/{lib → dist/mjs}/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  748. /package/{lib → dist/mjs}/types/data-structures/priority-queue/priority-queue.d.ts +0 -0
  749. /package/{lib → dist/mjs}/types/data-structures/queue/deque.d.ts +0 -0
  750. /package/{lib → dist/mjs}/types/data-structures/queue/index.d.ts +0 -0
  751. /package/{lib → dist/mjs}/types/data-structures/queue/queue.d.ts +0 -0
  752. /package/{lib → dist/mjs}/types/data-structures/stack/index.d.ts +0 -0
  753. /package/{lib → dist/mjs}/types/data-structures/stack/stack.d.ts +0 -0
  754. /package/{lib → dist/mjs}/types/data-structures/tree/index.d.ts +0 -0
  755. /package/{lib → dist/mjs}/types/data-structures/tree/tree.d.ts +0 -0
  756. /package/{lib → dist/mjs}/types/data-structures/trie/index.d.ts +0 -0
  757. /package/{lib → dist/mjs}/types/data-structures/trie/trie.d.ts +0 -0
  758. /package/{lib → dist/mjs}/types/index.d.ts +0 -0
  759. /package/{lib → dist/mjs}/types/utils/index.d.ts +0 -0
  760. /package/{lib → dist/mjs}/types/utils/utils.d.ts +0 -0
  761. /package/{lib → dist/mjs}/types/utils/validate-type.d.ts +0 -0
  762. /package/{lib → dist/mjs}/utils/index.d.ts +0 -0
  763. /package/{lib → dist/mjs}/utils/utils.d.ts +0 -0
package/umd/bundle.min.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see bundle.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.dataStructureTyped=e():t.dataStructureTyped=e()}(self,(()=>(()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{AVLTree:()=>rt,AVLTreeNode:()=>it,AbstractEdge:()=>O,AbstractGraph:()=>L,AbstractVertex:()=>N,ArrayDeque:()=>x,BST:()=>$,BSTNode:()=>Z,BinaryIndexedTree:()=>tt,BinaryTree:()=>X,BinaryTreeNode:()=>J,CP:()=>Y,Character:()=>yt,CoordinateMap:()=>r,CoordinateSet:()=>n,Deque:()=>y,DirectedEdge:()=>F,DirectedGraph:()=>P,DirectedVertex:()=>I,DoublyLinkedList:()=>d,DoublyLinkedListNode:()=>c,FamilyPosition:()=>G,FibonacciHeap:()=>C,FibonacciHeapNode:()=>V,HashMap:()=>l,HashTable:()=>i,HashTableNode:()=>s,Heap:()=>z,IterationType:()=>K,LinkedListQueue:()=>p,MapEdge:()=>j,MapGraph:()=>U,MapVertex:()=>q,Matrix2D:()=>vt,MatrixNTI2D:()=>gt,MaxHeap:()=>ut,MaxPriorityQueue:()=>ft,MinHeap:()=>ct,MinPriorityQueue:()=>dt,Navigator:()=>mt,ObjectDeque:()=>m,PriorityQueue:()=>A,Queue:()=>v,RBColor:()=>W,RBTree:()=>ht,RBTreeNode:()=>nt,SegmentTree:()=>st,SegmentTreeNode:()=>et,SinglyLinkedList:()=>u,SinglyLinkedListNode:()=>a,SkipList:()=>g,SkipListNode:()=>f,Stack:()=>_,THUNK_SYMBOL:()=>w,TopologicalProperty:()=>Q,TreeMap:()=>h,TreeMultiset:()=>lt,TreeMultisetNode:()=>ot,TreeNode:()=>at,TreeSet:()=>o,Trie:()=>bt,TrieNode:()=>xt,UndirectedEdge:()=>B,UndirectedGraph:()=>H,UndirectedVertex:()=>D,Vector2D:()=>_t,arrayRemove:()=>E,getMSB:()=>R,isThunk:()=>k,toThunk:()=>M,trampoline:()=>T,trampolineAsync:()=>S,uuidV4:()=>b});class s{constructor(t,e){this.key=t,this.val=e,this.next=null}}class i{constructor(t=i.DEFAULT_CAPACITY,e){this._hashFn=e||this._defaultHashFn,this._capacity=Math.max(t,i.DEFAULT_CAPACITY),this._size=0,this._buckets=new Array(this._capacity).fill(null)}get capacity(){return this._capacity}set capacity(t){this._capacity=t}get size(){return this._size}get buckets(){return this._buckets}set buckets(t){this._buckets=t}get hashFn(){return this._hashFn}set hashFn(t){this._hashFn=t}set(t,e){const r=this._hash(t),n=new s(t,e);if(this._buckets[r]){let s=this._buckets[r];for(;s;){if(s.key===t)return void(s.val=e);if(!s.next)break;s=s.next}s.next=n}else this._buckets[r]=n;this._size++,this._size/this._capacity>=i.LOAD_FACTOR&&this._expand()}get(t){const e=this._hash(t);let s=this._buckets[e];for(;s;){if(s.key===t)return s.val;s=s.next}}delete(t){const e=this._hash(t);let s=this._buckets[e],i=null;for(;s;){if(s.key===t)return i?i.next=s.next:this._buckets[e]=s.next,this._size--,void(s.next=null);i=s,s=s.next}}_defaultHashFn(t){return("string"==typeof t?this._murmurStringHashFn(t):this._objectHash(t))%this._capacity}_multiplicativeStringHashFn(t){const e=String(t);let s=0;for(let t=0;t<e.length;t++)s=(.618033988749895*s+e.charCodeAt(t))%(1<<30);return Math.abs(s)}_murmurStringHashFn(t){const e=String(t);let s=0;for(let t=0;t<e.length;t++)s=1540483477*(s^e.charCodeAt(t)),s=668265261*(s^s>>>15),s^=s>>>15;return Math.abs(s)}_hash(t){return this.hashFn(t)}_stringHash(t){let e=0;for(let s=0;s<t.length;s++)e=31*e+t.charCodeAt(s)&4294967295;return e}_objectHash(t){return this._stringHash(JSON.stringify(t))}_expand(){const t=2*this._capacity,e=new Array(t).fill(null);for(const t of this._buckets){let i=t;for(;i;){const t=this._hash(i.key),r=new s(i.key,i.val);if(e[t]){let s=e[t];for(;s.next;)s=s.next;s.next=r}else e[t]=r;i=i.next}}this._buckets=e,this._capacity=t}}i.DEFAULT_CAPACITY=16,i.LOAD_FACTOR=.75;class r extends Map{constructor(t){super(),this._joint="_",void 0!==t&&(this._joint=t)}get joint(){return this._joint}has(t){return super.has(t.join(this._joint))}set(t,e){return super.set(t.join(this._joint),e)}get(t){return super.get(t.join(this._joint))}delete(t){return super.delete(t.join(this._joint))}_setJoint(t){this._joint=t}}class n extends Set{constructor(t){super(),this._joint="_",void 0!==t&&(this._joint=t)}get joint(){return this._joint}has(t){return super.has(t.join(this._joint))}add(t){return super.add(t.join(this._joint))}delete(t){return super.delete(t.join(this._joint))}_setJoint(t){this._joint=t}}class h{}class o{}class l{constructor(t=16,e=.75,s){this._initialCapacity=t,this._loadFactor=e,this._capacityMultiplier=2,this._size=0,this._table=new Array(t),this._hashFn=s||(t=>{const e=String(t);let s=0;for(let t=0;t<e.length;t++)s+=e.charCodeAt(t);return s%this.table.length})}get initialCapacity(){return this._initialCapacity}set initialCapacity(t){this._initialCapacity=t}get loadFactor(){return this._loadFactor}set loadFactor(t){this._loadFactor=t}get capacityMultiplier(){return this._capacityMultiplier}set capacityMultiplier(t){this._capacityMultiplier=t}get size(){return this._size}set size(t){this._size=t}get table(){return this._table}set table(t){this._table=t}get hashFn(){return this._hashFn}set hashFn(t){this._hashFn=t}set(t,e){this.size/this.table.length>=this.loadFactor&&this.resizeTable(this.table.length*this.capacityMultiplier);const s=this._hash(t);this.table[s]||(this.table[s]=[]);for(let i=0;i<this.table[s].length;i++)if(this.table[s][i][0]===t)return void(this.table[s][i][1]=e);this.table[s].push([t,e]),this.size++}get(t){const e=this._hash(t);if(this.table[e])for(const[s,i]of this.table[e])if(s===t)return i}delete(t){const e=this._hash(t);if(this.table[e])for(let s=0;s<this.table[e].length;s++)if(this.table[e][s][0]===t)return this.table[e].splice(s,1),this.size--,void(this.size/this.table.length<this.loadFactor/this.capacityMultiplier&&this.resizeTable(this.table.length/this.capacityMultiplier))}*entries(){for(const t of this.table)if(t)for(const[e,s]of t)yield[e,s]}[Symbol.iterator](){return this.entries()}clear(){this.size=0,this.table=new Array(this.initialCapacity)}isEmpty(){return 0===this.size}_hash(t){return this._hashFn(t)}resizeTable(t){const e=new Array(t);for(const s of this._table)if(s)for(const[i,r]of s){const s=this._hash(i)%t;e[s]||(e[s]=[]),e[s].push([i,r])}this._table=e}}class a{constructor(t){this._val=t,this._next=null}get val(){return this._val}set val(t){this._val=t}get next(){return this._next}set next(t){this._next=t}}class u{constructor(){this._head=null,this._tail=null,this._length=0}get head(){return this._head}set head(t){this._head=t}get tail(){return this._tail}set tail(t){this._tail=t}get length(){return this._length}static fromArray(t){const e=new u;for(const s of t)e.push(s);return e}getLength(){return this._length}push(t){const e=new a(t);this.head?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++}pop(){if(!this.head)return;if(this.head===this.tail){const t=this.head.val;return this.head=null,this.tail=null,this._length--,t}let t=this.head;for(;t.next!==this.tail;)t=t.next;const e=this.tail.val;return t.next=null,this.tail=t,this._length--,e}shift(){if(!this.head)return;const t=this.head;return this.head=this.head.next,this._length--,t.val}unshift(t){const e=new a(t);this.head?(e.next=this.head,this.head=e):(this.head=e,this.tail=e),this._length++}getAt(t){if(t<0||t>=this.length)return;let e=this.head;for(let s=0;s<t;s++)e=e.next;return e.val}getNodeAt(t){let e=this.head;for(let s=0;s<t;s++)e=e.next;return e}deleteAt(t){if(t<0||t>=this.length)return;if(0===t)return this.shift();if(t===this.length-1)return this.pop();const e=this.getNodeAt(t-1),s=e.next;return e.next=s.next,this._length--,s.val}delete(t){let e;e=t instanceof a?t.val:t;let s=this.head,i=null;for(;s;){if(s.val===e)return null===i?(this.head=s.next,s===this.tail&&(this.tail=null)):(i.next=s.next,s===this.tail&&(this.tail=i)),this._length--,!0;i=s,s=s.next}return!1}insertAt(t,e){if(t<0||t>this.length)return!1;if(0===t)return this.unshift(e),!0;if(t===this.length)return this.push(e),!0;const s=new a(e),i=this.getNodeAt(t-1);return s.next=i.next,i.next=s,this._length++,!0}isEmpty(){return 0===this.length}clear(){this._head=null,this._tail=null,this._length=0}toArray(){const t=[];let e=this.head;for(;e;)t.push(e.val),e=e.next;return t}reverse(){if(!this.head||this.head===this.tail)return;let t=null,e=this.head,s=null;for(;e;)s=e.next,e.next=t,t=e,e=s;[this.head,this.tail]=[this.tail,this.head]}find(t){let e=this.head;for(;e;){if(t(e.val))return e.val;e=e.next}return null}indexOf(t){let e=0,s=this.head;for(;s;){if(s.val===t)return e;e++,s=s.next}return-1}findNode(t){let e=this.head;for(;e;){if(e.val===t)return e;e=e.next}return null}insertBefore(t,e){if(!this.head)return!1;let s;if(s=t instanceof a?t.val:t,this.head.val===s)return this.unshift(e),!0;let i=this.head;for(;i.next;){if(i.next.val===s){const t=new a(e);return t.next=i.next,i.next=t,this._length++,!0}i=i.next}return!1}insertAfter(t,e){let s;if(s=t instanceof a?t:this.findNode(t),s){const t=new a(e);return t.next=s.next,s.next=t,s===this.tail&&(this.tail=t),this._length++,!0}return!1}countOccurrences(t){let e=0,s=this.head;for(;s;)s.val===t&&e++,s=s.next;return e}*[Symbol.iterator](){let t=this.head;for(;t;)yield t.val,t=t.next}}class c{constructor(t){this._val=t,this._next=null,this._prev=null}get val(){return this._val}set val(t){this._val=t}get next(){return this._next}set next(t){this._next=t}get prev(){return this._prev}set prev(t){this._prev=t}}class d{constructor(){this._head=null,this._tail=null,this._length=0}get head(){return this._head}set head(t){this._head=t}get tail(){return this._tail}set tail(t){this._tail=t}get length(){return this._length}get size(){return this.length}static fromArray(t){const e=new d;for(const s of t)e.push(s);return e}push(t){const e=new c(t);this.head?(e.prev=this.tail,this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++}addLast(t){this.push(t)}pop(){if(!this.tail)return;const t=this.tail;return this.head===this.tail?(this.head=null,this.tail=null):(this.tail=t.prev,this.tail.next=null),this._length--,t.val}pollLast(){return this.pop()}shift(){if(!this.head)return;const t=this.head;return this.head===this.tail?(this.head=null,this.tail=null):(this.head=t.next,this.head.prev=null),this._length--,t.val}pollFirst(){return this.shift()}unshift(t){const e=new c(t);this.head?(e.next=this.head,this.head.prev=e,this.head=e):(this.head=e,this.tail=e),this._length++}addFirst(t){this.unshift(t)}peekFirst(){var t;return null===(t=this.head)||void 0===t?void 0:t.val}peekLast(){var t;return null===(t=this.tail)||void 0===t?void 0:t.val}getAt(t){if(t<0||t>=this.length)return;let e=this.head;for(let s=0;s<t;s++)e=e.next;return e.val}getNodeAt(t){if(t<0||t>=this.length)return null;let e=this.head;for(let s=0;s<t;s++)e=e.next;return e}findNode(t){let e=this.head;for(;e;){if(e.val===t)return e;e=e.next}return null}insertAt(t,e){if(t<0||t>this.length)return!1;if(0===t)return this.unshift(e),!0;if(t===this.length)return this.push(e),!0;const s=new c(e),i=this.getNodeAt(t-1),r=i.next;return s.prev=i,s.next=r,i.next=s,r.prev=s,this._length++,!0}deleteAt(t){if(t<0||t>=this.length)return;if(0===t)return this.shift();if(t===this.length-1)return this.pop();const e=this.getNodeAt(t),s=e.prev,i=e.next;return s.next=i,i.prev=s,this._length--,e.val}delete(t){let e;if(e=t instanceof c?t:this.findNode(t),e){if(e===this.head)this.shift();else if(e===this.tail)this.pop();else{const t=e.prev,s=e.next;t.next=s,s.prev=t,this._length--}return!0}return!1}toArray(){const t=[];let e=this.head;for(;e;)t.push(e.val),e=e.next;return t}isEmpty(){return 0===this.length}clear(){this._head=null,this._tail=null,this._length=0}find(t){let e=this.head;for(;e;){if(t(e.val))return e.val;e=e.next}return null}indexOf(t){let e=0,s=this.head;for(;s;){if(s.val===t)return e;e++,s=s.next}return-1}findLast(t){let e=this.tail;for(;e;){if(t(e.val))return e.val;e=e.prev}return null}toArrayReverse(){const t=[];let e=this.tail;for(;e;)t.push(e.val),e=e.prev;return t}reverse(){let t=this.head;for([this.head,this.tail]=[this.tail,this.head];t;){const e=t.next;[t.prev,t.next]=[t.next,t.prev],t=e}}forEach(t){let e=this.head,s=0;for(;e;)t(e.val,s),e=e.next,s++}map(t){const e=new d;let s=this.head;for(;s;)e.push(t(s.val)),s=s.next;return e}filter(t){const e=new d;let s=this.head;for(;s;)t(s.val)&&e.push(s.val),s=s.next;return e}reduce(t,e){let s=e,i=this.head;for(;i;)s=t(s,i.val),i=i.next;return s}insertAfter(t,e){let s;if(s=t instanceof c?t:this.findNode(t),s){const t=new c(e);return t.next=s.next,s.next&&(s.next.prev=t),t.prev=s,s.next=t,s===this.tail&&(this.tail=t),this._length++,!0}return!1}insertBefore(t,e){let s;if(s=t instanceof c?t:this.findNode(t),s){const t=new c(e);return t.prev=s.prev,s.prev&&(s.prev.next=t),t.next=s,s.prev=t,s===this.head&&(this.head=t),this._length++,!0}return!1}}class f{constructor(t,e,s){this.key=t,this.value=e,this.forward=new Array(s)}}class g{constructor(t=16,e=.5){this._head=new f(null,null,t),this._level=0,this._maxLevel=t,this._probability=e}get head(){return this._head}set head(t){this._head=t}get level(){return this._level}set level(t){this._level=t}get maxLevel(){return this._maxLevel}set maxLevel(t){this._maxLevel=t}get probability(){return this._probability}set probability(t){this._probability=t}add(t,e){const s=new f(t,e,this.randomLevel()),i=new Array(this.maxLevel).fill(this.head);let r=this.head;for(let e=this.level-1;e>=0;e--){for(;r.forward[e]&&r.forward[e].key<t;)r=r.forward[e];i[e]=r}for(let t=0;t<s.forward.length;t++)s.forward[t]=i[t].forward[t],i[t].forward[t]=s;null!==s.forward[0]&&(this.level=Math.max(this.level,s.forward.length))}get(t){let e=this.head;for(let s=this.level-1;s>=0;s--)for(;e.forward[s]&&e.forward[s].key<t;)e=e.forward[s];if(e=e.forward[0],e&&e.key===t)return e.value}delete(t){const e=new Array(this.maxLevel).fill(this.head);let s=this.head;for(let i=this.level-1;i>=0;i--){for(;s.forward[i]&&s.forward[i].key<t;)s=s.forward[i];e[i]=s}if(s=s.forward[0],s&&s.key===t){for(let t=0;t<this.level&&e[t].forward[t]===s;t++)e[t].forward[t]=s.forward[t];for(;this.level>0&&null===this.head.forward[this.level-1];)this.level--;return!0}return!1}randomLevel(){let t=1;for(;Math.random()<this.probability&&t<this.maxLevel;)t++;return t}}class _{constructor(t){this._elements=Array.isArray(t)?t:[]}static fromArray(t){return new _(t)}isEmpty(){return 0===this._elements.length}size(){return this._elements.length}peek(){return this.isEmpty()?null:this._elements[this._elements.length-1]}push(t){return this._elements.push(t),this}pop(){return this.isEmpty()?null:this._elements.pop()||null}toArray(){return this._elements.slice()}clear(){this._elements=[]}clone(){return new _(this._elements.slice())}}class p extends u{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){var t;return null===(t=this.head)||void 0===t?void 0:t.val}}class v{constructor(t){this._nodes=t||[],this._offset=0}get nodes(){return this._nodes}set nodes(t){this._nodes=t}get offset(){return this._offset}set offset(t){this._offset=t}get size(){return this.nodes.length-this.offset}static fromArray(t){return new v(t)}push(t){return this.nodes.push(t),this}shift(){if(0===this.size)return;const t=this.peek();return this.offset+=1,2*this.offset<this.nodes.length||(this.nodes=this.nodes.slice(this.offset),this.offset=0),t}peek(){return this.size>0?this.nodes[this.offset]:void 0}peekLast(){return this.size>0?this.nodes[this.nodes.length-1]:void 0}enqueue(t){this.push(t)}dequeue(){return this.shift()}getAt(t){return this.nodes[t]}isEmpty(){return 0===this.size}toArray(){return this.nodes.slice(this.offset)}clear(){this.nodes=[],this.offset=0}clone(){return new v(this.nodes.slice(this.offset))}*[Symbol.iterator](){for(const t of this.nodes)yield t}}class y extends d{}class m{constructor(t){this._nodes={},this._capacity=Number.MAX_SAFE_INTEGER,this._first=-1,this._last=-1,this._size=0,void 0!==t&&(this._capacity=t)}get nodes(){return this._nodes}get capacity(){return this._capacity}set capacity(t){this._capacity=t}get first(){return this._first}set first(t){this._first=t}get last(){return this._last}set last(t){this._last=t}get size(){return this._size}addFirst(t){if(0===this._size){const t=Math.floor(this._capacity/2);this._first=t,this._last=t}else this._first--;this._nodes[this._first]=t,this._size++}addLast(t){if(0===this._size){const t=Math.floor(this._capacity/2);this._first=t,this._last=t}else this._last++;this._nodes[this._last]=t,this._size++}pollFirst(){if(!this._size)return;const t=this.peekFirst();return delete this._nodes[this._first],this._first++,this._size--,t}peekFirst(){if(this._size)return this._nodes[this._first]}pollLast(){if(!this._size)return;const t=this.peekLast();return delete this._nodes[this._last],this._last--,this._size--,t}peekLast(){if(this._size)return this._nodes[this._last]}get(t){return this._nodes[this._first+t]||null}isEmpty(){return this._size<=0}_seNodes(t){this._nodes=t}_setSize(t){this._size=t}}class x{constructor(){this._nodes=[]}get size(){return this._nodes.length}addLast(t){return this._nodes.push(t)}pollLast(){var t;return null!==(t=this._nodes.pop())&&void 0!==t?t:null}pollFirst(){var t;return null!==(t=this._nodes.shift())&&void 0!==t?t:null}addFirst(t){return this._nodes.unshift(t)}peekFirst(){var t;return null!==(t=this._nodes[0])&&void 0!==t?t:null}peekLast(){var t;return null!==(t=this._nodes[this._nodes.length-1])&&void 0!==t?t:null}get(t){var e;return null!==(e=this._nodes[t])&&void 0!==e?e:null}set(t,e){return this._nodes[t]=e}insert(t,e){return this._nodes.splice(t,0,e)}delete(t){return this._nodes.splice(t,1)}isEmpty(){return 0===this._nodes.length}}const b=function(){return"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".replace(/[x]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},E=function(t,e){let s=-1,i=t?t.length:0;const r=[];for(;++s<i;){const n=t[s];e(n,s,t)&&(r.push(n),Array.prototype.splice.call(t,s--,1),i--)}return r},w=Symbol("thunk"),k=t=>"function"==typeof t&&t.__THUNK__===w,M=t=>{const e=()=>t();return e.__THUNK__=w,e},T=t=>Object.assign(((...e)=>{let s=t(...e);for(;k(s)&&"function"==typeof s;)s=s();return s}),{cont:(...e)=>M((()=>t(...e)))}),S=t=>Object.assign(((...e)=>{return s=void 0,i=void 0,n=function*(){let s=yield t(...e);for(;k(s)&&"function"==typeof s;)s=yield s();return s},new((r=void 0)||(r=Promise))((function(t,e){function h(t){try{l(n.next(t))}catch(t){e(t)}}function o(t){try{l(n.throw(t))}catch(t){e(t)}}function l(e){var s;e.done?t(e.value):(s=e.value,s instanceof r?s:new r((function(t){t(s)}))).then(h,o)}l((n=n.apply(s,i||[])).next())}));var s,i,r,n}),{cont:(...e)=>M((()=>t(...e)))}),R=t=>t<=0?0:1<<31-Math.clz32(t);class z{constructor(t){this.nodes=[],this.comparator=t}get size(){return this.nodes.length}get leaf(){var t;return null!==(t=this.nodes[this.size-1])&&void 0!==t?t:void 0}static heapify(t,e){const s=new z(e);return s.nodes=[...t],s.fix(),s}add(t){return this.push(t)}push(t){return this.nodes.push(t),this.bubbleUp(this.nodes.length-1),this}poll(){if(0===this.nodes.length)return;if(1===this.nodes.length)return this.nodes.pop();const t=this.nodes[0];return this.nodes[0]=this.nodes.pop(),this.sinkDown(0),t}pop(){return this.poll()}peek(){if(0!==this.nodes.length)return this.nodes[0]}isEmpty(){return 0===this.size}clear(){this.nodes=[]}refill(t){this.nodes=t,this.fix()}has(t){return this.nodes.includes(t)}dfs(t){const e=[],s=i=>{i<this.size&&("in"===t?(s(2*i+1),e.push(this.nodes[i]),s(2*i+2)):"pre"===t?(e.push(this.nodes[i]),s(2*i+1),s(2*i+2)):"post"===t&&(s(2*i+1),s(2*i+2),e.push(this.nodes[i])))};return s(0),e}toArray(){return[...this.nodes]}getNodes(){return this.nodes}clone(){const t=new z(this.comparator);return t.nodes=[...this.nodes],t}sort(){const t=[],e=this.clone();for(;0!==e.size;){const s=e.poll();s&&t.push(s)}return t}bubbleUp(t){const e=this.nodes[t];for(;t>0;){const s=Math.floor((t-1)/2),i=this.nodes[s];if(!(this.comparator(e,i)<0))break;this.nodes[t]=i,this.nodes[s]=e,t=s}}sinkDown(t){const e=2*t+1,s=2*t+2,i=this.nodes.length;let r=t;if(e<i&&this.comparator(this.nodes[e],this.nodes[r])<0&&(r=e),s<i&&this.comparator(this.nodes[s],this.nodes[r])<0&&(r=s),r!==t){const e=this.nodes[t];this.nodes[t]=this.nodes[r],this.nodes[r]=e,this.sinkDown(r)}}fix(){for(let t=Math.floor(this.size/2);t>=0;t--)this.sinkDown(t)}}class V{constructor(t,e=0){this.element=t,this.degree=e,this.marked=!1}}class C{constructor(t){if(this.size=0,this.clear(),this.comparator=t||this.defaultComparator,"function"!=typeof this.comparator)throw new Error("FibonacciHeap constructor: given comparator should be a function.")}clear(){this.root=void 0,this.min=void 0,this.size=0}add(t){return this.push(t)}push(t){const e=this.createNode(t);return e.left=e,e.right=e,this.mergeWithRoot(e),(!this.min||this.comparator(e.element,this.min.element)<=0)&&(this.min=e),this.size++,this}peek(){return this.min?this.min.element:void 0}consumeLinkedList(t){const e=[];if(!t)return e;let s=t,i=!1;for(;s!==t||!i;)s===t&&(i=!0),s&&(e.push(s),s=s.right);return e}mergeWithChild(t,e){t.child?(e.right=t.child.right,e.left=t.child,t.child.right.left=e,t.child.right=e):t.child=e}poll(){return this.pop()}pop(){if(0===this.size)return;const t=this.min;if(t.child){const e=this.consumeLinkedList(t.child);for(const t of e)this.mergeWithRoot(t),t.parent=void 0}return this.removeFromRoot(t),t===t.right?(this.min=void 0,this.root=void 0):(this.min=t.right,this.consolidate()),this.size--,t.element}merge(t){if(0!==t.size){if(this.root&&t.root){const e=this.root,s=t.root,i=e.right,r=s.left;e.right=s,s.left=e,i.left=r,r.right=i}(!this.min||t.min&&this.comparator(t.min.element,this.min.element)<0)&&(this.min=t.min),this.size+=t.size,t.clear()}}defaultComparator(t,e){return t<e?-1:t>e?1:0}createNode(t){return new V(t)}mergeWithRoot(t){this.root?(t.right=this.root.right,t.left=this.root,this.root.right.left=t,this.root.right=t):this.root=t}removeFromRoot(t){this.root===t&&(this.root=t.right),t.left&&(t.left.right=t.right),t.right&&(t.right.left=t.left)}link(t,e){this.removeFromRoot(t),t.left=t,t.right=t,this.mergeWithChild(e,t),e.degree++,t.parent=e}consolidate(){const t=new Array(this.size),e=this.consumeLinkedList(this.root);let s,i,r,n;for(const h of e){for(s=h,r=s.degree;t[r];)i=t[r],this.comparator(s.element,i.element)>0&&(n=s,s=i,i=n),this.link(i,s),t[r]=void 0,r++;t[r]=s}for(let e=0;e<this.size;e++)t[e]&&this.comparator(t[e].element,this.min.element)<=0&&(this.min=t[e])}}class A extends z{constructor(t){super(t)}}class N{constructor(t,e){this._key=t,this._val=e}get key(){return this._key}set key(t){this._key=t}get val(){return this._val}set val(t){this._val=t}}class O{constructor(t,e){this._weight=void 0!==t?t:1,this._val=e,this._hashCode=b()}get val(){return this._val}set val(t){this._val=t}get weight(){return this._weight}set weight(t){this._weight=t}get hashCode(){return this._hashCode}_setHashCode(t){this._hashCode=t}}class L{constructor(){this._vertices=new Map}get vertices(){return this._vertices}getVertex(t){return this._vertices.get(t)||null}hasVertex(t){return this._vertices.has(this._getVertexKey(t))}addVertex(t,e){if(t instanceof N)return this._addVertexOnly(t);{const s=this.createVertex(t,e);return this._addVertexOnly(s)}}removeVertex(t){const e=this._getVertexKey(t);return this._vertices.delete(e)}removeAllVertices(t){const e=[];for(const s of t)e.push(this.removeVertex(s));return e.length>0}hasEdge(t,e){return!!this.getEdge(t,e)}addEdge(t,e,s,i){if(t instanceof O)return this._addEdgeOnly(t);if(e instanceof N||"string"==typeof e||"number"==typeof e){if(!this.hasVertex(t)||!this.hasVertex(e))return!1;t instanceof N&&(t=t.key),e instanceof N&&(e=e.key);const r=this.createEdge(t,e,s,i);return this._addEdgeOnly(r)}throw new Error("dest must be a Vertex or vertex key while srcOrEdge is an Edge")}setEdgeWeight(t,e,s){const i=this.getEdge(t,e);return!!i&&(i.weight=s,!0)}getAllPathsBetween(t,e){const s=[],i=this._getVertex(t),r=this._getVertex(e);if(!i||!r)return[];const n=(t,e,r,h)=>{r.set(t,!0),t===e&&s.push([i,...h]);const o=this.getNeighbors(t);for(const t of o)r.get(t)||(h.push(t),n(t,e,r,h),E(h,(e=>e===t)));r.set(t,!1)};return n(i,r,new Map,[]),s}getPathSumWeight(t){var e;let s=0;for(let i=0;i<t.length;i++)s+=(null===(e=this.getEdge(t[i],t[i+1]))||void 0===e?void 0:e.weight)||0;return s}getMinCostBetween(t,e,s){if(void 0===s&&(s=!1),s){const s=this.getAllPathsBetween(t,e);let i=1/0;for(const t of s)i=Math.min(this.getPathSumWeight(t),i);return i}{const s=this._getVertex(e),i=this._getVertex(t);if(!i||!s)return null;const r=new Map,n=new v([i]);r.set(i,!0);let h=0;for(;n.size>0;){for(let t=0;t<n.size;t++){const t=n.shift();if(t===s)return h;if(void 0!==t){const e=this.getNeighbors(t);for(const t of e)r.has(t)||(r.set(t,!0),n.push(t))}}h++}return null}}getMinPathBetween(t,e,s){if(void 0===s&&(s=!1),s){const s=this.getAllPathsBetween(t,e);let i=1/0,r=-1,n=0;for(const t of s){const e=this.getPathSumWeight(t);e<i&&(i=e,r=n),n++}return s[r]||null}{let s=[];const i=this._getVertex(t),r=this._getVertex(e);if(!i||!r)return[];const n=(t,e,r,h)=>{if(r.set(t,!0),t===e)return void(s=[i,...h]);const o=this.getNeighbors(t);for(const t of o)r.get(t)||(h.push(t),n(t,e,r,h),E(h,(e=>e===t)));r.set(t,!1)};return n(i,r,new Map,[]),s}}dijkstraWithoutHeap(t,e,s,i){void 0===s&&(s=!1),void 0===i&&(i=!1),void 0===e&&(e=null);let r=1/0,n=null,h=[];const o=[],l=this._vertices,a=new Map,u=new Set,c=new Map,d=this._getVertex(t),f=e?this._getVertex(e):null;if(!d)return null;for(const t of l){const e=t[1];e instanceof N&&a.set(e,1/0)}a.set(d,0),c.set(d,null);const g=()=>{let t=1/0,e=null;for(const[s,i]of a)u.has(s)||i<t&&(t=i,e=s);return e},_=t=>{for(const e of l){const s=e[1];if(s instanceof N){const i=[s];let r=c.get(s);for(;r;)i.push(r),r=c.get(r);const n=i.reverse();e[1]===t&&(h=n),o.push(n)}}};for(let t=1;t<l.size;t++){const t=g();if(t){if(u.add(t),f&&f===t)return s&&(r=a.get(f)||1/0),i&&_(f),{distMap:a,preMap:c,seen:u,paths:o,minDist:r,minPath:h};const e=this.getNeighbors(t);for(const s of e)if(!u.has(s)){const e=this.getEdge(t,s);if(e){const i=a.get(t),r=a.get(s);void 0!==i&&void 0!==r&&e.weight+i<r&&(a.set(s,e.weight+i),c.set(s,t))}}}}return s&&a.forEach(((t,e)=>{e!==d&&t<r&&(r=t,i&&(n=e))})),i&&_(n),{distMap:a,preMap:c,seen:u,paths:o,minDist:r,minPath:h}}dijkstra(t,e,s,i){var r;void 0===s&&(s=!1),void 0===i&&(i=!1),void 0===e&&(e=null);let n=1/0,h=null,o=[];const l=[],a=this._vertices,u=new Map,c=new Set,d=new Map,f=this._getVertex(t),g=e?this._getVertex(e):null;if(!f)return null;for(const t of a){const e=t[1];e instanceof N&&u.set(e,1/0)}const _=new A(((t,e)=>t.key-e.key));_.add({key:0,val:f}),u.set(f,0),d.set(f,null);const p=t=>{for(const e of a){const s=e[1];if(s instanceof N){const i=[s];let r=d.get(s);for(;r;)i.push(r),r=d.get(r);const n=i.reverse();e[1]===t&&(o=n),l.push(n)}}};for(;_.size>0;){const t=_.poll(),e=null==t?void 0:t.key,h=null==t?void 0:t.val;if(void 0!==e&&h){if(c.add(h),g&&g===h)return s&&(n=u.get(g)||1/0),i&&p(g),{distMap:u,preMap:d,seen:c,paths:l,minDist:n,minPath:o};const t=this.getNeighbors(h);for(const s of t)if(!c.has(s)){const t=null===(r=this.getEdge(h,s))||void 0===r?void 0:r.weight;if("number"==typeof t){const i=u.get(s);i&&e+t<i&&(_.add({key:e+t,val:s}),d.set(s,h),u.set(s,e+t))}}}}return s&&u.forEach(((t,e)=>{e!==f&&t<n&&(n=t,i&&(h=e))})),i&&p(h),{distMap:u,preMap:d,seen:c,paths:l,minDist:n,minPath:o}}bellmanFord(t,e,s,i){void 0===s&&(s=!1),void 0===i&&(i=!1);const r=this._getVertex(t),n=[],h=new Map,o=new Map;let l,a=1/0,u=[];if(e&&(l=!1),!r)return{hasNegativeCycle:l,distMap:h,preMap:o,paths:n,min:a,minPath:u};const c=this._vertices,d=c.size,f=this.edgeSet(),g=f.length;this._vertices.forEach((t=>{h.set(t,1/0)})),h.set(r,0);for(let t=1;t<d;++t)for(let t=0;t<g;++t){const e=this.getEndsOfEdge(f[t]);if(e){const[s,r]=e,n=f[t].weight,l=h.get(s),a=h.get(r);void 0!==l&&void 0!==a&&h.get(s)!==1/0&&l+n<a&&(h.set(r,l+n),i&&o.set(r,s))}}let _=null;if(s&&h.forEach(((t,e)=>{e!==r&&t<a&&(a=t,i&&(_=e))})),i)for(const t of c){const e=t[1];if(e instanceof N){const s=[e];let i=o.get(e);for(;void 0!==i;)s.push(i),i=o.get(i);const r=s.reverse();t[1]===_&&(u=r),n.push(r)}}for(let t=0;t<g;++t){const e=this.getEndsOfEdge(f[t]);if(e){const[s]=e,i=f[t].weight,r=h.get(s);r&&r!==1/0&&r+i<r&&(l=!0)}}return{hasNegativeCycle:l,distMap:h,preMap:o,paths:n,min:a,minPath:u}}floyd(){var t;const e=[...this._vertices],s=e.length,i=[],r=[];for(let t=0;t<s;t++){i[t]=[],r[t]=[];for(let e=0;e<s;e++)r[t][e]=null}for(let r=0;r<s;r++)for(let n=0;n<s;n++)i[r][n]=(null===(t=this.getEdge(e[r][1],e[n][1]))||void 0===t?void 0:t.weight)||1/0;for(let t=0;t<s;t++)for(let n=0;n<s;n++)for(let h=0;h<s;h++)i[n][h]>i[n][t]+i[t][h]&&(i[n][h]=i[n][t]+i[t][h],r[n][h]=e[t][1]);return{costs:i,predecessor:r}}tarjan(t,e,s,i){const r=!1;void 0===t&&(t=r),void 0===e&&(e=r),void 0===s&&(s=r),void 0===i&&(i=r);const n=new Map,h=new Map,o=this._vertices;o.forEach((t=>{n.set(t,-1),h.set(t,1/0)}));const[l]=o.values(),a=[],u=[];let c=0;const d=(s,i)=>{c++,n.set(s,c),h.set(s,c);const r=this.getNeighbors(s);let o=0;for(const c of r)if(c!==i){-1===n.get(c)&&(o++,d(c,s));const i=h.get(c),r=h.get(s);void 0!==r&&void 0!==i&&h.set(s,Math.min(r,i));const f=n.get(s);if(void 0!==i&&void 0!==f&&(t&&(s===l&&o>=2||s!==l&&i>=f)&&a.push(s),e&&i>f)){const t=this.getEdge(s,c);t&&u.push(t)}}};d(l,null);let f=new Map;const g=()=>{const t=new Map;return h.forEach(((e,s)=>{var i;t.has(e)?null===(i=t.get(e))||void 0===i||i.push(s):t.set(e,[s])})),t};s&&(f=g());const _=new Map;if(i){let t=new Map;t.size<1&&(t=g()),t.forEach(((t,e)=>{t.length>1&&_.set(e,t)}))}return{dfnMap:n,lowMap:h,bridges:u,articulationPoints:a,SCCs:f,cycles:_}}_addVertexOnly(t){return!this.hasVertex(t)&&(this._vertices.set(t.key,t),!0)}_getVertex(t){const e=this._getVertexKey(t);return this._vertices.get(e)||null}_getVertexKey(t){return t instanceof N?t.key:t}_setVertices(t){this._vertices=t}}class I extends N{constructor(t,e){super(t,e)}}class F extends O{constructor(t,e,s,i){super(s,i),this._src=t,this._dest=e}get src(){return this._src}set src(t){this._src=t}get dest(){return this._dest}set dest(t){this._dest=t}}class P extends L{constructor(){super(),this._outEdgeMap=new Map,this._inEdgeMap=new Map}get outEdgeMap(){return this._outEdgeMap}get inEdgeMap(){return this._inEdgeMap}createVertex(t,e){return new I(t,null!=e?e:t)}createEdge(t,e,s,i){return new F(t,e,null!=s?s:1,i)}getEdge(t,e){let s=[];if(null!==t&&null!==e){const i=this._getVertex(t),r=this._getVertex(e);if(i&&r){const t=this._outEdgeMap.get(i);t&&(s=t.filter((t=>t.dest===r.key)))}}return s[0]||null}removeEdgeSrcToDest(t,e){const s=this._getVertex(t),i=this._getVertex(e);let r=null;if(!s||!i)return null;const n=this._outEdgeMap.get(s);n&&E(n,(t=>t.dest===i.key));const h=this._inEdgeMap.get(i);return h&&(r=E(h,(t=>t.src===s.key))[0]||null),r}removeEdge(t){let e=null;const s=this._getVertex(t.src),i=this._getVertex(t.dest);if(s&&i){const t=this._outEdgeMap.get(s);t&&t.length>0&&E(t,(t=>t.src===s.key));const r=this._inEdgeMap.get(i);r&&r.length>0&&(e=E(r,(t=>t.dest===i.key))[0])}return e}removeEdgesBetween(t,e){const s=[];if(t&&e){const i=this.removeEdgeSrcToDest(t,e),r=this.removeEdgeSrcToDest(e,t);i&&s.push(i),r&&s.push(r)}return s}incomingEdgesOf(t){const e=this._getVertex(t);return e&&this.inEdgeMap.get(e)||[]}outgoingEdgesOf(t){const e=this._getVertex(t);return e&&this._outEdgeMap.get(e)||[]}degreeOf(t){return this.outDegreeOf(t)+this.inDegreeOf(t)}inDegreeOf(t){return this.incomingEdgesOf(t).length}outDegreeOf(t){return this.outgoingEdgesOf(t).length}edgesOf(t){return[...this.outgoingEdgesOf(t),...this.incomingEdgesOf(t)]}getEdgeSrc(t){return this._getVertex(t.src)}getEdgeDest(t){return this._getVertex(t.dest)}getDestinations(t){if(null===t)return[];const e=[],s=this.outgoingEdgesOf(t);for(const t of s){const s=this.getEdgeDest(t);s&&e.push(s)}return e}topologicalSort(t){t=null!=t?t:"key";const e=new Map;for(const t of this.vertices)e.set(t[1],0);let s=[],i=!1;const r=t=>{e.set(t,1);const n=this.getDestinations(t);for(const t of n){const s=e.get(t);0===s?r(t):1===s&&(i=!0)}e.set(t,2),s.push(t)};for(const t of this.vertices)0===e.get(t[1])&&r(t[1]);return i?null:("key"===t&&(s=s.map((t=>t instanceof I?t.key:t))),s.reverse())}edgeSet(){let t=[];return this._outEdgeMap.forEach((e=>{t=[...t,...e]})),t}getNeighbors(t){const e=[],s=this._getVertex(t);if(s){const t=this.outgoingEdgesOf(s);for(const s of t){const t=this._getVertex(s.dest);t&&e.push(t)}}return e}getEndsOfEdge(t){if(!this.hasEdge(t.src,t.dest))return null;const e=this._getVertex(t.src),s=this._getVertex(t.dest);return e&&s?[e,s]:null}_addEdgeOnly(t){if(!this.hasVertex(t.src)||!this.hasVertex(t.dest))return!1;const e=this._getVertex(t.src),s=this._getVertex(t.dest);if(e&&s){const i=this._outEdgeMap.get(e);i?i.push(t):this._outEdgeMap.set(e,[t]);const r=this._inEdgeMap.get(s);return r?r.push(t):this._inEdgeMap.set(s,[t]),!0}return!1}_setOutEdgeMap(t){this._outEdgeMap=t}_setInEdgeMap(t){this._inEdgeMap=t}}class D extends N{constructor(t,e){super(t,e)}}class B extends O{constructor(t,e,s,i){super(s,i),this._vertices=[t,e]}get vertices(){return this._vertices}set vertices(t){this._vertices=t}}class H extends L{constructor(){super(),this._edges=new Map}get edges(){return this._edges}createVertex(t,e){return new D(t,null!=e?e:t)}createEdge(t,e,s,i){return new B(t,e,null!=s?s:1,i)}getEdge(t,e){var s;let i=[];if(null!==t&&null!==e){const r=this._getVertex(t),n=this._getVertex(e);r&&n&&(i=null===(s=this._edges.get(r))||void 0===s?void 0:s.filter((t=>t.vertices.includes(n.key))))}return i&&i[0]||null}removeEdgeBetween(t,e){const s=this._getVertex(t),i=this._getVertex(e);if(!s||!i)return null;const r=this._edges.get(s);let n=null;r&&(n=E(r,(t=>t.vertices.includes(i.key)))[0]||null);const h=this._edges.get(i);return h&&E(h,(t=>t.vertices.includes(s.key))),n}removeEdge(t){return this.removeEdgeBetween(t.vertices[0],t.vertices[1])}degreeOf(t){var e;const s=this._getVertex(t);return s&&(null===(e=this._edges.get(s))||void 0===e?void 0:e.length)||0}edgesOf(t){const e=this._getVertex(t);return e&&this._edges.get(e)||[]}edgeSet(){const t=new Set;return this._edges.forEach((e=>{e.forEach((e=>{t.add(e)}))})),[...t]}getNeighbors(t){const e=[],s=this._getVertex(t);if(s){const t=this.edgesOf(s);for(const i of t){const t=this._getVertex(i.vertices.filter((t=>t!==s.key))[0]);t&&e.push(t)}}return e}getEndsOfEdge(t){if(!this.hasEdge(t.vertices[0],t.vertices[1]))return null;const e=this._getVertex(t.vertices[0]),s=this._getVertex(t.vertices[1]);return e&&s?[e,s]:null}_addEdgeOnly(t){for(const e of t.vertices){const s=this._getVertex(e);if(null===s)return!1;if(s){const e=this._edges.get(s);e?e.push(t):this._edges.set(s,[t])}}return!0}_setEdges(t){this._edges=t}}class q extends I{constructor(t,e,s,i){super(t,i),this._lat=e,this._long=s}get lat(){return this._lat}set lat(t){this._lat=t}get long(){return this._long}set long(t){this._long=t}}class j extends F{constructor(t,e,s,i){super(t,e,s,i)}}class U extends P{constructor(t,e){super(),this._origin=[0,0],this._origin=t,this._bottomRight=e}get origin(){return this._origin}set origin(t){this._origin=t}get bottomRight(){return this._bottomRight}set bottomRight(t){this._bottomRight=t}createVertex(t,e,s=this.origin[0],i=this.origin[1]){return new q(t,s,i,e)}createEdge(t,e,s,i){return new j(t,e,s,i)}}var K,G,W,Q,Y;!function(t){t.ITERATIVE="ITERATIVE",t.RECURSIVE="RECURSIVE"}(K||(K={})),function(t){t.ROOT="ROOT",t.LEFT="LEFT",t.RIGHT="RIGHT",t.ROOT_LEFT="ROOT_LEFT",t.ROOT_RIGHT="ROOT_RIGHT",t.ISOLATED="ISOLATED",t.MAL_NODE="MAL_NODE"}(G||(G={})),function(t){t.RED="RED",t.BLACK="BLACK"}(W||(W={})),function(t){t.VAL="VAL",t.NODE="NODE",t.ID="ID"}(Q||(Q={})),function(t){t.lt="lt",t.eq="eq",t.gt="gt"}(Y||(Y={}));class J{constructor(t,e){this.key=t,this.val=e}get left(){return this._left}set left(t){t&&(t.parent=this),this._left=t}get right(){return this._right}set right(t){t&&(t.parent=this),this._right=t}get familyPosition(){const t=this;return t.parent?t.parent.left===t?t.left||t.right?G.ROOT_LEFT:G.LEFT:t.parent.right===t?t.left||t.right?G.ROOT_RIGHT:G.RIGHT:G.MAL_NODE:t.left||t.right?G.ROOT:G.ISOLATED}}class X{constructor(t){if(this._loopType=K.ITERATIVE,this._root=null,this._size=0,this._defaultCallbackByKey=t=>t.key,void 0!==t){const{iterationType:e=K.ITERATIVE}=t;this._loopType=e}}get root(){return this._root}get size(){return this._size}get iterationType(){return this._loopType}set iterationType(t){this._loopType=t}createNode(t,e){return new J(t,e)}clear(){this._root=null,this._size=0}isEmpty(){return 0===this.size}add(t,e){let s,i;if(null===t)i=null;else if("number"==typeof t)i=this.createNode(t,e);else{if(!(t instanceof J))return;i=t}const r=t?this.get(t,this._defaultCallbackByKey):void 0;return this.root?r?(r.val=e,s=r):s=((t,e)=>{const s=new v([t]);for(;s.size>0;){const t=s.shift();if(!t)return;{if(e&&t.key===e.key)return;const i=this._addTo(e,t);if(void 0!==i)return i;t.left&&s.push(t.left),t.right&&s.push(t.right)}}})(this.root,i):(this._setRoot(i),null!==i?this._setSize(1):this._setSize(0),s=this.root),s}addMany(t,e){const s=[];for(let i=0;i<t.length;i++){const r=t[i];if(r instanceof J){s.push(this.add(r.key,r.val));continue}if(null===r){s.push(this.add(null));continue}const n=null==e?void 0:e[i];s.push(this.add(r,n))}return s}refill(t,e){return this.clear(),t.length===this.addMany(t,e).length}delete(t){const e=[];if(!this.root)return e;const s="number"==typeof t?this.get(t):t;if(!s)return e;const i=(null==s?void 0:s.parent)?s.parent:null;let r=null,n=s;if(s.left){const t=s.left?this.getRightMost(s.left):null;if(t){const e=t.parent;n=this._swap(s,t),e&&(e.right===t?e.right=t.left:e.left=t.left,r=e)}}else if(i){const{familyPosition:t}=s;t===G.LEFT||t===G.ROOT_LEFT?i.left=s.right:t!==G.RIGHT&&t!==G.ROOT_RIGHT||(i.right=s.right),r=i}else void 0!==s.right&&this._setRoot(s.right);return this._setSize(this.size-1),e.push({deleted:n,needBalanced:r}),e}getDepth(t,e=this.root){"number"==typeof t&&(t=this.get(t)),"number"==typeof e&&(e=this.get(e));let s=0;for(;null==t?void 0:t.parent;){if(t===e)return s;s++,t=t.parent}return s}getHeight(t=this.root,e=this.iterationType){if("number"==typeof t&&(t=this.get(t)),!t)return-1;if(e===K.RECURSIVE){const e=t=>{if(!t)return-1;const s=e(t.left),i=e(t.right);return Math.max(s,i)+1};return e(t)}{if(!t)return-1;const e=[{node:t,depth:0}];let s=0;for(;e.length>0;){const{node:t,depth:i}=e.pop();t.left&&e.push({node:t.left,depth:i+1}),t.right&&e.push({node:t.right,depth:i+1}),s=Math.max(s,i)}return s}}getMinHeight(t=this.root,e=this.iterationType){var s,i,r;if(!t)return-1;if(e===K.RECURSIVE){const e=t=>{if(!t)return 0;if(!t.left&&!t.right)return 0;const s=e(t.left),i=e(t.right);return Math.min(s,i)+1};return e(t)}{const e=[];let n=t,h=null;const o=new Map;for(;e.length>0||n;)if(n)e.push(n),n=n.left;else if(n=e[e.length-1],n.right&&h!==n.right)n=n.right;else if(n=e.pop(),n){const t=n.left&&null!==(s=o.get(n.left))&&void 0!==s?s:-1,e=n.right&&null!==(i=o.get(n.right))&&void 0!==i?i:-1;o.set(n,1+Math.min(t,e)),h=n,n=null}return null!==(r=o.get(t))&&void 0!==r?r:-1}}isPerfectlyBalanced(t=this.root){return this.getMinHeight(t)+1>=this.getHeight(t)}getNodes(t,e=this._defaultCallbackByKey,s=!1,i=this.root,r=this.iterationType){if(!i)return[];const n=[];if(r===K.RECURSIVE){const r=i=>{e(i)===t&&(n.push(i),s)||(i.left||i.right)&&(i.left&&r(i.left),i.right&&r(i.right))};r(i)}else{const r=new v([i]);for(;r.size>0;){const i=r.shift();if(i){if(e(i)===t&&(n.push(i),s))return n;i.left&&r.push(i.left),i.right&&r.push(i.right)}}}return n}has(t,e=this._defaultCallbackByKey,s=this.root,i=this.iterationType){return this.getNodes(t,e,!0,s,i).length>0}get(t,e=this._defaultCallbackByKey,s=this.root,i=this.iterationType){var r;return null!==(r=this.getNodes(t,e,!0,s,i)[0])&&void 0!==r?r:null}getPathToRoot(t,e=!0){const s=[];for(;t.parent;)s.push(t),t=t.parent;return s.push(t),e?s.reverse():s}getLeftMost(t=this.root,e=this.iterationType){if("number"==typeof t&&(t=this.get(t)),!t)return t;if(e===K.RECURSIVE){const e=t=>t.left?e(t.left):t;return e(t)}{const e=T((t=>t.left?e.cont(t.left):t));return e(t)}}getRightMost(t=this.root,e=this.iterationType){if(!t)return t;if(e===K.RECURSIVE){const e=t=>t.right?e(t.right):t;return e(t)}{const e=T((t=>t.right?e.cont(t.right):t));return e(t)}}isSubtreeBST(t,e=this.iterationType){if(!t)return!0;if(e===K.RECURSIVE){const e=(t,s,i)=>!t||!(t.key<=s||t.key>=i)&&e(t.left,s,t.key)&&e(t.right,t.key,i);return e(t,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}{const e=[];let s=Number.MIN_SAFE_INTEGER,i=t;for(;i||e.length>0;){for(;i;)e.push(i),i=i.left;if(i=e.pop(),!i||s>=i.key)return!1;s=i.key,i=i.right}return!0}}isBST(t=this.iterationType){return null===this.root||this.isSubtreeBST(this.root,t)}subTreeTraverse(t=this._defaultCallbackByKey,e=this.root,s=this.iterationType){"number"==typeof e&&(e=this.get(e));const i=[];if(!e)return i;if(s===K.RECURSIVE){const s=e=>{i.push(t(e)),e.left&&s(e.left),e.right&&s(e.right)};s(e)}else{const s=[e];for(;s.length>0;){const e=s.pop();i.push(t(e)),e.right&&s.push(e.right),e.left&&s.push(e.left)}}return i}dfs(t=this._defaultCallbackByKey,e="in",s=this.root,i=K.ITERATIVE){if(!s)return[];const r=[];if(i===K.RECURSIVE){const i=s=>{switch(e){case"in":s.left&&i(s.left),r.push(t(s)),s.right&&i(s.right);break;case"pre":r.push(t(s)),s.left&&i(s.left),s.right&&i(s.right);break;case"post":s.left&&i(s.left),s.right&&i(s.right),r.push(t(s))}};i(s)}else{const i=[{opt:0,node:s}];for(;i.length>0;){const s=i.pop();if(s&&s.node)if(1===s.opt)r.push(t(s.node));else switch(e){case"in":default:i.push({opt:0,node:s.node.right}),i.push({opt:1,node:s.node}),i.push({opt:0,node:s.node.left});break;case"pre":i.push({opt:0,node:s.node.right}),i.push({opt:0,node:s.node.left}),i.push({opt:1,node:s.node});break;case"post":i.push({opt:1,node:s.node}),i.push({opt:0,node:s.node.right}),i.push({opt:0,node:s.node.left})}}}return r}bfs(t=this._defaultCallbackByKey,e=!1,s=this.root,i=this.iterationType){if(!s)return[];const r=[];if(i===K.RECURSIVE){const i=(s,n)=>{t&&r.push(t(s,e?n:void 0)),s.left&&i(s.left,n+1),s.right&&i(s.right,n+1)};i(s,0)}else{const i=[[s,0]];for(;i.length>0;){const s=i.pop(),[n,h]=s;t&&r.push(t(n,e?h:void 0)),n.right&&i.push([n.right,h+1]),n.left&&i.push([n.left,h+1])}}return r}getPredecessor(t){if(t.left){let e=t.left;for(;!e||e.right&&e.right!==t;)e&&(e=e.right);return e}return t}morris(t=this._defaultCallbackByKey,e="in",s=this.root){if(null===s)return[];const i=[];let r=s;const n=t=>{let e=null,s=null;for(;t;)s=t.right,t.right=e,e=t,t=s;return e},h=e=>{const s=n(e);let r=s;for(;r;)i.push(t(r)),r=r.right;n(s)};switch(e){case"in":for(;r;){if(r.left){const t=this.getPredecessor(r);if(!t.right){t.right=r,r=r.left;continue}t.right=null}i.push(t(r)),r=r.right}break;case"pre":for(;r;){if(r.left){const e=this.getPredecessor(r);if(!e.right){e.right=r,i.push(t(r)),r=r.left;continue}e.right=null}else i.push(t(r));r=r.right}break;case"post":for(;r;){if(r.left){const t=this.getPredecessor(r);if(null===t.right){t.right=r,r=r.left;continue}t.right=null,h(r.left)}r=r.right}h(s)}return i}_swap(t,e){const{key:s,val:i}=e,r=this.createNode(s,i);return r&&(e.key=t.key,e.val=t.val,t.key=r.key,t.val=r.val),e}_addTo(t,e){return e?void 0===e.left?(e.left=t,t&&this._setSize(this.size+1),e.left):void 0===e.right?(e.right=t,t&&this._setSize(this.size+1),e.right):void 0:void 0}_setRoot(t){t&&(t.parent=void 0),this._root=t}_setSize(t){this._size=t}}class Z extends J{constructor(t,e){super(t,e)}}class $ extends X{constructor(t){if(super(t),this._comparator=(t,e)=>t-e,void 0!==t){const{comparator:e}=t;void 0!==e&&(this._comparator=e)}}createNode(t,e){return new Z(t,e)}add(t,e){let s=null,i=null;if(t instanceof Z?i=t:"number"==typeof t?i=this.createNode(t,e):null===t&&(i=null),null===this.root)this._setRoot(i),this._setSize(this.size+1),s=this.root;else{let t=this.root,e=!0;for(;e;)null!==t&&null!==i?this._compare(t.key,i.key)===Y.eq?(i&&(t.val=i.val),e=!1,s=t):this._compare(t.key,i.key)===Y.gt?void 0===t.left?(i&&(i.parent=t),t.left=i,this._setSize(this.size+1),e=!1,s=t.left):t.left&&(t=t.left):this._compare(t.key,i.key)===Y.lt&&(void 0===t.right?(i&&(i.parent=t),t.right=i,this._setSize(this.size+1),e=!1,s=t.right):t.right&&(t=t.right)):e=!1}return s}addMany(t,e,s=!0,i=this.iterationType){if(!s||-1!==t.indexOf(null))return super.addMany(t,e);const r=[],n=t.map(((t,s)=>[t,null==e?void 0:e[s]]));let h=[],o=[],l=[];if(function(t){for(const[e]of t)if(e instanceof Z)return!0;return!1}(n))h=n.sort(((t,e)=>t[0].key-e[0].key));else{if(!function(t){for(const[e]of t)if("number"==typeof e)return!0;return!1}(n))throw new Error("Invalid input keysOrNodes");h=n.sort(((t,e)=>t[0]-e[0]))}o=h.map((([t])=>t)),l=h.map((([,t])=>t));const a=(t,e)=>{if(0===t.length)return;const s=Math.floor((t.length-1)/2),i=this.add(t[s],null==e?void 0:e[s]);r.push(i),a(t.slice(0,s),null==e?void 0:e.slice(0,s)),a(t.slice(s+1),null==e?void 0:e.slice(s+1))};return i===K.RECURSIVE?a(o,l):(()=>{const t=[[0,h.length-1]];for(;t.length>0;){const e=t.pop();if(e){const[s,i]=e;if(s<=i){const e=s+Math.floor((i-s)/2),n=this.add(o[e],null==l?void 0:l[e]);r.push(n),t.push([e+1,i]),t.push([s,e-1])}}}})(),r}get(t,e=this._defaultCallbackByKey,s=this.root,i=this.iterationType){var r;return null!==(r=this.getNodes(t,e,!0,s,i)[0])&&void 0!==r?r:null}lastKey(t=this.root,e=this.iterationType){var s,i,r,n,h,o;return this._compare(0,1)===Y.lt?null!==(i=null===(s=this.getRightMost(t,e))||void 0===s?void 0:s.key)&&void 0!==i?i:0:this._compare(0,1)===Y.gt?null!==(n=null===(r=this.getLeftMost(t,e))||void 0===r?void 0:r.key)&&void 0!==n?n:0:null!==(o=null===(h=this.getRightMost(t,e))||void 0===h?void 0:h.key)&&void 0!==o?o:0}getNodes(t,e=this._defaultCallbackByKey,s=!1,i=this.root,r=this.iterationType){if(!i)return[];const n=[];if(r===K.RECURSIVE){const r=i=>{e(i)===t&&(n.push(i),s)||(i.left||i.right)&&(e===this._defaultCallbackByKey?(this._compare(i.key,t)===Y.gt&&i.left&&r(i.left),this._compare(i.key,t)===Y.lt&&i.right&&r(i.right)):(i.left&&r(i.left),i.right&&r(i.right)))};r(i)}else{const r=new v([i]);for(;r.size>0;){const i=r.shift();if(i){if(e(i)===t&&(n.push(i),s))return n;e===this._defaultCallbackByKey?(this._compare(i.key,t)===Y.gt&&i.left&&r.push(i.left),this._compare(i.key,t)===Y.lt&&i.right&&r.push(i.right)):(i.left&&r.push(i.left),i.right&&r.push(i.right))}}}return n}lesserOrGreaterTraverse(t=this._defaultCallbackByKey,e=Y.lt,s=this.root,i=this.iterationType){"number"==typeof s&&(s=this.get(s));const r=[];if(!s)return r;const n=s.key;if(!this.root)return r;if(i===K.RECURSIVE){const s=i=>{this._compare(i.key,n)===e&&r.push(t(i)),(i.left||i.right)&&(i.left&&this._compare(i.left.key,n)===e&&s(i.left),i.right&&this._compare(i.right.key,n)===e&&s(i.right))};return s(this.root),r}{const s=new v([this.root]);for(;s.size>0;){const i=s.shift();i&&(this._compare(i.key,n)===e&&r.push(t(i)),i.left&&this._compare(i.left.key,n)===e&&s.push(i.left),i.right&&this._compare(i.right.key,n)===e&&s.push(i.right))}return r}}perfectlyBalance(t=this.iterationType){const e=this.dfs((t=>t),"in"),s=e.length;if(this.clear(),e.length<1)return!1;if(t===K.RECURSIVE){const t=(s,i)=>{if(s>i)return;const r=s+Math.floor((i-s)/2),n=e[r];this.add(n.key,n.val),t(s,r-1),t(r+1,i)};return t(0,s-1),!0}{const t=[[0,s-1]];for(;t.length>0;){const s=t.pop();if(s){const[i,r]=s;if(i<=r){const s=i+Math.floor((r-i)/2),n=e[s];this.add(n.key,n.val),t.push([s+1,r]),t.push([i,s-1])}}}return!0}}isAVLBalanced(t=this.iterationType){var e,s;if(!this.root)return!0;let i=!0;if(t===K.RECURSIVE){const t=e=>{if(!e)return 0;const s=t(e.left),r=t(e.right);return Math.abs(s-r)>1&&(i=!1),Math.max(s,r)+1};t(this.root)}else{const t=[];let i=this.root,r=null;const n=new Map;for(;t.length>0||i;)if(i)t.push(i),i=i.left;else if(i=t[t.length-1],i.right&&r!==i.right)i=i.right;else if(i=t.pop(),i){const t=i.left&&null!==(e=n.get(i.left))&&void 0!==e?e:-1,h=i.right&&null!==(s=n.get(i.right))&&void 0!==s?s:-1;if(Math.abs(t-h)>1)return!1;n.set(i,1+Math.max(t,h)),r=i,i=null}}return i}_compare(t,e){const s=this._comparator(t,e);return s>0?Y.gt:s<0?Y.lt:Y.eq}}class tt{constructor({frequency:t=0,max:e}){this._freq=t,this._max=e,this._freqMap={0:0},this._msb=R(e),this._negativeCount=t<0?e:0}get freqMap(){return this._freqMap}set freqMap(t){this._freqMap=t}get msb(){return this._msb}set msb(t){this._msb=t}get negativeCount(){return this._negativeCount}set negativeCount(t){this._negativeCount=t}get freq(){return this._freq}get max(){return this._max}readSingle(t){return this._checkIndex(t),this._readSingle(t)}update(t,e){this._checkIndex(t);const s=this._readSingle(t);this._update(t,e),this._updateNegativeCount(s,s+e)}writeSingle(t,e){this._checkIndex(t),this._writeSingle(t,e)}read(t){if(!Number.isInteger(t))throw new Error("Invalid count");return this._read(Math.max(Math.min(t,this.max),0))}lowerBound(t){if(this.negativeCount>0)throw new Error("Sequence is not non-descending");return this._binarySearch(t,((t,e)=>t<e))}upperBound(t){if(this.negativeCount>0)throw new Error("Must not be descending");return this._binarySearch(t,((t,e)=>t<=e))}_getFrequency(t){return t in this.freqMap?this.freqMap[t]:this.freq*(t&-t)}_updateFrequency(t,e){this.freqMap[t]=this._getFrequency(t)+e}_checkIndex(t){if(!Number.isInteger(t))throw new Error("Invalid index: Index must be an integer.");if(t<0||t>=this.max)throw new Error("Index out of range: Index must be within the range [0, this.max).")}_readSingle(t){t+=1;let e=this._getFrequency(t);const s=t-(t&-t);for(t--;t!==s;)e-=this._getFrequency(t),t-=t&-t;return e}_updateNegativeCount(t,e){t<0&&e>=0?this.negativeCount--:t>=0&&e<0&&this.negativeCount++}_update(t,e){for(t+=1;t<=this.max;)this._updateFrequency(t,e),t+=t&-t}_writeSingle(t,e){const s=this._readSingle(t);this._update(t,e-s),this._updateNegativeCount(s,e)}_read(t){let e=t,s=0;for(;e;)s+=this._getFrequency(e),e-=e&-e;return s}_binarySearch(t,e){let s=0,i=this.msb<<1,r=t;for(;i>s+1;){const t=s+i>>1,n=this._getFrequency(t);t<=this.max&&e(n,r)?(r-=n,s=t):i=t}return s}}class et{constructor(t,e,s,i){this._start=0,this._end=0,this._val=null,this._sum=0,this._left=null,this._right=null,this._start=t,this._end=e,this._sum=s,this._val=i||null}get start(){return this._start}set start(t){this._start=t}get end(){return this._end}set end(t){this._end=t}get val(){return this._val}set val(t){this._val=t}get sum(){return this._sum}set sum(t){this._sum=t}get left(){return this._left}set left(t){this._left=t}get right(){return this._right}set right(t){this._right=t}}class st{constructor(t,e,s){this._values=[],this._start=0,e=e||0,s=s||t.length-1,this._values=t,this._start=e,this._end=s,t.length>0?this._root=this.build(e,s):(this._root=null,this._values=[])}get values(){return this._values}get start(){return this._start}get end(){return this._end}get root(){return this._root}build(t,e){if(t>e)return new et(t,e,0);if(t===e)return new et(t,e,this._values[t]);const s=t+Math.floor((e-t)/2),i=this.build(t,s),r=this.build(s+1,e),n=new et(t,e,i.sum+r.sum);return n.left=i,n.right=r,n}updateNode(t,e,s){const i=this.root||null;if(!i)return;const r=(t,e,s,i)=>{if(t.start===t.end&&t.start===e)return t.sum=s,void(void 0!==i&&(t.val=i));e<=t.start+Math.floor((t.end-t.start)/2)?t.left&&r(t.left,e,s,i):t.right&&r(t.right,e,s,i),t.left&&t.right&&(t.sum=t.left.sum+t.right.sum)};r(i,t,e,s)}querySumByRange(t,e){const s=this.root||null;if(!s)return 0;if(t<0||e>=this.values.length||t>e)return NaN;const i=(t,e,s)=>{if(e<=t.start&&s>=t.end)return t.sum;const r=t.start+Math.floor((t.end-t.start)/2);if(s<=r)return t.left?i(t.left,e,s):NaN;if(e>r)return t.right?i(t.right,e,s):NaN;{let n=0,h=0;return t.left&&(n=i(t.left,e,r)),t.right&&(h=i(t.right,r+1,s)),n+h}};return i(s,t,e)}_setValues(t){this._values=t}_setStart(t){this._start=t}_setEnd(t){this._end=t}_setRoot(t){this._root=t}}class it extends Z{constructor(t,e){super(t,e),this.height=0}}class rt extends ${constructor(t){super(t)}createNode(t,e){return new it(t,e)}add(t,e){const s=super.add(t,e);return s&&this._balancePath(s),s}delete(t){const e=super.delete(t);for(const{needBalanced:t}of e)t&&this._balancePath(t);return e}_swap(t,e){const{key:s,val:i,height:r}=e,n=this.createNode(s,i);return n&&(n.height=r,e.key=t.key,e.val=t.val,e.height=t.height,t.key=n.key,t.val=n.val,t.height=n.height),e}_balanceFactor(t){return t.right?t.left?t.right.height-t.left.height:+t.height:-t.height}_updateHeight(t){if(t.left||t.right)if(t.left)t.right?t.height=1+Math.max(t.right.height,t.left.height):t.height=1+t.left.height;else{const e=t.right?t.right.height:0;t.height=1+e}else t.height=0}_balancePath(t){const e=this.getPathToRoot(t,!1);for(let t=0;t<e.length;t++){const s=e[t];switch(this._updateHeight(s),this._balanceFactor(s)){case-2:s&&s.left&&(this._balanceFactor(s.left)<=0?this._balanceLL(s):this._balanceLR(s));break;case 2:s&&s.right&&(this._balanceFactor(s.right)>=0?this._balanceRR(s):this._balanceRL(s))}}}_balanceLL(t){const e=t.parent,s=t.left;t.parent=s,s&&s.right&&(s.right.parent=t),s&&(s.parent=e),t===this.root?s&&this._setRoot(s):(null==e?void 0:e.left)===t?e.left=s:e&&(e.right=s),s&&(t.left=s.right,s.right=t),this._updateHeight(t),s&&this._updateHeight(s)}_balanceLR(t){const e=t.parent,s=t.left;let i=null;s&&(i=s.right),t&&(t.parent=i),s&&(s.parent=i),i&&(i.left&&(i.left.parent=s),i.right&&(i.right.parent=t),i.parent=e),t===this.root?i&&this._setRoot(i):e&&(e.left===t?e.left=i:e.right=i),i&&(t.left=i.right,s&&(s.right=i.left),i.left=s,i.right=t),this._updateHeight(t),s&&this._updateHeight(s),i&&this._updateHeight(i)}_balanceRR(t){const e=t.parent,s=t.right;t.parent=s,s&&(s.left&&(s.left.parent=t),s.parent=e),t===this.root?s&&this._setRoot(s):e&&(e.left===t?e.left=s:e.right=s),s&&(t.right=s.left,s.left=t),this._updateHeight(t),s&&this._updateHeight(s)}_balanceRL(t){const e=t.parent,s=t.right;let i=null;s&&(i=s.left),t.parent=i,s&&(s.parent=i),i&&(i.left&&(i.left.parent=t),i.right&&(i.right.parent=s),i.parent=e),t===this.root?i&&this._setRoot(i):e&&(e.left===t?e.left=i:e.right=i),i&&(t.right=i.left),s&&i&&(s.left=i.right),i&&(i.left=t),i&&(i.right=s),this._updateHeight(t),s&&this._updateHeight(s),i&&this._updateHeight(i)}}class nt extends Z{constructor(t,e){super(t,e),this._color=W.RED}get color(){return this._color}set color(t){this._color=t}}class ht extends ${constructor(t){super(t)}createNode(t,e){return new nt(t,e)}}class ot extends it{constructor(t,e,s=1){super(t,e),this.count=s}}class lt extends rt{constructor(t){super(t),this._count=0}get count(){return this._count}createNode(t,e,s){return new ot(t,e,s)}add(t,e,s=1){let i,r;if(r=t instanceof ot?this.createNode(t.key,t.val,t.count):null===t?null:this.createNode(t,e,s),this.root){let t=this.root,e=!0;for(;e;)t?r&&(this._compare(t.key,r.key)===Y.eq?(t.val=r.val,t.count+=r.count,this._setCount(this.count+r.count),e=!1,i=t):this._compare(t.key,r.key)===Y.gt?void 0===t.left?(t.left=r,this._setSize(this.size+1),this._setCount(this.count+r.count),e=!1,i=t.left):t.left&&(t=t.left):this._compare(t.key,r.key)===Y.lt&&(void 0===t.right?(t.right=r,this._setSize(this.size+1),this._setCount(this.count+r.count),e=!1,i=t.right):t.right&&(t=t.right))):e=!1}else this._setRoot(r),this._setSize(this.size+1),r&&this._setCount(this.count+r.count),i=this.root;return i&&this._balancePath(i),i}_addTo(t,e){return e?void 0===e.left?(e.left=t,null!==t&&(this._setSize(this.size+1),this._setCount(this.count+t.count)),e.left):void 0===e.right?(e.right=t,null!==t&&(this._setSize(this.size+1),this._setCount(this.count+t.count)),e.right):void 0:void 0}addMany(t,e){const s=[];for(let i=0;i<t.length;i++){const r=t[i];r instanceof ot?s.push(this.add(r.key,r.val,r.count)):null!==r?s.push(this.add(r,null==e?void 0:e[i],1)):s.push(this.add(NaN,null,0))}return s}perfectlyBalance(t=this.iterationType){const e=this.dfs((t=>t),"in"),s=e.length;if(e.length<1)return!1;if(this.clear(),t===K.RECURSIVE){const t=(s,i)=>{if(s>i)return;const r=s+Math.floor((i-s)/2),n=e[r];this.add(n.key,n.val,n.count),t(s,r-1),t(r+1,i)};return t(0,s-1),!0}{const t=[[0,s-1]];for(;t.length>0;){const s=t.pop();if(s){const[i,r]=s;if(i<=r){const s=i+Math.floor((r-i)/2),n=e[s];this.add(n.key,n.val,n.count),t.push([s+1,r]),t.push([i,s-1])}}}return!0}}delete(t,e=!1){const s=[];if(!this.root)return s;const i=this.get(t);if(!i)return s;const r=(null==i?void 0:i.parent)?i.parent:null;let n=null,h=i;if(i.count>1&&!e)i.count--,this._setCount(this.count-1);else{if(i.left){const t=i.left?this.getRightMost(i.left):null;if(t){const e=t.parent;h=this._swap(i,t),e&&(e.right===t?e.right=t.left:e.left=t.left,n=e)}}else if(r){const{familyPosition:t}=i;t===G.LEFT||t===G.ROOT_LEFT?r.left=i.right:t!==G.RIGHT&&t!==G.ROOT_RIGHT||(r.right=i.right),n=r}else void 0!==i.right&&this._setRoot(i.right);this._setSize(this.size-1),this._setCount(this.count-h.count)}return s.push({deleted:h,needBalanced:n}),n&&this._balancePath(n),s}clear(){super.clear(),this._setCount(0)}_swap(t,e){const{key:s,val:i,count:r,height:n}=e,h=this.createNode(s,i,r);return h&&(h.height=n,e.key=t.key,e.val=t.val,e.count=t.count,e.height=t.height,t.key=h.key,t.val=h.val,t.count=h.count,t.height=h.height),e}_setCount(t){this._count=t}}class at{constructor(t,e,s){this._key=t,this._value=e||void 0,this._children=s||[]}get key(){return this._key}set key(t){this._key=t}get value(){return this._value}set value(t){this._value=t}get children(){return this._children}set children(t){this._children=t}addChildren(t){this.children||(this.children=[]),t instanceof at?this.children.push(t):this.children=this.children.concat(t)}getHeight(){let t=0;if(this){const e=(s,i)=>{i>t&&(t=i);const{children:r}=s;if(r)for(let t=0,s=r.length;t<s;t++)e(r[t],i+1)};e(this,0)}return t}}class ut extends z{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return e-t})){super(t)}}class ct extends z{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return t-e})){super(t)}}class dt extends A{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return t-e})){super(t)}}class ft extends A{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return e-t})){super(t)}}class gt{constructor(t){const{row:e,col:s,initialVal:i}=t;this._matrix=new Array(e).fill(void 0).map((()=>new Array(s).fill(i||0)))}toArray(){return this._matrix}}class _t{constructor(t=0,e=0,s=1){this.x=t,this.y=e,this.w=s}get isZero(){return 0===this.x&&0===this.y}get length(){return Math.sqrt(this.x*this.x+this.y*this.y)}get lengthSq(){return this.x*this.x+this.y*this.y}get rounded(){return new _t(Math.round(this.x),Math.round(this.y))}static add(t,e){return new _t(t.x+e.x,t.y+e.y)}static subtract(t,e){return new _t(t.x-e.x,t.y-e.y)}static subtractValue(t,e){return new _t(t.x-e,t.y-e)}static multiply(t,e){return new _t(t.x*e,t.y*e)}static divide(t,e){return new _t(t.x/e,t.y/e)}static equals(t,e){return t.x===e.x&&t.y===e.y}static equalsRounded(t,e,s=12){const i=_t.abs(_t.subtract(t,e));return i.x<s&&i.y<s}static normalize(t){const e=t.length;return e>2220446049250313e-31?_t.divide(t,e):t}static truncate(t,e){return t.length>e?_t.multiply(_t.normalize(t),e):t}static perp(t){return new _t(-t.y,t.x)}static reverse(t){return new _t(-t.x,-t.y)}static abs(t){return new _t(Math.abs(t.x),Math.abs(t.y))}static dot(t,e){return t.x*e.x+t.y*e.y}static distance(t,e){const s=e.y-t.y,i=e.x-t.x;return Math.sqrt(s*s+i*i)}static distanceSq(t,e){const s=e.y-t.y,i=e.x-t.x;return s*s+i*i}static sign(t,e){return t.y*e.x>t.x*e.y?-1:1}static angle(t){const e=new _t(0,-1),s=Math.acos(_t.dot(t,e)/(t.length*e.length));return 1===_t.sign(t,e)?2*Math.PI-s:s}static random(t,e){const s=Math.floor(Math.random()*t-t/2),i=Math.floor(Math.random()*e-e/2);return new _t(s,i)}zero(){this.x=0,this.y=0}}const pt=_t;class vt{constructor(t){void 0===t?this._matrix=vt.identity:t instanceof pt?(this._matrix=vt.identity,this._matrix[0][0]=t.x,this._matrix[1][0]=t.y,this._matrix[2][0]=t.w):this._matrix=t}static get empty(){return[[],[],[]]}static get identity(){return[[1,0,0],[0,1,0],[0,0,1]]}get m(){return this._matrix}static add(t,e){const s=vt.empty;for(let i=0;i<3;i++)for(let r=0;r<3;r++)s[i][r]=t.m[i][r]+e.m[i][r];return new vt(s)}static subtract(t,e){const s=vt.empty;for(let i=0;i<3;i++)for(let r=0;r<3;r++)s[i][r]=t.m[i][r]-e.m[i][r];return new vt(s)}static multiply(t,e){const s=vt.empty;for(let i=0;i<3;i++)for(let r=0;r<3;r++){s[i][r]=0;for(let n=0;n<3;n++)s[i][r]+=t.m[i][n]*e.m[n][r]}return new vt(s)}static multiplyByValue(t,e){const s=vt.empty;for(let i=0;i<3;i++)for(let r=0;r<3;r++)s[i][r]=t.m[i][r]*e;return new vt(s)}static multiplyByVector(t,e){return vt.multiply(t,new vt(e)).toVector()}static view(t,e){const s=t/2,i=e/2,r=Math.cos(Math.PI);return new vt([[1,0,s],[0,1*r,i],[0,0,1]])}static scale(t){return vt.multiplyByValue(new vt,t)}static rotate(t){const e=Math.cos(t),s=Math.sin(t);return new vt([[e,-s,0],[s,e,0],[0,0,1]])}static translate(t){return new vt([[1,0,t.x],[0,1,t.y],[0,0,t.w]])}toVector(){return new pt(this._matrix[0][0],this._matrix[1][0])}}class yt{constructor(t,e){this.direction=t,this.turn=()=>new yt(e[t],e)}}class mt{constructor({matrix:t,turning:e,onMove:s,init:{cur:i,charDir:r,VISITED:n}}){this._matrix=t,this._cur=i,this._character=new yt(r,e),this.onMove=s,this.onMove&&this.onMove(this._cur),this._VISITED=n,this._matrix[this._cur[0]][this._cur[1]]=this._VISITED}start(){for(;this.check(this._character.direction)||this.check(this._character.turn().direction);){const{direction:t}=this._character;this.check(t)?this.move(t):this.check(this._character.turn().direction)&&(this._character=this._character.turn())}}check(t){let e,s;const i=this._matrix,[r,n]=this._cur;switch(t){case"up":if(s=i[r-1],!s)return!1;e=s[n];break;case"right":e=i[r][n+1];break;case"down":if(s=i[r+1],!s)return!1;e=s[n];break;case"left":e=i[r][n-1]}return void 0!==e&&e!==this._VISITED}move(t){switch(t){case"up":this._cur[0]--;break;case"right":this._cur[1]++;break;case"down":this._cur[0]++;break;case"left":this._cur[1]--}const[e,s]=this._cur;this._matrix[e][s]=this._VISITED,this.onMove&&this.onMove(this._cur)}}class xt{constructor(t){this._key=t,this._isEnd=!1,this._children=new Map}get key(){return this._key}set key(t){this._key=t}get children(){return this._children}set children(t){this._children=t}get isEnd(){return this._isEnd}set isEnd(t){this._isEnd=t}}class bt{constructor(t,e=!0){if(this._root=new xt(""),this._caseSensitive=e,t)for(const e of t)this.add(e)}get root(){return this._root}set root(t){this._root=t}add(t){t=this._caseProcess(t);let e=this.root;for(const s of t){let t=e.children.get(s);t||(t=new xt(s),e.children.set(s,t)),e=t}return e.isEnd=!0,!0}has(t){t=this._caseProcess(t);let e=this.root;for(const s of t){const t=e.children.get(s);if(!t)return!1;e=t}return e.isEnd}delete(t){t=this._caseProcess(t);let e=!1;const s=(i,r)=>{const n=t[r],h=i.children.get(n);return!!h&&(r===t.length-1?!!h.isEnd&&(h.children.size>0?h.isEnd=!1:i.children.delete(n),e=!0,!0):!(!s(h,r+1)||i.isEnd||0!==h.children.size||(i.children.delete(n),0)))};return s(this.root,0),e}getHeight(){const t=this.root;let e=0;if(t){const s=(t,i)=>{i>e&&(e=i);const{children:r}=t;if(r)for(const t of r.entries())s(t[1],i+1)};s(t,0)}return e}hasPurePrefix(t){t=this._caseProcess(t);let e=this.root;for(const s of t){const t=e.children.get(s);if(!t)return!1;e=t}return!e.isEnd}hasPrefix(t){t=this._caseProcess(t);let e=this.root;for(const s of t){const t=e.children.get(s);if(!t)return!1;e=t}return!0}hasCommonPrefix(t){t=this._caseProcess(t);let e="";const s=i=>{e+=i.key,e!==t&&(i.isEnd||i&&i.children&&1===i.children.size&&s(Array.from(i.children.values())[0]))};return s(this.root),e===t}getLongestCommonPrefix(){let t="";const e=s=>{t+=s.key,s.isEnd||s&&s.children&&1===s.children.size&&e(Array.from(s.children.values())[0])};return e(this.root),t}getWords(t="",e=Number.MAX_SAFE_INTEGER){t=this._caseProcess(t);const s=[];let i=0,r=this.root;if(t)for(const e of t){const t=r.children.get(e);t&&(r=t)}return r!==this.root&&function t(r,n){for(const e of r.children.keys()){const s=r.children.get(e);void 0!==s&&t(s,n.concat(e))}if(r.isEnd){if(i>e-1)return;s.push(n),i++}}(r,t),s}_caseProcess(t){return this._caseSensitive||(t=t.toLowerCase()),t}}return e})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dataStructureTyped=e():t.dataStructureTyped=e()}(self,(()=>(()=>{"use strict";var t={9993:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AVLTree=e.AVLTreeNode=void 0;const i=r(761);class s extends i.BSTNode{height;constructor(t,e){super(t,e),this.height=0}}e.AVLTreeNode=s;class n extends i.BST{constructor(t){super(t)}createNode(t,e){return new s(t,e)}add(t,e){const r=super.add(t,e);return r&&this._balancePath(r),r}delete(t){const e=super.delete(t);for(const{needBalanced:t}of e)t&&this._balancePath(t);return e}_swap(t,e){const{key:r,val:i,height:s}=e,n=this.createNode(r,i);return n&&(n.height=s,e.key=t.key,e.val=t.val,e.height=t.height,t.key=n.key,t.val=n.val,t.height=n.height),e}_balanceFactor(t){return t.right?t.left?t.right.height-t.left.height:+t.height:-t.height}_updateHeight(t){if(t.left||t.right)if(t.left)t.right?t.height=1+Math.max(t.right.height,t.left.height):t.height=1+t.left.height;else{const e=t.right?t.right.height:0;t.height=1+e}else t.height=0}_balancePath(t){const e=this.getPathToRoot(t,!1);for(let t=0;t<e.length;t++){const r=e[t];switch(this._updateHeight(r),this._balanceFactor(r)){case-2:r&&r.left&&(this._balanceFactor(r.left)<=0?this._balanceLL(r):this._balanceLR(r));break;case 2:r&&r.right&&(this._balanceFactor(r.right)>=0?this._balanceRR(r):this._balanceRL(r))}}}_balanceLL(t){const e=t.parent,r=t.left;t.parent=r,r&&r.right&&(r.right.parent=t),r&&(r.parent=e),t===this.root?r&&this._setRoot(r):e?.left===t?e.left=r:e&&(e.right=r),r&&(t.left=r.right,r.right=t),this._updateHeight(t),r&&this._updateHeight(r)}_balanceLR(t){const e=t.parent,r=t.left;let i=null;r&&(i=r.right),t&&(t.parent=i),r&&(r.parent=i),i&&(i.left&&(i.left.parent=r),i.right&&(i.right.parent=t),i.parent=e),t===this.root?i&&this._setRoot(i):e&&(e.left===t?e.left=i:e.right=i),i&&(t.left=i.right,r&&(r.right=i.left),i.left=r,i.right=t),this._updateHeight(t),r&&this._updateHeight(r),i&&this._updateHeight(i)}_balanceRR(t){const e=t.parent,r=t.right;t.parent=r,r&&(r.left&&(r.left.parent=t),r.parent=e),t===this.root?r&&this._setRoot(r):e&&(e.left===t?e.left=r:e.right=r),r&&(t.right=r.left,r.left=t),this._updateHeight(t),r&&this._updateHeight(r)}_balanceRL(t){const e=t.parent,r=t.right;let i=null;r&&(i=r.left),t.parent=i,r&&(r.parent=i),i&&(i.left&&(i.left.parent=t),i.right&&(i.right.parent=r),i.parent=e),t===this.root?i&&this._setRoot(i):e&&(e.left===t?e.left=i:e.right=i),i&&(t.right=i.left),r&&i&&(r.left=i.right),i&&(i.left=t),i&&(i.right=r),this._updateHeight(t),r&&this._updateHeight(r),i&&this._updateHeight(i)}}e.AVLTree=n},9649:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BinaryIndexedTree=void 0;const i=r(5928);e.BinaryIndexedTree=class{_freq;_max;constructor({frequency:t=0,max:e}){this._freq=t,this._max=e,this._freqMap={0:0},this._msb=(0,i.getMSB)(e),this._negativeCount=t<0?e:0}_freqMap;get freqMap(){return this._freqMap}set freqMap(t){this._freqMap=t}_msb;get msb(){return this._msb}set msb(t){this._msb=t}_negativeCount;get negativeCount(){return this._negativeCount}set negativeCount(t){this._negativeCount=t}get freq(){return this._freq}get max(){return this._max}readSingle(t){return this._checkIndex(t),this._readSingle(t)}update(t,e){this._checkIndex(t);const r=this._readSingle(t);this._update(t,e),this._updateNegativeCount(r,r+e)}writeSingle(t,e){this._checkIndex(t),this._writeSingle(t,e)}read(t){if(!Number.isInteger(t))throw new Error("Invalid count");return this._read(Math.max(Math.min(t,this.max),0))}lowerBound(t){if(this.negativeCount>0)throw new Error("Sequence is not non-descending");return this._binarySearch(t,((t,e)=>t<e))}upperBound(t){if(this.negativeCount>0)throw new Error("Must not be descending");return this._binarySearch(t,((t,e)=>t<=e))}_getFrequency(t){return t in this.freqMap?this.freqMap[t]:this.freq*(t&-t)}_updateFrequency(t,e){this.freqMap[t]=this._getFrequency(t)+e}_checkIndex(t){if(!Number.isInteger(t))throw new Error("Invalid index: Index must be an integer.");if(t<0||t>=this.max)throw new Error("Index out of range: Index must be within the range [0, this.max).")}_readSingle(t){t+=1;let e=this._getFrequency(t);const r=t-(t&-t);for(t--;t!==r;)e-=this._getFrequency(t),t-=t&-t;return e}_updateNegativeCount(t,e){t<0&&e>=0?this.negativeCount--:t>=0&&e<0&&this.negativeCount++}_update(t,e){for(t+=1;t<=this.max;)this._updateFrequency(t,e),t+=t&-t}_writeSingle(t,e){const r=this._readSingle(t);this._update(t,e-r),this._updateNegativeCount(r,e)}_read(t){let e=t,r=0;for(;e;)r+=this._getFrequency(e),e-=e&-e;return r}_binarySearch(t,e){let r=0,i=this.msb<<1,s=t;for(;i>r+1;){const t=r+i>>1,n=this._getFrequency(t);t<=this.max&&e(n,s)?(s-=n,r=t):i=t}return r}}},8021:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BinaryTree=e.BinaryTreeNode=void 0;const i=r(1230),s=r(5928),n=r(2627);class o{key;val;parent;constructor(t,e){this.key=t,this.val=e}_left;get left(){return this._left}set left(t){t&&(t.parent=this),this._left=t}_right;get right(){return this._right}set right(t){t&&(t.parent=this),this._right=t}get familyPosition(){const t=this;return t.parent?t.parent.left===t?t.left||t.right?i.FamilyPosition.ROOT_LEFT:i.FamilyPosition.LEFT:t.parent.right===t?t.left||t.right?i.FamilyPosition.ROOT_RIGHT:i.FamilyPosition.RIGHT:i.FamilyPosition.MAL_NODE:t.left||t.right?i.FamilyPosition.ROOT:i.FamilyPosition.ISOLATED}}e.BinaryTreeNode=o,e.BinaryTree=class{_loopType=i.IterationType.ITERATIVE;constructor(t){if(void 0!==t){const{iterationType:e=i.IterationType.ITERATIVE}=t;this._loopType=e}}_root=null;get root(){return this._root}_size=0;get size(){return this._size}get iterationType(){return this._loopType}set iterationType(t){this._loopType=t}createNode(t,e){return new o(t,e)}clear(){this._root=null,this._size=0}isEmpty(){return 0===this.size}add(t,e){let r,i;if(null===t)i=null;else if("number"==typeof t)i=this.createNode(t,e);else{if(!(t instanceof o))return;i=t}const s=t?this.get(t,this._defaultCallbackByKey):void 0;return this.root?s?(s.val=e,r=s):r=((t,e)=>{const r=new n.Queue([t]);for(;r.size>0;){const t=r.shift();if(!t)return;{if(e&&t.key===e.key)return;const i=this._addTo(e,t);if(void 0!==i)return i;t.left&&r.push(t.left),t.right&&r.push(t.right)}}})(this.root,i):(this._setRoot(i),null!==i?this._setSize(1):this._setSize(0),r=this.root),r}addMany(t,e){const r=[];for(let i=0;i<t.length;i++){const s=t[i];if(s instanceof o){r.push(this.add(s.key,s.val));continue}if(null===s){r.push(this.add(null));continue}const n=e?.[i];r.push(this.add(s,n))}return r}refill(t,e){return this.clear(),t.length===this.addMany(t,e).length}delete(t){const e=[];if(!this.root)return e;const r="number"==typeof t?this.get(t):t;if(!r)return e;const s=r?.parent?r.parent:null;let n=null,o=r;if(r.left){const t=r.left?this.getRightMost(r.left):null;if(t){const e=t.parent;o=this._swap(r,t),e&&(e.right===t?e.right=t.left:e.left=t.left,n=e)}}else if(s){const{familyPosition:t}=r;t===i.FamilyPosition.LEFT||t===i.FamilyPosition.ROOT_LEFT?s.left=r.right:t!==i.FamilyPosition.RIGHT&&t!==i.FamilyPosition.ROOT_RIGHT||(s.right=r.right),n=s}else void 0!==r.right&&this._setRoot(r.right);return this._setSize(this.size-1),e.push({deleted:o,needBalanced:n}),e}getDepth(t,e=this.root){"number"==typeof t&&(t=this.get(t)),"number"==typeof e&&(e=this.get(e));let r=0;for(;t?.parent;){if(t===e)return r;r++,t=t.parent}return r}getHeight(t=this.root,e=this.iterationType){if("number"==typeof t&&(t=this.get(t)),!t)return-1;if(e===i.IterationType.RECURSIVE){const e=t=>{if(!t)return-1;const r=e(t.left),i=e(t.right);return Math.max(r,i)+1};return e(t)}{if(!t)return-1;const e=[{node:t,depth:0}];let r=0;for(;e.length>0;){const{node:t,depth:i}=e.pop();t.left&&e.push({node:t.left,depth:i+1}),t.right&&e.push({node:t.right,depth:i+1}),r=Math.max(r,i)}return r}}getMinHeight(t=this.root,e=this.iterationType){if(!t)return-1;if(e===i.IterationType.RECURSIVE){const e=t=>{if(!t)return 0;if(!t.left&&!t.right)return 0;const r=e(t.left),i=e(t.right);return Math.min(r,i)+1};return e(t)}{const e=[];let r=t,i=null;const s=new Map;for(;e.length>0||r;)if(r)e.push(r),r=r.left;else if(r=e[e.length-1],r.right&&i!==r.right)r=r.right;else if(r=e.pop(),r){const t=r.left?s.get(r.left)??-1:-1,e=r.right?s.get(r.right)??-1:-1;s.set(r,1+Math.min(t,e)),i=r,r=null}return s.get(t)??-1}}isPerfectlyBalanced(t=this.root){return this.getMinHeight(t)+1>=this.getHeight(t)}getNodes(t,e=this._defaultCallbackByKey,r=!1,s=this.root,o=this.iterationType){if(!s)return[];const h=[];if(o===i.IterationType.RECURSIVE){const i=s=>{e(s)===t&&(h.push(s),r)||(s.left||s.right)&&(s.left&&i(s.left),s.right&&i(s.right))};i(s)}else{const i=new n.Queue([s]);for(;i.size>0;){const s=i.shift();if(s){if(e(s)===t&&(h.push(s),r))return h;s.left&&i.push(s.left),s.right&&i.push(s.right)}}}return h}has(t,e=this._defaultCallbackByKey,r=this.root,i=this.iterationType){return this.getNodes(t,e,!0,r,i).length>0}get(t,e=this._defaultCallbackByKey,r=this.root,i=this.iterationType){return this.getNodes(t,e,!0,r,i)[0]??null}getPathToRoot(t,e=!0){const r=[];for(;t.parent;)r.push(t),t=t.parent;return r.push(t),e?r.reverse():r}getLeftMost(t=this.root,e=this.iterationType){if("number"==typeof t&&(t=this.get(t)),!t)return t;if(e===i.IterationType.RECURSIVE){const e=t=>t.left?e(t.left):t;return e(t)}{const e=(0,s.trampoline)((t=>t.left?e.cont(t.left):t));return e(t)}}getRightMost(t=this.root,e=this.iterationType){if(!t)return t;if(e===i.IterationType.RECURSIVE){const e=t=>t.right?e(t.right):t;return e(t)}{const e=(0,s.trampoline)((t=>t.right?e.cont(t.right):t));return e(t)}}isSubtreeBST(t,e=this.iterationType){if(!t)return!0;if(e===i.IterationType.RECURSIVE){const e=(t,r,i)=>!t||!(t.key<=r||t.key>=i)&&e(t.left,r,t.key)&&e(t.right,t.key,i);return e(t,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}{const e=[];let r=Number.MIN_SAFE_INTEGER,i=t;for(;i||e.length>0;){for(;i;)e.push(i),i=i.left;if(i=e.pop(),!i||r>=i.key)return!1;r=i.key,i=i.right}return!0}}isBST(t=this.iterationType){return null===this.root||this.isSubtreeBST(this.root,t)}subTreeTraverse(t=this._defaultCallbackByKey,e=this.root,r=this.iterationType){"number"==typeof e&&(e=this.get(e));const s=[];if(!e)return s;if(r===i.IterationType.RECURSIVE){const r=e=>{s.push(t(e)),e.left&&r(e.left),e.right&&r(e.right)};r(e)}else{const r=[e];for(;r.length>0;){const e=r.pop();s.push(t(e)),e.right&&r.push(e.right),e.left&&r.push(e.left)}}return s}dfs(t=this._defaultCallbackByKey,e="in",r=this.root,s=i.IterationType.ITERATIVE){if(!r)return[];const n=[];if(s===i.IterationType.RECURSIVE){const i=r=>{switch(e){case"in":r.left&&i(r.left),n.push(t(r)),r.right&&i(r.right);break;case"pre":n.push(t(r)),r.left&&i(r.left),r.right&&i(r.right);break;case"post":r.left&&i(r.left),r.right&&i(r.right),n.push(t(r))}};i(r)}else{const i=[{opt:0,node:r}];for(;i.length>0;){const r=i.pop();if(r&&r.node)if(1===r.opt)n.push(t(r.node));else switch(e){case"in":default:i.push({opt:0,node:r.node.right}),i.push({opt:1,node:r.node}),i.push({opt:0,node:r.node.left});break;case"pre":i.push({opt:0,node:r.node.right}),i.push({opt:0,node:r.node.left}),i.push({opt:1,node:r.node});break;case"post":i.push({opt:1,node:r.node}),i.push({opt:0,node:r.node.right}),i.push({opt:0,node:r.node.left})}}}return n}bfs(t=this._defaultCallbackByKey,e=!1,r=this.root,s=this.iterationType){if(!r)return[];const n=[];if(s===i.IterationType.RECURSIVE){const i=(r,s)=>{t&&n.push(t(r,e?s:void 0)),r.left&&i(r.left,s+1),r.right&&i(r.right,s+1)};i(r,0)}else{const i=[[r,0]];for(;i.length>0;){const r=i.pop(),[s,o]=r;t&&n.push(t(s,e?o:void 0)),s.right&&i.push([s.right,o+1]),s.left&&i.push([s.left,o+1])}}return n}getPredecessor(t){if(t.left){let e=t.left;for(;!e||e.right&&e.right!==t;)e&&(e=e.right);return e}return t}morris(t=this._defaultCallbackByKey,e="in",r=this.root){if(null===r)return[];const i=[];let s=r;const n=t=>{let e=null,r=null;for(;t;)r=t.right,t.right=e,e=t,t=r;return e},o=e=>{const r=n(e);let s=r;for(;s;)i.push(t(s)),s=s.right;n(r)};switch(e){case"in":for(;s;){if(s.left){const t=this.getPredecessor(s);if(!t.right){t.right=s,s=s.left;continue}t.right=null}i.push(t(s)),s=s.right}break;case"pre":for(;s;){if(s.left){const e=this.getPredecessor(s);if(!e.right){e.right=s,i.push(t(s)),s=s.left;continue}e.right=null}else i.push(t(s));s=s.right}break;case"post":for(;s;){if(s.left){const t=this.getPredecessor(s);if(null===t.right){t.right=s,s=s.left;continue}t.right=null,o(s.left)}s=s.right}o(r)}return i}_swap(t,e){const{key:r,val:i}=e,s=this.createNode(r,i);return s&&(e.key=t.key,e.val=t.val,t.key=s.key,t.val=s.val),e}_defaultCallbackByKey=t=>t.key;_addTo(t,e){return e?void 0===e.left?(e.left=t,t&&this._setSize(this.size+1),e.left):void 0===e.right?(e.right=t,t&&this._setSize(this.size+1),e.right):void 0:void 0}_setRoot(t){t&&(t.parent=void 0),this._root=t}_setSize(t){this._size=t}}},761:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BST=e.BSTNode=void 0;const i=r(1230),s=r(8021),n=r(2627);class o extends s.BinaryTreeNode{constructor(t,e){super(t,e)}}e.BSTNode=o;class h extends s.BinaryTree{constructor(t){if(super(t),void 0!==t){const{comparator:e}=t;void 0!==e&&(this._comparator=e)}}createNode(t,e){return new o(t,e)}add(t,e){let r=null,s=null;if(t instanceof o?s=t:"number"==typeof t?s=this.createNode(t,e):null===t&&(s=null),null===this.root)this._setRoot(s),this._setSize(this.size+1),r=this.root;else{let t=this.root,e=!0;for(;e;)null!==t&&null!==s?this._compare(t.key,s.key)===i.CP.eq?(s&&(t.val=s.val),e=!1,r=t):this._compare(t.key,s.key)===i.CP.gt?void 0===t.left?(s&&(s.parent=t),t.left=s,this._setSize(this.size+1),e=!1,r=t.left):t.left&&(t=t.left):this._compare(t.key,s.key)===i.CP.lt&&(void 0===t.right?(s&&(s.parent=t),t.right=s,this._setSize(this.size+1),e=!1,r=t.right):t.right&&(t=t.right)):e=!1}return r}addMany(t,e,r=!0,s=this.iterationType){if(!r||-1!==t.indexOf(null))return super.addMany(t,e);const n=[],h=t.map(((t,r)=>[t,e?.[r]]));let a=[],l=[],u=[];if(function(t){for(const[e]of t)if(e instanceof o)return!0;return!1}(h))a=h.sort(((t,e)=>t[0].key-e[0].key));else{if(!function(t){for(const[e]of t)if("number"==typeof e)return!0;return!1}(h))throw new Error("Invalid input keysOrNodes");a=h.sort(((t,e)=>t[0]-e[0]))}l=a.map((([t])=>t)),u=a.map((([,t])=>t));const c=(t,e)=>{if(0===t.length)return;const r=Math.floor((t.length-1)/2),i=this.add(t[r],e?.[r]);n.push(i),c(t.slice(0,r),e?.slice(0,r)),c(t.slice(r+1),e?.slice(r+1))};return s===i.IterationType.RECURSIVE?c(l,u):(()=>{const t=[[0,a.length-1]];for(;t.length>0;){const e=t.pop();if(e){const[r,i]=e;if(r<=i){const e=r+Math.floor((i-r)/2),s=this.add(l[e],u?.[e]);n.push(s),t.push([e+1,i]),t.push([r,e-1])}}}})(),n}get(t,e=this._defaultCallbackByKey,r=this.root,i=this.iterationType){return this.getNodes(t,e,!0,r,i)[0]??null}lastKey(t=this.root,e=this.iterationType){return this._compare(0,1)===i.CP.lt?this.getRightMost(t,e)?.key??0:this._compare(0,1)===i.CP.gt?this.getLeftMost(t,e)?.key??0:this.getRightMost(t,e)?.key??0}getNodes(t,e=this._defaultCallbackByKey,r=!1,s=this.root,o=this.iterationType){if(!s)return[];const h=[];if(o===i.IterationType.RECURSIVE){const n=s=>{e(s)===t&&(h.push(s),r)||(s.left||s.right)&&(e===this._defaultCallbackByKey?(this._compare(s.key,t)===i.CP.gt&&s.left&&n(s.left),this._compare(s.key,t)===i.CP.lt&&s.right&&n(s.right)):(s.left&&n(s.left),s.right&&n(s.right)))};n(s)}else{const o=new n.Queue([s]);for(;o.size>0;){const s=o.shift();if(s){if(e(s)===t&&(h.push(s),r))return h;e===this._defaultCallbackByKey?(this._compare(s.key,t)===i.CP.gt&&s.left&&o.push(s.left),this._compare(s.key,t)===i.CP.lt&&s.right&&o.push(s.right)):(s.left&&o.push(s.left),s.right&&o.push(s.right))}}}return h}lesserOrGreaterTraverse(t=this._defaultCallbackByKey,e=i.CP.lt,r=this.root,s=this.iterationType){"number"==typeof r&&(r=this.get(r));const o=[];if(!r)return o;const h=r.key;if(!this.root)return o;if(s===i.IterationType.RECURSIVE){const r=i=>{this._compare(i.key,h)===e&&o.push(t(i)),(i.left||i.right)&&(i.left&&this._compare(i.left.key,h)===e&&r(i.left),i.right&&this._compare(i.right.key,h)===e&&r(i.right))};return r(this.root),o}{const r=new n.Queue([this.root]);for(;r.size>0;){const i=r.shift();i&&(this._compare(i.key,h)===e&&o.push(t(i)),i.left&&this._compare(i.left.key,h)===e&&r.push(i.left),i.right&&this._compare(i.right.key,h)===e&&r.push(i.right))}return o}}perfectlyBalance(t=this.iterationType){const e=this.dfs((t=>t),"in"),r=e.length;if(this.clear(),e.length<1)return!1;if(t===i.IterationType.RECURSIVE){const t=(r,i)=>{if(r>i)return;const s=r+Math.floor((i-r)/2),n=e[s];this.add(n.key,n.val),t(r,s-1),t(s+1,i)};return t(0,r-1),!0}{const t=[[0,r-1]];for(;t.length>0;){const r=t.pop();if(r){const[i,s]=r;if(i<=s){const r=i+Math.floor((s-i)/2),n=e[r];this.add(n.key,n.val),t.push([r+1,s]),t.push([i,r-1])}}}return!0}}isAVLBalanced(t=this.iterationType){if(!this.root)return!0;let e=!0;if(t===i.IterationType.RECURSIVE){const t=r=>{if(!r)return 0;const i=t(r.left),s=t(r.right);return Math.abs(i-s)>1&&(e=!1),Math.max(i,s)+1};t(this.root)}else{const t=[];let e=this.root,r=null;const i=new Map;for(;t.length>0||e;)if(e)t.push(e),e=e.left;else if(e=t[t.length-1],e.right&&r!==e.right)e=e.right;else if(e=t.pop(),e){const t=e.left?i.get(e.left)??-1:-1,s=e.right?i.get(e.right)??-1:-1;if(Math.abs(t-s)>1)return!1;i.set(e,1+Math.max(t,s)),r=e,e=null}}return e}_comparator=(t,e)=>t-e;_compare(t,e){const r=this._comparator(t,e);return r>0?i.CP.gt:r<0?i.CP.lt:i.CP.eq}}e.BST=h},255:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(8021),e),s(r(761),e),s(r(9649),e),s(r(8207),e),s(r(9993),e),s(r(1259),e),s(r(2570),e)},1259:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RBTree=e.RBTreeNode=void 0;const i=r(1230),s=r(761);class n extends s.BSTNode{constructor(t,e){super(t,e),this._color=i.RBColor.RED}_color;get color(){return this._color}set color(t){this._color=t}}e.RBTreeNode=n;class o extends s.BST{constructor(t){super(t)}createNode(t,e){return new n(t,e)}}e.RBTree=o},8207:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentTree=e.SegmentTreeNode=void 0;class r{constructor(t,e,r,i){this._start=t,this._end=e,this._sum=r,this._val=i||null}_start=0;get start(){return this._start}set start(t){this._start=t}_end=0;get end(){return this._end}set end(t){this._end=t}_val=null;get val(){return this._val}set val(t){this._val=t}_sum=0;get sum(){return this._sum}set sum(t){this._sum=t}_left=null;get left(){return this._left}set left(t){this._left=t}_right=null;get right(){return this._right}set right(t){this._right=t}}e.SegmentTreeNode=r,e.SegmentTree=class{constructor(t,e,r){e=e||0,r=r||t.length-1,this._values=t,this._start=e,this._end=r,t.length>0?this._root=this.build(e,r):(this._root=null,this._values=[])}_values=[];get values(){return this._values}_start=0;get start(){return this._start}_end;get end(){return this._end}_root;get root(){return this._root}build(t,e){if(t>e)return new r(t,e,0);if(t===e)return new r(t,e,this._values[t]);const i=t+Math.floor((e-t)/2),s=this.build(t,i),n=this.build(i+1,e),o=new r(t,e,s.sum+n.sum);return o.left=s,o.right=n,o}updateNode(t,e,r){const i=this.root||null;if(!i)return;const s=(t,e,r,i)=>{if(t.start===t.end&&t.start===e)return t.sum=r,void(void 0!==i&&(t.val=i));e<=t.start+Math.floor((t.end-t.start)/2)?t.left&&s(t.left,e,r,i):t.right&&s(t.right,e,r,i),t.left&&t.right&&(t.sum=t.left.sum+t.right.sum)};s(i,t,e,r)}querySumByRange(t,e){const r=this.root||null;if(!r)return 0;if(t<0||e>=this.values.length||t>e)return NaN;const i=(t,e,r)=>{if(e<=t.start&&r>=t.end)return t.sum;const s=t.start+Math.floor((t.end-t.start)/2);if(r<=s)return t.left?i(t.left,e,r):NaN;if(e>s)return t.right?i(t.right,e,r):NaN;{let n=0,o=0;return t.left&&(n=i(t.left,e,s)),t.right&&(o=i(t.right,s+1,r)),n+o}};return i(r,t,e)}_setValues(t){this._values=t}_setStart(t){this._start=t}_setEnd(t){this._end=t}_setRoot(t){this._root=t}}},2570:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeMultiset=e.TreeMultisetNode=void 0;const i=r(1230),s=r(9993);class n extends s.AVLTreeNode{count;constructor(t,e,r=1){super(t,e),this.count=r}}e.TreeMultisetNode=n;class o extends s.AVLTree{constructor(t){super(t)}_count=0;get count(){return this._count}createNode(t,e,r){return new n(t,e,r)}add(t,e,r=1){let s,o;if(o=t instanceof n?this.createNode(t.key,t.val,t.count):null===t?null:this.createNode(t,e,r),this.root){let t=this.root,e=!0;for(;e;)t?o&&(this._compare(t.key,o.key)===i.CP.eq?(t.val=o.val,t.count+=o.count,this._setCount(this.count+o.count),e=!1,s=t):this._compare(t.key,o.key)===i.CP.gt?void 0===t.left?(t.left=o,this._setSize(this.size+1),this._setCount(this.count+o.count),e=!1,s=t.left):t.left&&(t=t.left):this._compare(t.key,o.key)===i.CP.lt&&(void 0===t.right?(t.right=o,this._setSize(this.size+1),this._setCount(this.count+o.count),e=!1,s=t.right):t.right&&(t=t.right))):e=!1}else this._setRoot(o),this._setSize(this.size+1),o&&this._setCount(this.count+o.count),s=this.root;return s&&this._balancePath(s),s}_addTo(t,e){return e?void 0===e.left?(e.left=t,null!==t&&(this._setSize(this.size+1),this._setCount(this.count+t.count)),e.left):void 0===e.right?(e.right=t,null!==t&&(this._setSize(this.size+1),this._setCount(this.count+t.count)),e.right):void 0:void 0}addMany(t,e){const r=[];for(let i=0;i<t.length;i++){const s=t[i];s instanceof n?r.push(this.add(s.key,s.val,s.count)):null!==s?r.push(this.add(s,e?.[i],1)):r.push(this.add(NaN,null,0))}return r}perfectlyBalance(t=this.iterationType){const e=this.dfs((t=>t),"in"),r=e.length;if(e.length<1)return!1;if(this.clear(),t===i.IterationType.RECURSIVE){const t=(r,i)=>{if(r>i)return;const s=r+Math.floor((i-r)/2),n=e[s];this.add(n.key,n.val,n.count),t(r,s-1),t(s+1,i)};return t(0,r-1),!0}{const t=[[0,r-1]];for(;t.length>0;){const r=t.pop();if(r){const[i,s]=r;if(i<=s){const r=i+Math.floor((s-i)/2),n=e[r];this.add(n.key,n.val,n.count),t.push([r+1,s]),t.push([i,r-1])}}}return!0}}delete(t,e=!1){const r=[];if(!this.root)return r;const s=this.get(t);if(!s)return r;const n=s?.parent?s.parent:null;let o=null,h=s;if(s.count>1&&!e)s.count--,this._setCount(this.count-1);else{if(s.left){const t=s.left?this.getRightMost(s.left):null;if(t){const e=t.parent;h=this._swap(s,t),e&&(e.right===t?e.right=t.left:e.left=t.left,o=e)}}else if(n){const{familyPosition:t}=s;t===i.FamilyPosition.LEFT||t===i.FamilyPosition.ROOT_LEFT?n.left=s.right:t!==i.FamilyPosition.RIGHT&&t!==i.FamilyPosition.ROOT_RIGHT||(n.right=s.right),o=n}else void 0!==s.right&&this._setRoot(s.right);this._setSize(this.size-1),this._setCount(this.count-h.count)}return r.push({deleted:h,needBalanced:o}),o&&this._balancePath(o),r}clear(){super.clear(),this._setCount(0)}_swap(t,e){const{key:r,val:i,count:s,height:n}=e,o=this.createNode(r,i,s);return o&&(o.height=n,e.key=t.key,e.val=t.val,e.count=t.count,e.height=t.height,t.key=o.key,t.val=o.val,t.count=o.count,t.height=o.height),e}_setCount(t){this._count=t}}e.TreeMultiset=o},618:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractGraph=e.AbstractEdge=e.AbstractVertex=void 0;const i=r(5928),s=r(7641),n=r(2627);class o{constructor(t,e){this._key=t,this._val=e}_key;get key(){return this._key}set key(t){this._key=t}_val;get val(){return this._val}set val(t){this._val=t}}e.AbstractVertex=o;class h{constructor(t,e){this._weight=void 0!==t?t:1,this._val=e,this._hashCode=(0,i.uuidV4)()}_val;get val(){return this._val}set val(t){this._val=t}_weight;get weight(){return this._weight}set weight(t){this._weight=t}_hashCode;get hashCode(){return this._hashCode}_setHashCode(t){this._hashCode=t}}e.AbstractEdge=h,e.AbstractGraph=class{_vertices=new Map;get vertices(){return this._vertices}getVertex(t){return this._vertices.get(t)||null}hasVertex(t){return this._vertices.has(this._getVertexKey(t))}addVertex(t,e){if(t instanceof o)return this._addVertexOnly(t);{const r=this.createVertex(t,e);return this._addVertexOnly(r)}}removeVertex(t){const e=this._getVertexKey(t);return this._vertices.delete(e)}removeAllVertices(t){const e=[];for(const r of t)e.push(this.removeVertex(r));return e.length>0}hasEdge(t,e){return!!this.getEdge(t,e)}addEdge(t,e,r,i){if(t instanceof h)return this._addEdgeOnly(t);if(e instanceof o||"string"==typeof e||"number"==typeof e){if(!this.hasVertex(t)||!this.hasVertex(e))return!1;t instanceof o&&(t=t.key),e instanceof o&&(e=e.key);const s=this.createEdge(t,e,r,i);return this._addEdgeOnly(s)}throw new Error("dest must be a Vertex or vertex key while srcOrEdge is an Edge")}setEdgeWeight(t,e,r){const i=this.getEdge(t,e);return!!i&&(i.weight=r,!0)}getAllPathsBetween(t,e){const r=[],s=this._getVertex(t),n=this._getVertex(e);if(!s||!n)return[];const o=(t,e,n,h)=>{n.set(t,!0),t===e&&r.push([s,...h]);const a=this.getNeighbors(t);for(const t of a)n.get(t)||(h.push(t),o(t,e,n,h),(0,i.arrayRemove)(h,(e=>e===t)));n.set(t,!1)};return o(s,n,new Map,[]),r}getPathSumWeight(t){let e=0;for(let r=0;r<t.length;r++)e+=this.getEdge(t[r],t[r+1])?.weight||0;return e}getMinCostBetween(t,e,r){if(void 0===r&&(r=!1),r){const r=this.getAllPathsBetween(t,e);let i=1/0;for(const t of r)i=Math.min(this.getPathSumWeight(t),i);return i}{const r=this._getVertex(e),i=this._getVertex(t);if(!i||!r)return null;const s=new Map,o=new n.Queue([i]);s.set(i,!0);let h=0;for(;o.size>0;){for(let t=0;t<o.size;t++){const t=o.shift();if(t===r)return h;if(void 0!==t){const e=this.getNeighbors(t);for(const t of e)s.has(t)||(s.set(t,!0),o.push(t))}}h++}return null}}getMinPathBetween(t,e,r){if(void 0===r&&(r=!1),r){const r=this.getAllPathsBetween(t,e);let i=1/0,s=-1,n=0;for(const t of r){const e=this.getPathSumWeight(t);e<i&&(i=e,s=n),n++}return r[s]||null}{let r=[];const s=this._getVertex(t),n=this._getVertex(e);if(!s||!n)return[];const o=(t,e,n,h)=>{if(n.set(t,!0),t===e)return void(r=[s,...h]);const a=this.getNeighbors(t);for(const t of a)n.get(t)||(h.push(t),o(t,e,n,h),(0,i.arrayRemove)(h,(e=>e===t)));n.set(t,!1)};return o(s,n,new Map,[]),r}}dijkstraWithoutHeap(t,e,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===e&&(e=null);let s=1/0,n=null,h=[];const a=[],l=this._vertices,u=new Map,c=new Set,d=new Map,f=this._getVertex(t),_=e?this._getVertex(e):null;if(!f)return null;for(const t of l){const e=t[1];e instanceof o&&u.set(e,1/0)}u.set(f,0),d.set(f,null);const g=()=>{let t=1/0,e=null;for(const[r,i]of u)c.has(r)||i<t&&(t=i,e=r);return e},p=t=>{for(const e of l){const r=e[1];if(r instanceof o){const i=[r];let s=d.get(r);for(;s;)i.push(s),s=d.get(s);const n=i.reverse();e[1]===t&&(h=n),a.push(n)}}};for(let t=1;t<l.size;t++){const t=g();if(t){if(c.add(t),_&&_===t)return r&&(s=u.get(_)||1/0),i&&p(_),{distMap:u,preMap:d,seen:c,paths:a,minDist:s,minPath:h};const e=this.getNeighbors(t);for(const r of e)if(!c.has(r)){const e=this.getEdge(t,r);if(e){const i=u.get(t),s=u.get(r);void 0!==i&&void 0!==s&&e.weight+i<s&&(u.set(r,e.weight+i),d.set(r,t))}}}}return r&&u.forEach(((t,e)=>{e!==f&&t<s&&(s=t,i&&(n=e))})),i&&p(n),{distMap:u,preMap:d,seen:c,paths:a,minDist:s,minPath:h}}dijkstra(t,e,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===e&&(e=null);let n=1/0,h=null,a=[];const l=[],u=this._vertices,c=new Map,d=new Set,f=new Map,_=this._getVertex(t),g=e?this._getVertex(e):null;if(!_)return null;for(const t of u){const e=t[1];e instanceof o&&c.set(e,1/0)}const p=new s.PriorityQueue(((t,e)=>t.key-e.key));p.add({key:0,val:_}),c.set(_,0),f.set(_,null);const y=t=>{for(const e of u){const r=e[1];if(r instanceof o){const i=[r];let s=f.get(r);for(;s;)i.push(s),s=f.get(s);const n=i.reverse();e[1]===t&&(a=n),l.push(n)}}};for(;p.size>0;){const t=p.poll(),e=t?.key,s=t?.val;if(void 0!==e&&s){if(d.add(s),g&&g===s)return r&&(n=c.get(g)||1/0),i&&y(g),{distMap:c,preMap:f,seen:d,paths:l,minDist:n,minPath:a};const t=this.getNeighbors(s);for(const r of t)if(!d.has(r)){const t=this.getEdge(s,r)?.weight;if("number"==typeof t){const i=c.get(r);i&&e+t<i&&(p.add({key:e+t,val:r}),f.set(r,s),c.set(r,e+t))}}}}return r&&c.forEach(((t,e)=>{e!==_&&t<n&&(n=t,i&&(h=e))})),i&&y(h),{distMap:c,preMap:f,seen:d,paths:l,minDist:n,minPath:a}}bellmanFord(t,e,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);const s=this._getVertex(t),n=[],h=new Map,a=new Map;let l,u=1/0,c=[];if(e&&(l=!1),!s)return{hasNegativeCycle:l,distMap:h,preMap:a,paths:n,min:u,minPath:c};const d=this._vertices,f=d.size,_=this.edgeSet(),g=_.length;this._vertices.forEach((t=>{h.set(t,1/0)})),h.set(s,0);for(let t=1;t<f;++t)for(let t=0;t<g;++t){const e=this.getEndsOfEdge(_[t]);if(e){const[r,s]=e,n=_[t].weight,o=h.get(r),l=h.get(s);void 0!==o&&void 0!==l&&h.get(r)!==1/0&&o+n<l&&(h.set(s,o+n),i&&a.set(s,r))}}let p=null;if(r&&h.forEach(((t,e)=>{e!==s&&t<u&&(u=t,i&&(p=e))})),i)for(const t of d){const e=t[1];if(e instanceof o){const r=[e];let i=a.get(e);for(;void 0!==i;)r.push(i),i=a.get(i);const s=r.reverse();t[1]===p&&(c=s),n.push(s)}}for(let t=0;t<g;++t){const e=this.getEndsOfEdge(_[t]);if(e){const[r]=e,i=_[t].weight,s=h.get(r);s&&s!==1/0&&s+i<s&&(l=!0)}}return{hasNegativeCycle:l,distMap:h,preMap:a,paths:n,min:u,minPath:c}}floyd(){const t=[...this._vertices],e=t.length,r=[],i=[];for(let t=0;t<e;t++){r[t]=[],i[t]=[];for(let r=0;r<e;r++)i[t][r]=null}for(let i=0;i<e;i++)for(let s=0;s<e;s++)r[i][s]=this.getEdge(t[i][1],t[s][1])?.weight||1/0;for(let s=0;s<e;s++)for(let n=0;n<e;n++)for(let o=0;o<e;o++)r[n][o]>r[n][s]+r[s][o]&&(r[n][o]=r[n][s]+r[s][o],i[n][o]=t[s][1]);return{costs:r,predecessor:i}}tarjan(t,e,r,i){const s=!1;void 0===t&&(t=s),void 0===e&&(e=s),void 0===r&&(r=s),void 0===i&&(i=s);const n=new Map,o=new Map,h=this._vertices;h.forEach((t=>{n.set(t,-1),o.set(t,1/0)}));const[a]=h.values(),l=[],u=[];let c=0;const d=(r,i)=>{c++,n.set(r,c),o.set(r,c);const s=this.getNeighbors(r);let h=0;for(const c of s)if(c!==i){-1===n.get(c)&&(h++,d(c,r));const i=o.get(c),s=o.get(r);void 0!==s&&void 0!==i&&o.set(r,Math.min(s,i));const f=n.get(r);if(void 0!==i&&void 0!==f&&(t&&(r===a&&h>=2||r!==a&&i>=f)&&l.push(r),e&&i>f)){const t=this.getEdge(r,c);t&&u.push(t)}}};d(a,null);let f=new Map;const _=()=>{const t=new Map;return o.forEach(((e,r)=>{t.has(e)?t.get(e)?.push(r):t.set(e,[r])})),t};r&&(f=_());const g=new Map;if(i){let t=new Map;t.size<1&&(t=_()),t.forEach(((t,e)=>{t.length>1&&g.set(e,t)}))}return{dfnMap:n,lowMap:o,bridges:u,articulationPoints:l,SCCs:f,cycles:g}}_addVertexOnly(t){return!this.hasVertex(t)&&(this._vertices.set(t.key,t),!0)}_getVertex(t){const e=this._getVertexKey(t);return this._vertices.get(e)||null}_getVertexKey(t){return t instanceof o?t.key:t}_setVertices(t){this._vertices=t}}},4693:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DirectedGraph=e.DirectedEdge=e.DirectedVertex=void 0;const i=r(5928),s=r(618);class n extends s.AbstractVertex{constructor(t,e){super(t,e)}}e.DirectedVertex=n;class o extends s.AbstractEdge{constructor(t,e,r,i){super(r,i),this._src=t,this._dest=e}_src;get src(){return this._src}set src(t){this._src=t}_dest;get dest(){return this._dest}set dest(t){this._dest=t}}e.DirectedEdge=o;class h extends s.AbstractGraph{constructor(){super()}_outEdgeMap=new Map;get outEdgeMap(){return this._outEdgeMap}_inEdgeMap=new Map;get inEdgeMap(){return this._inEdgeMap}createVertex(t,e){return new n(t,e??t)}createEdge(t,e,r,i){return new o(t,e,r??1,i)}getEdge(t,e){let r=[];if(null!==t&&null!==e){const i=this._getVertex(t),s=this._getVertex(e);if(i&&s){const t=this._outEdgeMap.get(i);t&&(r=t.filter((t=>t.dest===s.key)))}}return r[0]||null}removeEdgeSrcToDest(t,e){const r=this._getVertex(t),s=this._getVertex(e);let n=null;if(!r||!s)return null;const o=this._outEdgeMap.get(r);o&&(0,i.arrayRemove)(o,(t=>t.dest===s.key));const h=this._inEdgeMap.get(s);return h&&(n=(0,i.arrayRemove)(h,(t=>t.src===r.key))[0]||null),n}removeEdge(t){let e=null;const r=this._getVertex(t.src),s=this._getVertex(t.dest);if(r&&s){const t=this._outEdgeMap.get(r);t&&t.length>0&&(0,i.arrayRemove)(t,(t=>t.src===r.key));const n=this._inEdgeMap.get(s);n&&n.length>0&&(e=(0,i.arrayRemove)(n,(t=>t.dest===s.key))[0])}return e}removeEdgesBetween(t,e){const r=[];if(t&&e){const i=this.removeEdgeSrcToDest(t,e),s=this.removeEdgeSrcToDest(e,t);i&&r.push(i),s&&r.push(s)}return r}incomingEdgesOf(t){const e=this._getVertex(t);return e&&this.inEdgeMap.get(e)||[]}outgoingEdgesOf(t){const e=this._getVertex(t);return e&&this._outEdgeMap.get(e)||[]}degreeOf(t){return this.outDegreeOf(t)+this.inDegreeOf(t)}inDegreeOf(t){return this.incomingEdgesOf(t).length}outDegreeOf(t){return this.outgoingEdgesOf(t).length}edgesOf(t){return[...this.outgoingEdgesOf(t),...this.incomingEdgesOf(t)]}getEdgeSrc(t){return this._getVertex(t.src)}getEdgeDest(t){return this._getVertex(t.dest)}getDestinations(t){if(null===t)return[];const e=[],r=this.outgoingEdgesOf(t);for(const t of r){const r=this.getEdgeDest(t);r&&e.push(r)}return e}topologicalSort(t){t=t??"key";const e=new Map;for(const t of this.vertices)e.set(t[1],0);let r=[],i=!1;const s=t=>{e.set(t,1);const n=this.getDestinations(t);for(const t of n){const r=e.get(t);0===r?s(t):1===r&&(i=!0)}e.set(t,2),r.push(t)};for(const t of this.vertices)0===e.get(t[1])&&s(t[1]);return i?null:("key"===t&&(r=r.map((t=>t instanceof n?t.key:t))),r.reverse())}edgeSet(){let t=[];return this._outEdgeMap.forEach((e=>{t=[...t,...e]})),t}getNeighbors(t){const e=[],r=this._getVertex(t);if(r){const t=this.outgoingEdgesOf(r);for(const r of t){const t=this._getVertex(r.dest);t&&e.push(t)}}return e}getEndsOfEdge(t){if(!this.hasEdge(t.src,t.dest))return null;const e=this._getVertex(t.src),r=this._getVertex(t.dest);return e&&r?[e,r]:null}_addEdgeOnly(t){if(!this.hasVertex(t.src)||!this.hasVertex(t.dest))return!1;const e=this._getVertex(t.src),r=this._getVertex(t.dest);if(e&&r){const i=this._outEdgeMap.get(e);i?i.push(t):this._outEdgeMap.set(e,[t]);const s=this._inEdgeMap.get(r);return s?s.push(t):this._inEdgeMap.set(r,[t]),!0}return!1}_setOutEdgeMap(t){this._outEdgeMap=t}_setInEdgeMap(t){this._inEdgeMap=t}}e.DirectedGraph=h},8079:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(618),e),s(r(4693),e),s(r(5237),e),s(r(5309),e)},5309:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapGraph=e.MapEdge=e.MapVertex=void 0;const i=r(4693);class s extends i.DirectedVertex{constructor(t,e,r,i){super(t,i),this._lat=e,this._long=r}_lat;get lat(){return this._lat}set lat(t){this._lat=t}_long;get long(){return this._long}set long(t){this._long=t}}e.MapVertex=s;class n extends i.DirectedEdge{constructor(t,e,r,i){super(t,e,r,i)}}e.MapEdge=n;class o extends i.DirectedGraph{constructor(t,e){super(),this._origin=t,this._bottomRight=e}_origin=[0,0];get origin(){return this._origin}set origin(t){this._origin=t}_bottomRight;get bottomRight(){return this._bottomRight}set bottomRight(t){this._bottomRight=t}createVertex(t,e,r=this.origin[0],i=this.origin[1]){return new s(t,r,i,e)}createEdge(t,e,r,i){return new n(t,e,r,i)}}e.MapGraph=o},5237:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UndirectedGraph=e.UndirectedEdge=e.UndirectedVertex=void 0;const i=r(5928),s=r(618);class n extends s.AbstractVertex{constructor(t,e){super(t,e)}}e.UndirectedVertex=n;class o extends s.AbstractEdge{constructor(t,e,r,i){super(r,i),this._vertices=[t,e]}_vertices;get vertices(){return this._vertices}set vertices(t){this._vertices=t}}e.UndirectedEdge=o;class h extends s.AbstractGraph{constructor(){super(),this._edges=new Map}_edges;get edges(){return this._edges}createVertex(t,e){return new n(t,e??t)}createEdge(t,e,r,i){return new o(t,e,r??1,i)}getEdge(t,e){let r=[];if(null!==t&&null!==e){const i=this._getVertex(t),s=this._getVertex(e);i&&s&&(r=this._edges.get(i)?.filter((t=>t.vertices.includes(s.key))))}return r&&r[0]||null}removeEdgeBetween(t,e){const r=this._getVertex(t),s=this._getVertex(e);if(!r||!s)return null;const n=this._edges.get(r);let o=null;n&&(o=(0,i.arrayRemove)(n,(t=>t.vertices.includes(s.key)))[0]||null);const h=this._edges.get(s);return h&&(0,i.arrayRemove)(h,(t=>t.vertices.includes(r.key))),o}removeEdge(t){return this.removeEdgeBetween(t.vertices[0],t.vertices[1])}degreeOf(t){const e=this._getVertex(t);return e&&this._edges.get(e)?.length||0}edgesOf(t){const e=this._getVertex(t);return e&&this._edges.get(e)||[]}edgeSet(){const t=new Set;return this._edges.forEach((e=>{e.forEach((e=>{t.add(e)}))})),[...t]}getNeighbors(t){const e=[],r=this._getVertex(t);if(r){const t=this.edgesOf(r);for(const i of t){const t=this._getVertex(i.vertices.filter((t=>t!==r.key))[0]);t&&e.push(t)}}return e}getEndsOfEdge(t){if(!this.hasEdge(t.vertices[0],t.vertices[1]))return null;const e=this._getVertex(t.vertices[0]),r=this._getVertex(t.vertices[1]);return e&&r?[e,r]:null}_addEdgeOnly(t){for(const e of t.vertices){const r=this._getVertex(e);if(null===r)return!1;if(r){const e=this._edges.get(r);e?e.push(t):this._edges.set(r,[t])}}return!0}_setEdges(t){this._edges=t}}e.UndirectedGraph=h},2808:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoordinateMap=void 0;class r extends Map{constructor(t){super(),void 0!==t&&(this._joint=t)}_joint="_";get joint(){return this._joint}has(t){return super.has(t.join(this._joint))}set(t,e){return super.set(t.join(this._joint),e)}get(t){return super.get(t.join(this._joint))}delete(t){return super.delete(t.join(this._joint))}_setJoint(t){this._joint=t}}e.CoordinateMap=r},2130:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoordinateSet=void 0;class r extends Set{constructor(t){super(),void 0!==t&&(this._joint=t)}_joint="_";get joint(){return this._joint}has(t){return super.has(t.join(this._joint))}add(t){return super.add(t.join(this._joint))}delete(t){return super.delete(t.join(this._joint))}_setJoint(t){this._joint=t}}e.CoordinateSet=r},9121:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HashMap=void 0;class r{constructor(t=16,e=.75,r){this._initialCapacity=t,this._loadFactor=e,this._capacityMultiplier=2,this._size=0,this._table=new Array(t),this._hashFn=r||(t=>{const e=String(t);let r=0;for(let t=0;t<e.length;t++)r+=e.charCodeAt(t);return r%this.table.length})}_initialCapacity;get initialCapacity(){return this._initialCapacity}set initialCapacity(t){this._initialCapacity=t}_loadFactor;get loadFactor(){return this._loadFactor}set loadFactor(t){this._loadFactor=t}_capacityMultiplier;get capacityMultiplier(){return this._capacityMultiplier}set capacityMultiplier(t){this._capacityMultiplier=t}_size;get size(){return this._size}set size(t){this._size=t}_table;get table(){return this._table}set table(t){this._table=t}_hashFn;get hashFn(){return this._hashFn}set hashFn(t){this._hashFn=t}set(t,e){this.size/this.table.length>=this.loadFactor&&this.resizeTable(this.table.length*this.capacityMultiplier);const r=this._hash(t);this.table[r]||(this.table[r]=[]);for(let i=0;i<this.table[r].length;i++)if(this.table[r][i][0]===t)return void(this.table[r][i][1]=e);this.table[r].push([t,e]),this.size++}get(t){const e=this._hash(t);if(this.table[e])for(const[r,i]of this.table[e])if(r===t)return i}delete(t){const e=this._hash(t);if(this.table[e])for(let r=0;r<this.table[e].length;r++)if(this.table[e][r][0]===t)return this.table[e].splice(r,1),this.size--,void(this.size/this.table.length<this.loadFactor/this.capacityMultiplier&&this.resizeTable(this.table.length/this.capacityMultiplier))}*entries(){for(const t of this.table)if(t)for(const[e,r]of t)yield[e,r]}[Symbol.iterator](){return this.entries()}clear(){this.size=0,this.table=new Array(this.initialCapacity)}isEmpty(){return 0===this.size}_hash(t){return this._hashFn(t)}resizeTable(t){const e=new Array(t);for(const r of this._table)if(r)for(const[i,s]of r){const r=this._hash(i)%t;e[r]||(e[r]=[]),e[r].push([i,s])}this._table=e}}e.HashMap=r},5946:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HashTable=e.HashTableNode=void 0;class r{key;val;next;constructor(t,e){this.key=t,this.val=e,this.next=null}}e.HashTableNode=r;class i{static DEFAULT_CAPACITY=16;static LOAD_FACTOR=.75;constructor(t=i.DEFAULT_CAPACITY,e){this._hashFn=e||this._defaultHashFn,this._capacity=Math.max(t,i.DEFAULT_CAPACITY),this._size=0,this._buckets=new Array(this._capacity).fill(null)}_capacity;get capacity(){return this._capacity}set capacity(t){this._capacity=t}_size;get size(){return this._size}_buckets;get buckets(){return this._buckets}set buckets(t){this._buckets=t}_hashFn;get hashFn(){return this._hashFn}set hashFn(t){this._hashFn=t}set(t,e){const s=this._hash(t),n=new r(t,e);if(this._buckets[s]){let r=this._buckets[s];for(;r;){if(r.key===t)return void(r.val=e);if(!r.next)break;r=r.next}r.next=n}else this._buckets[s]=n;this._size++,this._size/this._capacity>=i.LOAD_FACTOR&&this._expand()}get(t){const e=this._hash(t);let r=this._buckets[e];for(;r;){if(r.key===t)return r.val;r=r.next}}delete(t){const e=this._hash(t);let r=this._buckets[e],i=null;for(;r;){if(r.key===t)return i?i.next=r.next:this._buckets[e]=r.next,this._size--,void(r.next=null);i=r,r=r.next}}_defaultHashFn(t){return("string"==typeof t?this._murmurStringHashFn(t):this._objectHash(t))%this._capacity}_multiplicativeStringHashFn(t){const e=String(t);let r=0;for(let t=0;t<e.length;t++)r=(.618033988749895*r+e.charCodeAt(t))%(1<<30);return Math.abs(r)}_murmurStringHashFn(t){const e=String(t);let r=0;for(let t=0;t<e.length;t++)r=1540483477*(r^e.charCodeAt(t)),r=668265261*(r^r>>>15),r^=r>>>15;return Math.abs(r)}_hash(t){return this.hashFn(t)}_stringHash(t){let e=0;for(let r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)&4294967295;return e}_objectHash(t){return this._stringHash(JSON.stringify(t))}_expand(){const t=2*this._capacity,e=new Array(t).fill(null);for(const t of this._buckets){let i=t;for(;i;){const t=this._hash(i.key),s=new r(i.key,i.val);if(e[t]){let r=e[t];for(;r.next;)r=r.next;r.next=s}else e[t]=s;i=i.next}}this._buckets=e,this._capacity=t}}e.HashTable=i},6841:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(5946),e),s(r(2808),e),s(r(2130),e),s(r(7665),e),s(r(8107),e),s(r(9121),e)},7665:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeMap=void 0,e.TreeMap=class{}},8107:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeSet=void 0,e.TreeSet=class{}},8049:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FibonacciHeap=e.FibonacciHeapNode=e.Heap=void 0;class r{nodes=[];comparator;constructor(t){this.comparator=t}get size(){return this.nodes.length}get leaf(){return this.nodes[this.size-1]??void 0}static heapify(t,e){const i=new r(e);return i.nodes=[...t],i.fix(),i}add(t){return this.push(t)}push(t){return this.nodes.push(t),this.bubbleUp(this.nodes.length-1),this}poll(){if(0===this.nodes.length)return;if(1===this.nodes.length)return this.nodes.pop();const t=this.nodes[0];return this.nodes[0]=this.nodes.pop(),this.sinkDown(0),t}pop(){return this.poll()}peek(){if(0!==this.nodes.length)return this.nodes[0]}isEmpty(){return 0===this.size}clear(){this.nodes=[]}refill(t){this.nodes=t,this.fix()}has(t){return this.nodes.includes(t)}dfs(t){const e=[],r=i=>{i<this.size&&("in"===t?(r(2*i+1),e.push(this.nodes[i]),r(2*i+2)):"pre"===t?(e.push(this.nodes[i]),r(2*i+1),r(2*i+2)):"post"===t&&(r(2*i+1),r(2*i+2),e.push(this.nodes[i])))};return r(0),e}toArray(){return[...this.nodes]}getNodes(){return this.nodes}clone(){const t=new r(this.comparator);return t.nodes=[...this.nodes],t}sort(){const t=[],e=this.clone();for(;0!==e.size;){const r=e.poll();r&&t.push(r)}return t}bubbleUp(t){const e=this.nodes[t];for(;t>0;){const r=Math.floor((t-1)/2),i=this.nodes[r];if(!(this.comparator(e,i)<0))break;this.nodes[t]=i,this.nodes[r]=e,t=r}}sinkDown(t){const e=2*t+1,r=2*t+2,i=this.nodes.length;let s=t;if(e<i&&this.comparator(this.nodes[e],this.nodes[s])<0&&(s=e),r<i&&this.comparator(this.nodes[r],this.nodes[s])<0&&(s=r),s!==t){const e=this.nodes[t];this.nodes[t]=this.nodes[s],this.nodes[s]=e,this.sinkDown(s)}}fix(){for(let t=Math.floor(this.size/2);t>=0;t--)this.sinkDown(t)}}e.Heap=r;class i{element;degree;left;right;child;parent;marked;constructor(t,e=0){this.element=t,this.degree=e,this.marked=!1}}e.FibonacciHeapNode=i,e.FibonacciHeap=class{root;size=0;min;comparator;constructor(t){if(this.clear(),this.comparator=t||this.defaultComparator,"function"!=typeof this.comparator)throw new Error("FibonacciHeap constructor: given comparator should be a function.")}clear(){this.root=void 0,this.min=void 0,this.size=0}add(t){return this.push(t)}push(t){const e=this.createNode(t);return e.left=e,e.right=e,this.mergeWithRoot(e),(!this.min||this.comparator(e.element,this.min.element)<=0)&&(this.min=e),this.size++,this}peek(){return this.min?this.min.element:void 0}consumeLinkedList(t){const e=[];if(!t)return e;let r=t,i=!1;for(;r!==t||!i;)r===t&&(i=!0),r&&(e.push(r),r=r.right);return e}mergeWithChild(t,e){t.child?(e.right=t.child.right,e.left=t.child,t.child.right.left=e,t.child.right=e):t.child=e}poll(){return this.pop()}pop(){if(0===this.size)return;const t=this.min;if(t.child){const e=this.consumeLinkedList(t.child);for(const t of e)this.mergeWithRoot(t),t.parent=void 0}return this.removeFromRoot(t),t===t.right?(this.min=void 0,this.root=void 0):(this.min=t.right,this.consolidate()),this.size--,t.element}merge(t){if(0!==t.size){if(this.root&&t.root){const e=this.root,r=t.root,i=e.right,s=r.left;e.right=r,r.left=e,i.left=s,s.right=i}(!this.min||t.min&&this.comparator(t.min.element,this.min.element)<0)&&(this.min=t.min),this.size+=t.size,t.clear()}}defaultComparator(t,e){return t<e?-1:t>e?1:0}createNode(t){return new i(t)}mergeWithRoot(t){this.root?(t.right=this.root.right,t.left=this.root,this.root.right.left=t,this.root.right=t):this.root=t}removeFromRoot(t){this.root===t&&(this.root=t.right),t.left&&(t.left.right=t.right),t.right&&(t.right.left=t.left)}link(t,e){this.removeFromRoot(t),t.left=t,t.right=t,this.mergeWithChild(e,t),e.degree++,t.parent=e}consolidate(){const t=new Array(this.size),e=this.consumeLinkedList(this.root);let r,i,s,n;for(const o of e){for(r=o,s=r.degree;t[s];)i=t[s],this.comparator(r.element,i.element)>0&&(n=r,r=i,i=n),this.link(i,r),t[s]=void 0,s++;t[s]=r}for(let e=0;e<this.size;e++)t[e]&&this.comparator(t[e].element,this.min.element)<=0&&(this.min=t[e])}}},7888:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(7112),e),s(r(1269),e),s(r(8049),e)},7112:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MaxHeap=void 0;const i=r(8049);class s extends i.Heap{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return e-t})){super(t)}}e.MaxHeap=s},1269:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MinHeap=void 0;const i=r(8049);class s extends i.Heap{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return t-e})){super(t)}}e.MinHeap=s},4866:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(6841),e),s(r(2324),e),s(r(9509),e),s(r(2627),e),s(r(8079),e),s(r(255),e),s(r(8456),e),s(r(7888),e),s(r(7641),e),s(r(7619),e),s(r(3543),e)},2198:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DoublyLinkedList=e.DoublyLinkedListNode=void 0;class r{constructor(t){this._val=t,this._next=null,this._prev=null}_val;get val(){return this._val}set val(t){this._val=t}_next;get next(){return this._next}set next(t){this._next=t}_prev;get prev(){return this._prev}set prev(t){this._prev=t}}e.DoublyLinkedListNode=r;class i{constructor(){this._head=null,this._tail=null,this._length=0}_head;get head(){return this._head}set head(t){this._head=t}_tail;get tail(){return this._tail}set tail(t){this._tail=t}_length;get length(){return this._length}get size(){return this.length}static fromArray(t){const e=new i;for(const r of t)e.push(r);return e}push(t){const e=new r(t);this.head?(e.prev=this.tail,this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++}addLast(t){this.push(t)}pop(){if(!this.tail)return;const t=this.tail;return this.head===this.tail?(this.head=null,this.tail=null):(this.tail=t.prev,this.tail.next=null),this._length--,t.val}pollLast(){return this.pop()}shift(){if(!this.head)return;const t=this.head;return this.head===this.tail?(this.head=null,this.tail=null):(this.head=t.next,this.head.prev=null),this._length--,t.val}pollFirst(){return this.shift()}unshift(t){const e=new r(t);this.head?(e.next=this.head,this.head.prev=e,this.head=e):(this.head=e,this.tail=e),this._length++}addFirst(t){this.unshift(t)}peekFirst(){return this.head?.val}peekLast(){return this.tail?.val}getAt(t){if(t<0||t>=this.length)return;let e=this.head;for(let r=0;r<t;r++)e=e.next;return e.val}getNodeAt(t){if(t<0||t>=this.length)return null;let e=this.head;for(let r=0;r<t;r++)e=e.next;return e}findNode(t){let e=this.head;for(;e;){if(e.val===t)return e;e=e.next}return null}insertAt(t,e){if(t<0||t>this.length)return!1;if(0===t)return this.unshift(e),!0;if(t===this.length)return this.push(e),!0;const i=new r(e),s=this.getNodeAt(t-1),n=s.next;return i.prev=s,i.next=n,s.next=i,n.prev=i,this._length++,!0}deleteAt(t){if(t<0||t>=this.length)return;if(0===t)return this.shift();if(t===this.length-1)return this.pop();const e=this.getNodeAt(t),r=e.prev,i=e.next;return r.next=i,i.prev=r,this._length--,e.val}delete(t){let e;if(e=t instanceof r?t:this.findNode(t),e){if(e===this.head)this.shift();else if(e===this.tail)this.pop();else{const t=e.prev,r=e.next;t.next=r,r.prev=t,this._length--}return!0}return!1}toArray(){const t=[];let e=this.head;for(;e;)t.push(e.val),e=e.next;return t}isEmpty(){return 0===this.length}clear(){this._head=null,this._tail=null,this._length=0}find(t){let e=this.head;for(;e;){if(t(e.val))return e.val;e=e.next}return null}indexOf(t){let e=0,r=this.head;for(;r;){if(r.val===t)return e;e++,r=r.next}return-1}findLast(t){let e=this.tail;for(;e;){if(t(e.val))return e.val;e=e.prev}return null}toArrayReverse(){const t=[];let e=this.tail;for(;e;)t.push(e.val),e=e.prev;return t}reverse(){let t=this.head;for([this.head,this.tail]=[this.tail,this.head];t;){const e=t.next;[t.prev,t.next]=[t.next,t.prev],t=e}}forEach(t){let e=this.head,r=0;for(;e;)t(e.val,r),e=e.next,r++}map(t){const e=new i;let r=this.head;for(;r;)e.push(t(r.val)),r=r.next;return e}filter(t){const e=new i;let r=this.head;for(;r;)t(r.val)&&e.push(r.val),r=r.next;return e}reduce(t,e){let r=e,i=this.head;for(;i;)r=t(r,i.val),i=i.next;return r}insertAfter(t,e){let i;if(i=t instanceof r?t:this.findNode(t),i){const t=new r(e);return t.next=i.next,i.next&&(i.next.prev=t),t.prev=i,i.next=t,i===this.tail&&(this.tail=t),this._length++,!0}return!1}insertBefore(t,e){let i;if(i=t instanceof r?t:this.findNode(t),i){const t=new r(e);return t.prev=i.prev,i.prev&&(i.prev.next=t),t.next=i,i.prev=t,i===this.head&&(this.head=t),this._length++,!0}return!1}}e.DoublyLinkedList=i},2324:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(8549),e),s(r(2198),e),s(r(5435),e)},8549:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SinglyLinkedList=e.SinglyLinkedListNode=void 0;class r{constructor(t){this._val=t,this._next=null}_val;get val(){return this._val}set val(t){this._val=t}_next;get next(){return this._next}set next(t){this._next=t}}e.SinglyLinkedListNode=r;class i{constructor(){this._head=null,this._tail=null,this._length=0}_head;get head(){return this._head}set head(t){this._head=t}_tail;get tail(){return this._tail}set tail(t){this._tail=t}_length;get length(){return this._length}static fromArray(t){const e=new i;for(const r of t)e.push(r);return e}getLength(){return this._length}push(t){const e=new r(t);this.head?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++}pop(){if(!this.head)return;if(this.head===this.tail){const t=this.head.val;return this.head=null,this.tail=null,this._length--,t}let t=this.head;for(;t.next!==this.tail;)t=t.next;const e=this.tail.val;return t.next=null,this.tail=t,this._length--,e}shift(){if(!this.head)return;const t=this.head;return this.head=this.head.next,this._length--,t.val}unshift(t){const e=new r(t);this.head?(e.next=this.head,this.head=e):(this.head=e,this.tail=e),this._length++}getAt(t){if(t<0||t>=this.length)return;let e=this.head;for(let r=0;r<t;r++)e=e.next;return e.val}getNodeAt(t){let e=this.head;for(let r=0;r<t;r++)e=e.next;return e}deleteAt(t){if(t<0||t>=this.length)return;if(0===t)return this.shift();if(t===this.length-1)return this.pop();const e=this.getNodeAt(t-1),r=e.next;return e.next=r.next,this._length--,r.val}delete(t){let e;e=t instanceof r?t.val:t;let i=this.head,s=null;for(;i;){if(i.val===e)return null===s?(this.head=i.next,i===this.tail&&(this.tail=null)):(s.next=i.next,i===this.tail&&(this.tail=s)),this._length--,!0;s=i,i=i.next}return!1}insertAt(t,e){if(t<0||t>this.length)return!1;if(0===t)return this.unshift(e),!0;if(t===this.length)return this.push(e),!0;const i=new r(e),s=this.getNodeAt(t-1);return i.next=s.next,s.next=i,this._length++,!0}isEmpty(){return 0===this.length}clear(){this._head=null,this._tail=null,this._length=0}toArray(){const t=[];let e=this.head;for(;e;)t.push(e.val),e=e.next;return t}reverse(){if(!this.head||this.head===this.tail)return;let t=null,e=this.head,r=null;for(;e;)r=e.next,e.next=t,t=e,e=r;[this.head,this.tail]=[this.tail,this.head]}find(t){let e=this.head;for(;e;){if(t(e.val))return e.val;e=e.next}return null}indexOf(t){let e=0,r=this.head;for(;r;){if(r.val===t)return e;e++,r=r.next}return-1}findNode(t){let e=this.head;for(;e;){if(e.val===t)return e;e=e.next}return null}insertBefore(t,e){if(!this.head)return!1;let i;if(i=t instanceof r?t.val:t,this.head.val===i)return this.unshift(e),!0;let s=this.head;for(;s.next;){if(s.next.val===i){const t=new r(e);return t.next=s.next,s.next=t,this._length++,!0}s=s.next}return!1}insertAfter(t,e){let i;if(i=t instanceof r?t:this.findNode(t),i){const t=new r(e);return t.next=i.next,i.next=t,i===this.tail&&(this.tail=t),this._length++,!0}return!1}countOccurrences(t){let e=0,r=this.head;for(;r;)r.val===t&&e++,r=r.next;return e}*[Symbol.iterator](){let t=this.head;for(;t;)yield t.val,t=t.next}}e.SinglyLinkedList=i},5435:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SkipList=e.SkipListNode=void 0;class r{key;value;forward;constructor(t,e,r){this.key=t,this.value=e,this.forward=new Array(r)}}e.SkipListNode=r,e.SkipList=class{constructor(t=16,e=.5){this._head=new r(null,null,t),this._level=0,this._maxLevel=t,this._probability=e}_head;get head(){return this._head}set head(t){this._head=t}_level;get level(){return this._level}set level(t){this._level=t}_maxLevel;get maxLevel(){return this._maxLevel}set maxLevel(t){this._maxLevel=t}_probability;get probability(){return this._probability}set probability(t){this._probability=t}add(t,e){const i=new r(t,e,this.randomLevel()),s=new Array(this.maxLevel).fill(this.head);let n=this.head;for(let e=this.level-1;e>=0;e--){for(;n.forward[e]&&n.forward[e].key<t;)n=n.forward[e];s[e]=n}for(let t=0;t<i.forward.length;t++)i.forward[t]=s[t].forward[t],s[t].forward[t]=i;null!==i.forward[0]&&(this.level=Math.max(this.level,i.forward.length))}get(t){let e=this.head;for(let r=this.level-1;r>=0;r--)for(;e.forward[r]&&e.forward[r].key<t;)e=e.forward[r];if(e=e.forward[0],e&&e.key===t)return e.value}delete(t){const e=new Array(this.maxLevel).fill(this.head);let r=this.head;for(let i=this.level-1;i>=0;i--){for(;r.forward[i]&&r.forward[i].key<t;)r=r.forward[i];e[i]=r}if(r=r.forward[0],r&&r.key===t){for(let t=0;t<this.level&&e[t].forward[t]===r;t++)e[t].forward[t]=r.forward[t];for(;this.level>0&&null===this.head.forward[this.level-1];)this.level--;return!0}return!1}randomLevel(){let t=1;for(;Math.random()<this.probability&&t<this.maxLevel;)t++;return t}}},7619:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(4824),e),s(r(6090),e),s(r(8723),e),s(r(6690),e)},4824:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MatrixNTI2D=void 0,e.MatrixNTI2D=class{_matrix;constructor(t){const{row:e,col:r,initialVal:i}=t;this._matrix=new Array(e).fill(void 0).map((()=>new Array(r).fill(i||0)))}toArray(){return this._matrix}}},8723:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Matrix2D=void 0;const s=i(r(6090));class n{_matrix;constructor(t){void 0===t?this._matrix=n.identity:t instanceof s.default?(this._matrix=n.identity,this._matrix[0][0]=t.x,this._matrix[1][0]=t.y,this._matrix[2][0]=t.w):this._matrix=t}static get empty(){return[[],[],[]]}static get identity(){return[[1,0,0],[0,1,0],[0,0,1]]}get m(){return this._matrix}static add(t,e){const r=n.empty;for(let i=0;i<3;i++)for(let s=0;s<3;s++)r[i][s]=t.m[i][s]+e.m[i][s];return new n(r)}static subtract(t,e){const r=n.empty;for(let i=0;i<3;i++)for(let s=0;s<3;s++)r[i][s]=t.m[i][s]-e.m[i][s];return new n(r)}static multiply(t,e){const r=n.empty;for(let i=0;i<3;i++)for(let s=0;s<3;s++){r[i][s]=0;for(let n=0;n<3;n++)r[i][s]+=t.m[i][n]*e.m[n][s]}return new n(r)}static multiplyByValue(t,e){const r=n.empty;for(let i=0;i<3;i++)for(let s=0;s<3;s++)r[i][s]=t.m[i][s]*e;return new n(r)}static multiplyByVector(t,e){return n.multiply(t,new n(e)).toVector()}static view(t,e){const r=t/2,i=e/2,s=Math.cos(Math.PI);return new n([[1,0,r],[0,1*s,i],[0,0,1]])}static scale(t){return n.multiplyByValue(new n,t)}static rotate(t){const e=Math.cos(t),r=Math.sin(t);return new n([[e,-r,0],[r,e,0],[0,0,1]])}static translate(t){return new n([[1,0,t.x],[0,1,t.y],[0,0,t.w]])}toVector(){return new s.default(this._matrix[0][0],this._matrix[1][0])}}e.Matrix2D=n,e.default=n},6690:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Navigator=e.Character=void 0;class r{direction;turn;constructor(t,e){this.direction=t,this.turn=()=>new r(e[t],e)}}e.Character=r,e.Navigator=class{onMove;_matrix;_cur;_character;_VISITED;constructor({matrix:t,turning:e,onMove:i,init:{cur:s,charDir:n,VISITED:o}}){this._matrix=t,this._cur=s,this._character=new r(n,e),this.onMove=i,this.onMove&&this.onMove(this._cur),this._VISITED=o,this._matrix[this._cur[0]][this._cur[1]]=this._VISITED}start(){for(;this.check(this._character.direction)||this.check(this._character.turn().direction);){const{direction:t}=this._character;this.check(t)?this.move(t):this.check(this._character.turn().direction)&&(this._character=this._character.turn())}}check(t){let e,r;const i=this._matrix,[s,n]=this._cur;switch(t){case"up":if(r=i[s-1],!r)return!1;e=r[n];break;case"right":e=i[s][n+1];break;case"down":if(r=i[s+1],!r)return!1;e=r[n];break;case"left":e=i[s][n-1]}return void 0!==e&&e!==this._VISITED}move(t){switch(t){case"up":this._cur[0]--;break;case"right":this._cur[1]++;break;case"down":this._cur[0]++;break;case"left":this._cur[1]--}const[e,r]=this._cur;this._matrix[e][r]=this._VISITED,this.onMove&&this.onMove(this._cur)}}},6090:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Vector2D=void 0;class r{x;y;w;constructor(t=0,e=0,r=1){this.x=t,this.y=e,this.w=r}get isZero(){return 0===this.x&&0===this.y}get length(){return Math.sqrt(this.x*this.x+this.y*this.y)}get lengthSq(){return this.x*this.x+this.y*this.y}get rounded(){return new r(Math.round(this.x),Math.round(this.y))}static add(t,e){return new r(t.x+e.x,t.y+e.y)}static subtract(t,e){return new r(t.x-e.x,t.y-e.y)}static subtractValue(t,e){return new r(t.x-e,t.y-e)}static multiply(t,e){return new r(t.x*e,t.y*e)}static divide(t,e){return new r(t.x/e,t.y/e)}static equals(t,e){return t.x===e.x&&t.y===e.y}static equalsRounded(t,e,i=12){const s=r.abs(r.subtract(t,e));return s.x<i&&s.y<i}static normalize(t){const e=t.length;return e>2220446049250313e-31?r.divide(t,e):t}static truncate(t,e){return t.length>e?r.multiply(r.normalize(t),e):t}static perp(t){return new r(-t.y,t.x)}static reverse(t){return new r(-t.x,-t.y)}static abs(t){return new r(Math.abs(t.x),Math.abs(t.y))}static dot(t,e){return t.x*e.x+t.y*e.y}static distance(t,e){const r=e.y-t.y,i=e.x-t.x;return Math.sqrt(r*r+i*i)}static distanceSq(t,e){const r=e.y-t.y,i=e.x-t.x;return r*r+i*i}static sign(t,e){return t.y*e.x>t.x*e.y?-1:1}static angle(t){const e=new r(0,-1),i=Math.acos(r.dot(t,e)/(t.length*e.length));return 1===r.sign(t,e)?2*Math.PI-i:i}static random(t,e){const i=Math.floor(Math.random()*t-t/2),s=Math.floor(Math.random()*e-e/2);return new r(i,s)}zero(){this.x=0,this.y=0}}e.Vector2D=r,e.default=r},7641:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(3491),e),s(r(7016),e),s(r(7021),e)},7021:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MaxPriorityQueue=void 0;const i=r(3491);class s extends i.PriorityQueue{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return e-t})){super(t)}}e.MaxPriorityQueue=s},7016:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MinPriorityQueue=void 0;const i=r(3491);class s extends i.PriorityQueue{constructor(t=((t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("The a, b params of compare function must be number");return t-e})){super(t)}}e.MinPriorityQueue=s},3491:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PriorityQueue=void 0;const i=r(7888);class s extends i.Heap{constructor(t){super(t)}}e.PriorityQueue=s},7569:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayDeque=e.ObjectDeque=e.Deque=void 0;const i=r(2324);class s extends i.DoublyLinkedList{}e.Deque=s,e.ObjectDeque=class{constructor(t){void 0!==t&&(this._capacity=t)}_nodes={};get nodes(){return this._nodes}_capacity=Number.MAX_SAFE_INTEGER;get capacity(){return this._capacity}set capacity(t){this._capacity=t}_first=-1;get first(){return this._first}set first(t){this._first=t}_last=-1;get last(){return this._last}set last(t){this._last=t}_size=0;get size(){return this._size}addFirst(t){if(0===this._size){const t=Math.floor(this._capacity/2);this._first=t,this._last=t}else this._first--;this._nodes[this._first]=t,this._size++}addLast(t){if(0===this._size){const t=Math.floor(this._capacity/2);this._first=t,this._last=t}else this._last++;this._nodes[this._last]=t,this._size++}pollFirst(){if(!this._size)return;const t=this.peekFirst();return delete this._nodes[this._first],this._first++,this._size--,t}peekFirst(){if(this._size)return this._nodes[this._first]}pollLast(){if(!this._size)return;const t=this.peekLast();return delete this._nodes[this._last],this._last--,this._size--,t}peekLast(){if(this._size)return this._nodes[this._last]}get(t){return this._nodes[this._first+t]||null}isEmpty(){return this._size<=0}_seNodes(t){this._nodes=t}_setSize(t){this._size=t}},e.ArrayDeque=class{_nodes=[];get size(){return this._nodes.length}addLast(t){return this._nodes.push(t)}pollLast(){return this._nodes.pop()??null}pollFirst(){return this._nodes.shift()??null}addFirst(t){return this._nodes.unshift(t)}peekFirst(){return this._nodes[0]??null}peekLast(){return this._nodes[this._nodes.length-1]??null}get(t){return this._nodes[t]??null}set(t,e){return this._nodes[t]=e}insert(t,e){return this._nodes.splice(t,0,e)}delete(t){return this._nodes.splice(t,1)}isEmpty(){return 0===this._nodes.length}}},2627:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(3295),e),s(r(7569),e)},3295:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Queue=e.LinkedListQueue=void 0;const i=r(2324);class s extends i.SinglyLinkedList{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this.head?.val}}e.LinkedListQueue=s;class n{constructor(t){this._nodes=t||[],this._offset=0}_nodes;get nodes(){return this._nodes}set nodes(t){this._nodes=t}_offset;get offset(){return this._offset}set offset(t){this._offset=t}get size(){return this.nodes.length-this.offset}static fromArray(t){return new n(t)}push(t){return this.nodes.push(t),this}shift(){if(0===this.size)return;const t=this.peek();return this.offset+=1,2*this.offset<this.nodes.length||(this.nodes=this.nodes.slice(this.offset),this.offset=0),t}peek(){return this.size>0?this.nodes[this.offset]:void 0}peekLast(){return this.size>0?this.nodes[this.nodes.length-1]:void 0}enqueue(t){this.push(t)}dequeue(){return this.shift()}getAt(t){return this.nodes[t]}isEmpty(){return 0===this.size}toArray(){return this.nodes.slice(this.offset)}clear(){this.nodes=[],this.offset=0}clone(){return new n(this.nodes.slice(this.offset))}*[Symbol.iterator](){for(const t of this.nodes)yield t}}e.Queue=n},9509:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(6006),e)},6006:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Stack=void 0;class r{_elements;constructor(t){this._elements=Array.isArray(t)?t:[]}static fromArray(t){return new r(t)}isEmpty(){return 0===this._elements.length}size(){return this._elements.length}peek(){return this.isEmpty()?null:this._elements[this._elements.length-1]}push(t){return this._elements.push(t),this}pop(){return this.isEmpty()?null:this._elements.pop()||null}toArray(){return this._elements.slice()}clear(){this._elements=[]}clone(){return new r(this._elements.slice())}}e.Stack=r},8456:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(301),e)},301:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeNode=void 0;class r{constructor(t,e,r){this._key=t,this._value=e||void 0,this._children=r||[]}_key;get key(){return this._key}set key(t){this._key=t}_value;get value(){return this._value}set value(t){this._value=t}_children;get children(){return this._children}set children(t){this._children=t}addChildren(t){this.children||(this.children=[]),t instanceof r?this.children.push(t):this.children=this.children.concat(t)}getHeight(){let t=0;if(this){const e=(r,i)=>{i>t&&(t=i);const{children:s}=r;if(s)for(let t=0,r=s.length;t<r;t++)e(s[t],i+1)};e(this,0)}return t}}e.TreeNode=r},3543:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(2952),e)},2952:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Trie=e.TrieNode=void 0;class r{constructor(t){this._key=t,this._isEnd=!1,this._children=new Map}_key;get key(){return this._key}set key(t){this._key=t}_children;get children(){return this._children}set children(t){this._children=t}_isEnd;get isEnd(){return this._isEnd}set isEnd(t){this._isEnd=t}}e.TrieNode=r,e.Trie=class{_caseSensitive;constructor(t,e=!0){if(this._root=new r(""),this._caseSensitive=e,t)for(const e of t)this.add(e)}_root;get root(){return this._root}set root(t){this._root=t}add(t){t=this._caseProcess(t);let e=this.root;for(const i of t){let t=e.children.get(i);t||(t=new r(i),e.children.set(i,t)),e=t}return e.isEnd=!0,!0}has(t){t=this._caseProcess(t);let e=this.root;for(const r of t){const t=e.children.get(r);if(!t)return!1;e=t}return e.isEnd}delete(t){t=this._caseProcess(t);let e=!1;const r=(i,s)=>{const n=t[s],o=i.children.get(n);return!!o&&(s===t.length-1?!!o.isEnd&&(o.children.size>0?o.isEnd=!1:i.children.delete(n),e=!0,!0):!(!r(o,s+1)||i.isEnd||0!==o.children.size||(i.children.delete(n),0)))};return r(this.root,0),e}getHeight(){const t=this.root;let e=0;if(t){const r=(t,i)=>{i>e&&(e=i);const{children:s}=t;if(s)for(const t of s.entries())r(t[1],i+1)};r(t,0)}return e}hasPurePrefix(t){t=this._caseProcess(t);let e=this.root;for(const r of t){const t=e.children.get(r);if(!t)return!1;e=t}return!e.isEnd}hasPrefix(t){t=this._caseProcess(t);let e=this.root;for(const r of t){const t=e.children.get(r);if(!t)return!1;e=t}return!0}hasCommonPrefix(t){t=this._caseProcess(t);let e="";const r=i=>{e+=i.key,e!==t&&(i.isEnd||i&&i.children&&1===i.children.size&&r(Array.from(i.children.values())[0]))};return r(this.root),e===t}getLongestCommonPrefix(){let t="";const e=r=>{t+=r.key,r.isEnd||r&&r.children&&1===r.children.size&&e(Array.from(r.children.values())[0])};return e(this.root),t}getWords(t="",e=Number.MAX_SAFE_INTEGER){t=this._caseProcess(t);const r=[];let i=0,s=this.root;if(t)for(const e of t){const t=s.children.get(e);t&&(s=t)}return s!==this.root&&function t(s,n){for(const e of s.children.keys()){const r=s.children.get(e);void 0!==r&&t(r,n.concat(e))}if(s.isEnd){if(i>e-1)return;r.push(n),i++}}(s,t),r}_caseProcess(t){return this._caseSensitive||(t=t.toLowerCase()),t}}},3607:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(4866),e),s(r(5928),e),s(r(1247),e),s(r(1230),e)},3108:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4477:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4683:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2338:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1247:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(4683),e),s(r(3108),e),s(r(4477),e),s(r(2338),e),s(r(8447),e),s(r(5785),e),s(r(8759),e),s(r(2354),e)},8447:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5785:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8759:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2354:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},856:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8629:(t,e)=>{var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.FamilyPosition=e.IterationType=void 0,function(t){t.ITERATIVE="ITERATIVE",t.RECURSIVE="RECURSIVE"}(r||(e.IterationType=r={})),function(t){t.ROOT="ROOT",t.LEFT="LEFT",t.RIGHT="RIGHT",t.ROOT_LEFT="ROOT_LEFT",t.ROOT_RIGHT="ROOT_RIGHT",t.ISOLATED="ISOLATED",t.MAL_NODE="MAL_NODE"}(i||(e.FamilyPosition=i={}))},4778:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},615:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(8629),e),s(r(4778),e),s(r(856),e),s(r(4505),e),s(r(1930),e),s(r(8042),e)},8042:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.RBColor=void 0,function(t){t.RED="RED",t.BLACK="BLACK"}(r||(e.RBColor=r={}))},4505:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1930:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8041:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3689:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.TopologicalProperty=void 0,function(t){t.VAL="VAL",t.NODE="NODE",t.ID="ID"}(r||(e.TopologicalProperty=r={}))},930:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(8041),e),s(r(995),e),s(r(3689),e)},995:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6705:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9473:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8884:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(9473),e)},8720:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(615),e),s(r(930),e),s(r(2001),e),s(r(8884),e),s(r(1664),e),s(r(6705),e),s(r(9574),e),s(r(3744),e),s(r(1623),e),s(r(2680),e),s(r(4721),e)},7787:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2001:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(2451),e),s(r(7787),e)},2451:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1664:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(5414),e)},5414:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9574:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(3649),e),s(r(5936),e),s(r(3495),e)},3495:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5936:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3649:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1699:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3744:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(4315),e),s(r(1699),e)},4315:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1623:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(1635),e)},1635:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2680:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(9363),e)},9363:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4721:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(8716),e)},8716:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5268:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.CP=void 0,function(t){t.lt="lt",t.eq="eq",t.gt="gt"}(r||(e.CP=r={}))},1230:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(8720),e),s(r(5268),e),s(r(9963),e)},9963:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(6016),e),s(r(6706),e)},6016:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6706:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5928:function(t,e,r){var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),s(r(974),e)},974:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getMSB=e.trampolineAsync=e.trampoline=e.toThunk=e.isThunk=e.THUNK_SYMBOL=e.arrayRemove=e.uuidV4=void 0,e.uuidV4=function(){return"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".replace(/[x]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},e.arrayRemove=function(t,e){let r=-1,i=t?t.length:0;const s=[];for(;++r<i;){const n=t[r];e(n,r,t)&&(s.push(n),Array.prototype.splice.call(t,r--,1),i--)}return s},e.THUNK_SYMBOL=Symbol("thunk"),e.isThunk=t=>"function"==typeof t&&t.__THUNK__===e.THUNK_SYMBOL,e.toThunk=t=>{const r=()=>t();return r.__THUNK__=e.THUNK_SYMBOL,r},e.trampoline=t=>Object.assign(((...r)=>{let i=t(...r);for(;(0,e.isThunk)(i)&&"function"==typeof i;)i=i();return i}),{cont:(...r)=>(0,e.toThunk)((()=>t(...r)))}),e.trampolineAsync=t=>Object.assign((async(...r)=>{let i=await t(...r);for(;(0,e.isThunk)(i)&&"function"==typeof i;)i=await i();return i}),{cont:(...r)=>(0,e.toThunk)((()=>t(...r)))}),e.getMSB=t=>t<=0?0:1<<31-Math.clz32(t)}},e={};return function r(i){var s=e[i];if(void 0!==s)return s.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,r),n.exports}(3607)})()));
3
3
  //# sourceMappingURL=bundle.min.js.map