@machhub-dev/node-red-nodes 1.0.5

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 (1283) hide show
  1. package/LICENSE +373 -0
  2. package/dist/lib/config/machhub-env-loader.js +93 -0
  3. package/dist/lib/enums/data.enums.js +12 -0
  4. package/dist/lib/errors/errors.js +15 -0
  5. package/dist/lib/models/collections.model.js +2 -0
  6. package/dist/lib/models/machine.models.js +2 -0
  7. package/dist/lib/models/product.models.js +2 -0
  8. package/dist/lib/models/recordId.models.js +11 -0
  9. package/dist/lib/services/http.api.services.js +152 -0
  10. package/dist/lib/services/http.service.js +188 -0
  11. package/dist/lib/services/mqtt.service.js +234 -0
  12. package/dist/nodes/bulk-tag-write.html +91 -0
  13. package/dist/nodes/bulk-tag-write.js +118 -0
  14. package/dist/nodes/collections.html +508 -0
  15. package/dist/nodes/collections.js +241 -0
  16. package/dist/nodes/dbquery.html +131 -0
  17. package/dist/nodes/dbquery.js +83 -0
  18. package/dist/nodes/machhub-config.html +39 -0
  19. package/dist/nodes/machhub-config.js +15 -0
  20. package/dist/nodes/tag-read.html +194 -0
  21. package/dist/nodes/tag-read.js +133 -0
  22. package/dist/nodes/tag-write.html +162 -0
  23. package/dist/nodes/tag-write.js +110 -0
  24. package/node_modules/@babel/runtime/LICENSE +22 -0
  25. package/node_modules/@babel/runtime/README.md +19 -0
  26. package/node_modules/@babel/runtime/helpers/AwaitValue.js +4 -0
  27. package/node_modules/@babel/runtime/helpers/OverloadYield.js +4 -0
  28. package/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +9 -0
  29. package/node_modules/@babel/runtime/helpers/applyDecs.js +236 -0
  30. package/node_modules/@babel/runtime/helpers/applyDecs2203.js +184 -0
  31. package/node_modules/@babel/runtime/helpers/applyDecs2203R.js +191 -0
  32. package/node_modules/@babel/runtime/helpers/applyDecs2301.js +222 -0
  33. package/node_modules/@babel/runtime/helpers/applyDecs2305.js +133 -0
  34. package/node_modules/@babel/runtime/helpers/applyDecs2311.js +124 -0
  35. package/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +6 -0
  36. package/node_modules/@babel/runtime/helpers/arrayWithHoles.js +4 -0
  37. package/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +5 -0
  38. package/node_modules/@babel/runtime/helpers/assertClassBrand.js +5 -0
  39. package/node_modules/@babel/runtime/helpers/assertThisInitialized.js +5 -0
  40. package/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +24 -0
  41. package/node_modules/@babel/runtime/helpers/asyncIterator.js +45 -0
  42. package/node_modules/@babel/runtime/helpers/asyncToGenerator.js +26 -0
  43. package/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +5 -0
  44. package/node_modules/@babel/runtime/helpers/callSuper.js +7 -0
  45. package/node_modules/@babel/runtime/helpers/checkInRHS.js +6 -0
  46. package/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +4 -0
  47. package/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +10 -0
  48. package/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +4 -0
  49. package/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +7 -0
  50. package/node_modules/@babel/runtime/helpers/classCallCheck.js +4 -0
  51. package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +5 -0
  52. package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +4 -0
  53. package/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +5 -0
  54. package/node_modules/@babel/runtime/helpers/classNameTDZError.js +4 -0
  55. package/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +7 -0
  56. package/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +7 -0
  57. package/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js +5 -0
  58. package/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +5 -0
  59. package/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +5 -0
  60. package/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +5 -0
  61. package/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +7 -0
  62. package/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js +5 -0
  63. package/node_modules/@babel/runtime/helpers/classPrivateGetter.js +5 -0
  64. package/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +5 -0
  65. package/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +5 -0
  66. package/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +4 -0
  67. package/node_modules/@babel/runtime/helpers/classPrivateSetter.js +5 -0
  68. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +7 -0
  69. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +7 -0
  70. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +7 -0
  71. package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +5 -0
  72. package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +4 -0
  73. package/node_modules/@babel/runtime/helpers/construct.js +10 -0
  74. package/node_modules/@babel/runtime/helpers/createClass.js +13 -0
  75. package/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +50 -0
  76. package/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +19 -0
  77. package/node_modules/@babel/runtime/helpers/createSuper.js +16 -0
  78. package/node_modules/@babel/runtime/helpers/decorate.js +250 -0
  79. package/node_modules/@babel/runtime/helpers/defaults.js +9 -0
  80. package/node_modules/@babel/runtime/helpers/defineAccessor.js +8 -0
  81. package/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +12 -0
  82. package/node_modules/@babel/runtime/helpers/defineProperty.js +10 -0
  83. package/node_modules/@babel/runtime/helpers/dispose.js +28 -0
  84. package/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +4 -0
  85. package/node_modules/@babel/runtime/helpers/esm/OverloadYield.js +4 -0
  86. package/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +9 -0
  87. package/node_modules/@babel/runtime/helpers/esm/applyDecs.js +236 -0
  88. package/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +184 -0
  89. package/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +191 -0
  90. package/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +222 -0
  91. package/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js +133 -0
  92. package/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js +124 -0
  93. package/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +6 -0
  94. package/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +4 -0
  95. package/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +5 -0
  96. package/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js +5 -0
  97. package/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +5 -0
  98. package/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +24 -0
  99. package/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +45 -0
  100. package/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +26 -0
  101. package/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +5 -0
  102. package/node_modules/@babel/runtime/helpers/esm/callSuper.js +7 -0
  103. package/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +6 -0
  104. package/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +4 -0
  105. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +10 -0
  106. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +4 -0
  107. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +7 -0
  108. package/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +4 -0
  109. package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +5 -0
  110. package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +4 -0
  111. package/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +5 -0
  112. package/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +4 -0
  113. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +7 -0
  114. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +7 -0
  115. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js +5 -0
  116. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +5 -0
  117. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +5 -0
  118. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +5 -0
  119. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +7 -0
  120. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js +5 -0
  121. package/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js +5 -0
  122. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +5 -0
  123. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +5 -0
  124. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +4 -0
  125. package/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js +5 -0
  126. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +7 -0
  127. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +7 -0
  128. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +7 -0
  129. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +5 -0
  130. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +4 -0
  131. package/node_modules/@babel/runtime/helpers/esm/construct.js +10 -0
  132. package/node_modules/@babel/runtime/helpers/esm/createClass.js +13 -0
  133. package/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +50 -0
  134. package/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +19 -0
  135. package/node_modules/@babel/runtime/helpers/esm/createSuper.js +16 -0
  136. package/node_modules/@babel/runtime/helpers/esm/decorate.js +250 -0
  137. package/node_modules/@babel/runtime/helpers/esm/defaults.js +9 -0
  138. package/node_modules/@babel/runtime/helpers/esm/defineAccessor.js +8 -0
  139. package/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +12 -0
  140. package/node_modules/@babel/runtime/helpers/esm/defineProperty.js +10 -0
  141. package/node_modules/@babel/runtime/helpers/esm/dispose.js +28 -0
  142. package/node_modules/@babel/runtime/helpers/esm/extends.js +10 -0
  143. package/node_modules/@babel/runtime/helpers/esm/get.js +11 -0
  144. package/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +6 -0
  145. package/node_modules/@babel/runtime/helpers/esm/identity.js +4 -0
  146. package/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js +27 -0
  147. package/node_modules/@babel/runtime/helpers/esm/inherits.js +14 -0
  148. package/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +5 -0
  149. package/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +9 -0
  150. package/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +4 -0
  151. package/node_modules/@babel/runtime/helpers/esm/instanceof.js +4 -0
  152. package/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +6 -0
  153. package/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +27 -0
  154. package/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +8 -0
  155. package/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +9 -0
  156. package/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +4 -0
  157. package/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +28 -0
  158. package/node_modules/@babel/runtime/helpers/esm/jsx.js +22 -0
  159. package/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +9 -0
  160. package/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +4 -0
  161. package/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +4 -0
  162. package/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +4 -0
  163. package/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js +4 -0
  164. package/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +4 -0
  165. package/node_modules/@babel/runtime/helpers/esm/objectSpread.js +14 -0
  166. package/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +23 -0
  167. package/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
  168. package/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +10 -0
  169. package/node_modules/@babel/runtime/helpers/esm/package.json +3 -0
  170. package/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +8 -0
  171. package/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +4 -0
  172. package/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +304 -0
  173. package/node_modules/@babel/runtime/helpers/esm/set.js +22 -0
  174. package/node_modules/@babel/runtime/helpers/esm/setFunctionName.js +12 -0
  175. package/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +6 -0
  176. package/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +7 -0
  177. package/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +8 -0
  178. package/node_modules/@babel/runtime/helpers/esm/superPropBase.js +6 -0
  179. package/node_modules/@babel/runtime/helpers/esm/superPropGet.js +9 -0
  180. package/node_modules/@babel/runtime/helpers/esm/superPropSet.js +6 -0
  181. package/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +8 -0
  182. package/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +4 -0
  183. package/node_modules/@babel/runtime/helpers/esm/tdz.js +4 -0
  184. package/node_modules/@babel/runtime/helpers/esm/temporalRef.js +6 -0
  185. package/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +2 -0
  186. package/node_modules/@babel/runtime/helpers/esm/toArray.js +8 -0
  187. package/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +8 -0
  188. package/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +12 -0
  189. package/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +7 -0
  190. package/node_modules/@babel/runtime/helpers/esm/toSetter.js +10 -0
  191. package/node_modules/@babel/runtime/helpers/esm/typeof.js +10 -0
  192. package/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +9 -0
  193. package/node_modules/@babel/runtime/helpers/esm/using.js +12 -0
  194. package/node_modules/@babel/runtime/helpers/esm/usingCtx.js +59 -0
  195. package/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +69 -0
  196. package/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +27 -0
  197. package/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +51 -0
  198. package/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +4 -0
  199. package/node_modules/@babel/runtime/helpers/extends.js +10 -0
  200. package/node_modules/@babel/runtime/helpers/get.js +11 -0
  201. package/node_modules/@babel/runtime/helpers/getPrototypeOf.js +6 -0
  202. package/node_modules/@babel/runtime/helpers/identity.js +4 -0
  203. package/node_modules/@babel/runtime/helpers/importDeferProxy.js +27 -0
  204. package/node_modules/@babel/runtime/helpers/inherits.js +14 -0
  205. package/node_modules/@babel/runtime/helpers/inheritsLoose.js +5 -0
  206. package/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +9 -0
  207. package/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +4 -0
  208. package/node_modules/@babel/runtime/helpers/instanceof.js +4 -0
  209. package/node_modules/@babel/runtime/helpers/interopRequireDefault.js +6 -0
  210. package/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +27 -0
  211. package/node_modules/@babel/runtime/helpers/isNativeFunction.js +8 -0
  212. package/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +9 -0
  213. package/node_modules/@babel/runtime/helpers/iterableToArray.js +4 -0
  214. package/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +28 -0
  215. package/node_modules/@babel/runtime/helpers/jsx.js +22 -0
  216. package/node_modules/@babel/runtime/helpers/maybeArrayLike.js +9 -0
  217. package/node_modules/@babel/runtime/helpers/newArrowCheck.js +4 -0
  218. package/node_modules/@babel/runtime/helpers/nonIterableRest.js +4 -0
  219. package/node_modules/@babel/runtime/helpers/nonIterableSpread.js +4 -0
  220. package/node_modules/@babel/runtime/helpers/nullishReceiverError.js +4 -0
  221. package/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +4 -0
  222. package/node_modules/@babel/runtime/helpers/objectSpread.js +14 -0
  223. package/node_modules/@babel/runtime/helpers/objectSpread2.js +23 -0
  224. package/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +13 -0
  225. package/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +10 -0
  226. package/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +8 -0
  227. package/node_modules/@babel/runtime/helpers/readOnlyError.js +4 -0
  228. package/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +304 -0
  229. package/node_modules/@babel/runtime/helpers/set.js +22 -0
  230. package/node_modules/@babel/runtime/helpers/setFunctionName.js +12 -0
  231. package/node_modules/@babel/runtime/helpers/setPrototypeOf.js +6 -0
  232. package/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +7 -0
  233. package/node_modules/@babel/runtime/helpers/slicedToArray.js +8 -0
  234. package/node_modules/@babel/runtime/helpers/superPropBase.js +6 -0
  235. package/node_modules/@babel/runtime/helpers/superPropGet.js +9 -0
  236. package/node_modules/@babel/runtime/helpers/superPropSet.js +6 -0
  237. package/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +8 -0
  238. package/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +4 -0
  239. package/node_modules/@babel/runtime/helpers/tdz.js +4 -0
  240. package/node_modules/@babel/runtime/helpers/temporalRef.js +6 -0
  241. package/node_modules/@babel/runtime/helpers/temporalUndefined.js +2 -0
  242. package/node_modules/@babel/runtime/helpers/toArray.js +8 -0
  243. package/node_modules/@babel/runtime/helpers/toConsumableArray.js +8 -0
  244. package/node_modules/@babel/runtime/helpers/toPrimitive.js +12 -0
  245. package/node_modules/@babel/runtime/helpers/toPropertyKey.js +7 -0
  246. package/node_modules/@babel/runtime/helpers/toSetter.js +10 -0
  247. package/node_modules/@babel/runtime/helpers/typeof.js +10 -0
  248. package/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +9 -0
  249. package/node_modules/@babel/runtime/helpers/using.js +12 -0
  250. package/node_modules/@babel/runtime/helpers/usingCtx.js +59 -0
  251. package/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +69 -0
  252. package/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +27 -0
  253. package/node_modules/@babel/runtime/helpers/wrapRegExp.js +51 -0
  254. package/node_modules/@babel/runtime/helpers/writeOnlyError.js +4 -0
  255. package/node_modules/@babel/runtime/package.json +1056 -0
  256. package/node_modules/@babel/runtime/regenerator/index.js +15 -0
  257. package/node_modules/@types/ace/LICENSE +21 -0
  258. package/node_modules/@types/ace/README.md +15 -0
  259. package/node_modules/@types/ace/index.d.ts +3135 -0
  260. package/node_modules/@types/ace/package.json +30 -0
  261. package/node_modules/@types/body-parser/LICENSE +21 -0
  262. package/node_modules/@types/body-parser/README.md +15 -0
  263. package/node_modules/@types/body-parser/index.d.ts +95 -0
  264. package/node_modules/@types/body-parser/package.json +58 -0
  265. package/node_modules/@types/connect/LICENSE +21 -0
  266. package/node_modules/@types/connect/README.md +15 -0
  267. package/node_modules/@types/connect/index.d.ts +91 -0
  268. package/node_modules/@types/connect/package.json +32 -0
  269. package/node_modules/@types/cors/LICENSE +21 -0
  270. package/node_modules/@types/cors/README.md +75 -0
  271. package/node_modules/@types/cors/index.d.ts +56 -0
  272. package/node_modules/@types/cors/package.json +32 -0
  273. package/node_modules/@types/express/LICENSE +21 -0
  274. package/node_modules/@types/express/README.md +15 -0
  275. package/node_modules/@types/express/index.d.ts +128 -0
  276. package/node_modules/@types/express/package.json +45 -0
  277. package/node_modules/@types/express-serve-static-core/LICENSE +21 -0
  278. package/node_modules/@types/express-serve-static-core/README.md +15 -0
  279. package/node_modules/@types/express-serve-static-core/index.d.ts +1295 -0
  280. package/node_modules/@types/express-serve-static-core/package.json +50 -0
  281. package/node_modules/@types/http-errors/LICENSE +21 -0
  282. package/node_modules/@types/http-errors/README.md +15 -0
  283. package/node_modules/@types/http-errors/index.d.ts +77 -0
  284. package/node_modules/@types/http-errors/package.json +30 -0
  285. package/node_modules/@types/jquery/JQuery.d.ts +13372 -0
  286. package/node_modules/@types/jquery/JQueryStatic.d.ts +13944 -0
  287. package/node_modules/@types/jquery/LICENSE +21 -0
  288. package/node_modules/@types/jquery/README.md +15 -0
  289. package/node_modules/@types/jquery/dist/jquery.slim.d.ts +3 -0
  290. package/node_modules/@types/jquery/index.d.ts +7 -0
  291. package/node_modules/@types/jquery/legacy.d.ts +204 -0
  292. package/node_modules/@types/jquery/misc.d.ts +7364 -0
  293. package/node_modules/@types/jquery/package.json +132 -0
  294. package/node_modules/@types/mime/LICENSE +21 -0
  295. package/node_modules/@types/mime/Mime.d.ts +10 -0
  296. package/node_modules/@types/mime/README.md +15 -0
  297. package/node_modules/@types/mime/index.d.ts +31 -0
  298. package/node_modules/@types/mime/lite.d.ts +7 -0
  299. package/node_modules/@types/mime/package.json +30 -0
  300. package/node_modules/@types/node/LICENSE +21 -0
  301. package/node_modules/@types/node/README.md +15 -0
  302. package/node_modules/@types/node/assert/strict.d.ts +8 -0
  303. package/node_modules/@types/node/assert.d.ts +1040 -0
  304. package/node_modules/@types/node/async_hooks.d.ts +541 -0
  305. package/node_modules/@types/node/buffer.d.ts +2293 -0
  306. package/node_modules/@types/node/child_process.d.ts +1544 -0
  307. package/node_modules/@types/node/cluster.d.ts +578 -0
  308. package/node_modules/@types/node/console.d.ts +452 -0
  309. package/node_modules/@types/node/constants.d.ts +19 -0
  310. package/node_modules/@types/node/crypto.d.ts +4451 -0
  311. package/node_modules/@types/node/dgram.d.ts +596 -0
  312. package/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  313. package/node_modules/@types/node/dns/promises.d.ts +476 -0
  314. package/node_modules/@types/node/dns.d.ts +865 -0
  315. package/node_modules/@types/node/dom-events.d.ts +124 -0
  316. package/node_modules/@types/node/domain.d.ts +170 -0
  317. package/node_modules/@types/node/events.d.ts +931 -0
  318. package/node_modules/@types/node/fs/promises.d.ts +1264 -0
  319. package/node_modules/@types/node/fs.d.ts +4390 -0
  320. package/node_modules/@types/node/globals.d.ts +510 -0
  321. package/node_modules/@types/node/globals.global.d.ts +1 -0
  322. package/node_modules/@types/node/http.d.ts +1921 -0
  323. package/node_modules/@types/node/http2.d.ts +2418 -0
  324. package/node_modules/@types/node/https.d.ts +550 -0
  325. package/node_modules/@types/node/index.d.ts +90 -0
  326. package/node_modules/@types/node/inspector.d.ts +2746 -0
  327. package/node_modules/@types/node/module.d.ts +301 -0
  328. package/node_modules/@types/node/net.d.ts +999 -0
  329. package/node_modules/@types/node/os.d.ts +495 -0
  330. package/node_modules/@types/node/package.json +217 -0
  331. package/node_modules/@types/node/path.d.ts +200 -0
  332. package/node_modules/@types/node/perf_hooks.d.ts +941 -0
  333. package/node_modules/@types/node/process.d.ts +1913 -0
  334. package/node_modules/@types/node/punycode.d.ts +117 -0
  335. package/node_modules/@types/node/querystring.d.ts +153 -0
  336. package/node_modules/@types/node/readline/promises.d.ts +150 -0
  337. package/node_modules/@types/node/readline.d.ts +540 -0
  338. package/node_modules/@types/node/repl.d.ts +430 -0
  339. package/node_modules/@types/node/sea.d.ts +153 -0
  340. package/node_modules/@types/node/sqlite.d.ts +213 -0
  341. package/node_modules/@types/node/stream/consumers.d.ts +12 -0
  342. package/node_modules/@types/node/stream/promises.d.ts +83 -0
  343. package/node_modules/@types/node/stream/web.d.ts +367 -0
  344. package/node_modules/@types/node/stream.d.ts +1707 -0
  345. package/node_modules/@types/node/string_decoder.d.ts +67 -0
  346. package/node_modules/@types/node/test.d.ts +2006 -0
  347. package/node_modules/@types/node/timers/promises.d.ts +97 -0
  348. package/node_modules/@types/node/timers.d.ts +240 -0
  349. package/node_modules/@types/node/tls.d.ts +1220 -0
  350. package/node_modules/@types/node/trace_events.d.ts +197 -0
  351. package/node_modules/@types/node/tty.d.ts +208 -0
  352. package/node_modules/@types/node/url.d.ts +969 -0
  353. package/node_modules/@types/node/util.d.ts +2298 -0
  354. package/node_modules/@types/node/v8.d.ts +808 -0
  355. package/node_modules/@types/node/vm.d.ts +922 -0
  356. package/node_modules/@types/node/wasi.d.ts +181 -0
  357. package/node_modules/@types/node/worker_threads.d.ts +712 -0
  358. package/node_modules/@types/node/zlib.d.ts +539 -0
  359. package/node_modules/@types/node-red/LICENSE +21 -0
  360. package/node_modules/@types/node-red/README.md +15 -0
  361. package/node_modules/@types/node-red/index.d.ts +241 -0
  362. package/node_modules/@types/node-red/package.json +52 -0
  363. package/node_modules/@types/node-red__editor-api/LICENSE +21 -0
  364. package/node_modules/@types/node-red__editor-api/README.md +65 -0
  365. package/node_modules/@types/node-red__editor-api/index.d.ts +46 -0
  366. package/node_modules/@types/node-red__editor-api/package.json +33 -0
  367. package/node_modules/@types/node-red__editor-client/LICENSE +21 -0
  368. package/node_modules/@types/node-red__editor-client/README.md +15 -0
  369. package/node_modules/@types/node-red__editor-client/index.d.ts +1738 -0
  370. package/node_modules/@types/node-red__editor-client/package.json +36 -0
  371. package/node_modules/@types/node-red__registry/LICENSE +21 -0
  372. package/node_modules/@types/node-red__registry/README.md +15 -0
  373. package/node_modules/@types/node-red__registry/index.d.ts +452 -0
  374. package/node_modules/@types/node-red__registry/package.json +34 -0
  375. package/node_modules/@types/node-red__runtime/LICENSE +21 -0
  376. package/node_modules/@types/node-red__runtime/README.md +15 -0
  377. package/node_modules/@types/node-red__runtime/index.d.ts +1458 -0
  378. package/node_modules/@types/node-red__runtime/package.json +36 -0
  379. package/node_modules/@types/node-red__util/LICENSE +21 -0
  380. package/node_modules/@types/node-red__util/README.md +15 -0
  381. package/node_modules/@types/node-red__util/index.d.ts +557 -0
  382. package/node_modules/@types/node-red__util/package.json +34 -0
  383. package/node_modules/@types/passport/LICENSE +21 -0
  384. package/node_modules/@types/passport/README.md +15 -0
  385. package/node_modules/@types/passport/index.d.ts +921 -0
  386. package/node_modules/@types/passport/package.json +57 -0
  387. package/node_modules/@types/qs/LICENSE +21 -0
  388. package/node_modules/@types/qs/README.md +15 -0
  389. package/node_modules/@types/qs/index.d.ts +80 -0
  390. package/node_modules/@types/qs/package.json +65 -0
  391. package/node_modules/@types/range-parser/LICENSE +21 -0
  392. package/node_modules/@types/range-parser/README.md +53 -0
  393. package/node_modules/@types/range-parser/index.d.ts +34 -0
  394. package/node_modules/@types/range-parser/package.json +25 -0
  395. package/node_modules/@types/readable-stream/LICENSE +21 -0
  396. package/node_modules/@types/readable-stream/README.md +15 -0
  397. package/node_modules/@types/readable-stream/index.d.ts +677 -0
  398. package/node_modules/@types/readable-stream/package.json +38 -0
  399. package/node_modules/@types/send/LICENSE +21 -0
  400. package/node_modules/@types/send/README.md +15 -0
  401. package/node_modules/@types/send/index.d.ts +225 -0
  402. package/node_modules/@types/send/package.json +33 -0
  403. package/node_modules/@types/serve-static/LICENSE +21 -0
  404. package/node_modules/@types/serve-static/README.md +15 -0
  405. package/node_modules/@types/serve-static/index.d.ts +107 -0
  406. package/node_modules/@types/serve-static/package.json +39 -0
  407. package/node_modules/@types/sizzle/LICENSE +21 -0
  408. package/node_modules/@types/sizzle/README.md +15 -0
  409. package/node_modules/@types/sizzle/index.d.ts +91 -0
  410. package/node_modules/@types/sizzle/package.json +25 -0
  411. package/node_modules/@types/ws/LICENSE +21 -0
  412. package/node_modules/@types/ws/README.md +15 -0
  413. package/node_modules/@types/ws/index.d.mts +21 -0
  414. package/node_modules/@types/ws/index.d.ts +401 -0
  415. package/node_modules/@types/ws/package.json +71 -0
  416. package/node_modules/abort-controller/LICENSE +21 -0
  417. package/node_modules/abort-controller/README.md +98 -0
  418. package/node_modules/abort-controller/browser.js +13 -0
  419. package/node_modules/abort-controller/browser.mjs +11 -0
  420. package/node_modules/abort-controller/dist/abort-controller.d.ts +43 -0
  421. package/node_modules/abort-controller/dist/abort-controller.js +127 -0
  422. package/node_modules/abort-controller/dist/abort-controller.js.map +1 -0
  423. package/node_modules/abort-controller/dist/abort-controller.mjs +118 -0
  424. package/node_modules/abort-controller/dist/abort-controller.mjs.map +1 -0
  425. package/node_modules/abort-controller/dist/abort-controller.umd.js +5 -0
  426. package/node_modules/abort-controller/dist/abort-controller.umd.js.map +1 -0
  427. package/node_modules/abort-controller/package.json +97 -0
  428. package/node_modules/abort-controller/polyfill.js +21 -0
  429. package/node_modules/abort-controller/polyfill.mjs +19 -0
  430. package/node_modules/base64-js/LICENSE +21 -0
  431. package/node_modules/base64-js/README.md +34 -0
  432. package/node_modules/base64-js/base64js.min.js +1 -0
  433. package/node_modules/base64-js/index.d.ts +3 -0
  434. package/node_modules/base64-js/index.js +150 -0
  435. package/node_modules/base64-js/package.json +47 -0
  436. package/node_modules/bl/.github/dependabot.yml +16 -0
  437. package/node_modules/bl/.github/workflows/test-and-release.yml +61 -0
  438. package/node_modules/bl/BufferList.d.ts +418 -0
  439. package/node_modules/bl/BufferList.js +400 -0
  440. package/node_modules/bl/CHANGELOG.md +142 -0
  441. package/node_modules/bl/LICENSE.md +13 -0
  442. package/node_modules/bl/README.md +247 -0
  443. package/node_modules/bl/bl.js +84 -0
  444. package/node_modules/bl/index.d.ts +88 -0
  445. package/node_modules/bl/package.json +123 -0
  446. package/node_modules/bl/test/convert.js +21 -0
  447. package/node_modules/bl/test/indexOf.js +492 -0
  448. package/node_modules/bl/test/isBufferList.js +32 -0
  449. package/node_modules/bl/test/test.js +948 -0
  450. package/node_modules/buffer/AUTHORS.md +73 -0
  451. package/node_modules/buffer/LICENSE +21 -0
  452. package/node_modules/buffer/README.md +410 -0
  453. package/node_modules/buffer/index.d.ts +194 -0
  454. package/node_modules/buffer/index.js +2106 -0
  455. package/node_modules/buffer/package.json +93 -0
  456. package/node_modules/buffer-from/LICENSE +21 -0
  457. package/node_modules/buffer-from/index.js +72 -0
  458. package/node_modules/buffer-from/package.json +19 -0
  459. package/node_modules/buffer-from/readme.md +69 -0
  460. package/node_modules/commist/.github/workflows/ci.yml +27 -0
  461. package/node_modules/commist/LICENSE +21 -0
  462. package/node_modules/commist/README.md +113 -0
  463. package/node_modules/commist/example.js +26 -0
  464. package/node_modules/commist/index.js +155 -0
  465. package/node_modules/commist/leven.js +91 -0
  466. package/node_modules/commist/package.json +28 -0
  467. package/node_modules/commist/test.js +368 -0
  468. package/node_modules/concat-stream/LICENSE +24 -0
  469. package/node_modules/concat-stream/index.js +144 -0
  470. package/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  471. package/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md +136 -0
  472. package/node_modules/concat-stream/node_modules/readable-stream/LICENSE +47 -0
  473. package/node_modules/concat-stream/node_modules/readable-stream/README.md +106 -0
  474. package/node_modules/concat-stream/node_modules/readable-stream/errors-browser.js +127 -0
  475. package/node_modules/concat-stream/node_modules/readable-stream/errors.js +116 -0
  476. package/node_modules/concat-stream/node_modules/readable-stream/experimentalWarning.js +17 -0
  477. package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
  478. package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
  479. package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
  480. package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js +190 -0
  481. package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js +641 -0
  482. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
  483. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
  484. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
  485. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
  486. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  487. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
  488. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
  489. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
  490. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  491. package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  492. package/node_modules/concat-stream/node_modules/readable-stream/package.json +68 -0
  493. package/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js +9 -0
  494. package/node_modules/concat-stream/node_modules/readable-stream/readable.js +16 -0
  495. package/node_modules/concat-stream/package.json +55 -0
  496. package/node_modules/concat-stream/readme.md +102 -0
  497. package/node_modules/debug/LICENSE +20 -0
  498. package/node_modules/debug/README.md +481 -0
  499. package/node_modules/debug/package.json +60 -0
  500. package/node_modules/debug/src/browser.js +271 -0
  501. package/node_modules/debug/src/common.js +274 -0
  502. package/node_modules/debug/src/index.js +10 -0
  503. package/node_modules/debug/src/node.js +263 -0
  504. package/node_modules/event-target-shim/LICENSE +22 -0
  505. package/node_modules/event-target-shim/README.md +293 -0
  506. package/node_modules/event-target-shim/dist/event-target-shim.js +871 -0
  507. package/node_modules/event-target-shim/dist/event-target-shim.js.map +1 -0
  508. package/node_modules/event-target-shim/dist/event-target-shim.mjs +862 -0
  509. package/node_modules/event-target-shim/dist/event-target-shim.mjs.map +1 -0
  510. package/node_modules/event-target-shim/dist/event-target-shim.umd.js +6 -0
  511. package/node_modules/event-target-shim/dist/event-target-shim.umd.js.map +1 -0
  512. package/node_modules/event-target-shim/index.d.ts +399 -0
  513. package/node_modules/event-target-shim/package.json +82 -0
  514. package/node_modules/events/.airtap.yml +15 -0
  515. package/node_modules/events/.github/FUNDING.yml +12 -0
  516. package/node_modules/events/.travis.yml +18 -0
  517. package/node_modules/events/History.md +118 -0
  518. package/node_modules/events/LICENSE +22 -0
  519. package/node_modules/events/Readme.md +50 -0
  520. package/node_modules/events/events.js +497 -0
  521. package/node_modules/events/package.json +37 -0
  522. package/node_modules/events/security.md +10 -0
  523. package/node_modules/events/tests/add-listeners.js +111 -0
  524. package/node_modules/events/tests/check-listener-leaks.js +101 -0
  525. package/node_modules/events/tests/common.js +104 -0
  526. package/node_modules/events/tests/errors.js +13 -0
  527. package/node_modules/events/tests/events-list.js +28 -0
  528. package/node_modules/events/tests/events-once.js +234 -0
  529. package/node_modules/events/tests/index.js +64 -0
  530. package/node_modules/events/tests/legacy-compat.js +16 -0
  531. package/node_modules/events/tests/listener-count.js +37 -0
  532. package/node_modules/events/tests/listeners-side-effects.js +56 -0
  533. package/node_modules/events/tests/listeners.js +168 -0
  534. package/node_modules/events/tests/max-listeners.js +47 -0
  535. package/node_modules/events/tests/method-names.js +35 -0
  536. package/node_modules/events/tests/modify-in-emit.js +90 -0
  537. package/node_modules/events/tests/num-args.js +60 -0
  538. package/node_modules/events/tests/once.js +83 -0
  539. package/node_modules/events/tests/prepend.js +31 -0
  540. package/node_modules/events/tests/remove-all-listeners.js +133 -0
  541. package/node_modules/events/tests/remove-listeners.js +212 -0
  542. package/node_modules/events/tests/set-max-listeners-side-effects.js +31 -0
  543. package/node_modules/events/tests/special-event-names.js +45 -0
  544. package/node_modules/events/tests/subclass.js +66 -0
  545. package/node_modules/events/tests/symbols.js +25 -0
  546. package/node_modules/fast-unique-numbers/LICENSE +21 -0
  547. package/node_modules/fast-unique-numbers/README.md +51 -0
  548. package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.d.ts +3 -0
  549. package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.d.ts.map +1 -0
  550. package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.js +8 -0
  551. package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.js.map +1 -0
  552. package/node_modules/fast-unique-numbers/build/es2019/factories/cache.d.ts +3 -0
  553. package/node_modules/fast-unique-numbers/build/es2019/factories/cache.d.ts.map +1 -0
  554. package/node_modules/fast-unique-numbers/build/es2019/factories/cache.js +7 -0
  555. package/node_modules/fast-unique-numbers/build/es2019/factories/cache.js.map +1 -0
  556. package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.d.ts +3 -0
  557. package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.d.ts.map +1 -0
  558. package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.js +46 -0
  559. package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.js.map +1 -0
  560. package/node_modules/fast-unique-numbers/build/es2019/module.d.ts +5 -0
  561. package/node_modules/fast-unique-numbers/build/es2019/module.d.ts.map +1 -0
  562. package/node_modules/fast-unique-numbers/build/es2019/module.js +14 -0
  563. package/node_modules/fast-unique-numbers/build/es2019/module.js.map +1 -0
  564. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.d.ts +4 -0
  565. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.d.ts.map +1 -0
  566. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.js +2 -0
  567. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.js.map +1 -0
  568. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.d.ts +2 -0
  569. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.d.ts.map +1 -0
  570. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.js +2 -0
  571. package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.js.map +1 -0
  572. package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.d.ts +3 -0
  573. package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.d.ts.map +1 -0
  574. package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.js +2 -0
  575. package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.js.map +1 -0
  576. package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.d.ts +2 -0
  577. package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.d.ts.map +1 -0
  578. package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.js +2 -0
  579. package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.js.map +1 -0
  580. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.d.ts +4 -0
  581. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.d.ts.map +1 -0
  582. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.js +2 -0
  583. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.js.map +1 -0
  584. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.d.ts +2 -0
  585. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.d.ts.map +1 -0
  586. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.js +2 -0
  587. package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.js.map +1 -0
  588. package/node_modules/fast-unique-numbers/build/es2019/types/index.d.ts +7 -0
  589. package/node_modules/fast-unique-numbers/build/es2019/types/index.d.ts.map +1 -0
  590. package/node_modules/fast-unique-numbers/build/es2019/types/index.js +7 -0
  591. package/node_modules/fast-unique-numbers/build/es2019/types/index.js.map +1 -0
  592. package/node_modules/fast-unique-numbers/build/es5/bundle.js +76 -0
  593. package/node_modules/fast-unique-numbers/build/node/factories/add-unique-number.js +14 -0
  594. package/node_modules/fast-unique-numbers/build/node/factories/cache.js +13 -0
  595. package/node_modules/fast-unique-numbers/build/node/factories/generate-unique-number.js +52 -0
  596. package/node_modules/fast-unique-numbers/build/node/module.js +34 -0
  597. package/node_modules/fast-unique-numbers/build/node/types/add-unique-number-factory.js +5 -0
  598. package/node_modules/fast-unique-numbers/build/node/types/add-unique-number-function.js +5 -0
  599. package/node_modules/fast-unique-numbers/build/node/types/cache-factory.js +5 -0
  600. package/node_modules/fast-unique-numbers/build/node/types/cache-function.js +5 -0
  601. package/node_modules/fast-unique-numbers/build/node/types/generate-unique-number-factory.js +5 -0
  602. package/node_modules/fast-unique-numbers/build/node/types/generate-unique-number-function.js +5 -0
  603. package/node_modules/fast-unique-numbers/build/node/types/index.js +71 -0
  604. package/node_modules/fast-unique-numbers/package.json +94 -0
  605. package/node_modules/fast-unique-numbers/src/factories/add-unique-number.ts +11 -0
  606. package/node_modules/fast-unique-numbers/src/factories/cache.ts +9 -0
  607. package/node_modules/fast-unique-numbers/src/factories/generate-unique-number.ts +55 -0
  608. package/node_modules/fast-unique-numbers/src/module.ts +17 -0
  609. package/node_modules/fast-unique-numbers/src/tsconfig.json +6 -0
  610. package/node_modules/fast-unique-numbers/src/types/add-unique-number-factory.ts +4 -0
  611. package/node_modules/fast-unique-numbers/src/types/add-unique-number-function.ts +1 -0
  612. package/node_modules/fast-unique-numbers/src/types/cache-factory.ts +3 -0
  613. package/node_modules/fast-unique-numbers/src/types/cache-function.ts +1 -0
  614. package/node_modules/fast-unique-numbers/src/types/generate-unique-number-factory.ts +7 -0
  615. package/node_modules/fast-unique-numbers/src/types/generate-unique-number-function.ts +1 -0
  616. package/node_modules/fast-unique-numbers/src/types/index.ts +6 -0
  617. package/node_modules/help-me/.github/workflows/ci.yml +28 -0
  618. package/node_modules/help-me/LICENSE +22 -0
  619. package/node_modules/help-me/README.md +66 -0
  620. package/node_modules/help-me/doc/hello.txt +1 -0
  621. package/node_modules/help-me/doc/help.txt +5 -0
  622. package/node_modules/help-me/example.js +18 -0
  623. package/node_modules/help-me/fixture/basic/hello.txt +1 -0
  624. package/node_modules/help-me/fixture/basic/help.txt +1 -0
  625. package/node_modules/help-me/fixture/dir/a/b.txt +0 -0
  626. package/node_modules/help-me/fixture/no-ext/hello +1 -0
  627. package/node_modules/help-me/fixture/sameprefix/hello world.txt +1 -0
  628. package/node_modules/help-me/fixture/sameprefix/hello.txt +1 -0
  629. package/node_modules/help-me/fixture/shortnames/abcde fghi lmno.txt +1 -0
  630. package/node_modules/help-me/fixture/shortnames/abcde hello.txt +1 -0
  631. package/node_modules/help-me/fixture/shortnames/hello world.txt +1 -0
  632. package/node_modules/help-me/help-me.js +134 -0
  633. package/node_modules/help-me/package.json +36 -0
  634. package/node_modules/help-me/test.js +316 -0
  635. package/node_modules/ieee754/LICENSE +11 -0
  636. package/node_modules/ieee754/README.md +51 -0
  637. package/node_modules/ieee754/index.d.ts +10 -0
  638. package/node_modules/ieee754/index.js +85 -0
  639. package/node_modules/ieee754/package.json +52 -0
  640. package/node_modules/inherits/LICENSE +16 -0
  641. package/node_modules/inherits/README.md +42 -0
  642. package/node_modules/inherits/inherits.js +9 -0
  643. package/node_modules/inherits/inherits_browser.js +27 -0
  644. package/node_modules/inherits/package.json +29 -0
  645. package/node_modules/js-sdsl/CHANGELOG.md +211 -0
  646. package/node_modules/js-sdsl/LICENSE +21 -0
  647. package/node_modules/js-sdsl/README.md +296 -0
  648. package/node_modules/js-sdsl/README.zh-CN.md +298 -0
  649. package/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.d.ts +206 -0
  650. package/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js +40 -0
  651. package/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js.map +1 -0
  652. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.d.ts +29 -0
  653. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js +188 -0
  654. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js.map +1 -0
  655. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.d.ts +49 -0
  656. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js +125 -0
  657. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js.map +1 -0
  658. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.d.ts +39 -0
  659. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js +94 -0
  660. package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js.map +1 -0
  661. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.d.ts +79 -0
  662. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js +118 -0
  663. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js.map +1 -0
  664. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.d.ts +22 -0
  665. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js +52 -0
  666. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js.map +1 -0
  667. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.d.ts +22 -0
  668. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js +42 -0
  669. package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js.map +1 -0
  670. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.d.ts +9 -0
  671. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js +58 -0
  672. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js.map +1 -0
  673. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.d.ts +67 -0
  674. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js +16 -0
  675. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js.map +1 -0
  676. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.d.ts +58 -0
  677. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js +338 -0
  678. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js.map +1 -0
  679. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.d.ts +58 -0
  680. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js +330 -0
  681. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js.map +1 -0
  682. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.d.ts +40 -0
  683. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js +158 -0
  684. package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js.map +1 -0
  685. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.d.ts +18 -0
  686. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js +80 -0
  687. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js.map +1 -0
  688. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.d.ts +47 -0
  689. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js +115 -0
  690. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js.map +1 -0
  691. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.d.ts +58 -0
  692. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js +514 -0
  693. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js.map +1 -0
  694. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.d.ts +62 -0
  695. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js +127 -0
  696. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js.map +1 -0
  697. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.d.ts +54 -0
  698. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js +107 -0
  699. package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js.map +1 -0
  700. package/node_modules/js-sdsl/dist/cjs/index.d.ts +21 -0
  701. package/node_modules/js-sdsl/dist/cjs/index.js +102 -0
  702. package/node_modules/js-sdsl/dist/cjs/index.js.map +1 -0
  703. package/node_modules/js-sdsl/dist/cjs/utils/checkObject.d.ts +1 -0
  704. package/node_modules/js-sdsl/dist/cjs/utils/checkObject.js +13 -0
  705. package/node_modules/js-sdsl/dist/cjs/utils/checkObject.js.map +1 -0
  706. package/node_modules/js-sdsl/dist/cjs/utils/throwError.d.ts +1 -0
  707. package/node_modules/js-sdsl/dist/cjs/utils/throwError.js +12 -0
  708. package/node_modules/js-sdsl/dist/cjs/utils/throwError.js.map +1 -0
  709. package/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.d.ts +206 -0
  710. package/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js +68 -0
  711. package/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js.map +1 -0
  712. package/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts +29 -0
  713. package/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js +201 -0
  714. package/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js.map +1 -0
  715. package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.d.ts +49 -0
  716. package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js +248 -0
  717. package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js.map +1 -0
  718. package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.d.ts +39 -0
  719. package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js +223 -0
  720. package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js.map +1 -0
  721. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.d.ts +79 -0
  722. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js +171 -0
  723. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js.map +1 -0
  724. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.d.ts +22 -0
  725. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js +69 -0
  726. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js.map +1 -0
  727. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.d.ts +22 -0
  728. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js +59 -0
  729. package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js.map +1 -0
  730. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts +9 -0
  731. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js +78 -0
  732. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js.map +1 -0
  733. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts +67 -0
  734. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js +33 -0
  735. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js.map +1 -0
  736. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.d.ts +58 -0
  737. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js +498 -0
  738. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js.map +1 -0
  739. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.d.ts +58 -0
  740. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js +456 -0
  741. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js.map +1 -0
  742. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.d.ts +40 -0
  743. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js +323 -0
  744. package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js.map +1 -0
  745. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.d.ts +18 -0
  746. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js +98 -0
  747. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js.map +1 -0
  748. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.d.ts +47 -0
  749. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js +132 -0
  750. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js.map +1 -0
  751. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.d.ts +58 -0
  752. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js +600 -0
  753. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js.map +1 -0
  754. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.d.ts +62 -0
  755. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js +265 -0
  756. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js.map +1 -0
  757. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.d.ts +54 -0
  758. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js +245 -0
  759. package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js.map +1 -0
  760. package/node_modules/js-sdsl/dist/esm/index.d.ts +21 -0
  761. package/node_modules/js-sdsl/dist/esm/index.js +20 -0
  762. package/node_modules/js-sdsl/dist/esm/index.js.map +1 -0
  763. package/node_modules/js-sdsl/dist/esm/utils/checkObject.d.ts +1 -0
  764. package/node_modules/js-sdsl/dist/esm/utils/checkObject.js +5 -0
  765. package/node_modules/js-sdsl/dist/esm/utils/checkObject.js.map +1 -0
  766. package/node_modules/js-sdsl/dist/esm/utils/throwError.d.ts +1 -0
  767. package/node_modules/js-sdsl/dist/esm/utils/throwError.js +4 -0
  768. package/node_modules/js-sdsl/dist/esm/utils/throwError.js.map +1 -0
  769. package/node_modules/js-sdsl/dist/umd/js-sdsl.js +3154 -0
  770. package/node_modules/js-sdsl/dist/umd/js-sdsl.min.js +8 -0
  771. package/node_modules/js-sdsl/dist/umd/js-sdsl.min.js.map +1 -0
  772. package/node_modules/js-sdsl/package.json +166 -0
  773. package/node_modules/jsonata/LICENSE +19 -0
  774. package/node_modules/jsonata/README.md +70 -0
  775. package/node_modules/jsonata/jsonata-es5.js +9867 -0
  776. package/node_modules/jsonata/jsonata-es5.min.js +1 -0
  777. package/node_modules/jsonata/jsonata.d.ts +53 -0
  778. package/node_modules/jsonata/jsonata.js +7541 -0
  779. package/node_modules/jsonata/jsonata.min.js +1 -0
  780. package/node_modules/jsonata/package.json +62 -0
  781. package/node_modules/lru-cache/LICENSE +15 -0
  782. package/node_modules/lru-cache/README.md +331 -0
  783. package/node_modules/lru-cache/dist/commonjs/index.d.ts +1277 -0
  784. package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
  785. package/node_modules/lru-cache/dist/commonjs/index.js +1546 -0
  786. package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
  787. package/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  788. package/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
  789. package/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  790. package/node_modules/lru-cache/dist/esm/index.d.ts +1277 -0
  791. package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
  792. package/node_modules/lru-cache/dist/esm/index.js +1542 -0
  793. package/node_modules/lru-cache/dist/esm/index.js.map +1 -0
  794. package/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  795. package/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
  796. package/node_modules/lru-cache/dist/esm/package.json +3 -0
  797. package/node_modules/lru-cache/package.json +116 -0
  798. package/node_modules/minimist/.eslintrc +29 -0
  799. package/node_modules/minimist/.github/FUNDING.yml +12 -0
  800. package/node_modules/minimist/.nycrc +14 -0
  801. package/node_modules/minimist/CHANGELOG.md +298 -0
  802. package/node_modules/minimist/LICENSE +18 -0
  803. package/node_modules/minimist/README.md +121 -0
  804. package/node_modules/minimist/example/parse.js +4 -0
  805. package/node_modules/minimist/index.js +263 -0
  806. package/node_modules/minimist/package.json +75 -0
  807. package/node_modules/minimist/test/all_bool.js +34 -0
  808. package/node_modules/minimist/test/bool.js +177 -0
  809. package/node_modules/minimist/test/dash.js +43 -0
  810. package/node_modules/minimist/test/default_bool.js +37 -0
  811. package/node_modules/minimist/test/dotted.js +24 -0
  812. package/node_modules/minimist/test/kv_short.js +32 -0
  813. package/node_modules/minimist/test/long.js +33 -0
  814. package/node_modules/minimist/test/num.js +38 -0
  815. package/node_modules/minimist/test/parse.js +209 -0
  816. package/node_modules/minimist/test/parse_modified.js +11 -0
  817. package/node_modules/minimist/test/proto.js +64 -0
  818. package/node_modules/minimist/test/short.js +69 -0
  819. package/node_modules/minimist/test/stop_early.js +17 -0
  820. package/node_modules/minimist/test/unknown.js +104 -0
  821. package/node_modules/minimist/test/whitespace.js +10 -0
  822. package/node_modules/mqtt/CONTRIBUTING.md +27 -0
  823. package/node_modules/mqtt/LICENSE.md +15 -0
  824. package/node_modules/mqtt/README.md +960 -0
  825. package/node_modules/mqtt/build/bin/mqtt.d.ts +2 -0
  826. package/node_modules/mqtt/build/bin/mqtt.js +30 -0
  827. package/node_modules/mqtt/build/bin/mqtt.js.map +1 -0
  828. package/node_modules/mqtt/build/bin/pub.d.ts +2 -0
  829. package/node_modules/mqtt/build/bin/pub.js +147 -0
  830. package/node_modules/mqtt/build/bin/pub.js.map +1 -0
  831. package/node_modules/mqtt/build/bin/sub.d.ts +2 -0
  832. package/node_modules/mqtt/build/bin/sub.js +121 -0
  833. package/node_modules/mqtt/build/bin/sub.js.map +1 -0
  834. package/node_modules/mqtt/build/index.d.ts +3 -0
  835. package/node_modules/mqtt/build/index.js +32 -0
  836. package/node_modules/mqtt/build/index.js.map +1 -0
  837. package/node_modules/mqtt/build/lib/BufferedDuplex.d.ts +20 -0
  838. package/node_modules/mqtt/build/lib/BufferedDuplex.js +78 -0
  839. package/node_modules/mqtt/build/lib/BufferedDuplex.js.map +1 -0
  840. package/node_modules/mqtt/build/lib/KeepaliveManager.d.ts +21 -0
  841. package/node_modules/mqtt/build/lib/KeepaliveManager.js +73 -0
  842. package/node_modules/mqtt/build/lib/KeepaliveManager.js.map +1 -0
  843. package/node_modules/mqtt/build/lib/TypedEmitter.d.ts +19 -0
  844. package/node_modules/mqtt/build/lib/TypedEmitter.js +13 -0
  845. package/node_modules/mqtt/build/lib/TypedEmitter.js.map +1 -0
  846. package/node_modules/mqtt/build/lib/client.d.ts +235 -0
  847. package/node_modules/mqtt/build/lib/client.js +1211 -0
  848. package/node_modules/mqtt/build/lib/client.js.map +1 -0
  849. package/node_modules/mqtt/build/lib/connect/ali.d.ts +3 -0
  850. package/node_modules/mqtt/build/lib/connect/ali.js +108 -0
  851. package/node_modules/mqtt/build/lib/connect/ali.js.map +1 -0
  852. package/node_modules/mqtt/build/lib/connect/index.d.ts +10 -0
  853. package/node_modules/mqtt/build/lib/connect/index.js +192 -0
  854. package/node_modules/mqtt/build/lib/connect/index.js.map +1 -0
  855. package/node_modules/mqtt/build/lib/connect/tcp.d.ts +3 -0
  856. package/node_modules/mqtt/build/lib/connect/tcp.js +18 -0
  857. package/node_modules/mqtt/build/lib/connect/tcp.js.map +1 -0
  858. package/node_modules/mqtt/build/lib/connect/tls.d.ts +3 -0
  859. package/node_modules/mqtt/build/lib/connect/tls.js +38 -0
  860. package/node_modules/mqtt/build/lib/connect/tls.js.map +1 -0
  861. package/node_modules/mqtt/build/lib/connect/ws.d.ts +4 -0
  862. package/node_modules/mqtt/build/lib/connect/ws.js +217 -0
  863. package/node_modules/mqtt/build/lib/connect/ws.js.map +1 -0
  864. package/node_modules/mqtt/build/lib/connect/wx.d.ts +6 -0
  865. package/node_modules/mqtt/build/lib/connect/wx.js +115 -0
  866. package/node_modules/mqtt/build/lib/connect/wx.js.map +1 -0
  867. package/node_modules/mqtt/build/lib/default-message-id-provider.d.ts +16 -0
  868. package/node_modules/mqtt/build/lib/default-message-id-provider.js +24 -0
  869. package/node_modules/mqtt/build/lib/default-message-id-provider.js.map +1 -0
  870. package/node_modules/mqtt/build/lib/get-timer.d.ts +8 -0
  871. package/node_modules/mqtt/build/lib/get-timer.js +53 -0
  872. package/node_modules/mqtt/build/lib/get-timer.js.map +1 -0
  873. package/node_modules/mqtt/build/lib/handlers/ack.d.ts +48 -0
  874. package/node_modules/mqtt/build/lib/handlers/ack.js +131 -0
  875. package/node_modules/mqtt/build/lib/handlers/ack.js.map +1 -0
  876. package/node_modules/mqtt/build/lib/handlers/auth.d.ts +3 -0
  877. package/node_modules/mqtt/build/lib/handlers/auth.js +30 -0
  878. package/node_modules/mqtt/build/lib/handlers/auth.js.map +1 -0
  879. package/node_modules/mqtt/build/lib/handlers/connack.d.ts +3 -0
  880. package/node_modules/mqtt/build/lib/handlers/connack.js +47 -0
  881. package/node_modules/mqtt/build/lib/handlers/connack.js.map +1 -0
  882. package/node_modules/mqtt/build/lib/handlers/index.d.ts +3 -0
  883. package/node_modules/mqtt/build/lib/handlers/index.js +68 -0
  884. package/node_modules/mqtt/build/lib/handlers/index.js.map +1 -0
  885. package/node_modules/mqtt/build/lib/handlers/publish.d.ts +3 -0
  886. package/node_modules/mqtt/build/lib/handlers/publish.js +106 -0
  887. package/node_modules/mqtt/build/lib/handlers/publish.js.map +1 -0
  888. package/node_modules/mqtt/build/lib/handlers/pubrel.d.ts +3 -0
  889. package/node_modules/mqtt/build/lib/handlers/pubrel.js +25 -0
  890. package/node_modules/mqtt/build/lib/handlers/pubrel.js.map +1 -0
  891. package/node_modules/mqtt/build/lib/is-browser.d.ts +4 -0
  892. package/node_modules/mqtt/build/lib/is-browser.js +27 -0
  893. package/node_modules/mqtt/build/lib/is-browser.js.map +1 -0
  894. package/node_modules/mqtt/build/lib/shared.d.ts +23 -0
  895. package/node_modules/mqtt/build/lib/shared.js +41 -0
  896. package/node_modules/mqtt/build/lib/shared.js.map +1 -0
  897. package/node_modules/mqtt/build/lib/store.d.ts +24 -0
  898. package/node_modules/mqtt/build/lib/store.js +80 -0
  899. package/node_modules/mqtt/build/lib/store.js.map +1 -0
  900. package/node_modules/mqtt/build/lib/topic-alias-recv.d.ts +9 -0
  901. package/node_modules/mqtt/build/lib/topic-alias-recv.js +24 -0
  902. package/node_modules/mqtt/build/lib/topic-alias-recv.js.map +1 -0
  903. package/node_modules/mqtt/build/lib/topic-alias-send.d.ts +13 -0
  904. package/node_modules/mqtt/build/lib/topic-alias-send.js +53 -0
  905. package/node_modules/mqtt/build/lib/topic-alias-send.js.map +1 -0
  906. package/node_modules/mqtt/build/lib/unique-message-id-provider.d.ts +11 -0
  907. package/node_modules/mqtt/build/lib/unique-message-id-provider.js +26 -0
  908. package/node_modules/mqtt/build/lib/unique-message-id-provider.js.map +1 -0
  909. package/node_modules/mqtt/build/lib/validations.d.ts +2 -0
  910. package/node_modules/mqtt/build/lib/validations.js +32 -0
  911. package/node_modules/mqtt/build/lib/validations.js.map +1 -0
  912. package/node_modules/mqtt/build/mqtt.d.ts +12 -0
  913. package/node_modules/mqtt/build/mqtt.js +51 -0
  914. package/node_modules/mqtt/build/mqtt.js.map +1 -0
  915. package/node_modules/mqtt/build/tsconfig.build.tsbuildinfo +1 -0
  916. package/node_modules/mqtt/dist/mqtt.esm.js +10 -0
  917. package/node_modules/mqtt/dist/mqtt.js +21678 -0
  918. package/node_modules/mqtt/dist/mqtt.min.js +10 -0
  919. package/node_modules/mqtt/help/help.txt +8 -0
  920. package/node_modules/mqtt/help/publish.txt +26 -0
  921. package/node_modules/mqtt/help/subscribe.txt +26 -0
  922. package/node_modules/mqtt/package.json +171 -0
  923. package/node_modules/mqtt/src/bin/mqtt.ts +39 -0
  924. package/node_modules/mqtt/src/bin/pub.ts +174 -0
  925. package/node_modules/mqtt/src/bin/sub.ts +146 -0
  926. package/node_modules/mqtt/src/index.ts +4 -0
  927. package/node_modules/mqtt/src/lib/BufferedDuplex.ts +115 -0
  928. package/node_modules/mqtt/src/lib/KeepaliveManager.ts +112 -0
  929. package/node_modules/mqtt/src/lib/TypedEmitter.ts +71 -0
  930. package/node_modules/mqtt/src/lib/client.ts +2371 -0
  931. package/node_modules/mqtt/src/lib/connect/ali.ts +127 -0
  932. package/node_modules/mqtt/src/lib/connect/index.ts +288 -0
  933. package/node_modules/mqtt/src/lib/connect/tcp.ts +22 -0
  934. package/node_modules/mqtt/src/lib/connect/tls.ts +54 -0
  935. package/node_modules/mqtt/src/lib/connect/ws.ts +303 -0
  936. package/node_modules/mqtt/src/lib/connect/wx.ts +142 -0
  937. package/node_modules/mqtt/src/lib/default-message-id-provider.ts +99 -0
  938. package/node_modules/mqtt/src/lib/get-timer.ts +40 -0
  939. package/node_modules/mqtt/src/lib/handlers/ack.ts +159 -0
  940. package/node_modules/mqtt/src/lib/handlers/auth.ts +44 -0
  941. package/node_modules/mqtt/src/lib/handlers/connack.ts +55 -0
  942. package/node_modules/mqtt/src/lib/handlers/index.ts +74 -0
  943. package/node_modules/mqtt/src/lib/handlers/publish.ts +183 -0
  944. package/node_modules/mqtt/src/lib/handlers/pubrel.ts +27 -0
  945. package/node_modules/mqtt/src/lib/is-browser.ts +46 -0
  946. package/node_modules/mqtt/src/lib/shared.ts +87 -0
  947. package/node_modules/mqtt/src/lib/store.ts +166 -0
  948. package/node_modules/mqtt/src/lib/topic-alias-recv.ts +48 -0
  949. package/node_modules/mqtt/src/lib/topic-alias-send.ts +96 -0
  950. package/node_modules/mqtt/src/lib/unique-message-id-provider.ts +64 -0
  951. package/node_modules/mqtt/src/lib/validations.ts +46 -0
  952. package/node_modules/mqtt/src/mqtt.ts +28 -0
  953. package/node_modules/mqtt-packet/.github/workflows/ci.yml +27 -0
  954. package/node_modules/mqtt-packet/CONTRIBUTING.md +27 -0
  955. package/node_modules/mqtt-packet/LICENSE.md +13 -0
  956. package/node_modules/mqtt-packet/README.md +491 -0
  957. package/node_modules/mqtt-packet/benchmarks/generate.js +26 -0
  958. package/node_modules/mqtt-packet/benchmarks/generateNet.js +50 -0
  959. package/node_modules/mqtt-packet/benchmarks/parse.js +19 -0
  960. package/node_modules/mqtt-packet/benchmarks/writeToStream.js +48 -0
  961. package/node_modules/mqtt-packet/constants.js +291 -0
  962. package/node_modules/mqtt-packet/generate.js +57 -0
  963. package/node_modules/mqtt-packet/mqtt.js +3 -0
  964. package/node_modules/mqtt-packet/numbers.js +59 -0
  965. package/node_modules/mqtt-packet/package.json +48 -0
  966. package/node_modules/mqtt-packet/packet.js +13 -0
  967. package/node_modules/mqtt-packet/parser.js +809 -0
  968. package/node_modules/mqtt-packet/test.js +3177 -0
  969. package/node_modules/mqtt-packet/testRandom.js +86 -0
  970. package/node_modules/mqtt-packet/types/index.d.ts +257 -0
  971. package/node_modules/mqtt-packet/writeToStream.js +1127 -0
  972. package/node_modules/ms/index.js +162 -0
  973. package/node_modules/ms/license.md +21 -0
  974. package/node_modules/ms/package.json +37 -0
  975. package/node_modules/ms/readme.md +60 -0
  976. package/node_modules/number-allocator/.github/workflows/nodejs.yml +33 -0
  977. package/node_modules/number-allocator/CHANGELOG.md +47 -0
  978. package/node_modules/number-allocator/LICENSE +21 -0
  979. package/node_modules/number-allocator/README.md +203 -0
  980. package/node_modules/number-allocator/index.js +7 -0
  981. package/node_modules/number-allocator/karma.conf.js +63 -0
  982. package/node_modules/number-allocator/lib/number-allocator.js +249 -0
  983. package/node_modules/number-allocator/package.json +69 -0
  984. package/node_modules/number-allocator/test/test.js +337 -0
  985. package/node_modules/number-allocator/test/typescript/test.ts +24 -0
  986. package/node_modules/number-allocator/test/typescript/tsconfig.json +14 -0
  987. package/node_modules/number-allocator/types/index.d.ts +1 -0
  988. package/node_modules/number-allocator/types/lib/number-allocator.d.ts +65 -0
  989. package/node_modules/process/.eslintrc +21 -0
  990. package/node_modules/process/LICENSE +22 -0
  991. package/node_modules/process/README.md +26 -0
  992. package/node_modules/process/browser.js +184 -0
  993. package/node_modules/process/index.js +2 -0
  994. package/node_modules/process/package.json +27 -0
  995. package/node_modules/process/test.js +199 -0
  996. package/node_modules/process-nextick-args/index.js +45 -0
  997. package/node_modules/process-nextick-args/license.md +19 -0
  998. package/node_modules/process-nextick-args/package.json +25 -0
  999. package/node_modules/process-nextick-args/readme.md +18 -0
  1000. package/node_modules/readable-stream/LICENSE +47 -0
  1001. package/node_modules/readable-stream/README.md +116 -0
  1002. package/node_modules/readable-stream/lib/_stream_duplex.js +4 -0
  1003. package/node_modules/readable-stream/lib/_stream_passthrough.js +4 -0
  1004. package/node_modules/readable-stream/lib/_stream_readable.js +4 -0
  1005. package/node_modules/readable-stream/lib/_stream_transform.js +4 -0
  1006. package/node_modules/readable-stream/lib/_stream_writable.js +4 -0
  1007. package/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +52 -0
  1008. package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +157 -0
  1009. package/node_modules/readable-stream/lib/internal/streams/compose.js +194 -0
  1010. package/node_modules/readable-stream/lib/internal/streams/destroy.js +290 -0
  1011. package/node_modules/readable-stream/lib/internal/streams/duplex.js +143 -0
  1012. package/node_modules/readable-stream/lib/internal/streams/duplexify.js +378 -0
  1013. package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +284 -0
  1014. package/node_modules/readable-stream/lib/internal/streams/from.js +98 -0
  1015. package/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +51 -0
  1016. package/node_modules/readable-stream/lib/internal/streams/legacy.js +89 -0
  1017. package/node_modules/readable-stream/lib/internal/streams/operators.js +457 -0
  1018. package/node_modules/readable-stream/lib/internal/streams/passthrough.js +39 -0
  1019. package/node_modules/readable-stream/lib/internal/streams/pipeline.js +471 -0
  1020. package/node_modules/readable-stream/lib/internal/streams/readable.js +1288 -0
  1021. package/node_modules/readable-stream/lib/internal/streams/state.js +39 -0
  1022. package/node_modules/readable-stream/lib/internal/streams/transform.js +180 -0
  1023. package/node_modules/readable-stream/lib/internal/streams/utils.js +329 -0
  1024. package/node_modules/readable-stream/lib/internal/streams/writable.js +817 -0
  1025. package/node_modules/readable-stream/lib/internal/validators.js +530 -0
  1026. package/node_modules/readable-stream/lib/ours/browser.js +35 -0
  1027. package/node_modules/readable-stream/lib/ours/errors.js +341 -0
  1028. package/node_modules/readable-stream/lib/ours/index.js +65 -0
  1029. package/node_modules/readable-stream/lib/ours/primordials.js +107 -0
  1030. package/node_modules/readable-stream/lib/ours/util.js +200 -0
  1031. package/node_modules/readable-stream/lib/stream/promises.js +43 -0
  1032. package/node_modules/readable-stream/lib/stream.js +141 -0
  1033. package/node_modules/readable-stream/package.json +86 -0
  1034. package/node_modules/regenerator-runtime/LICENSE +21 -0
  1035. package/node_modules/regenerator-runtime/README.md +31 -0
  1036. package/node_modules/regenerator-runtime/package.json +19 -0
  1037. package/node_modules/regenerator-runtime/path.js +11 -0
  1038. package/node_modules/regenerator-runtime/runtime.js +761 -0
  1039. package/node_modules/reinterval/.npmignore +27 -0
  1040. package/node_modules/reinterval/.travis.yml +20 -0
  1041. package/node_modules/reinterval/LICENSE +22 -0
  1042. package/node_modules/reinterval/README.md +60 -0
  1043. package/node_modules/reinterval/index.js +57 -0
  1044. package/node_modules/reinterval/package.json +32 -0
  1045. package/node_modules/reinterval/tests/test.js +52 -0
  1046. package/node_modules/rfdc/.github/workflows/ci.yml +21 -0
  1047. package/node_modules/rfdc/LICENSE +15 -0
  1048. package/node_modules/rfdc/default.js +3 -0
  1049. package/node_modules/rfdc/index.d.ts +13 -0
  1050. package/node_modules/rfdc/index.js +198 -0
  1051. package/node_modules/rfdc/index.test-d.ts +13 -0
  1052. package/node_modules/rfdc/package.json +73 -0
  1053. package/node_modules/rfdc/readme.md +181 -0
  1054. package/node_modules/rfdc/test/index.js +306 -0
  1055. package/node_modules/safe-buffer/LICENSE +21 -0
  1056. package/node_modules/safe-buffer/README.md +584 -0
  1057. package/node_modules/safe-buffer/index.d.ts +187 -0
  1058. package/node_modules/safe-buffer/index.js +62 -0
  1059. package/node_modules/safe-buffer/package.json +37 -0
  1060. package/node_modules/split2/LICENSE +13 -0
  1061. package/node_modules/split2/README.md +85 -0
  1062. package/node_modules/split2/bench.js +27 -0
  1063. package/node_modules/split2/index.js +141 -0
  1064. package/node_modules/split2/package.json +39 -0
  1065. package/node_modules/split2/test.js +409 -0
  1066. package/node_modules/string_decoder/LICENSE +48 -0
  1067. package/node_modules/string_decoder/README.md +47 -0
  1068. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  1069. package/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +21 -0
  1070. package/node_modules/string_decoder/node_modules/safe-buffer/README.md +584 -0
  1071. package/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +187 -0
  1072. package/node_modules/string_decoder/node_modules/safe-buffer/index.js +65 -0
  1073. package/node_modules/string_decoder/node_modules/safe-buffer/package.json +51 -0
  1074. package/node_modules/string_decoder/package.json +34 -0
  1075. package/node_modules/tslib/CopyrightNotice.txt +15 -0
  1076. package/node_modules/tslib/LICENSE.txt +12 -0
  1077. package/node_modules/tslib/README.md +164 -0
  1078. package/node_modules/tslib/SECURITY.md +41 -0
  1079. package/node_modules/tslib/modules/index.d.ts +37 -0
  1080. package/node_modules/tslib/modules/index.js +68 -0
  1081. package/node_modules/tslib/modules/package.json +3 -0
  1082. package/node_modules/tslib/package.json +47 -0
  1083. package/node_modules/tslib/tslib.d.ts +453 -0
  1084. package/node_modules/tslib/tslib.es6.html +1 -0
  1085. package/node_modules/tslib/tslib.es6.js +379 -0
  1086. package/node_modules/tslib/tslib.es6.mjs +378 -0
  1087. package/node_modules/tslib/tslib.html +1 -0
  1088. package/node_modules/tslib/tslib.js +429 -0
  1089. package/node_modules/typedarray/.travis.yml +4 -0
  1090. package/node_modules/typedarray/LICENSE +35 -0
  1091. package/node_modules/typedarray/example/tarray.js +4 -0
  1092. package/node_modules/typedarray/index.js +630 -0
  1093. package/node_modules/typedarray/package.json +55 -0
  1094. package/node_modules/typedarray/readme.markdown +61 -0
  1095. package/node_modules/typedarray/test/server/undef_globals.js +19 -0
  1096. package/node_modules/typedarray/test/tarray.js +10 -0
  1097. package/node_modules/undici-types/LICENSE +21 -0
  1098. package/node_modules/undici-types/README.md +6 -0
  1099. package/node_modules/undici-types/agent.d.ts +31 -0
  1100. package/node_modules/undici-types/api.d.ts +43 -0
  1101. package/node_modules/undici-types/balanced-pool.d.ts +29 -0
  1102. package/node_modules/undici-types/cache.d.ts +36 -0
  1103. package/node_modules/undici-types/client.d.ts +108 -0
  1104. package/node_modules/undici-types/connector.d.ts +34 -0
  1105. package/node_modules/undici-types/content-type.d.ts +21 -0
  1106. package/node_modules/undici-types/cookies.d.ts +28 -0
  1107. package/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  1108. package/node_modules/undici-types/dispatcher.d.ts +255 -0
  1109. package/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  1110. package/node_modules/undici-types/errors.d.ts +149 -0
  1111. package/node_modules/undici-types/eventsource.d.ts +63 -0
  1112. package/node_modules/undici-types/fetch.d.ts +209 -0
  1113. package/node_modules/undici-types/file.d.ts +39 -0
  1114. package/node_modules/undici-types/filereader.d.ts +54 -0
  1115. package/node_modules/undici-types/formdata.d.ts +108 -0
  1116. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  1117. package/node_modules/undici-types/global-origin.d.ts +7 -0
  1118. package/node_modules/undici-types/handlers.d.ts +15 -0
  1119. package/node_modules/undici-types/header.d.ts +4 -0
  1120. package/node_modules/undici-types/index.d.ts +71 -0
  1121. package/node_modules/undici-types/interceptors.d.ts +15 -0
  1122. package/node_modules/undici-types/mock-agent.d.ts +50 -0
  1123. package/node_modules/undici-types/mock-client.d.ts +25 -0
  1124. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  1125. package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  1126. package/node_modules/undici-types/mock-pool.d.ts +25 -0
  1127. package/node_modules/undici-types/package.json +55 -0
  1128. package/node_modules/undici-types/patch.d.ts +71 -0
  1129. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  1130. package/node_modules/undici-types/pool.d.ts +39 -0
  1131. package/node_modules/undici-types/proxy-agent.d.ts +28 -0
  1132. package/node_modules/undici-types/readable.d.ts +60 -0
  1133. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  1134. package/node_modules/undici-types/retry-handler.d.ts +116 -0
  1135. package/node_modules/undici-types/util.d.ts +18 -0
  1136. package/node_modules/undici-types/webidl.d.ts +222 -0
  1137. package/node_modules/undici-types/websocket.d.ts +152 -0
  1138. package/node_modules/util-deprecate/History.md +16 -0
  1139. package/node_modules/util-deprecate/LICENSE +24 -0
  1140. package/node_modules/util-deprecate/README.md +53 -0
  1141. package/node_modules/util-deprecate/browser.js +67 -0
  1142. package/node_modules/util-deprecate/node.js +6 -0
  1143. package/node_modules/util-deprecate/package.json +27 -0
  1144. package/node_modules/worker-timers/LICENSE +21 -0
  1145. package/node_modules/worker-timers/README.md +79 -0
  1146. package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.d.ts +2 -0
  1147. package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.d.ts.map +1 -0
  1148. package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.js +15 -0
  1149. package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.js.map +1 -0
  1150. package/node_modules/worker-timers/build/es2019/module.d.ts +6 -0
  1151. package/node_modules/worker-timers/build/es2019/module.d.ts.map +1 -0
  1152. package/node_modules/worker-timers/build/es2019/module.js +9 -0
  1153. package/node_modules/worker-timers/build/es2019/module.js.map +1 -0
  1154. package/node_modules/worker-timers/build/es2019/worker/worker.d.ts +2 -0
  1155. package/node_modules/worker-timers/build/es2019/worker/worker.d.ts.map +1 -0
  1156. package/node_modules/worker-timers/build/es2019/worker/worker.js +3 -0
  1157. package/node_modules/worker-timers/build/es2019/worker/worker.js.map +1 -0
  1158. package/node_modules/worker-timers/build/es5/bundle.js +50 -0
  1159. package/node_modules/worker-timers/package.json +106 -0
  1160. package/node_modules/worker-timers/src/factories/load-or-return-broker.ts +19 -0
  1161. package/node_modules/worker-timers/src/module.ts +13 -0
  1162. package/node_modules/worker-timers/src/tsconfig.json +6 -0
  1163. package/node_modules/worker-timers/src/worker/worker.ts +2 -0
  1164. package/node_modules/worker-timers-broker/LICENSE +21 -0
  1165. package/node_modules/worker-timers-broker/README.md +5 -0
  1166. package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.d.ts +3 -0
  1167. package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.d.ts.map +1 -0
  1168. package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.js +4 -0
  1169. package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.js.map +1 -0
  1170. package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.d.ts +3 -0
  1171. package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.d.ts.map +1 -0
  1172. package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.js +4 -0
  1173. package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.js.map +1 -0
  1174. package/node_modules/worker-timers-broker/build/es2019/module.d.ts +7 -0
  1175. package/node_modules/worker-timers-broker/build/es2019/module.d.ts.map +1 -0
  1176. package/node_modules/worker-timers-broker/build/es2019/module.js +142 -0
  1177. package/node_modules/worker-timers-broker/build/es2019/module.js.map +1 -0
  1178. package/node_modules/worker-timers-broker/build/es5/bundle.js +162 -0
  1179. package/node_modules/worker-timers-broker/package.json +84 -0
  1180. package/node_modules/worker-timers-broker/src/guards/call-notification.ts +5 -0
  1181. package/node_modules/worker-timers-broker/src/guards/clear-response.ts +5 -0
  1182. package/node_modules/worker-timers-broker/src/module.ts +173 -0
  1183. package/node_modules/worker-timers-broker/src/tsconfig.json +6 -0
  1184. package/node_modules/worker-timers-worker/LICENSE +21 -0
  1185. package/node_modules/worker-timers-worker/README.md +5 -0
  1186. package/node_modules/worker-timers-worker/build/es2019/helpers/timer.d.ts +5 -0
  1187. package/node_modules/worker-timers-worker/build/es2019/helpers/timer.d.ts.map +1 -0
  1188. package/node_modules/worker-timers-worker/build/es2019/helpers/timer.js +50 -0
  1189. package/node_modules/worker-timers-worker/build/es2019/helpers/timer.js.map +1 -0
  1190. package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.d.ts +5 -0
  1191. package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.d.ts.map +1 -0
  1192. package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.js +2 -0
  1193. package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.js.map +1 -0
  1194. package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.d.ts +10 -0
  1195. package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.d.ts.map +1 -0
  1196. package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.js +2 -0
  1197. package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.js.map +1 -0
  1198. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.d.ts +10 -0
  1199. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.d.ts.map +1 -0
  1200. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.js +2 -0
  1201. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.js.map +1 -0
  1202. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.d.ts +5 -0
  1203. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.d.ts.map +1 -0
  1204. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.js +2 -0
  1205. package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.js.map +1 -0
  1206. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.d.ts +8 -0
  1207. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.d.ts.map +1 -0
  1208. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.js +2 -0
  1209. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.js.map +1 -0
  1210. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.d.ts +8 -0
  1211. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.d.ts.map +1 -0
  1212. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.js +2 -0
  1213. package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.js.map +1 -0
  1214. package/node_modules/worker-timers-worker/build/es2019/interfaces/index.d.ts +9 -0
  1215. package/node_modules/worker-timers-worker/build/es2019/interfaces/index.d.ts.map +1 -0
  1216. package/node_modules/worker-timers-worker/build/es2019/interfaces/index.js +9 -0
  1217. package/node_modules/worker-timers-worker/build/es2019/interfaces/index.js.map +1 -0
  1218. package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.d.ts +12 -0
  1219. package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.d.ts.map +1 -0
  1220. package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.js +2 -0
  1221. package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.js.map +1 -0
  1222. package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.d.ts +5 -0
  1223. package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.d.ts.map +1 -0
  1224. package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.js +2 -0
  1225. package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.js.map +1 -0
  1226. package/node_modules/worker-timers-worker/build/es2019/module.d.ts +3 -0
  1227. package/node_modules/worker-timers-worker/build/es2019/module.d.ts.map +1 -0
  1228. package/node_modules/worker-timers-worker/build/es2019/module.js +50 -0
  1229. package/node_modules/worker-timers-worker/build/es2019/module.js.map +1 -0
  1230. package/node_modules/worker-timers-worker/build/es2019/types/broker-message.d.ts +3 -0
  1231. package/node_modules/worker-timers-worker/build/es2019/types/broker-message.d.ts.map +1 -0
  1232. package/node_modules/worker-timers-worker/build/es2019/types/broker-message.js +2 -0
  1233. package/node_modules/worker-timers-worker/build/es2019/types/broker-message.js.map +1 -0
  1234. package/node_modules/worker-timers-worker/build/es2019/types/index.d.ts +4 -0
  1235. package/node_modules/worker-timers-worker/build/es2019/types/index.d.ts.map +1 -0
  1236. package/node_modules/worker-timers-worker/build/es2019/types/index.js +4 -0
  1237. package/node_modules/worker-timers-worker/build/es2019/types/index.js.map +1 -0
  1238. package/node_modules/worker-timers-worker/build/es2019/types/timer-type.d.ts +2 -0
  1239. package/node_modules/worker-timers-worker/build/es2019/types/timer-type.d.ts.map +1 -0
  1240. package/node_modules/worker-timers-worker/build/es2019/types/timer-type.js +2 -0
  1241. package/node_modules/worker-timers-worker/build/es2019/types/timer-type.js.map +1 -0
  1242. package/node_modules/worker-timers-worker/build/es2019/types/worker-message.d.ts +3 -0
  1243. package/node_modules/worker-timers-worker/build/es2019/types/worker-message.d.ts.map +1 -0
  1244. package/node_modules/worker-timers-worker/build/es2019/types/worker-message.js +2 -0
  1245. package/node_modules/worker-timers-worker/build/es2019/types/worker-message.js.map +1 -0
  1246. package/node_modules/worker-timers-worker/build/es5/bundle.js +117 -0
  1247. package/node_modules/worker-timers-worker/package.json +91 -0
  1248. package/node_modules/worker-timers-worker/src/helpers/timer.ts +68 -0
  1249. package/node_modules/worker-timers-worker/src/interfaces/broker-event.ts +5 -0
  1250. package/node_modules/worker-timers-worker/src/interfaces/call-notification.ts +13 -0
  1251. package/node_modules/worker-timers-worker/src/interfaces/clear-request.ts +13 -0
  1252. package/node_modules/worker-timers-worker/src/interfaces/clear-response.ts +5 -0
  1253. package/node_modules/worker-timers-worker/src/interfaces/error-notification.ts +9 -0
  1254. package/node_modules/worker-timers-worker/src/interfaces/error-response.ts +9 -0
  1255. package/node_modules/worker-timers-worker/src/interfaces/index.ts +8 -0
  1256. package/node_modules/worker-timers-worker/src/interfaces/set-notification.ts +17 -0
  1257. package/node_modules/worker-timers-worker/src/interfaces/worker-event.ts +5 -0
  1258. package/node_modules/worker-timers-worker/src/module.ts +54 -0
  1259. package/node_modules/worker-timers-worker/src/tsconfig.json +6 -0
  1260. package/node_modules/worker-timers-worker/src/types/broker-message.ts +3 -0
  1261. package/node_modules/worker-timers-worker/src/types/index.ts +3 -0
  1262. package/node_modules/worker-timers-worker/src/types/timer-type.ts +1 -0
  1263. package/node_modules/worker-timers-worker/src/types/worker-message.ts +3 -0
  1264. package/node_modules/ws/LICENSE +20 -0
  1265. package/node_modules/ws/README.md +548 -0
  1266. package/node_modules/ws/browser.js +8 -0
  1267. package/node_modules/ws/index.js +13 -0
  1268. package/node_modules/ws/lib/buffer-util.js +131 -0
  1269. package/node_modules/ws/lib/constants.js +18 -0
  1270. package/node_modules/ws/lib/event-target.js +292 -0
  1271. package/node_modules/ws/lib/extension.js +203 -0
  1272. package/node_modules/ws/lib/limiter.js +55 -0
  1273. package/node_modules/ws/lib/permessage-deflate.js +514 -0
  1274. package/node_modules/ws/lib/receiver.js +706 -0
  1275. package/node_modules/ws/lib/sender.js +602 -0
  1276. package/node_modules/ws/lib/stream.js +159 -0
  1277. package/node_modules/ws/lib/subprotocol.js +62 -0
  1278. package/node_modules/ws/lib/validation.js +152 -0
  1279. package/node_modules/ws/lib/websocket-server.js +540 -0
  1280. package/node_modules/ws/lib/websocket.js +1388 -0
  1281. package/node_modules/ws/package.json +69 -0
  1282. package/node_modules/ws/wrapper.mjs +8 -0
  1283. package/package.json +51 -0
@@ -0,0 +1,3154 @@
1
+ /*!
2
+ * js-sdsl v4.3.0
3
+ * https://github.com/js-sdsl/js-sdsl
4
+ * (c) 2021-present ZLY201 <zilongyao1366@gmail.com>
5
+ * MIT license
6
+ */
7
+
8
+ (function (global, factory) {
9
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
10
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
11
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sdsl = {}));
12
+ })(this, (function (exports) { 'use strict';
13
+
14
+ /******************************************************************************
15
+ Copyright (c) Microsoft Corporation.
16
+
17
+ Permission to use, copy, modify, and/or distribute this software for any
18
+ purpose with or without fee is hereby granted.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
+ PERFORMANCE OF THIS SOFTWARE.
27
+ ***************************************************************************** */
28
+ /* global Reflect, Promise */
29
+
30
+ var extendStatics = function (d, b) {
31
+ extendStatics = Object.setPrototypeOf || {
32
+ __proto__: []
33
+ } instanceof Array && function (d, b) {
34
+ d.__proto__ = b;
35
+ } || function (d, b) {
36
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
37
+ };
38
+ return extendStatics(d, b);
39
+ };
40
+ function __extends(d, b) {
41
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
42
+ extendStatics(d, b);
43
+ function __() {
44
+ this.constructor = d;
45
+ }
46
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
47
+ }
48
+ function __generator(thisArg, body) {
49
+ var _ = {
50
+ label: 0,
51
+ sent: function () {
52
+ if (t[0] & 1) throw t[1];
53
+ return t[1];
54
+ },
55
+ trys: [],
56
+ ops: []
57
+ },
58
+ f,
59
+ y,
60
+ t,
61
+ g;
62
+ return g = {
63
+ next: verb(0),
64
+ "throw": verb(1),
65
+ "return": verb(2)
66
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
67
+ return this;
68
+ }), g;
69
+ function verb(n) {
70
+ return function (v) {
71
+ return step([n, v]);
72
+ };
73
+ }
74
+ function step(op) {
75
+ if (f) throw new TypeError("Generator is already executing.");
76
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
77
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
78
+ if (y = 0, t) op = [op[0] & 2, t.value];
79
+ switch (op[0]) {
80
+ case 0:
81
+ case 1:
82
+ t = op;
83
+ break;
84
+ case 4:
85
+ _.label++;
86
+ return {
87
+ value: op[1],
88
+ done: false
89
+ };
90
+ case 5:
91
+ _.label++;
92
+ y = op[1];
93
+ op = [0];
94
+ continue;
95
+ case 7:
96
+ op = _.ops.pop();
97
+ _.trys.pop();
98
+ continue;
99
+ default:
100
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
101
+ _ = 0;
102
+ continue;
103
+ }
104
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
105
+ _.label = op[1];
106
+ break;
107
+ }
108
+ if (op[0] === 6 && _.label < t[1]) {
109
+ _.label = t[1];
110
+ t = op;
111
+ break;
112
+ }
113
+ if (t && _.label < t[2]) {
114
+ _.label = t[2];
115
+ _.ops.push(op);
116
+ break;
117
+ }
118
+ if (t[2]) _.ops.pop();
119
+ _.trys.pop();
120
+ continue;
121
+ }
122
+ op = body.call(thisArg, _);
123
+ } catch (e) {
124
+ op = [6, e];
125
+ y = 0;
126
+ } finally {
127
+ f = t = 0;
128
+ }
129
+ if (op[0] & 5) throw op[1];
130
+ return {
131
+ value: op[0] ? op[1] : void 0,
132
+ done: true
133
+ };
134
+ }
135
+ }
136
+ function __values(o) {
137
+ var s = typeof Symbol === "function" && Symbol.iterator,
138
+ m = s && o[s],
139
+ i = 0;
140
+ if (m) return m.call(o);
141
+ if (o && typeof o.length === "number") return {
142
+ next: function () {
143
+ if (o && i >= o.length) o = void 0;
144
+ return {
145
+ value: o && o[i++],
146
+ done: !o
147
+ };
148
+ }
149
+ };
150
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
151
+ }
152
+ function __read(o, n) {
153
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
154
+ if (!m) return o;
155
+ var i = m.call(o),
156
+ r,
157
+ ar = [],
158
+ e;
159
+ try {
160
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
161
+ } catch (error) {
162
+ e = {
163
+ error: error
164
+ };
165
+ } finally {
166
+ try {
167
+ if (r && !r.done && (m = i["return"])) m.call(i);
168
+ } finally {
169
+ if (e) throw e.error;
170
+ }
171
+ }
172
+ return ar;
173
+ }
174
+ function __spreadArray(to, from, pack) {
175
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
176
+ if (ar || !(i in from)) {
177
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
178
+ ar[i] = from[i];
179
+ }
180
+ }
181
+ return to.concat(ar || Array.prototype.slice.call(from));
182
+ }
183
+
184
+ var ContainerIterator = /** @class */function () {
185
+ /**
186
+ * @internal
187
+ */
188
+ function ContainerIterator(iteratorType) {
189
+ if (iteratorType === void 0) {
190
+ iteratorType = 0 /* IteratorType.NORMAL */;
191
+ }
192
+ this.iteratorType = iteratorType;
193
+ }
194
+ /**
195
+ * @param iter - The other iterator you want to compare.
196
+ * @returns Whether this equals to obj.
197
+ * @example
198
+ * container.find(1).equals(container.end());
199
+ */
200
+ ContainerIterator.prototype.equals = function (iter) {
201
+ return this._node === iter._node;
202
+ };
203
+ return ContainerIterator;
204
+ }();
205
+ var Base = /** @class */function () {
206
+ function Base() {
207
+ /**
208
+ * @description Container's size.
209
+ * @internal
210
+ */
211
+ this._length = 0;
212
+ }
213
+ Object.defineProperty(Base.prototype, "length", {
214
+ /**
215
+ * @returns The size of the container.
216
+ * @example
217
+ * const container = new Vector([1, 2]);
218
+ * console.log(container.length); // 2
219
+ */
220
+ get: function () {
221
+ return this._length;
222
+ },
223
+ enumerable: false,
224
+ configurable: true
225
+ });
226
+ /**
227
+ * @returns The size of the container.
228
+ * @example
229
+ * const container = new Vector([1, 2]);
230
+ * console.log(container.size()); // 2
231
+ */
232
+ Base.prototype.size = function () {
233
+ return this._length;
234
+ };
235
+ /**
236
+ * @returns Whether the container is empty.
237
+ * @example
238
+ * container.clear();
239
+ * console.log(container.empty()); // true
240
+ */
241
+ Base.prototype.empty = function () {
242
+ return this._length === 0;
243
+ };
244
+ return Base;
245
+ }();
246
+ var Container = /** @class */function (_super) {
247
+ __extends(Container, _super);
248
+ function Container() {
249
+ return _super !== null && _super.apply(this, arguments) || this;
250
+ }
251
+ return Container;
252
+ }(Base);
253
+
254
+ var Stack = /** @class */function (_super) {
255
+ __extends(Stack, _super);
256
+ function Stack(container) {
257
+ if (container === void 0) {
258
+ container = [];
259
+ }
260
+ var _this = _super.call(this) || this;
261
+ /**
262
+ * @internal
263
+ */
264
+ _this._stack = [];
265
+ var self = _this;
266
+ container.forEach(function (el) {
267
+ self.push(el);
268
+ });
269
+ return _this;
270
+ }
271
+ Stack.prototype.clear = function () {
272
+ this._length = 0;
273
+ this._stack = [];
274
+ };
275
+ /**
276
+ * @description Insert element to stack's end.
277
+ * @description The element you want to push to the back.
278
+ * @returns The container length after erasing.
279
+ */
280
+ Stack.prototype.push = function (element) {
281
+ this._stack.push(element);
282
+ this._length += 1;
283
+ return this._length;
284
+ };
285
+ /**
286
+ * @description Removes the end element.
287
+ * @returns The element you popped.
288
+ */
289
+ Stack.prototype.pop = function () {
290
+ if (this._length === 0) return;
291
+ this._length -= 1;
292
+ return this._stack.pop();
293
+ };
294
+ /**
295
+ * @description Accesses the end element.
296
+ * @returns The last element.
297
+ */
298
+ Stack.prototype.top = function () {
299
+ return this._stack[this._length - 1];
300
+ };
301
+ return Stack;
302
+ }(Base);
303
+
304
+ var Queue = /** @class */function (_super) {
305
+ __extends(Queue, _super);
306
+ function Queue(container) {
307
+ if (container === void 0) {
308
+ container = [];
309
+ }
310
+ var _this = _super.call(this) || this;
311
+ /**
312
+ * @internal
313
+ */
314
+ _this._first = 0;
315
+ /**
316
+ * @internal
317
+ */
318
+ _this._queue = [];
319
+ var self = _this;
320
+ container.forEach(function (el) {
321
+ self.push(el);
322
+ });
323
+ return _this;
324
+ }
325
+ Queue.prototype.clear = function () {
326
+ this._queue = [];
327
+ this._length = this._first = 0;
328
+ };
329
+ /**
330
+ * @description Inserts element to queue's end.
331
+ * @param element - The element you want to push to the front.
332
+ * @returns The container length after pushing.
333
+ */
334
+ Queue.prototype.push = function (element) {
335
+ var capacity = this._queue.length;
336
+ if (this._first / capacity > 0.5 /* QUEUE_CONSTANT.ALLOCATE_SIGMA */ && this._first + this._length >= capacity && capacity > 4096 /* QUEUE_CONSTANT.MIN_ALLOCATE_SIZE */) {
337
+ var length_1 = this._length;
338
+ for (var i = 0; i < length_1; ++i) {
339
+ this._queue[i] = this._queue[this._first + i];
340
+ }
341
+ this._first = 0;
342
+ this._queue[this._length] = element;
343
+ } else this._queue[this._first + this._length] = element;
344
+ return ++this._length;
345
+ };
346
+ /**
347
+ * @description Removes the first element.
348
+ * @returns The element you popped.
349
+ */
350
+ Queue.prototype.pop = function () {
351
+ if (this._length === 0) return;
352
+ var el = this._queue[this._first++];
353
+ this._length -= 1;
354
+ return el;
355
+ };
356
+ /**
357
+ * @description Access the first element.
358
+ * @returns The first element.
359
+ */
360
+ Queue.prototype.front = function () {
361
+ if (this._length === 0) return;
362
+ return this._queue[this._first];
363
+ };
364
+ return Queue;
365
+ }(Base);
366
+
367
+ var PriorityQueue = /** @class */function (_super) {
368
+ __extends(PriorityQueue, _super);
369
+ /**
370
+ * @description PriorityQueue's constructor.
371
+ * @param container - Initialize container, must have a forEach function.
372
+ * @param cmp - Compare function.
373
+ * @param copy - When the container is an array, you can choose to directly operate on the original object of
374
+ * the array or perform a shallow copy. The default is shallow copy.
375
+ * @example
376
+ * new PriorityQueue();
377
+ * new PriorityQueue([1, 2, 3]);
378
+ * new PriorityQueue([1, 2, 3], (x, y) => x - y);
379
+ * new PriorityQueue([1, 2, 3], (x, y) => x - y, false);
380
+ */
381
+ function PriorityQueue(container, cmp, copy) {
382
+ if (container === void 0) {
383
+ container = [];
384
+ }
385
+ if (cmp === void 0) {
386
+ cmp = function (x, y) {
387
+ if (x > y) return -1;
388
+ if (x < y) return 1;
389
+ return 0;
390
+ };
391
+ }
392
+ if (copy === void 0) {
393
+ copy = true;
394
+ }
395
+ var _this = _super.call(this) || this;
396
+ _this._cmp = cmp;
397
+ if (Array.isArray(container)) {
398
+ _this._priorityQueue = copy ? __spreadArray([], __read(container), false) : container;
399
+ } else {
400
+ _this._priorityQueue = [];
401
+ var self_1 = _this;
402
+ container.forEach(function (el) {
403
+ self_1._priorityQueue.push(el);
404
+ });
405
+ }
406
+ _this._length = _this._priorityQueue.length;
407
+ var halfLength = _this._length >> 1;
408
+ for (var parent_1 = _this._length - 1 >> 1; parent_1 >= 0; --parent_1) {
409
+ _this._pushDown(parent_1, halfLength);
410
+ }
411
+ return _this;
412
+ }
413
+ /**
414
+ * @internal
415
+ */
416
+ PriorityQueue.prototype._pushUp = function (pos) {
417
+ var item = this._priorityQueue[pos];
418
+ while (pos > 0) {
419
+ var parent_2 = pos - 1 >> 1;
420
+ var parentItem = this._priorityQueue[parent_2];
421
+ if (this._cmp(parentItem, item) <= 0) break;
422
+ this._priorityQueue[pos] = parentItem;
423
+ pos = parent_2;
424
+ }
425
+ this._priorityQueue[pos] = item;
426
+ };
427
+ /**
428
+ * @internal
429
+ */
430
+ PriorityQueue.prototype._pushDown = function (pos, halfLength) {
431
+ var item = this._priorityQueue[pos];
432
+ while (pos < halfLength) {
433
+ var left = pos << 1 | 1;
434
+ var right = left + 1;
435
+ var minItem = this._priorityQueue[left];
436
+ if (right < this._length && this._cmp(minItem, this._priorityQueue[right]) > 0) {
437
+ left = right;
438
+ minItem = this._priorityQueue[right];
439
+ }
440
+ if (this._cmp(minItem, item) >= 0) break;
441
+ this._priorityQueue[pos] = minItem;
442
+ pos = left;
443
+ }
444
+ this._priorityQueue[pos] = item;
445
+ };
446
+ PriorityQueue.prototype.clear = function () {
447
+ this._length = 0;
448
+ this._priorityQueue.length = 0;
449
+ };
450
+ /**
451
+ * @description Push element into a container in order.
452
+ * @param item - The element you want to push.
453
+ * @returns The size of heap after pushing.
454
+ * @example
455
+ * queue.push(1);
456
+ */
457
+ PriorityQueue.prototype.push = function (item) {
458
+ this._priorityQueue.push(item);
459
+ this._pushUp(this._length);
460
+ this._length += 1;
461
+ };
462
+ /**
463
+ * @description Removes the top element.
464
+ * @returns The element you popped.
465
+ * @example
466
+ * queue.pop();
467
+ */
468
+ PriorityQueue.prototype.pop = function () {
469
+ if (this._length === 0) return;
470
+ var value = this._priorityQueue[0];
471
+ var last = this._priorityQueue.pop();
472
+ this._length -= 1;
473
+ if (this._length) {
474
+ this._priorityQueue[0] = last;
475
+ this._pushDown(0, this._length >> 1);
476
+ }
477
+ return value;
478
+ };
479
+ /**
480
+ * @description Accesses the top element.
481
+ * @example
482
+ * const top = queue.top();
483
+ */
484
+ PriorityQueue.prototype.top = function () {
485
+ return this._priorityQueue[0];
486
+ };
487
+ /**
488
+ * @description Check if element is in heap.
489
+ * @param item - The item want to find.
490
+ * @returns Whether element is in heap.
491
+ * @example
492
+ * const que = new PriorityQueue([], (x, y) => x.id - y.id);
493
+ * const obj = { id: 1 };
494
+ * que.push(obj);
495
+ * console.log(que.find(obj)); // true
496
+ */
497
+ PriorityQueue.prototype.find = function (item) {
498
+ return this._priorityQueue.indexOf(item) >= 0;
499
+ };
500
+ /**
501
+ * @description Remove specified item from heap.
502
+ * @param item - The item want to remove.
503
+ * @returns Whether remove success.
504
+ * @example
505
+ * const que = new PriorityQueue([], (x, y) => x.id - y.id);
506
+ * const obj = { id: 1 };
507
+ * que.push(obj);
508
+ * que.remove(obj);
509
+ */
510
+ PriorityQueue.prototype.remove = function (item) {
511
+ var index = this._priorityQueue.indexOf(item);
512
+ if (index < 0) return false;
513
+ if (index === 0) {
514
+ this.pop();
515
+ } else if (index === this._length - 1) {
516
+ this._priorityQueue.pop();
517
+ this._length -= 1;
518
+ } else {
519
+ this._priorityQueue.splice(index, 1, this._priorityQueue.pop());
520
+ this._length -= 1;
521
+ this._pushUp(index);
522
+ this._pushDown(index, this._length >> 1);
523
+ }
524
+ return true;
525
+ };
526
+ /**
527
+ * @description Update item and it's pos in the heap.
528
+ * @param item - The item want to update.
529
+ * @returns Whether update success.
530
+ * @example
531
+ * const que = new PriorityQueue([], (x, y) => x.id - y.id);
532
+ * const obj = { id: 1 };
533
+ * que.push(obj);
534
+ * obj.id = 2;
535
+ * que.updateItem(obj);
536
+ */
537
+ PriorityQueue.prototype.updateItem = function (item) {
538
+ var index = this._priorityQueue.indexOf(item);
539
+ if (index < 0) return false;
540
+ this._pushUp(index);
541
+ this._pushDown(index, this._length >> 1);
542
+ return true;
543
+ };
544
+ /**
545
+ * @returns Return a copy array of heap.
546
+ * @example
547
+ * const arr = queue.toArray();
548
+ */
549
+ PriorityQueue.prototype.toArray = function () {
550
+ return __spreadArray([], __read(this._priorityQueue), false);
551
+ };
552
+ return PriorityQueue;
553
+ }(Base);
554
+
555
+ var SequentialContainer = /** @class */function (_super) {
556
+ __extends(SequentialContainer, _super);
557
+ function SequentialContainer() {
558
+ return _super !== null && _super.apply(this, arguments) || this;
559
+ }
560
+ return SequentialContainer;
561
+ }(Container);
562
+
563
+ /**
564
+ * @description Throw an iterator access error.
565
+ * @internal
566
+ */
567
+ function throwIteratorAccessError() {
568
+ throw new RangeError('Iterator access denied!');
569
+ }
570
+
571
+ var RandomIterator = /** @class */function (_super) {
572
+ __extends(RandomIterator, _super);
573
+ /**
574
+ * @internal
575
+ */
576
+ function RandomIterator(index, iteratorType) {
577
+ var _this = _super.call(this, iteratorType) || this;
578
+ _this._node = index;
579
+ if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {
580
+ _this.pre = function () {
581
+ if (this._node === 0) {
582
+ throwIteratorAccessError();
583
+ }
584
+ this._node -= 1;
585
+ return this;
586
+ };
587
+ _this.next = function () {
588
+ if (this._node === this.container.size()) {
589
+ throwIteratorAccessError();
590
+ }
591
+ this._node += 1;
592
+ return this;
593
+ };
594
+ } else {
595
+ _this.pre = function () {
596
+ if (this._node === this.container.size() - 1) {
597
+ throwIteratorAccessError();
598
+ }
599
+ this._node += 1;
600
+ return this;
601
+ };
602
+ _this.next = function () {
603
+ if (this._node === -1) {
604
+ throwIteratorAccessError();
605
+ }
606
+ this._node -= 1;
607
+ return this;
608
+ };
609
+ }
610
+ return _this;
611
+ }
612
+ Object.defineProperty(RandomIterator.prototype, "pointer", {
613
+ get: function () {
614
+ return this.container.getElementByPos(this._node);
615
+ },
616
+ set: function (newValue) {
617
+ this.container.setElementByPos(this._node, newValue);
618
+ },
619
+ enumerable: false,
620
+ configurable: true
621
+ });
622
+ return RandomIterator;
623
+ }(ContainerIterator);
624
+
625
+ var VectorIterator = /** @class */function (_super) {
626
+ __extends(VectorIterator, _super);
627
+ function VectorIterator(node, container, iteratorType) {
628
+ var _this = _super.call(this, node, iteratorType) || this;
629
+ _this.container = container;
630
+ return _this;
631
+ }
632
+ VectorIterator.prototype.copy = function () {
633
+ return new VectorIterator(this._node, this.container, this.iteratorType);
634
+ };
635
+ return VectorIterator;
636
+ }(RandomIterator);
637
+ var Vector = /** @class */function (_super) {
638
+ __extends(Vector, _super);
639
+ /**
640
+ * @param container - Initialize container, must have a forEach function.
641
+ * @param copy - When the container is an array, you can choose to directly operate on the original object of
642
+ * the array or perform a shallow copy. The default is shallow copy.
643
+ */
644
+ function Vector(container, copy) {
645
+ if (container === void 0) {
646
+ container = [];
647
+ }
648
+ if (copy === void 0) {
649
+ copy = true;
650
+ }
651
+ var _this = _super.call(this) || this;
652
+ if (Array.isArray(container)) {
653
+ _this._vector = copy ? __spreadArray([], __read(container), false) : container;
654
+ _this._length = container.length;
655
+ } else {
656
+ _this._vector = [];
657
+ var self_1 = _this;
658
+ container.forEach(function (el) {
659
+ self_1.pushBack(el);
660
+ });
661
+ }
662
+ return _this;
663
+ }
664
+ Vector.prototype.clear = function () {
665
+ this._length = 0;
666
+ this._vector.length = 0;
667
+ };
668
+ Vector.prototype.begin = function () {
669
+ return new VectorIterator(0, this);
670
+ };
671
+ Vector.prototype.end = function () {
672
+ return new VectorIterator(this._length, this);
673
+ };
674
+ Vector.prototype.rBegin = function () {
675
+ return new VectorIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */);
676
+ };
677
+
678
+ Vector.prototype.rEnd = function () {
679
+ return new VectorIterator(-1, this, 1 /* IteratorType.REVERSE */);
680
+ };
681
+
682
+ Vector.prototype.front = function () {
683
+ return this._vector[0];
684
+ };
685
+ Vector.prototype.back = function () {
686
+ return this._vector[this._length - 1];
687
+ };
688
+ Vector.prototype.getElementByPos = function (pos) {
689
+ if (pos < 0 || pos > this._length - 1) {
690
+ throw new RangeError();
691
+ }
692
+ return this._vector[pos];
693
+ };
694
+ Vector.prototype.eraseElementByPos = function (pos) {
695
+ if (pos < 0 || pos > this._length - 1) {
696
+ throw new RangeError();
697
+ }
698
+ this._vector.splice(pos, 1);
699
+ this._length -= 1;
700
+ return this._length;
701
+ };
702
+ Vector.prototype.eraseElementByValue = function (value) {
703
+ var index = 0;
704
+ for (var i = 0; i < this._length; ++i) {
705
+ if (this._vector[i] !== value) {
706
+ this._vector[index++] = this._vector[i];
707
+ }
708
+ }
709
+ this._length = this._vector.length = index;
710
+ return this._length;
711
+ };
712
+ Vector.prototype.eraseElementByIterator = function (iter) {
713
+ var _node = iter._node;
714
+ iter = iter.next();
715
+ this.eraseElementByPos(_node);
716
+ return iter;
717
+ };
718
+ Vector.prototype.pushBack = function (element) {
719
+ this._vector.push(element);
720
+ this._length += 1;
721
+ return this._length;
722
+ };
723
+ Vector.prototype.popBack = function () {
724
+ if (this._length === 0) return;
725
+ this._length -= 1;
726
+ return this._vector.pop();
727
+ };
728
+ Vector.prototype.setElementByPos = function (pos, element) {
729
+ if (pos < 0 || pos > this._length - 1) {
730
+ throw new RangeError();
731
+ }
732
+ this._vector[pos] = element;
733
+ };
734
+ Vector.prototype.insert = function (pos, element, num) {
735
+ var _a;
736
+ if (num === void 0) {
737
+ num = 1;
738
+ }
739
+ if (pos < 0 || pos > this._length) {
740
+ throw new RangeError();
741
+ }
742
+ (_a = this._vector).splice.apply(_a, __spreadArray([pos, 0], __read(new Array(num).fill(element)), false));
743
+ this._length += num;
744
+ return this._length;
745
+ };
746
+ Vector.prototype.find = function (element) {
747
+ for (var i = 0; i < this._length; ++i) {
748
+ if (this._vector[i] === element) {
749
+ return new VectorIterator(i, this);
750
+ }
751
+ }
752
+ return this.end();
753
+ };
754
+ Vector.prototype.reverse = function () {
755
+ this._vector.reverse();
756
+ };
757
+ Vector.prototype.unique = function () {
758
+ var index = 1;
759
+ for (var i = 1; i < this._length; ++i) {
760
+ if (this._vector[i] !== this._vector[i - 1]) {
761
+ this._vector[index++] = this._vector[i];
762
+ }
763
+ }
764
+ this._length = this._vector.length = index;
765
+ return this._length;
766
+ };
767
+ Vector.prototype.sort = function (cmp) {
768
+ this._vector.sort(cmp);
769
+ };
770
+ Vector.prototype.forEach = function (callback) {
771
+ for (var i = 0; i < this._length; ++i) {
772
+ callback(this._vector[i], i, this);
773
+ }
774
+ };
775
+ Vector.prototype[Symbol.iterator] = function () {
776
+ return function () {
777
+ return __generator(this, function (_a) {
778
+ switch (_a.label) {
779
+ case 0:
780
+ return [5 /*yield**/, __values(this._vector)];
781
+ case 1:
782
+ _a.sent();
783
+ return [2 /*return*/];
784
+ }
785
+ });
786
+ }.bind(this)();
787
+ };
788
+ return Vector;
789
+ }(SequentialContainer);
790
+
791
+ var LinkListIterator = /** @class */function (_super) {
792
+ __extends(LinkListIterator, _super);
793
+ /**
794
+ * @internal
795
+ */
796
+ function LinkListIterator(_node, _header, container, iteratorType) {
797
+ var _this = _super.call(this, iteratorType) || this;
798
+ _this._node = _node;
799
+ _this._header = _header;
800
+ _this.container = container;
801
+ if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {
802
+ _this.pre = function () {
803
+ if (this._node._pre === this._header) {
804
+ throwIteratorAccessError();
805
+ }
806
+ this._node = this._node._pre;
807
+ return this;
808
+ };
809
+ _this.next = function () {
810
+ if (this._node === this._header) {
811
+ throwIteratorAccessError();
812
+ }
813
+ this._node = this._node._next;
814
+ return this;
815
+ };
816
+ } else {
817
+ _this.pre = function () {
818
+ if (this._node._next === this._header) {
819
+ throwIteratorAccessError();
820
+ }
821
+ this._node = this._node._next;
822
+ return this;
823
+ };
824
+ _this.next = function () {
825
+ if (this._node === this._header) {
826
+ throwIteratorAccessError();
827
+ }
828
+ this._node = this._node._pre;
829
+ return this;
830
+ };
831
+ }
832
+ return _this;
833
+ }
834
+ Object.defineProperty(LinkListIterator.prototype, "pointer", {
835
+ get: function () {
836
+ if (this._node === this._header) {
837
+ throwIteratorAccessError();
838
+ }
839
+ return this._node._value;
840
+ },
841
+ set: function (newValue) {
842
+ if (this._node === this._header) {
843
+ throwIteratorAccessError();
844
+ }
845
+ this._node._value = newValue;
846
+ },
847
+ enumerable: false,
848
+ configurable: true
849
+ });
850
+ LinkListIterator.prototype.copy = function () {
851
+ return new LinkListIterator(this._node, this._header, this.container, this.iteratorType);
852
+ };
853
+ return LinkListIterator;
854
+ }(ContainerIterator);
855
+ var LinkList = /** @class */function (_super) {
856
+ __extends(LinkList, _super);
857
+ function LinkList(container) {
858
+ if (container === void 0) {
859
+ container = [];
860
+ }
861
+ var _this = _super.call(this) || this;
862
+ _this._header = {};
863
+ _this._head = _this._tail = _this._header._pre = _this._header._next = _this._header;
864
+ var self = _this;
865
+ container.forEach(function (el) {
866
+ self.pushBack(el);
867
+ });
868
+ return _this;
869
+ }
870
+ /**
871
+ * @internal
872
+ */
873
+ LinkList.prototype._eraseNode = function (node) {
874
+ var _pre = node._pre,
875
+ _next = node._next;
876
+ _pre._next = _next;
877
+ _next._pre = _pre;
878
+ if (node === this._head) {
879
+ this._head = _next;
880
+ }
881
+ if (node === this._tail) {
882
+ this._tail = _pre;
883
+ }
884
+ this._length -= 1;
885
+ };
886
+ /**
887
+ * @internal
888
+ */
889
+ LinkList.prototype._insertNode = function (value, pre) {
890
+ var next = pre._next;
891
+ var node = {
892
+ _value: value,
893
+ _pre: pre,
894
+ _next: next
895
+ };
896
+ pre._next = node;
897
+ next._pre = node;
898
+ if (pre === this._header) {
899
+ this._head = node;
900
+ }
901
+ if (next === this._header) {
902
+ this._tail = node;
903
+ }
904
+ this._length += 1;
905
+ };
906
+ LinkList.prototype.clear = function () {
907
+ this._length = 0;
908
+ this._head = this._tail = this._header._pre = this._header._next = this._header;
909
+ };
910
+ LinkList.prototype.begin = function () {
911
+ return new LinkListIterator(this._head, this._header, this);
912
+ };
913
+ LinkList.prototype.end = function () {
914
+ return new LinkListIterator(this._header, this._header, this);
915
+ };
916
+ LinkList.prototype.rBegin = function () {
917
+ return new LinkListIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);
918
+ };
919
+
920
+ LinkList.prototype.rEnd = function () {
921
+ return new LinkListIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);
922
+ };
923
+
924
+ LinkList.prototype.front = function () {
925
+ return this._head._value;
926
+ };
927
+ LinkList.prototype.back = function () {
928
+ return this._tail._value;
929
+ };
930
+ LinkList.prototype.getElementByPos = function (pos) {
931
+ if (pos < 0 || pos > this._length - 1) {
932
+ throw new RangeError();
933
+ }
934
+ var curNode = this._head;
935
+ while (pos--) {
936
+ curNode = curNode._next;
937
+ }
938
+ return curNode._value;
939
+ };
940
+ LinkList.prototype.eraseElementByPos = function (pos) {
941
+ if (pos < 0 || pos > this._length - 1) {
942
+ throw new RangeError();
943
+ }
944
+ var curNode = this._head;
945
+ while (pos--) {
946
+ curNode = curNode._next;
947
+ }
948
+ this._eraseNode(curNode);
949
+ return this._length;
950
+ };
951
+ LinkList.prototype.eraseElementByValue = function (_value) {
952
+ var curNode = this._head;
953
+ while (curNode !== this._header) {
954
+ if (curNode._value === _value) {
955
+ this._eraseNode(curNode);
956
+ }
957
+ curNode = curNode._next;
958
+ }
959
+ return this._length;
960
+ };
961
+ LinkList.prototype.eraseElementByIterator = function (iter) {
962
+ var node = iter._node;
963
+ if (node === this._header) {
964
+ throwIteratorAccessError();
965
+ }
966
+ iter = iter.next();
967
+ this._eraseNode(node);
968
+ return iter;
969
+ };
970
+ LinkList.prototype.pushBack = function (element) {
971
+ this._insertNode(element, this._tail);
972
+ return this._length;
973
+ };
974
+ LinkList.prototype.popBack = function () {
975
+ if (this._length === 0) return;
976
+ var value = this._tail._value;
977
+ this._eraseNode(this._tail);
978
+ return value;
979
+ };
980
+ /**
981
+ * @description Push an element to the front.
982
+ * @param element - The element you want to push.
983
+ * @returns The size of queue after pushing.
984
+ */
985
+ LinkList.prototype.pushFront = function (element) {
986
+ this._insertNode(element, this._header);
987
+ return this._length;
988
+ };
989
+ /**
990
+ * @description Removes the first element.
991
+ * @returns The element you popped.
992
+ */
993
+ LinkList.prototype.popFront = function () {
994
+ if (this._length === 0) return;
995
+ var value = this._head._value;
996
+ this._eraseNode(this._head);
997
+ return value;
998
+ };
999
+ LinkList.prototype.setElementByPos = function (pos, element) {
1000
+ if (pos < 0 || pos > this._length - 1) {
1001
+ throw new RangeError();
1002
+ }
1003
+ var curNode = this._head;
1004
+ while (pos--) {
1005
+ curNode = curNode._next;
1006
+ }
1007
+ curNode._value = element;
1008
+ };
1009
+ LinkList.prototype.insert = function (pos, element, num) {
1010
+ if (num === void 0) {
1011
+ num = 1;
1012
+ }
1013
+ if (pos < 0 || pos > this._length) {
1014
+ throw new RangeError();
1015
+ }
1016
+ if (num <= 0) return this._length;
1017
+ if (pos === 0) {
1018
+ while (num--) this.pushFront(element);
1019
+ } else if (pos === this._length) {
1020
+ while (num--) this.pushBack(element);
1021
+ } else {
1022
+ var curNode = this._head;
1023
+ for (var i = 1; i < pos; ++i) {
1024
+ curNode = curNode._next;
1025
+ }
1026
+ var next = curNode._next;
1027
+ this._length += num;
1028
+ while (num--) {
1029
+ curNode._next = {
1030
+ _value: element,
1031
+ _pre: curNode
1032
+ };
1033
+ curNode._next._pre = curNode;
1034
+ curNode = curNode._next;
1035
+ }
1036
+ curNode._next = next;
1037
+ next._pre = curNode;
1038
+ }
1039
+ return this._length;
1040
+ };
1041
+ LinkList.prototype.find = function (element) {
1042
+ var curNode = this._head;
1043
+ while (curNode !== this._header) {
1044
+ if (curNode._value === element) {
1045
+ return new LinkListIterator(curNode, this._header, this);
1046
+ }
1047
+ curNode = curNode._next;
1048
+ }
1049
+ return this.end();
1050
+ };
1051
+ LinkList.prototype.reverse = function () {
1052
+ if (this._length <= 1) return;
1053
+ var pHead = this._head;
1054
+ var pTail = this._tail;
1055
+ var cnt = 0;
1056
+ while (cnt << 1 < this._length) {
1057
+ var tmp = pHead._value;
1058
+ pHead._value = pTail._value;
1059
+ pTail._value = tmp;
1060
+ pHead = pHead._next;
1061
+ pTail = pTail._pre;
1062
+ cnt += 1;
1063
+ }
1064
+ };
1065
+ LinkList.prototype.unique = function () {
1066
+ if (this._length <= 1) {
1067
+ return this._length;
1068
+ }
1069
+ var curNode = this._head;
1070
+ while (curNode !== this._header) {
1071
+ var tmpNode = curNode;
1072
+ while (tmpNode._next !== this._header && tmpNode._value === tmpNode._next._value) {
1073
+ tmpNode = tmpNode._next;
1074
+ this._length -= 1;
1075
+ }
1076
+ curNode._next = tmpNode._next;
1077
+ curNode._next._pre = curNode;
1078
+ curNode = curNode._next;
1079
+ }
1080
+ return this._length;
1081
+ };
1082
+ LinkList.prototype.sort = function (cmp) {
1083
+ if (this._length <= 1) return;
1084
+ var arr = [];
1085
+ this.forEach(function (el) {
1086
+ arr.push(el);
1087
+ });
1088
+ arr.sort(cmp);
1089
+ var curNode = this._head;
1090
+ arr.forEach(function (element) {
1091
+ curNode._value = element;
1092
+ curNode = curNode._next;
1093
+ });
1094
+ };
1095
+ /**
1096
+ * @description Merges two sorted lists.
1097
+ * @param list - The other list you want to merge (must be sorted).
1098
+ * @returns The size of list after merging.
1099
+ * @example
1100
+ * const linkA = new LinkList([1, 3, 5]);
1101
+ * const linkB = new LinkList([2, 4, 6]);
1102
+ * linkA.merge(linkB); // [1, 2, 3, 4, 5];
1103
+ */
1104
+ LinkList.prototype.merge = function (list) {
1105
+ var self = this;
1106
+ if (this._length === 0) {
1107
+ list.forEach(function (el) {
1108
+ self.pushBack(el);
1109
+ });
1110
+ } else {
1111
+ var curNode_1 = this._head;
1112
+ list.forEach(function (el) {
1113
+ while (curNode_1 !== self._header && curNode_1._value <= el) {
1114
+ curNode_1 = curNode_1._next;
1115
+ }
1116
+ self._insertNode(el, curNode_1._pre);
1117
+ });
1118
+ }
1119
+ return this._length;
1120
+ };
1121
+ LinkList.prototype.forEach = function (callback) {
1122
+ var curNode = this._head;
1123
+ var index = 0;
1124
+ while (curNode !== this._header) {
1125
+ callback(curNode._value, index++, this);
1126
+ curNode = curNode._next;
1127
+ }
1128
+ };
1129
+ LinkList.prototype[Symbol.iterator] = function () {
1130
+ return function () {
1131
+ var curNode;
1132
+ return __generator(this, function (_a) {
1133
+ switch (_a.label) {
1134
+ case 0:
1135
+ if (this._length === 0) return [2 /*return*/];
1136
+ curNode = this._head;
1137
+ _a.label = 1;
1138
+ case 1:
1139
+ if (!(curNode !== this._header)) return [3 /*break*/, 3];
1140
+ return [4 /*yield*/, curNode._value];
1141
+ case 2:
1142
+ _a.sent();
1143
+ curNode = curNode._next;
1144
+ return [3 /*break*/, 1];
1145
+ case 3:
1146
+ return [2 /*return*/];
1147
+ }
1148
+ });
1149
+ }.bind(this)();
1150
+ };
1151
+ return LinkList;
1152
+ }(SequentialContainer);
1153
+
1154
+ var DequeIterator = /** @class */function (_super) {
1155
+ __extends(DequeIterator, _super);
1156
+ function DequeIterator(node, container, iteratorType) {
1157
+ var _this = _super.call(this, node, iteratorType) || this;
1158
+ _this.container = container;
1159
+ return _this;
1160
+ }
1161
+ DequeIterator.prototype.copy = function () {
1162
+ return new DequeIterator(this._node, this.container, this.iteratorType);
1163
+ };
1164
+ return DequeIterator;
1165
+ }(RandomIterator);
1166
+ var Deque = /** @class */function (_super) {
1167
+ __extends(Deque, _super);
1168
+ function Deque(container, _bucketSize) {
1169
+ if (container === void 0) {
1170
+ container = [];
1171
+ }
1172
+ if (_bucketSize === void 0) {
1173
+ _bucketSize = 1 << 12;
1174
+ }
1175
+ var _this = _super.call(this) || this;
1176
+ /**
1177
+ * @internal
1178
+ */
1179
+ _this._first = 0;
1180
+ /**
1181
+ * @internal
1182
+ */
1183
+ _this._curFirst = 0;
1184
+ /**
1185
+ * @internal
1186
+ */
1187
+ _this._last = 0;
1188
+ /**
1189
+ * @internal
1190
+ */
1191
+ _this._curLast = 0;
1192
+ /**
1193
+ * @internal
1194
+ */
1195
+ _this._bucketNum = 0;
1196
+ /**
1197
+ * @internal
1198
+ */
1199
+ _this._map = [];
1200
+ var _length = function () {
1201
+ if (typeof container.length === "number") return container.length;
1202
+ if (typeof container.size === "number") return container.size;
1203
+ if (typeof container.size === "function") return container.size();
1204
+ throw new TypeError("Cannot get the length or size of the container");
1205
+ }();
1206
+ _this._bucketSize = _bucketSize;
1207
+ _this._bucketNum = Math.max(Math.ceil(_length / _this._bucketSize), 1);
1208
+ for (var i = 0; i < _this._bucketNum; ++i) {
1209
+ _this._map.push(new Array(_this._bucketSize));
1210
+ }
1211
+ var needBucketNum = Math.ceil(_length / _this._bucketSize);
1212
+ _this._first = _this._last = (_this._bucketNum >> 1) - (needBucketNum >> 1);
1213
+ _this._curFirst = _this._curLast = _this._bucketSize - _length % _this._bucketSize >> 1;
1214
+ var self = _this;
1215
+ container.forEach(function (element) {
1216
+ self.pushBack(element);
1217
+ });
1218
+ return _this;
1219
+ }
1220
+ /**
1221
+ * @description Growth the Deque.
1222
+ * @internal
1223
+ */
1224
+ Deque.prototype._reAllocate = function () {
1225
+ var newMap = [];
1226
+ var addBucketNum = Math.max(this._bucketNum >> 1, 1);
1227
+ for (var i = 0; i < addBucketNum; ++i) {
1228
+ newMap[i] = new Array(this._bucketSize);
1229
+ }
1230
+ for (var i = this._first; i < this._bucketNum; ++i) {
1231
+ newMap[newMap.length] = this._map[i];
1232
+ }
1233
+ for (var i = 0; i < this._last; ++i) {
1234
+ newMap[newMap.length] = this._map[i];
1235
+ }
1236
+ newMap[newMap.length] = __spreadArray([], __read(this._map[this._last]), false);
1237
+ this._first = addBucketNum;
1238
+ this._last = newMap.length - 1;
1239
+ for (var i = 0; i < addBucketNum; ++i) {
1240
+ newMap[newMap.length] = new Array(this._bucketSize);
1241
+ }
1242
+ this._map = newMap;
1243
+ this._bucketNum = newMap.length;
1244
+ };
1245
+ /**
1246
+ * @description Get the bucket position of the element and the pointer position by index.
1247
+ * @param pos - The element's index.
1248
+ * @internal
1249
+ */
1250
+ Deque.prototype._getElementIndex = function (pos) {
1251
+ var offset = this._curFirst + pos + 1;
1252
+ var offsetRemainder = offset % this._bucketSize;
1253
+ var curNodePointerIndex = offsetRemainder - 1;
1254
+ var curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize;
1255
+ if (offsetRemainder === 0) curNodeBucketIndex -= 1;
1256
+ curNodeBucketIndex %= this._bucketNum;
1257
+ if (curNodePointerIndex < 0) curNodePointerIndex += this._bucketSize;
1258
+ return {
1259
+ curNodeBucketIndex: curNodeBucketIndex,
1260
+ curNodePointerIndex: curNodePointerIndex
1261
+ };
1262
+ };
1263
+ Deque.prototype.clear = function () {
1264
+ this._map = [new Array(this._bucketSize)];
1265
+ this._bucketNum = 1;
1266
+ this._first = this._last = this._length = 0;
1267
+ this._curFirst = this._curLast = this._bucketSize >> 1;
1268
+ };
1269
+ Deque.prototype.begin = function () {
1270
+ return new DequeIterator(0, this);
1271
+ };
1272
+ Deque.prototype.end = function () {
1273
+ return new DequeIterator(this._length, this);
1274
+ };
1275
+ Deque.prototype.rBegin = function () {
1276
+ return new DequeIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */);
1277
+ };
1278
+
1279
+ Deque.prototype.rEnd = function () {
1280
+ return new DequeIterator(-1, this, 1 /* IteratorType.REVERSE */);
1281
+ };
1282
+
1283
+ Deque.prototype.front = function () {
1284
+ if (this._length === 0) return;
1285
+ return this._map[this._first][this._curFirst];
1286
+ };
1287
+ Deque.prototype.back = function () {
1288
+ if (this._length === 0) return;
1289
+ return this._map[this._last][this._curLast];
1290
+ };
1291
+ Deque.prototype.pushBack = function (element) {
1292
+ if (this._length) {
1293
+ if (this._curLast < this._bucketSize - 1) {
1294
+ this._curLast += 1;
1295
+ } else if (this._last < this._bucketNum - 1) {
1296
+ this._last += 1;
1297
+ this._curLast = 0;
1298
+ } else {
1299
+ this._last = 0;
1300
+ this._curLast = 0;
1301
+ }
1302
+ if (this._last === this._first && this._curLast === this._curFirst) this._reAllocate();
1303
+ }
1304
+ this._length += 1;
1305
+ this._map[this._last][this._curLast] = element;
1306
+ return this._length;
1307
+ };
1308
+ Deque.prototype.popBack = function () {
1309
+ if (this._length === 0) return;
1310
+ var value = this._map[this._last][this._curLast];
1311
+ if (this._length !== 1) {
1312
+ if (this._curLast > 0) {
1313
+ this._curLast -= 1;
1314
+ } else if (this._last > 0) {
1315
+ this._last -= 1;
1316
+ this._curLast = this._bucketSize - 1;
1317
+ } else {
1318
+ this._last = this._bucketNum - 1;
1319
+ this._curLast = this._bucketSize - 1;
1320
+ }
1321
+ }
1322
+ this._length -= 1;
1323
+ return value;
1324
+ };
1325
+ /**
1326
+ * @description Push the element to the front.
1327
+ * @param element - The element you want to push.
1328
+ * @returns The size of queue after pushing.
1329
+ */
1330
+ Deque.prototype.pushFront = function (element) {
1331
+ if (this._length) {
1332
+ if (this._curFirst > 0) {
1333
+ this._curFirst -= 1;
1334
+ } else if (this._first > 0) {
1335
+ this._first -= 1;
1336
+ this._curFirst = this._bucketSize - 1;
1337
+ } else {
1338
+ this._first = this._bucketNum - 1;
1339
+ this._curFirst = this._bucketSize - 1;
1340
+ }
1341
+ if (this._first === this._last && this._curFirst === this._curLast) this._reAllocate();
1342
+ }
1343
+ this._length += 1;
1344
+ this._map[this._first][this._curFirst] = element;
1345
+ return this._length;
1346
+ };
1347
+ /**
1348
+ * @description Remove the _first element.
1349
+ * @returns The element you popped.
1350
+ */
1351
+ Deque.prototype.popFront = function () {
1352
+ if (this._length === 0) return;
1353
+ var value = this._map[this._first][this._curFirst];
1354
+ if (this._length !== 1) {
1355
+ if (this._curFirst < this._bucketSize - 1) {
1356
+ this._curFirst += 1;
1357
+ } else if (this._first < this._bucketNum - 1) {
1358
+ this._first += 1;
1359
+ this._curFirst = 0;
1360
+ } else {
1361
+ this._first = 0;
1362
+ this._curFirst = 0;
1363
+ }
1364
+ }
1365
+ this._length -= 1;
1366
+ return value;
1367
+ };
1368
+ Deque.prototype.getElementByPos = function (pos) {
1369
+ if (pos < 0 || pos > this._length - 1) {
1370
+ throw new RangeError();
1371
+ }
1372
+ var _a = this._getElementIndex(pos),
1373
+ curNodeBucketIndex = _a.curNodeBucketIndex,
1374
+ curNodePointerIndex = _a.curNodePointerIndex;
1375
+ return this._map[curNodeBucketIndex][curNodePointerIndex];
1376
+ };
1377
+ Deque.prototype.setElementByPos = function (pos, element) {
1378
+ if (pos < 0 || pos > this._length - 1) {
1379
+ throw new RangeError();
1380
+ }
1381
+ var _a = this._getElementIndex(pos),
1382
+ curNodeBucketIndex = _a.curNodeBucketIndex,
1383
+ curNodePointerIndex = _a.curNodePointerIndex;
1384
+ this._map[curNodeBucketIndex][curNodePointerIndex] = element;
1385
+ };
1386
+ Deque.prototype.insert = function (pos, element, num) {
1387
+ if (num === void 0) {
1388
+ num = 1;
1389
+ }
1390
+ if (pos < 0 || pos > this._length) {
1391
+ throw new RangeError();
1392
+ }
1393
+ if (pos === 0) {
1394
+ while (num--) this.pushFront(element);
1395
+ } else if (pos === this._length) {
1396
+ while (num--) this.pushBack(element);
1397
+ } else {
1398
+ var arr = [];
1399
+ for (var i = pos; i < this._length; ++i) {
1400
+ arr.push(this.getElementByPos(i));
1401
+ }
1402
+ this.cut(pos - 1);
1403
+ for (var i = 0; i < num; ++i) this.pushBack(element);
1404
+ for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]);
1405
+ }
1406
+ return this._length;
1407
+ };
1408
+ /**
1409
+ * @description Remove all elements after the specified position (excluding the specified position).
1410
+ * @param pos - The previous position of the first removed element.
1411
+ * @returns The size of the container after cutting.
1412
+ * @example
1413
+ * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1]
1414
+ */
1415
+ Deque.prototype.cut = function (pos) {
1416
+ if (pos < 0) {
1417
+ this.clear();
1418
+ return 0;
1419
+ }
1420
+ var _a = this._getElementIndex(pos),
1421
+ curNodeBucketIndex = _a.curNodeBucketIndex,
1422
+ curNodePointerIndex = _a.curNodePointerIndex;
1423
+ this._last = curNodeBucketIndex;
1424
+ this._curLast = curNodePointerIndex;
1425
+ this._length = pos + 1;
1426
+ return this._length;
1427
+ };
1428
+ Deque.prototype.eraseElementByPos = function (pos) {
1429
+ if (pos < 0 || pos > this._length - 1) {
1430
+ throw new RangeError();
1431
+ }
1432
+ if (pos === 0) this.popFront();else if (pos === this._length - 1) this.popBack();else {
1433
+ var arr = [];
1434
+ for (var i = pos + 1; i < this._length; ++i) {
1435
+ arr.push(this.getElementByPos(i));
1436
+ }
1437
+ this.cut(pos);
1438
+ this.popBack();
1439
+ var self_1 = this;
1440
+ arr.forEach(function (el) {
1441
+ self_1.pushBack(el);
1442
+ });
1443
+ }
1444
+ return this._length;
1445
+ };
1446
+ Deque.prototype.eraseElementByValue = function (value) {
1447
+ if (this._length === 0) return 0;
1448
+ var arr = [];
1449
+ for (var i = 0; i < this._length; ++i) {
1450
+ var element = this.getElementByPos(i);
1451
+ if (element !== value) arr.push(element);
1452
+ }
1453
+ var _length = arr.length;
1454
+ for (var i = 0; i < _length; ++i) this.setElementByPos(i, arr[i]);
1455
+ return this.cut(_length - 1);
1456
+ };
1457
+ Deque.prototype.eraseElementByIterator = function (iter) {
1458
+ var _node = iter._node;
1459
+ this.eraseElementByPos(_node);
1460
+ iter = iter.next();
1461
+ return iter;
1462
+ };
1463
+ Deque.prototype.find = function (element) {
1464
+ for (var i = 0; i < this._length; ++i) {
1465
+ if (this.getElementByPos(i) === element) {
1466
+ return new DequeIterator(i, this);
1467
+ }
1468
+ }
1469
+ return this.end();
1470
+ };
1471
+ Deque.prototype.reverse = function () {
1472
+ var l = 0;
1473
+ var r = this._length - 1;
1474
+ while (l < r) {
1475
+ var tmp = this.getElementByPos(l);
1476
+ this.setElementByPos(l, this.getElementByPos(r));
1477
+ this.setElementByPos(r, tmp);
1478
+ l += 1;
1479
+ r -= 1;
1480
+ }
1481
+ };
1482
+ Deque.prototype.unique = function () {
1483
+ if (this._length <= 1) {
1484
+ return this._length;
1485
+ }
1486
+ var index = 1;
1487
+ var pre = this.getElementByPos(0);
1488
+ for (var i = 1; i < this._length; ++i) {
1489
+ var cur = this.getElementByPos(i);
1490
+ if (cur !== pre) {
1491
+ pre = cur;
1492
+ this.setElementByPos(index++, cur);
1493
+ }
1494
+ }
1495
+ while (this._length > index) this.popBack();
1496
+ return this._length;
1497
+ };
1498
+ Deque.prototype.sort = function (cmp) {
1499
+ var arr = [];
1500
+ for (var i = 0; i < this._length; ++i) {
1501
+ arr.push(this.getElementByPos(i));
1502
+ }
1503
+ arr.sort(cmp);
1504
+ for (var i = 0; i < this._length; ++i) this.setElementByPos(i, arr[i]);
1505
+ };
1506
+ /**
1507
+ * @description Remove as much useless space as possible.
1508
+ */
1509
+ Deque.prototype.shrinkToFit = function () {
1510
+ if (this._length === 0) return;
1511
+ var arr = [];
1512
+ this.forEach(function (el) {
1513
+ arr.push(el);
1514
+ });
1515
+ this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1);
1516
+ this._length = this._first = this._last = this._curFirst = this._curLast = 0;
1517
+ this._map = [];
1518
+ for (var i = 0; i < this._bucketNum; ++i) {
1519
+ this._map.push(new Array(this._bucketSize));
1520
+ }
1521
+ for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]);
1522
+ };
1523
+ Deque.prototype.forEach = function (callback) {
1524
+ for (var i = 0; i < this._length; ++i) {
1525
+ callback(this.getElementByPos(i), i, this);
1526
+ }
1527
+ };
1528
+ Deque.prototype[Symbol.iterator] = function () {
1529
+ return function () {
1530
+ var i;
1531
+ return __generator(this, function (_a) {
1532
+ switch (_a.label) {
1533
+ case 0:
1534
+ i = 0;
1535
+ _a.label = 1;
1536
+ case 1:
1537
+ if (!(i < this._length)) return [3 /*break*/, 4];
1538
+ return [4 /*yield*/, this.getElementByPos(i)];
1539
+ case 2:
1540
+ _a.sent();
1541
+ _a.label = 3;
1542
+ case 3:
1543
+ ++i;
1544
+ return [3 /*break*/, 1];
1545
+ case 4:
1546
+ return [2 /*return*/];
1547
+ }
1548
+ });
1549
+ }.bind(this)();
1550
+ };
1551
+ return Deque;
1552
+ }(SequentialContainer);
1553
+
1554
+ var TreeNode = /** @class */function () {
1555
+ function TreeNode(key, value) {
1556
+ this._color = 1 /* TreeNodeColor.RED */;
1557
+ this._key = undefined;
1558
+ this._value = undefined;
1559
+ this._left = undefined;
1560
+ this._right = undefined;
1561
+ this._parent = undefined;
1562
+ this._key = key;
1563
+ this._value = value;
1564
+ }
1565
+ /**
1566
+ * @description Get the pre node.
1567
+ * @returns TreeNode about the pre node.
1568
+ */
1569
+ TreeNode.prototype._pre = function () {
1570
+ var preNode = this;
1571
+ if (preNode._color === 1 /* TreeNodeColor.RED */ && preNode._parent._parent === preNode) {
1572
+ preNode = preNode._right;
1573
+ } else if (preNode._left) {
1574
+ preNode = preNode._left;
1575
+ while (preNode._right) {
1576
+ preNode = preNode._right;
1577
+ }
1578
+ } else {
1579
+ var pre = preNode._parent;
1580
+ while (pre._left === preNode) {
1581
+ preNode = pre;
1582
+ pre = preNode._parent;
1583
+ }
1584
+ preNode = pre;
1585
+ }
1586
+ return preNode;
1587
+ };
1588
+ /**
1589
+ * @description Get the next node.
1590
+ * @returns TreeNode about the next node.
1591
+ */
1592
+ TreeNode.prototype._next = function () {
1593
+ var nextNode = this;
1594
+ if (nextNode._right) {
1595
+ nextNode = nextNode._right;
1596
+ while (nextNode._left) {
1597
+ nextNode = nextNode._left;
1598
+ }
1599
+ return nextNode;
1600
+ } else {
1601
+ var pre = nextNode._parent;
1602
+ while (pre._right === nextNode) {
1603
+ nextNode = pre;
1604
+ pre = nextNode._parent;
1605
+ }
1606
+ if (nextNode._right !== pre) {
1607
+ return pre;
1608
+ } else return nextNode;
1609
+ }
1610
+ };
1611
+ /**
1612
+ * @description Rotate left.
1613
+ * @returns TreeNode about moved to original position after rotation.
1614
+ */
1615
+ TreeNode.prototype._rotateLeft = function () {
1616
+ var PP = this._parent;
1617
+ var V = this._right;
1618
+ var R = V._left;
1619
+ if (PP._parent === this) PP._parent = V;else if (PP._left === this) PP._left = V;else PP._right = V;
1620
+ V._parent = PP;
1621
+ V._left = this;
1622
+ this._parent = V;
1623
+ this._right = R;
1624
+ if (R) R._parent = this;
1625
+ return V;
1626
+ };
1627
+ /**
1628
+ * @description Rotate right.
1629
+ * @returns TreeNode about moved to original position after rotation.
1630
+ */
1631
+ TreeNode.prototype._rotateRight = function () {
1632
+ var PP = this._parent;
1633
+ var F = this._left;
1634
+ var K = F._right;
1635
+ if (PP._parent === this) PP._parent = F;else if (PP._left === this) PP._left = F;else PP._right = F;
1636
+ F._parent = PP;
1637
+ F._right = this;
1638
+ this._parent = F;
1639
+ this._left = K;
1640
+ if (K) K._parent = this;
1641
+ return F;
1642
+ };
1643
+ return TreeNode;
1644
+ }();
1645
+ var TreeNodeEnableIndex = /** @class */function (_super) {
1646
+ __extends(TreeNodeEnableIndex, _super);
1647
+ function TreeNodeEnableIndex() {
1648
+ var _this = _super !== null && _super.apply(this, arguments) || this;
1649
+ _this._subTreeSize = 1;
1650
+ return _this;
1651
+ }
1652
+ /**
1653
+ * @description Rotate left and do recount.
1654
+ * @returns TreeNode about moved to original position after rotation.
1655
+ */
1656
+ TreeNodeEnableIndex.prototype._rotateLeft = function () {
1657
+ var parent = _super.prototype._rotateLeft.call(this);
1658
+ this._recount();
1659
+ parent._recount();
1660
+ return parent;
1661
+ };
1662
+ /**
1663
+ * @description Rotate right and do recount.
1664
+ * @returns TreeNode about moved to original position after rotation.
1665
+ */
1666
+ TreeNodeEnableIndex.prototype._rotateRight = function () {
1667
+ var parent = _super.prototype._rotateRight.call(this);
1668
+ this._recount();
1669
+ parent._recount();
1670
+ return parent;
1671
+ };
1672
+ TreeNodeEnableIndex.prototype._recount = function () {
1673
+ this._subTreeSize = 1;
1674
+ if (this._left) {
1675
+ this._subTreeSize += this._left._subTreeSize;
1676
+ }
1677
+ if (this._right) {
1678
+ this._subTreeSize += this._right._subTreeSize;
1679
+ }
1680
+ };
1681
+ return TreeNodeEnableIndex;
1682
+ }(TreeNode);
1683
+
1684
+ var TreeContainer = /** @class */function (_super) {
1685
+ __extends(TreeContainer, _super);
1686
+ /**
1687
+ * @internal
1688
+ */
1689
+ function TreeContainer(cmp, enableIndex) {
1690
+ if (cmp === void 0) {
1691
+ cmp = function (x, y) {
1692
+ if (x < y) return -1;
1693
+ if (x > y) return 1;
1694
+ return 0;
1695
+ };
1696
+ }
1697
+ if (enableIndex === void 0) {
1698
+ enableIndex = false;
1699
+ }
1700
+ var _this = _super.call(this) || this;
1701
+ /**
1702
+ * @internal
1703
+ */
1704
+ _this._root = undefined;
1705
+ _this._cmp = cmp;
1706
+ if (enableIndex) {
1707
+ _this._TreeNodeClass = TreeNodeEnableIndex;
1708
+ _this._set = function (key, value, hint) {
1709
+ var curNode = this._preSet(key, value, hint);
1710
+ if (curNode) {
1711
+ var p = curNode._parent;
1712
+ while (p !== this._header) {
1713
+ p._subTreeSize += 1;
1714
+ p = p._parent;
1715
+ }
1716
+ var nodeList = this._insertNodeSelfBalance(curNode);
1717
+ if (nodeList) {
1718
+ var _a = nodeList,
1719
+ parentNode = _a.parentNode,
1720
+ grandParent = _a.grandParent,
1721
+ curNode_1 = _a.curNode;
1722
+ parentNode._recount();
1723
+ grandParent._recount();
1724
+ curNode_1._recount();
1725
+ }
1726
+ }
1727
+ return this._length;
1728
+ };
1729
+ _this._eraseNode = function (curNode) {
1730
+ var p = this._preEraseNode(curNode);
1731
+ while (p !== this._header) {
1732
+ p._subTreeSize -= 1;
1733
+ p = p._parent;
1734
+ }
1735
+ };
1736
+ } else {
1737
+ _this._TreeNodeClass = TreeNode;
1738
+ _this._set = function (key, value, hint) {
1739
+ var curNode = this._preSet(key, value, hint);
1740
+ if (curNode) this._insertNodeSelfBalance(curNode);
1741
+ return this._length;
1742
+ };
1743
+ _this._eraseNode = _this._preEraseNode;
1744
+ }
1745
+ _this._header = new _this._TreeNodeClass();
1746
+ return _this;
1747
+ }
1748
+ /**
1749
+ * @internal
1750
+ */
1751
+ TreeContainer.prototype._lowerBound = function (curNode, key) {
1752
+ var resNode = this._header;
1753
+ while (curNode) {
1754
+ var cmpResult = this._cmp(curNode._key, key);
1755
+ if (cmpResult < 0) {
1756
+ curNode = curNode._right;
1757
+ } else if (cmpResult > 0) {
1758
+ resNode = curNode;
1759
+ curNode = curNode._left;
1760
+ } else return curNode;
1761
+ }
1762
+ return resNode;
1763
+ };
1764
+ /**
1765
+ * @internal
1766
+ */
1767
+ TreeContainer.prototype._upperBound = function (curNode, key) {
1768
+ var resNode = this._header;
1769
+ while (curNode) {
1770
+ var cmpResult = this._cmp(curNode._key, key);
1771
+ if (cmpResult <= 0) {
1772
+ curNode = curNode._right;
1773
+ } else {
1774
+ resNode = curNode;
1775
+ curNode = curNode._left;
1776
+ }
1777
+ }
1778
+ return resNode;
1779
+ };
1780
+ /**
1781
+ * @internal
1782
+ */
1783
+ TreeContainer.prototype._reverseLowerBound = function (curNode, key) {
1784
+ var resNode = this._header;
1785
+ while (curNode) {
1786
+ var cmpResult = this._cmp(curNode._key, key);
1787
+ if (cmpResult < 0) {
1788
+ resNode = curNode;
1789
+ curNode = curNode._right;
1790
+ } else if (cmpResult > 0) {
1791
+ curNode = curNode._left;
1792
+ } else return curNode;
1793
+ }
1794
+ return resNode;
1795
+ };
1796
+ /**
1797
+ * @internal
1798
+ */
1799
+ TreeContainer.prototype._reverseUpperBound = function (curNode, key) {
1800
+ var resNode = this._header;
1801
+ while (curNode) {
1802
+ var cmpResult = this._cmp(curNode._key, key);
1803
+ if (cmpResult < 0) {
1804
+ resNode = curNode;
1805
+ curNode = curNode._right;
1806
+ } else {
1807
+ curNode = curNode._left;
1808
+ }
1809
+ }
1810
+ return resNode;
1811
+ };
1812
+ /**
1813
+ * @internal
1814
+ */
1815
+ TreeContainer.prototype._eraseNodeSelfBalance = function (curNode) {
1816
+ while (true) {
1817
+ var parentNode = curNode._parent;
1818
+ if (parentNode === this._header) return;
1819
+ if (curNode._color === 1 /* TreeNodeColor.RED */) {
1820
+ curNode._color = 0 /* TreeNodeColor.BLACK */;
1821
+ return;
1822
+ }
1823
+ if (curNode === parentNode._left) {
1824
+ var brother = parentNode._right;
1825
+ if (brother._color === 1 /* TreeNodeColor.RED */) {
1826
+ brother._color = 0 /* TreeNodeColor.BLACK */;
1827
+ parentNode._color = 1 /* TreeNodeColor.RED */;
1828
+ if (parentNode === this._root) {
1829
+ this._root = parentNode._rotateLeft();
1830
+ } else parentNode._rotateLeft();
1831
+ } else {
1832
+ if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) {
1833
+ brother._color = parentNode._color;
1834
+ parentNode._color = 0 /* TreeNodeColor.BLACK */;
1835
+ brother._right._color = 0 /* TreeNodeColor.BLACK */;
1836
+ if (parentNode === this._root) {
1837
+ this._root = parentNode._rotateLeft();
1838
+ } else parentNode._rotateLeft();
1839
+ return;
1840
+ } else if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) {
1841
+ brother._color = 1 /* TreeNodeColor.RED */;
1842
+ brother._left._color = 0 /* TreeNodeColor.BLACK */;
1843
+ brother._rotateRight();
1844
+ } else {
1845
+ brother._color = 1 /* TreeNodeColor.RED */;
1846
+ curNode = parentNode;
1847
+ }
1848
+ }
1849
+ } else {
1850
+ var brother = parentNode._left;
1851
+ if (brother._color === 1 /* TreeNodeColor.RED */) {
1852
+ brother._color = 0 /* TreeNodeColor.BLACK */;
1853
+ parentNode._color = 1 /* TreeNodeColor.RED */;
1854
+ if (parentNode === this._root) {
1855
+ this._root = parentNode._rotateRight();
1856
+ } else parentNode._rotateRight();
1857
+ } else {
1858
+ if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) {
1859
+ brother._color = parentNode._color;
1860
+ parentNode._color = 0 /* TreeNodeColor.BLACK */;
1861
+ brother._left._color = 0 /* TreeNodeColor.BLACK */;
1862
+ if (parentNode === this._root) {
1863
+ this._root = parentNode._rotateRight();
1864
+ } else parentNode._rotateRight();
1865
+ return;
1866
+ } else if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) {
1867
+ brother._color = 1 /* TreeNodeColor.RED */;
1868
+ brother._right._color = 0 /* TreeNodeColor.BLACK */;
1869
+ brother._rotateLeft();
1870
+ } else {
1871
+ brother._color = 1 /* TreeNodeColor.RED */;
1872
+ curNode = parentNode;
1873
+ }
1874
+ }
1875
+ }
1876
+ }
1877
+ };
1878
+ /**
1879
+ * @internal
1880
+ */
1881
+ TreeContainer.prototype._preEraseNode = function (curNode) {
1882
+ var _a, _b;
1883
+ if (this._length === 1) {
1884
+ this.clear();
1885
+ return this._header;
1886
+ }
1887
+ var swapNode = curNode;
1888
+ while (swapNode._left || swapNode._right) {
1889
+ if (swapNode._right) {
1890
+ swapNode = swapNode._right;
1891
+ while (swapNode._left) swapNode = swapNode._left;
1892
+ } else {
1893
+ swapNode = swapNode._left;
1894
+ }
1895
+ _a = __read([swapNode._key, curNode._key], 2), curNode._key = _a[0], swapNode._key = _a[1];
1896
+ _b = __read([swapNode._value, curNode._value], 2), curNode._value = _b[0], swapNode._value = _b[1];
1897
+ curNode = swapNode;
1898
+ }
1899
+ if (this._header._left === swapNode) {
1900
+ this._header._left = swapNode._parent;
1901
+ } else if (this._header._right === swapNode) {
1902
+ this._header._right = swapNode._parent;
1903
+ }
1904
+ this._eraseNodeSelfBalance(swapNode);
1905
+ var _parent = swapNode._parent;
1906
+ if (swapNode === _parent._left) {
1907
+ _parent._left = undefined;
1908
+ } else _parent._right = undefined;
1909
+ this._length -= 1;
1910
+ this._root._color = 0 /* TreeNodeColor.BLACK */;
1911
+ return _parent;
1912
+ };
1913
+ /**
1914
+ * @internal
1915
+ */
1916
+ TreeContainer.prototype._inOrderTraversal = function (curNode, callback) {
1917
+ if (curNode === undefined) return false;
1918
+ var ifReturn = this._inOrderTraversal(curNode._left, callback);
1919
+ if (ifReturn) return true;
1920
+ if (callback(curNode)) return true;
1921
+ return this._inOrderTraversal(curNode._right, callback);
1922
+ };
1923
+ /**
1924
+ * @internal
1925
+ */
1926
+ TreeContainer.prototype._insertNodeSelfBalance = function (curNode) {
1927
+ while (true) {
1928
+ var parentNode = curNode._parent;
1929
+ if (parentNode._color === 0 /* TreeNodeColor.BLACK */) return;
1930
+ var grandParent = parentNode._parent;
1931
+ if (parentNode === grandParent._left) {
1932
+ var uncle = grandParent._right;
1933
+ if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) {
1934
+ uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */;
1935
+ if (grandParent === this._root) return;
1936
+ grandParent._color = 1 /* TreeNodeColor.RED */;
1937
+ curNode = grandParent;
1938
+ continue;
1939
+ } else if (curNode === parentNode._right) {
1940
+ curNode._color = 0 /* TreeNodeColor.BLACK */;
1941
+ if (curNode._left) curNode._left._parent = parentNode;
1942
+ if (curNode._right) curNode._right._parent = grandParent;
1943
+ parentNode._right = curNode._left;
1944
+ grandParent._left = curNode._right;
1945
+ curNode._left = parentNode;
1946
+ curNode._right = grandParent;
1947
+ if (grandParent === this._root) {
1948
+ this._root = curNode;
1949
+ this._header._parent = curNode;
1950
+ } else {
1951
+ var GP = grandParent._parent;
1952
+ if (GP._left === grandParent) {
1953
+ GP._left = curNode;
1954
+ } else GP._right = curNode;
1955
+ }
1956
+ curNode._parent = grandParent._parent;
1957
+ parentNode._parent = curNode;
1958
+ grandParent._parent = curNode;
1959
+ grandParent._color = 1 /* TreeNodeColor.RED */;
1960
+ return {
1961
+ parentNode: parentNode,
1962
+ grandParent: grandParent,
1963
+ curNode: curNode
1964
+ };
1965
+ } else {
1966
+ parentNode._color = 0 /* TreeNodeColor.BLACK */;
1967
+ if (grandParent === this._root) {
1968
+ this._root = grandParent._rotateRight();
1969
+ } else grandParent._rotateRight();
1970
+ grandParent._color = 1 /* TreeNodeColor.RED */;
1971
+ }
1972
+ } else {
1973
+ var uncle = grandParent._left;
1974
+ if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) {
1975
+ uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */;
1976
+ if (grandParent === this._root) return;
1977
+ grandParent._color = 1 /* TreeNodeColor.RED */;
1978
+ curNode = grandParent;
1979
+ continue;
1980
+ } else if (curNode === parentNode._left) {
1981
+ curNode._color = 0 /* TreeNodeColor.BLACK */;
1982
+ if (curNode._left) curNode._left._parent = grandParent;
1983
+ if (curNode._right) curNode._right._parent = parentNode;
1984
+ grandParent._right = curNode._left;
1985
+ parentNode._left = curNode._right;
1986
+ curNode._left = grandParent;
1987
+ curNode._right = parentNode;
1988
+ if (grandParent === this._root) {
1989
+ this._root = curNode;
1990
+ this._header._parent = curNode;
1991
+ } else {
1992
+ var GP = grandParent._parent;
1993
+ if (GP._left === grandParent) {
1994
+ GP._left = curNode;
1995
+ } else GP._right = curNode;
1996
+ }
1997
+ curNode._parent = grandParent._parent;
1998
+ parentNode._parent = curNode;
1999
+ grandParent._parent = curNode;
2000
+ grandParent._color = 1 /* TreeNodeColor.RED */;
2001
+ return {
2002
+ parentNode: parentNode,
2003
+ grandParent: grandParent,
2004
+ curNode: curNode
2005
+ };
2006
+ } else {
2007
+ parentNode._color = 0 /* TreeNodeColor.BLACK */;
2008
+ if (grandParent === this._root) {
2009
+ this._root = grandParent._rotateLeft();
2010
+ } else grandParent._rotateLeft();
2011
+ grandParent._color = 1 /* TreeNodeColor.RED */;
2012
+ }
2013
+ }
2014
+
2015
+ return;
2016
+ }
2017
+ };
2018
+ /**
2019
+ * @internal
2020
+ */
2021
+ TreeContainer.prototype._preSet = function (key, value, hint) {
2022
+ if (this._root === undefined) {
2023
+ this._length += 1;
2024
+ this._root = new this._TreeNodeClass(key, value);
2025
+ this._root._color = 0 /* TreeNodeColor.BLACK */;
2026
+ this._root._parent = this._header;
2027
+ this._header._parent = this._root;
2028
+ this._header._left = this._root;
2029
+ this._header._right = this._root;
2030
+ return;
2031
+ }
2032
+ var curNode;
2033
+ var minNode = this._header._left;
2034
+ var compareToMin = this._cmp(minNode._key, key);
2035
+ if (compareToMin === 0) {
2036
+ minNode._value = value;
2037
+ return;
2038
+ } else if (compareToMin > 0) {
2039
+ minNode._left = new this._TreeNodeClass(key, value);
2040
+ minNode._left._parent = minNode;
2041
+ curNode = minNode._left;
2042
+ this._header._left = curNode;
2043
+ } else {
2044
+ var maxNode = this._header._right;
2045
+ var compareToMax = this._cmp(maxNode._key, key);
2046
+ if (compareToMax === 0) {
2047
+ maxNode._value = value;
2048
+ return;
2049
+ } else if (compareToMax < 0) {
2050
+ maxNode._right = new this._TreeNodeClass(key, value);
2051
+ maxNode._right._parent = maxNode;
2052
+ curNode = maxNode._right;
2053
+ this._header._right = curNode;
2054
+ } else {
2055
+ if (hint !== undefined) {
2056
+ var iterNode = hint._node;
2057
+ if (iterNode !== this._header) {
2058
+ var iterCmpRes = this._cmp(iterNode._key, key);
2059
+ if (iterCmpRes === 0) {
2060
+ iterNode._value = value;
2061
+ return;
2062
+ } else /* istanbul ignore else */if (iterCmpRes > 0) {
2063
+ var preNode = iterNode._pre();
2064
+ var preCmpRes = this._cmp(preNode._key, key);
2065
+ if (preCmpRes === 0) {
2066
+ preNode._value = value;
2067
+ return;
2068
+ } else if (preCmpRes < 0) {
2069
+ curNode = new this._TreeNodeClass(key, value);
2070
+ if (preNode._right === undefined) {
2071
+ preNode._right = curNode;
2072
+ curNode._parent = preNode;
2073
+ } else {
2074
+ iterNode._left = curNode;
2075
+ curNode._parent = iterNode;
2076
+ }
2077
+ }
2078
+ }
2079
+ }
2080
+ }
2081
+ if (curNode === undefined) {
2082
+ curNode = this._root;
2083
+ while (true) {
2084
+ var cmpResult = this._cmp(curNode._key, key);
2085
+ if (cmpResult > 0) {
2086
+ if (curNode._left === undefined) {
2087
+ curNode._left = new this._TreeNodeClass(key, value);
2088
+ curNode._left._parent = curNode;
2089
+ curNode = curNode._left;
2090
+ break;
2091
+ }
2092
+ curNode = curNode._left;
2093
+ } else if (cmpResult < 0) {
2094
+ if (curNode._right === undefined) {
2095
+ curNode._right = new this._TreeNodeClass(key, value);
2096
+ curNode._right._parent = curNode;
2097
+ curNode = curNode._right;
2098
+ break;
2099
+ }
2100
+ curNode = curNode._right;
2101
+ } else {
2102
+ curNode._value = value;
2103
+ return;
2104
+ }
2105
+ }
2106
+ }
2107
+ }
2108
+ }
2109
+ this._length += 1;
2110
+ return curNode;
2111
+ };
2112
+ /**
2113
+ * @internal
2114
+ */
2115
+ TreeContainer.prototype._findElementNode = function (curNode, key) {
2116
+ while (curNode) {
2117
+ var cmpResult = this._cmp(curNode._key, key);
2118
+ if (cmpResult < 0) {
2119
+ curNode = curNode._right;
2120
+ } else if (cmpResult > 0) {
2121
+ curNode = curNode._left;
2122
+ } else return curNode;
2123
+ }
2124
+ return curNode || this._header;
2125
+ };
2126
+ TreeContainer.prototype.clear = function () {
2127
+ this._length = 0;
2128
+ this._root = undefined;
2129
+ this._header._parent = undefined;
2130
+ this._header._left = this._header._right = undefined;
2131
+ };
2132
+ /**
2133
+ * @description Update node's key by iterator.
2134
+ * @param iter - The iterator you want to change.
2135
+ * @param key - The key you want to update.
2136
+ * @returns Whether the modification is successful.
2137
+ * @example
2138
+ * const st = new orderedSet([1, 2, 5]);
2139
+ * const iter = st.find(2);
2140
+ * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5]
2141
+ */
2142
+ TreeContainer.prototype.updateKeyByIterator = function (iter, key) {
2143
+ var node = iter._node;
2144
+ if (node === this._header) {
2145
+ throwIteratorAccessError();
2146
+ }
2147
+ if (this._length === 1) {
2148
+ node._key = key;
2149
+ return true;
2150
+ }
2151
+ if (node === this._header._left) {
2152
+ if (this._cmp(node._next()._key, key) > 0) {
2153
+ node._key = key;
2154
+ return true;
2155
+ }
2156
+ return false;
2157
+ }
2158
+ if (node === this._header._right) {
2159
+ if (this._cmp(node._pre()._key, key) < 0) {
2160
+ node._key = key;
2161
+ return true;
2162
+ }
2163
+ return false;
2164
+ }
2165
+ var preKey = node._pre()._key;
2166
+ if (this._cmp(preKey, key) >= 0) return false;
2167
+ var nextKey = node._next()._key;
2168
+ if (this._cmp(nextKey, key) <= 0) return false;
2169
+ node._key = key;
2170
+ return true;
2171
+ };
2172
+ TreeContainer.prototype.eraseElementByPos = function (pos) {
2173
+ if (pos < 0 || pos > this._length - 1) {
2174
+ throw new RangeError();
2175
+ }
2176
+ var index = 0;
2177
+ var self = this;
2178
+ this._inOrderTraversal(this._root, function (curNode) {
2179
+ if (pos === index) {
2180
+ self._eraseNode(curNode);
2181
+ return true;
2182
+ }
2183
+ index += 1;
2184
+ return false;
2185
+ });
2186
+ return this._length;
2187
+ };
2188
+ /**
2189
+ * @description Remove the element of the specified key.
2190
+ * @param key - The key you want to remove.
2191
+ * @returns Whether erase successfully.
2192
+ */
2193
+ TreeContainer.prototype.eraseElementByKey = function (key) {
2194
+ if (this._length === 0) return false;
2195
+ var curNode = this._findElementNode(this._root, key);
2196
+ if (curNode === this._header) return false;
2197
+ this._eraseNode(curNode);
2198
+ return true;
2199
+ };
2200
+ TreeContainer.prototype.eraseElementByIterator = function (iter) {
2201
+ var node = iter._node;
2202
+ if (node === this._header) {
2203
+ throwIteratorAccessError();
2204
+ }
2205
+ var hasNoRight = node._right === undefined;
2206
+ var isNormal = iter.iteratorType === 0 /* IteratorType.NORMAL */;
2207
+ // For the normal iterator, the `next` node will be swapped to `this` node when has right.
2208
+ if (isNormal) {
2209
+ // So we should move it to next when it's right is null.
2210
+ if (hasNoRight) iter.next();
2211
+ } else {
2212
+ // For the reverse iterator, only when it doesn't have right and has left the `next` node will be swapped.
2213
+ // So when it has right, or it is a leaf node we should move it to `next`.
2214
+ if (!hasNoRight || node._left === undefined) iter.next();
2215
+ }
2216
+ this._eraseNode(node);
2217
+ return iter;
2218
+ };
2219
+ TreeContainer.prototype.forEach = function (callback) {
2220
+ var e_1, _a;
2221
+ var index = 0;
2222
+ try {
2223
+ for (var _b = __values(this), _c = _b.next(); !_c.done; _c = _b.next()) {
2224
+ var element = _c.value;
2225
+ callback(element, index++, this);
2226
+ }
2227
+ } catch (e_1_1) {
2228
+ e_1 = {
2229
+ error: e_1_1
2230
+ };
2231
+ } finally {
2232
+ try {
2233
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2234
+ } finally {
2235
+ if (e_1) throw e_1.error;
2236
+ }
2237
+ }
2238
+ };
2239
+ TreeContainer.prototype.getElementByPos = function (pos) {
2240
+ var e_2, _a;
2241
+ if (pos < 0 || pos > this._length - 1) {
2242
+ throw new RangeError();
2243
+ }
2244
+ var res;
2245
+ var index = 0;
2246
+ try {
2247
+ for (var _b = __values(this), _c = _b.next(); !_c.done; _c = _b.next()) {
2248
+ var element = _c.value;
2249
+ if (index === pos) {
2250
+ res = element;
2251
+ break;
2252
+ }
2253
+ index += 1;
2254
+ }
2255
+ } catch (e_2_1) {
2256
+ e_2 = {
2257
+ error: e_2_1
2258
+ };
2259
+ } finally {
2260
+ try {
2261
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2262
+ } finally {
2263
+ if (e_2) throw e_2.error;
2264
+ }
2265
+ }
2266
+ return res;
2267
+ };
2268
+ /**
2269
+ * @description Get the height of the tree.
2270
+ * @returns Number about the height of the RB-tree.
2271
+ */
2272
+ TreeContainer.prototype.getHeight = function () {
2273
+ if (this._length === 0) return 0;
2274
+ var traversal = function (curNode) {
2275
+ if (!curNode) return 0;
2276
+ return Math.max(traversal(curNode._left), traversal(curNode._right)) + 1;
2277
+ };
2278
+ return traversal(this._root);
2279
+ };
2280
+ return TreeContainer;
2281
+ }(Container);
2282
+
2283
+ var TreeIterator = /** @class */function (_super) {
2284
+ __extends(TreeIterator, _super);
2285
+ /**
2286
+ * @internal
2287
+ */
2288
+ function TreeIterator(node, header, iteratorType) {
2289
+ var _this = _super.call(this, iteratorType) || this;
2290
+ _this._node = node;
2291
+ _this._header = header;
2292
+ if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {
2293
+ _this.pre = function () {
2294
+ if (this._node === this._header._left) {
2295
+ throwIteratorAccessError();
2296
+ }
2297
+ this._node = this._node._pre();
2298
+ return this;
2299
+ };
2300
+ _this.next = function () {
2301
+ if (this._node === this._header) {
2302
+ throwIteratorAccessError();
2303
+ }
2304
+ this._node = this._node._next();
2305
+ return this;
2306
+ };
2307
+ } else {
2308
+ _this.pre = function () {
2309
+ if (this._node === this._header._right) {
2310
+ throwIteratorAccessError();
2311
+ }
2312
+ this._node = this._node._next();
2313
+ return this;
2314
+ };
2315
+ _this.next = function () {
2316
+ if (this._node === this._header) {
2317
+ throwIteratorAccessError();
2318
+ }
2319
+ this._node = this._node._pre();
2320
+ return this;
2321
+ };
2322
+ }
2323
+ return _this;
2324
+ }
2325
+ Object.defineProperty(TreeIterator.prototype, "index", {
2326
+ /**
2327
+ * @description Get the sequential index of the iterator in the tree container.<br/>
2328
+ * <strong>Note:</strong>
2329
+ * This function only takes effect when the specified tree container `enableIndex = true`.
2330
+ * @returns The index subscript of the node in the tree.
2331
+ * @example
2332
+ * const st = new OrderedSet([1, 2, 3], true);
2333
+ * console.log(st.begin().next().index); // 1
2334
+ */
2335
+ get: function () {
2336
+ var _node = this._node;
2337
+ var root = this._header._parent;
2338
+ if (_node === this._header) {
2339
+ if (root) {
2340
+ return root._subTreeSize - 1;
2341
+ }
2342
+ return 0;
2343
+ }
2344
+ var index = 0;
2345
+ if (_node._left) {
2346
+ index += _node._left._subTreeSize;
2347
+ }
2348
+ while (_node !== root) {
2349
+ var _parent = _node._parent;
2350
+ if (_node === _parent._right) {
2351
+ index += 1;
2352
+ if (_parent._left) {
2353
+ index += _parent._left._subTreeSize;
2354
+ }
2355
+ }
2356
+ _node = _parent;
2357
+ }
2358
+ return index;
2359
+ },
2360
+ enumerable: false,
2361
+ configurable: true
2362
+ });
2363
+ return TreeIterator;
2364
+ }(ContainerIterator);
2365
+
2366
+ var OrderedSetIterator = /** @class */function (_super) {
2367
+ __extends(OrderedSetIterator, _super);
2368
+ function OrderedSetIterator(node, header, container, iteratorType) {
2369
+ var _this = _super.call(this, node, header, iteratorType) || this;
2370
+ _this.container = container;
2371
+ return _this;
2372
+ }
2373
+ Object.defineProperty(OrderedSetIterator.prototype, "pointer", {
2374
+ get: function () {
2375
+ if (this._node === this._header) {
2376
+ throwIteratorAccessError();
2377
+ }
2378
+ return this._node._key;
2379
+ },
2380
+ enumerable: false,
2381
+ configurable: true
2382
+ });
2383
+ OrderedSetIterator.prototype.copy = function () {
2384
+ return new OrderedSetIterator(this._node, this._header, this.container, this.iteratorType);
2385
+ };
2386
+ return OrderedSetIterator;
2387
+ }(TreeIterator);
2388
+ var OrderedSet = /** @class */function (_super) {
2389
+ __extends(OrderedSet, _super);
2390
+ /**
2391
+ * @param container - The initialization container.
2392
+ * @param cmp - The compare function.
2393
+ * @param enableIndex - Whether to enable iterator indexing function.
2394
+ * @example
2395
+ * new OrderedSet();
2396
+ * new OrderedSet([0, 1, 2]);
2397
+ * new OrderedSet([0, 1, 2], (x, y) => x - y);
2398
+ * new OrderedSet([0, 1, 2], (x, y) => x - y, true);
2399
+ */
2400
+ function OrderedSet(container, cmp, enableIndex) {
2401
+ if (container === void 0) {
2402
+ container = [];
2403
+ }
2404
+ var _this = _super.call(this, cmp, enableIndex) || this;
2405
+ var self = _this;
2406
+ container.forEach(function (el) {
2407
+ self.insert(el);
2408
+ });
2409
+ return _this;
2410
+ }
2411
+ /**
2412
+ * @internal
2413
+ */
2414
+ OrderedSet.prototype._iterationFunc = function (curNode) {
2415
+ return __generator(this, function (_a) {
2416
+ switch (_a.label) {
2417
+ case 0:
2418
+ if (curNode === undefined) return [2 /*return*/];
2419
+ return [5 /*yield**/, __values(this._iterationFunc(curNode._left))];
2420
+ case 1:
2421
+ _a.sent();
2422
+ return [4 /*yield*/, curNode._key];
2423
+ case 2:
2424
+ _a.sent();
2425
+ return [5 /*yield**/, __values(this._iterationFunc(curNode._right))];
2426
+ case 3:
2427
+ _a.sent();
2428
+ return [2 /*return*/];
2429
+ }
2430
+ });
2431
+ };
2432
+
2433
+ OrderedSet.prototype.begin = function () {
2434
+ return new OrderedSetIterator(this._header._left || this._header, this._header, this);
2435
+ };
2436
+ OrderedSet.prototype.end = function () {
2437
+ return new OrderedSetIterator(this._header, this._header, this);
2438
+ };
2439
+ OrderedSet.prototype.rBegin = function () {
2440
+ return new OrderedSetIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */);
2441
+ };
2442
+
2443
+ OrderedSet.prototype.rEnd = function () {
2444
+ return new OrderedSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);
2445
+ };
2446
+
2447
+ OrderedSet.prototype.front = function () {
2448
+ return this._header._left ? this._header._left._key : undefined;
2449
+ };
2450
+ OrderedSet.prototype.back = function () {
2451
+ return this._header._right ? this._header._right._key : undefined;
2452
+ };
2453
+ /**
2454
+ * @description Insert element to set.
2455
+ * @param key - The key want to insert.
2456
+ * @param hint - You can give an iterator hint to improve insertion efficiency.
2457
+ * @return The size of container after setting.
2458
+ * @example
2459
+ * const st = new OrderedSet([2, 4, 5]);
2460
+ * const iter = st.begin();
2461
+ * st.insert(1);
2462
+ * st.insert(3, iter); // give a hint will be faster.
2463
+ */
2464
+ OrderedSet.prototype.insert = function (key, hint) {
2465
+ return this._set(key, undefined, hint);
2466
+ };
2467
+ OrderedSet.prototype.find = function (element) {
2468
+ var resNode = this._findElementNode(this._root, element);
2469
+ return new OrderedSetIterator(resNode, this._header, this);
2470
+ };
2471
+ OrderedSet.prototype.lowerBound = function (key) {
2472
+ var resNode = this._lowerBound(this._root, key);
2473
+ return new OrderedSetIterator(resNode, this._header, this);
2474
+ };
2475
+ OrderedSet.prototype.upperBound = function (key) {
2476
+ var resNode = this._upperBound(this._root, key);
2477
+ return new OrderedSetIterator(resNode, this._header, this);
2478
+ };
2479
+ OrderedSet.prototype.reverseLowerBound = function (key) {
2480
+ var resNode = this._reverseLowerBound(this._root, key);
2481
+ return new OrderedSetIterator(resNode, this._header, this);
2482
+ };
2483
+ OrderedSet.prototype.reverseUpperBound = function (key) {
2484
+ var resNode = this._reverseUpperBound(this._root, key);
2485
+ return new OrderedSetIterator(resNode, this._header, this);
2486
+ };
2487
+ OrderedSet.prototype.union = function (other) {
2488
+ var self = this;
2489
+ other.forEach(function (el) {
2490
+ self.insert(el);
2491
+ });
2492
+ return this._length;
2493
+ };
2494
+ OrderedSet.prototype[Symbol.iterator] = function () {
2495
+ return this._iterationFunc(this._root);
2496
+ };
2497
+ return OrderedSet;
2498
+ }(TreeContainer);
2499
+
2500
+ var OrderedMapIterator = /** @class */function (_super) {
2501
+ __extends(OrderedMapIterator, _super);
2502
+ function OrderedMapIterator(node, header, container, iteratorType) {
2503
+ var _this = _super.call(this, node, header, iteratorType) || this;
2504
+ _this.container = container;
2505
+ return _this;
2506
+ }
2507
+ Object.defineProperty(OrderedMapIterator.prototype, "pointer", {
2508
+ get: function () {
2509
+ if (this._node === this._header) {
2510
+ throwIteratorAccessError();
2511
+ }
2512
+ var self = this;
2513
+ return new Proxy([], {
2514
+ get: function (_, props) {
2515
+ if (props === '0') return self._node._key;else if (props === '1') return self._node._value;
2516
+ },
2517
+ set: function (_, props, newValue) {
2518
+ if (props !== '1') {
2519
+ throw new TypeError('props must be 1');
2520
+ }
2521
+ self._node._value = newValue;
2522
+ return true;
2523
+ }
2524
+ });
2525
+ },
2526
+ enumerable: false,
2527
+ configurable: true
2528
+ });
2529
+ OrderedMapIterator.prototype.copy = function () {
2530
+ return new OrderedMapIterator(this._node, this._header, this.container, this.iteratorType);
2531
+ };
2532
+ return OrderedMapIterator;
2533
+ }(TreeIterator);
2534
+ var OrderedMap = /** @class */function (_super) {
2535
+ __extends(OrderedMap, _super);
2536
+ /**
2537
+ * @param container - The initialization container.
2538
+ * @param cmp - The compare function.
2539
+ * @param enableIndex - Whether to enable iterator indexing function.
2540
+ * @example
2541
+ * new OrderedMap();
2542
+ * new OrderedMap([[0, 1], [2, 1]]);
2543
+ * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y);
2544
+ * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true);
2545
+ */
2546
+ function OrderedMap(container, cmp, enableIndex) {
2547
+ if (container === void 0) {
2548
+ container = [];
2549
+ }
2550
+ var _this = _super.call(this, cmp, enableIndex) || this;
2551
+ var self = _this;
2552
+ container.forEach(function (el) {
2553
+ self.setElement(el[0], el[1]);
2554
+ });
2555
+ return _this;
2556
+ }
2557
+ /**
2558
+ * @internal
2559
+ */
2560
+ OrderedMap.prototype._iterationFunc = function (curNode) {
2561
+ return __generator(this, function (_a) {
2562
+ switch (_a.label) {
2563
+ case 0:
2564
+ if (curNode === undefined) return [2 /*return*/];
2565
+ return [5 /*yield**/, __values(this._iterationFunc(curNode._left))];
2566
+ case 1:
2567
+ _a.sent();
2568
+ return [4 /*yield*/, [curNode._key, curNode._value]];
2569
+ case 2:
2570
+ _a.sent();
2571
+ return [5 /*yield**/, __values(this._iterationFunc(curNode._right))];
2572
+ case 3:
2573
+ _a.sent();
2574
+ return [2 /*return*/];
2575
+ }
2576
+ });
2577
+ };
2578
+
2579
+ OrderedMap.prototype.begin = function () {
2580
+ return new OrderedMapIterator(this._header._left || this._header, this._header, this);
2581
+ };
2582
+ OrderedMap.prototype.end = function () {
2583
+ return new OrderedMapIterator(this._header, this._header, this);
2584
+ };
2585
+ OrderedMap.prototype.rBegin = function () {
2586
+ return new OrderedMapIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */);
2587
+ };
2588
+
2589
+ OrderedMap.prototype.rEnd = function () {
2590
+ return new OrderedMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);
2591
+ };
2592
+
2593
+ OrderedMap.prototype.front = function () {
2594
+ if (this._length === 0) return;
2595
+ var minNode = this._header._left;
2596
+ return [minNode._key, minNode._value];
2597
+ };
2598
+ OrderedMap.prototype.back = function () {
2599
+ if (this._length === 0) return;
2600
+ var maxNode = this._header._right;
2601
+ return [maxNode._key, maxNode._value];
2602
+ };
2603
+ OrderedMap.prototype.lowerBound = function (key) {
2604
+ var resNode = this._lowerBound(this._root, key);
2605
+ return new OrderedMapIterator(resNode, this._header, this);
2606
+ };
2607
+ OrderedMap.prototype.upperBound = function (key) {
2608
+ var resNode = this._upperBound(this._root, key);
2609
+ return new OrderedMapIterator(resNode, this._header, this);
2610
+ };
2611
+ OrderedMap.prototype.reverseLowerBound = function (key) {
2612
+ var resNode = this._reverseLowerBound(this._root, key);
2613
+ return new OrderedMapIterator(resNode, this._header, this);
2614
+ };
2615
+ OrderedMap.prototype.reverseUpperBound = function (key) {
2616
+ var resNode = this._reverseUpperBound(this._root, key);
2617
+ return new OrderedMapIterator(resNode, this._header, this);
2618
+ };
2619
+ /**
2620
+ * @description Insert a key-value pair or set value by the given key.
2621
+ * @param key - The key want to insert.
2622
+ * @param value - The value want to set.
2623
+ * @param hint - You can give an iterator hint to improve insertion efficiency.
2624
+ * @return The size of container after setting.
2625
+ * @example
2626
+ * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]);
2627
+ * const iter = mp.begin();
2628
+ * mp.setElement(1, 0);
2629
+ * mp.setElement(3, 0, iter); // give a hint will be faster.
2630
+ */
2631
+ OrderedMap.prototype.setElement = function (key, value, hint) {
2632
+ return this._set(key, value, hint);
2633
+ };
2634
+ OrderedMap.prototype.find = function (key) {
2635
+ var curNode = this._findElementNode(this._root, key);
2636
+ return new OrderedMapIterator(curNode, this._header, this);
2637
+ };
2638
+ /**
2639
+ * @description Get the value of the element of the specified key.
2640
+ * @param key - The specified key you want to get.
2641
+ * @example
2642
+ * const val = container.getElementByKey(1);
2643
+ */
2644
+ OrderedMap.prototype.getElementByKey = function (key) {
2645
+ var curNode = this._findElementNode(this._root, key);
2646
+ return curNode._value;
2647
+ };
2648
+ OrderedMap.prototype.union = function (other) {
2649
+ var self = this;
2650
+ other.forEach(function (el) {
2651
+ self.setElement(el[0], el[1]);
2652
+ });
2653
+ return this._length;
2654
+ };
2655
+ OrderedMap.prototype[Symbol.iterator] = function () {
2656
+ return this._iterationFunc(this._root);
2657
+ };
2658
+ return OrderedMap;
2659
+ }(TreeContainer);
2660
+
2661
+ /**
2662
+ * @description Determine whether the type of key is `object`.
2663
+ * @param key - The key want to check.
2664
+ * @returns Whether the type of key is `object`.
2665
+ * @internal
2666
+ */
2667
+ function checkObject(key) {
2668
+ var t = typeof key;
2669
+ return t === 'object' && key !== null || t === 'function';
2670
+ }
2671
+
2672
+ var HashContainerIterator = /** @class */function (_super) {
2673
+ __extends(HashContainerIterator, _super);
2674
+ /**
2675
+ * @internal
2676
+ */
2677
+ function HashContainerIterator(node, header, iteratorType) {
2678
+ var _this = _super.call(this, iteratorType) || this;
2679
+ _this._node = node;
2680
+ _this._header = header;
2681
+ if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {
2682
+ _this.pre = function () {
2683
+ if (this._node._pre === this._header) {
2684
+ throwIteratorAccessError();
2685
+ }
2686
+ this._node = this._node._pre;
2687
+ return this;
2688
+ };
2689
+ _this.next = function () {
2690
+ if (this._node === this._header) {
2691
+ throwIteratorAccessError();
2692
+ }
2693
+ this._node = this._node._next;
2694
+ return this;
2695
+ };
2696
+ } else {
2697
+ _this.pre = function () {
2698
+ if (this._node._next === this._header) {
2699
+ throwIteratorAccessError();
2700
+ }
2701
+ this._node = this._node._next;
2702
+ return this;
2703
+ };
2704
+ _this.next = function () {
2705
+ if (this._node === this._header) {
2706
+ throwIteratorAccessError();
2707
+ }
2708
+ this._node = this._node._pre;
2709
+ return this;
2710
+ };
2711
+ }
2712
+ return _this;
2713
+ }
2714
+ return HashContainerIterator;
2715
+ }(ContainerIterator);
2716
+ var HashContainer = /** @class */function (_super) {
2717
+ __extends(HashContainer, _super);
2718
+ /**
2719
+ * @internal
2720
+ */
2721
+ function HashContainer() {
2722
+ var _this = _super.call(this) || this;
2723
+ /**
2724
+ * @internal
2725
+ */
2726
+ _this._objMap = [];
2727
+ /**
2728
+ * @internal
2729
+ */
2730
+ _this._originMap = {};
2731
+ /**
2732
+ * @description Unique symbol used to tag object.
2733
+ */
2734
+ _this.HASH_TAG = Symbol('@@HASH_TAG');
2735
+ Object.setPrototypeOf(_this._originMap, null);
2736
+ _this._header = {};
2737
+ _this._header._pre = _this._header._next = _this._head = _this._tail = _this._header;
2738
+ return _this;
2739
+ }
2740
+ /**
2741
+ * @internal
2742
+ */
2743
+ HashContainer.prototype._eraseNode = function (node) {
2744
+ var _pre = node._pre,
2745
+ _next = node._next;
2746
+ _pre._next = _next;
2747
+ _next._pre = _pre;
2748
+ if (node === this._head) {
2749
+ this._head = _next;
2750
+ }
2751
+ if (node === this._tail) {
2752
+ this._tail = _pre;
2753
+ }
2754
+ this._length -= 1;
2755
+ };
2756
+ /**
2757
+ * @internal
2758
+ */
2759
+ HashContainer.prototype._set = function (key, value, isObject) {
2760
+ if (isObject === undefined) isObject = checkObject(key);
2761
+ var newTail;
2762
+ if (isObject) {
2763
+ var index = key[this.HASH_TAG];
2764
+ if (index !== undefined) {
2765
+ this._objMap[index]._value = value;
2766
+ return this._length;
2767
+ }
2768
+ Object.defineProperty(key, this.HASH_TAG, {
2769
+ value: this._objMap.length,
2770
+ configurable: true
2771
+ });
2772
+ newTail = {
2773
+ _key: key,
2774
+ _value: value,
2775
+ _pre: this._tail,
2776
+ _next: this._header
2777
+ };
2778
+ this._objMap.push(newTail);
2779
+ } else {
2780
+ var node = this._originMap[key];
2781
+ if (node) {
2782
+ node._value = value;
2783
+ return this._length;
2784
+ }
2785
+ newTail = {
2786
+ _key: key,
2787
+ _value: value,
2788
+ _pre: this._tail,
2789
+ _next: this._header
2790
+ };
2791
+ this._originMap[key] = newTail;
2792
+ }
2793
+ if (this._length === 0) {
2794
+ this._head = newTail;
2795
+ this._header._next = newTail;
2796
+ } else {
2797
+ this._tail._next = newTail;
2798
+ }
2799
+ this._tail = newTail;
2800
+ this._header._pre = newTail;
2801
+ return ++this._length;
2802
+ };
2803
+ /**
2804
+ * @internal
2805
+ */
2806
+ HashContainer.prototype._findElementNode = function (key, isObject) {
2807
+ if (isObject === undefined) isObject = checkObject(key);
2808
+ if (isObject) {
2809
+ var index = key[this.HASH_TAG];
2810
+ if (index === undefined) return this._header;
2811
+ return this._objMap[index];
2812
+ } else {
2813
+ return this._originMap[key] || this._header;
2814
+ }
2815
+ };
2816
+ HashContainer.prototype.clear = function () {
2817
+ var HASH_TAG = this.HASH_TAG;
2818
+ this._objMap.forEach(function (el) {
2819
+ delete el._key[HASH_TAG];
2820
+ });
2821
+ this._objMap = [];
2822
+ this._originMap = {};
2823
+ Object.setPrototypeOf(this._originMap, null);
2824
+ this._length = 0;
2825
+ this._head = this._tail = this._header._pre = this._header._next = this._header;
2826
+ };
2827
+ /**
2828
+ * @description Remove the element of the specified key.
2829
+ * @param key - The key you want to remove.
2830
+ * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/>
2831
+ * If a `undefined` value is passed in, the type will be automatically judged.
2832
+ * @returns Whether erase successfully.
2833
+ */
2834
+ HashContainer.prototype.eraseElementByKey = function (key, isObject) {
2835
+ var node;
2836
+ if (isObject === undefined) isObject = checkObject(key);
2837
+ if (isObject) {
2838
+ var index = key[this.HASH_TAG];
2839
+ if (index === undefined) return false;
2840
+ delete key[this.HASH_TAG];
2841
+ node = this._objMap[index];
2842
+ delete this._objMap[index];
2843
+ } else {
2844
+ node = this._originMap[key];
2845
+ if (node === undefined) return false;
2846
+ delete this._originMap[key];
2847
+ }
2848
+ this._eraseNode(node);
2849
+ return true;
2850
+ };
2851
+ HashContainer.prototype.eraseElementByIterator = function (iter) {
2852
+ var node = iter._node;
2853
+ if (node === this._header) {
2854
+ throwIteratorAccessError();
2855
+ }
2856
+ this._eraseNode(node);
2857
+ return iter.next();
2858
+ };
2859
+ HashContainer.prototype.eraseElementByPos = function (pos) {
2860
+ if (pos < 0 || pos > this._length - 1) {
2861
+ throw new RangeError();
2862
+ }
2863
+ var node = this._head;
2864
+ while (pos--) {
2865
+ node = node._next;
2866
+ }
2867
+ this._eraseNode(node);
2868
+ return this._length;
2869
+ };
2870
+ return HashContainer;
2871
+ }(Container);
2872
+
2873
+ var HashSetIterator = /** @class */function (_super) {
2874
+ __extends(HashSetIterator, _super);
2875
+ function HashSetIterator(node, header, container, iteratorType) {
2876
+ var _this = _super.call(this, node, header, iteratorType) || this;
2877
+ _this.container = container;
2878
+ return _this;
2879
+ }
2880
+ Object.defineProperty(HashSetIterator.prototype, "pointer", {
2881
+ get: function () {
2882
+ if (this._node === this._header) {
2883
+ throwIteratorAccessError();
2884
+ }
2885
+ return this._node._key;
2886
+ },
2887
+ enumerable: false,
2888
+ configurable: true
2889
+ });
2890
+ HashSetIterator.prototype.copy = function () {
2891
+ return new HashSetIterator(this._node, this._header, this.container, this.iteratorType);
2892
+ };
2893
+ return HashSetIterator;
2894
+ }(HashContainerIterator);
2895
+ var HashSet = /** @class */function (_super) {
2896
+ __extends(HashSet, _super);
2897
+ function HashSet(container) {
2898
+ if (container === void 0) {
2899
+ container = [];
2900
+ }
2901
+ var _this = _super.call(this) || this;
2902
+ var self = _this;
2903
+ container.forEach(function (el) {
2904
+ self.insert(el);
2905
+ });
2906
+ return _this;
2907
+ }
2908
+ HashSet.prototype.begin = function () {
2909
+ return new HashSetIterator(this._head, this._header, this);
2910
+ };
2911
+ HashSet.prototype.end = function () {
2912
+ return new HashSetIterator(this._header, this._header, this);
2913
+ };
2914
+ HashSet.prototype.rBegin = function () {
2915
+ return new HashSetIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);
2916
+ };
2917
+
2918
+ HashSet.prototype.rEnd = function () {
2919
+ return new HashSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);
2920
+ };
2921
+
2922
+ HashSet.prototype.front = function () {
2923
+ return this._head._key;
2924
+ };
2925
+ HashSet.prototype.back = function () {
2926
+ return this._tail._key;
2927
+ };
2928
+ /**
2929
+ * @description Insert element to set.
2930
+ * @param key - The key want to insert.
2931
+ * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/>
2932
+ * If a `undefined` value is passed in, the type will be automatically judged.
2933
+ * @returns The size of container after inserting.
2934
+ */
2935
+ HashSet.prototype.insert = function (key, isObject) {
2936
+ return this._set(key, undefined, isObject);
2937
+ };
2938
+ HashSet.prototype.getElementByPos = function (pos) {
2939
+ if (pos < 0 || pos > this._length - 1) {
2940
+ throw new RangeError();
2941
+ }
2942
+ var node = this._head;
2943
+ while (pos--) {
2944
+ node = node._next;
2945
+ }
2946
+ return node._key;
2947
+ };
2948
+ /**
2949
+ * @description Check key if exist in container.
2950
+ * @param key - The element you want to search.
2951
+ * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/>
2952
+ * If a `undefined` value is passed in, the type will be automatically judged.
2953
+ * @returns An iterator pointing to the element if found, or super end if not found.
2954
+ */
2955
+ HashSet.prototype.find = function (key, isObject) {
2956
+ var node = this._findElementNode(key, isObject);
2957
+ return new HashSetIterator(node, this._header, this);
2958
+ };
2959
+ HashSet.prototype.forEach = function (callback) {
2960
+ var index = 0;
2961
+ var node = this._head;
2962
+ while (node !== this._header) {
2963
+ callback(node._key, index++, this);
2964
+ node = node._next;
2965
+ }
2966
+ };
2967
+ HashSet.prototype[Symbol.iterator] = function () {
2968
+ return function () {
2969
+ var node;
2970
+ return __generator(this, function (_a) {
2971
+ switch (_a.label) {
2972
+ case 0:
2973
+ node = this._head;
2974
+ _a.label = 1;
2975
+ case 1:
2976
+ if (!(node !== this._header)) return [3 /*break*/, 3];
2977
+ return [4 /*yield*/, node._key];
2978
+ case 2:
2979
+ _a.sent();
2980
+ node = node._next;
2981
+ return [3 /*break*/, 1];
2982
+ case 3:
2983
+ return [2 /*return*/];
2984
+ }
2985
+ });
2986
+ }.bind(this)();
2987
+ };
2988
+ return HashSet;
2989
+ }(HashContainer);
2990
+
2991
+ var HashMapIterator = /** @class */function (_super) {
2992
+ __extends(HashMapIterator, _super);
2993
+ function HashMapIterator(node, header, container, iteratorType) {
2994
+ var _this = _super.call(this, node, header, iteratorType) || this;
2995
+ _this.container = container;
2996
+ return _this;
2997
+ }
2998
+ Object.defineProperty(HashMapIterator.prototype, "pointer", {
2999
+ get: function () {
3000
+ if (this._node === this._header) {
3001
+ throwIteratorAccessError();
3002
+ }
3003
+ var self = this;
3004
+ return new Proxy([], {
3005
+ get: function (_, props) {
3006
+ if (props === '0') return self._node._key;else if (props === '1') return self._node._value;
3007
+ },
3008
+ set: function (_, props, newValue) {
3009
+ if (props !== '1') {
3010
+ throw new TypeError('props must be 1');
3011
+ }
3012
+ self._node._value = newValue;
3013
+ return true;
3014
+ }
3015
+ });
3016
+ },
3017
+ enumerable: false,
3018
+ configurable: true
3019
+ });
3020
+ HashMapIterator.prototype.copy = function () {
3021
+ return new HashMapIterator(this._node, this._header, this.container, this.iteratorType);
3022
+ };
3023
+ return HashMapIterator;
3024
+ }(HashContainerIterator);
3025
+ var HashMap = /** @class */function (_super) {
3026
+ __extends(HashMap, _super);
3027
+ function HashMap(container) {
3028
+ if (container === void 0) {
3029
+ container = [];
3030
+ }
3031
+ var _this = _super.call(this) || this;
3032
+ var self = _this;
3033
+ container.forEach(function (el) {
3034
+ self.setElement(el[0], el[1]);
3035
+ });
3036
+ return _this;
3037
+ }
3038
+ HashMap.prototype.begin = function () {
3039
+ return new HashMapIterator(this._head, this._header, this);
3040
+ };
3041
+ HashMap.prototype.end = function () {
3042
+ return new HashMapIterator(this._header, this._header, this);
3043
+ };
3044
+ HashMap.prototype.rBegin = function () {
3045
+ return new HashMapIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);
3046
+ };
3047
+
3048
+ HashMap.prototype.rEnd = function () {
3049
+ return new HashMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);
3050
+ };
3051
+
3052
+ HashMap.prototype.front = function () {
3053
+ if (this._length === 0) return;
3054
+ return [this._head._key, this._head._value];
3055
+ };
3056
+ HashMap.prototype.back = function () {
3057
+ if (this._length === 0) return;
3058
+ return [this._tail._key, this._tail._value];
3059
+ };
3060
+ /**
3061
+ * @description Insert a key-value pair or set value by the given key.
3062
+ * @param key - The key want to insert.
3063
+ * @param value - The value want to set.
3064
+ * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/>
3065
+ * If a `undefined` value is passed in, the type will be automatically judged.
3066
+ * @returns The size of container after setting.
3067
+ */
3068
+ HashMap.prototype.setElement = function (key, value, isObject) {
3069
+ return this._set(key, value, isObject);
3070
+ };
3071
+ /**
3072
+ * @description Get the value of the element of the specified key.
3073
+ * @param key - The key want to search.
3074
+ * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/>
3075
+ * If a `undefined` value is passed in, the type will be automatically judged.
3076
+ * @example
3077
+ * const val = container.getElementByKey(1);
3078
+ */
3079
+ HashMap.prototype.getElementByKey = function (key, isObject) {
3080
+ if (isObject === undefined) isObject = checkObject(key);
3081
+ if (isObject) {
3082
+ var index = key[this.HASH_TAG];
3083
+ return index !== undefined ? this._objMap[index]._value : undefined;
3084
+ }
3085
+ var node = this._originMap[key];
3086
+ return node ? node._value : undefined;
3087
+ };
3088
+ HashMap.prototype.getElementByPos = function (pos) {
3089
+ if (pos < 0 || pos > this._length - 1) {
3090
+ throw new RangeError();
3091
+ }
3092
+ var node = this._head;
3093
+ while (pos--) {
3094
+ node = node._next;
3095
+ }
3096
+ return [node._key, node._value];
3097
+ };
3098
+ /**
3099
+ * @description Check key if exist in container.
3100
+ * @param key - The element you want to search.
3101
+ * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/>
3102
+ * If a `undefined` value is passed in, the type will be automatically judged.
3103
+ * @returns An iterator pointing to the element if found, or super end if not found.
3104
+ */
3105
+ HashMap.prototype.find = function (key, isObject) {
3106
+ var node = this._findElementNode(key, isObject);
3107
+ return new HashMapIterator(node, this._header, this);
3108
+ };
3109
+ HashMap.prototype.forEach = function (callback) {
3110
+ var index = 0;
3111
+ var node = this._head;
3112
+ while (node !== this._header) {
3113
+ callback([node._key, node._value], index++, this);
3114
+ node = node._next;
3115
+ }
3116
+ };
3117
+ HashMap.prototype[Symbol.iterator] = function () {
3118
+ return function () {
3119
+ var node;
3120
+ return __generator(this, function (_a) {
3121
+ switch (_a.label) {
3122
+ case 0:
3123
+ node = this._head;
3124
+ _a.label = 1;
3125
+ case 1:
3126
+ if (!(node !== this._header)) return [3 /*break*/, 3];
3127
+ return [4 /*yield*/, [node._key, node._value]];
3128
+ case 2:
3129
+ _a.sent();
3130
+ node = node._next;
3131
+ return [3 /*break*/, 1];
3132
+ case 3:
3133
+ return [2 /*return*/];
3134
+ }
3135
+ });
3136
+ }.bind(this)();
3137
+ };
3138
+ return HashMap;
3139
+ }(HashContainer);
3140
+
3141
+ exports.Deque = Deque;
3142
+ exports.HashMap = HashMap;
3143
+ exports.HashSet = HashSet;
3144
+ exports.LinkList = LinkList;
3145
+ exports.OrderedMap = OrderedMap;
3146
+ exports.OrderedSet = OrderedSet;
3147
+ exports.PriorityQueue = PriorityQueue;
3148
+ exports.Queue = Queue;
3149
+ exports.Stack = Stack;
3150
+ exports.Vector = Vector;
3151
+
3152
+ Object.defineProperty(exports, '__esModule', { value: true });
3153
+
3154
+ }));