@krainovsd/js-helpers 0.3.0 → 0.3.2

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 (261) hide show
  1. package/README.md +34 -9
  2. package/lib/cjs/index.js.map +1 -1
  3. package/lib/esm/_virtual/_commonjsHelpers.js +8 -0
  4. package/lib/esm/_virtual/_commonjsHelpers.js.map +1 -0
  5. package/lib/esm/_virtual/dayjs.min.js +8 -0
  6. package/lib/esm/_virtual/dayjs.min.js.map +1 -0
  7. package/lib/esm/_virtual/dayjs.min2.js +4 -0
  8. package/lib/esm/_virtual/dayjs.min2.js.map +1 -0
  9. package/lib/esm/_virtual/get.js +8 -0
  10. package/lib/esm/_virtual/get.js.map +1 -0
  11. package/lib/esm/_virtual/isToday.js +8 -0
  12. package/lib/esm/_virtual/isToday.js.map +1 -0
  13. package/lib/esm/_virtual/isToday2.js +4 -0
  14. package/lib/esm/_virtual/isToday2.js.map +1 -0
  15. package/lib/esm/_virtual/isTomorrow.js +8 -0
  16. package/lib/esm/_virtual/isTomorrow.js.map +1 -0
  17. package/lib/esm/_virtual/isTomorrow2.js +4 -0
  18. package/lib/esm/_virtual/isTomorrow2.js.map +1 -0
  19. package/lib/esm/_virtual/isYesterday.js +8 -0
  20. package/lib/esm/_virtual/isYesterday.js.map +1 -0
  21. package/lib/esm/_virtual/isYesterday2.js +4 -0
  22. package/lib/esm/_virtual/isYesterday2.js.map +1 -0
  23. package/lib/esm/_virtual/set.js +8 -0
  24. package/lib/esm/_virtual/set.js.map +1 -0
  25. package/lib/esm/constants/api.js +7 -0
  26. package/lib/esm/constants/api.js.map +1 -0
  27. package/lib/esm/constants/colors.js +9 -0
  28. package/lib/esm/constants/colors.js.map +1 -0
  29. package/lib/esm/constants/date.js +11 -0
  30. package/lib/esm/constants/date.js.map +1 -0
  31. package/lib/esm/constants/environment.js +19 -0
  32. package/lib/esm/constants/environment.js.map +1 -0
  33. package/lib/esm/constants/fields.js +11 -0
  34. package/lib/esm/constants/fields.js.map +1 -0
  35. package/lib/esm/index.js +51 -2813
  36. package/lib/esm/index.js.map +1 -1
  37. package/lib/esm/lib/api/core.js +130 -0
  38. package/lib/esm/lib/api/core.js.map +1 -0
  39. package/lib/esm/lib/api/middlewares/auth-middleware.js +48 -0
  40. package/lib/esm/lib/api/middlewares/auth-middleware.js.map +1 -0
  41. package/lib/esm/lib/api/middlewares/console-middleware.js +10 -0
  42. package/lib/esm/lib/api/middlewares/console-middleware.js.map +1 -0
  43. package/lib/esm/lib/api/middlewares/index.js +38 -0
  44. package/lib/esm/lib/api/middlewares/index.js.map +1 -0
  45. package/lib/esm/lib/api/token-request.js +47 -0
  46. package/lib/esm/lib/api/token-request.js.map +1 -0
  47. package/lib/esm/lib/browser/download-file.js +33 -0
  48. package/lib/esm/lib/browser/download-file.js.map +1 -0
  49. package/lib/esm/lib/browser/download-json.js +18 -0
  50. package/lib/esm/lib/browser/download-json.js.map +1 -0
  51. package/lib/esm/lib/browser/read-file.js +21 -0
  52. package/lib/esm/lib/browser/read-file.js.map +1 -0
  53. package/lib/esm/lib/colors/get-color-format.js +20 -0
  54. package/lib/esm/lib/colors/get-color-format.js.map +1 -0
  55. package/lib/esm/lib/colors/take-opacity-colors.js +24 -0
  56. package/lib/esm/lib/colors/take-opacity-colors.js.map +1 -0
  57. package/lib/esm/lib/colors/transform-hex-to-rgb.js +6 -0
  58. package/lib/esm/lib/colors/transform-hex-to-rgb.js.map +1 -0
  59. package/lib/esm/lib/colors/transform-rgb-to-rgba.js +8 -0
  60. package/lib/esm/lib/colors/transform-rgb-to-rgba.js.map +1 -0
  61. package/lib/esm/lib/colors/transform-rgba-to-rgb.js +8 -0
  62. package/lib/esm/lib/colors/transform-rgba-to-rgb.js.map +1 -0
  63. package/lib/esm/lib/colors/transform-to-color.js +38 -0
  64. package/lib/esm/lib/colors/transform-to-color.js.map +1 -0
  65. package/lib/esm/lib/date/date-difference.js +9 -0
  66. package/lib/esm/lib/date/date-difference.js.map +1 -0
  67. package/lib/esm/lib/date/date-format.js +12 -0
  68. package/lib/esm/lib/date/date-format.js.map +1 -0
  69. package/lib/esm/lib/date/get-date-by-rules.js +44 -0
  70. package/lib/esm/lib/date/get-date-by-rules.js.map +1 -0
  71. package/lib/esm/lib/date/get-today.js +10 -0
  72. package/lib/esm/lib/date/get-today.js.map +1 -0
  73. package/lib/esm/lib/date/get-tomorrow.js +9 -0
  74. package/lib/esm/lib/date/get-tomorrow.js.map +1 -0
  75. package/lib/esm/lib/date/get-yesterday.js +9 -0
  76. package/lib/esm/lib/date/get-yesterday.js.map +1 -0
  77. package/lib/esm/lib/date/is-today.js +15 -0
  78. package/lib/esm/lib/date/is-today.js.map +1 -0
  79. package/lib/esm/lib/date/is-tomorrow.js +15 -0
  80. package/lib/esm/lib/date/is-tomorrow.js.map +1 -0
  81. package/lib/esm/lib/date/is-yesterday.js +16 -0
  82. package/lib/esm/lib/date/is-yesterday.js.map +1 -0
  83. package/lib/esm/lib/typings/check-type.js +9 -0
  84. package/lib/esm/lib/typings/check-type.js.map +1 -0
  85. package/lib/esm/lib/typings/is-array.js +6 -0
  86. package/lib/esm/lib/typings/is-array.js.map +1 -0
  87. package/lib/esm/lib/typings/is-boolean.js +6 -0
  88. package/lib/esm/lib/typings/is-boolean.js.map +1 -0
  89. package/lib/esm/lib/typings/is-date.js +8 -0
  90. package/lib/esm/lib/typings/is-date.js.map +1 -0
  91. package/lib/esm/lib/typings/is-id.js +9 -0
  92. package/lib/esm/lib/typings/is-id.js.map +1 -0
  93. package/lib/esm/lib/typings/is-null.js +6 -0
  94. package/lib/esm/lib/typings/is-null.js.map +1 -0
  95. package/lib/esm/lib/typings/is-nullable.js +6 -0
  96. package/lib/esm/lib/typings/is-nullable.js.map +1 -0
  97. package/lib/esm/lib/typings/is-number.js +6 -0
  98. package/lib/esm/lib/typings/is-number.js.map +1 -0
  99. package/lib/esm/lib/typings/is-object.js +6 -0
  100. package/lib/esm/lib/typings/is-object.js.map +1 -0
  101. package/lib/esm/lib/typings/is-string.js +6 -0
  102. package/lib/esm/lib/typings/is-string.js.map +1 -0
  103. package/lib/esm/lib/typings/is-undefined.js +6 -0
  104. package/lib/esm/lib/typings/is-undefined.js.map +1 -0
  105. package/lib/esm/lib/utils/array-to-map-by-key.js +14 -0
  106. package/lib/esm/lib/utils/array-to-map-by-key.js.map +1 -0
  107. package/lib/esm/lib/utils/build-query-string.js +23 -0
  108. package/lib/esm/lib/utils/build-query-string.js.map +1 -0
  109. package/lib/esm/lib/utils/create-url-with-params.js +13 -0
  110. package/lib/esm/lib/utils/create-url-with-params.js.map +1 -0
  111. package/lib/esm/lib/utils/field-view-format.js +48 -0
  112. package/lib/esm/lib/utils/field-view-format.js.map +1 -0
  113. package/lib/esm/lib/utils/get-by-path.js +13 -0
  114. package/lib/esm/lib/utils/get-by-path.js.map +1 -0
  115. package/lib/esm/lib/utils/get-file-name-from-header.js +14 -0
  116. package/lib/esm/lib/utils/get-file-name-from-header.js.map +1 -0
  117. package/lib/esm/lib/utils/json-parse.js +15 -0
  118. package/lib/esm/lib/utils/json-parse.js.map +1 -0
  119. package/lib/esm/lib/utils/limit-stream-of-requests.js +51 -0
  120. package/lib/esm/lib/utils/limit-stream-of-requests.js.map +1 -0
  121. package/lib/esm/lib/utils/random-number.js +8 -0
  122. package/lib/esm/lib/utils/random-number.js.map +1 -0
  123. package/lib/esm/lib/utils/random-string.js +13 -0
  124. package/lib/esm/lib/utils/random-string.js.map +1 -0
  125. package/lib/esm/lib/utils/set-by-path.js +18 -0
  126. package/lib/esm/lib/utils/set-by-path.js.map +1 -0
  127. package/lib/esm/lib/utils/sync-object-values.js +20 -0
  128. package/lib/esm/lib/utils/sync-object-values.js.map +1 -0
  129. package/lib/esm/lib/utils/transform-to-number.js +13 -0
  130. package/lib/esm/lib/utils/transform-to-number.js.map +1 -0
  131. package/lib/esm/lib/utils/trim-url.js +6 -0
  132. package/lib/esm/lib/utils/trim-url.js.map +1 -0
  133. package/lib/esm/lib/utils/wait-until.js +13 -0
  134. package/lib/esm/lib/utils/wait-until.js.map +1 -0
  135. package/lib/esm/lib/utils/wait.js +10 -0
  136. package/lib/esm/lib/utils/wait.js.map +1 -0
  137. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js +17 -0
  138. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js.map +1 -0
  139. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isToday.js +17 -0
  140. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isToday.js.map +1 -0
  141. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isTomorrow.js +17 -0
  142. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isTomorrow.js.map +1 -0
  143. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isYesterday.js +17 -0
  144. package/lib/esm/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isYesterday.js.map +1 -0
  145. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js +49 -0
  146. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js.map +1 -0
  147. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js +49 -0
  148. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js.map +1 -0
  149. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js +21 -0
  150. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js.map +1 -0
  151. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js +49 -0
  152. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js.map +1 -0
  153. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +19 -0
  154. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js.map +1 -0
  155. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js +33 -0
  156. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js.map +1 -0
  157. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js +42 -0
  158. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js.map +1 -0
  159. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +34 -0
  160. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js.map +1 -0
  161. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js +38 -0
  162. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js.map +1 -0
  163. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js +38 -0
  164. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js.map +1 -0
  165. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +43 -0
  166. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js.map +1 -0
  167. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +63 -0
  168. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js.map +1 -0
  169. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSet.js +68 -0
  170. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSet.js.map +1 -0
  171. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js +53 -0
  172. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js.map +1 -0
  173. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js +37 -0
  174. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js.map +1 -0
  175. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js +19 -0
  176. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js.map +1 -0
  177. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_defineProperty.js +24 -0
  178. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_defineProperty.js.map +1 -0
  179. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +18 -0
  180. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js.map +1 -0
  181. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js +31 -0
  182. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js.map +1 -0
  183. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js +31 -0
  184. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js.map +1 -0
  185. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +59 -0
  186. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js.map +1 -0
  187. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js +25 -0
  188. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js.map +1 -0
  189. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js +28 -0
  190. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js.map +1 -0
  191. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js +29 -0
  192. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js.map +1 -0
  193. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js +43 -0
  194. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js.map +1 -0
  195. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js +36 -0
  196. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js.map +1 -0
  197. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js +36 -0
  198. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js.map +1 -0
  199. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js +37 -0
  200. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js.map +1 -0
  201. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.js +43 -0
  202. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.js.map +1 -0
  203. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js +27 -0
  204. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js.map +1 -0
  205. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js +33 -0
  206. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js.map +1 -0
  207. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +25 -0
  208. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js.map +1 -0
  209. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +48 -0
  210. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js.map +1 -0
  211. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +32 -0
  212. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js.map +1 -0
  213. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +29 -0
  214. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js.map +1 -0
  215. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +39 -0
  216. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js.map +1 -0
  217. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +36 -0
  218. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js.map +1 -0
  219. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +31 -0
  220. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js.map +1 -0
  221. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +29 -0
  222. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js.map +1 -0
  223. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +29 -0
  224. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js.map +1 -0
  225. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +35 -0
  226. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js.map +1 -0
  227. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js +39 -0
  228. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js.map +1 -0
  229. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +19 -0
  230. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js.map +1 -0
  231. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +34 -0
  232. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js.map +1 -0
  233. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +22 -0
  234. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js.map +1 -0
  235. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stringToPath.js +40 -0
  236. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stringToPath.js.map +1 -0
  237. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js +34 -0
  238. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js.map +1 -0
  239. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js +38 -0
  240. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js.map +1 -0
  241. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js +49 -0
  242. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js.map +1 -0
  243. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js +46 -0
  244. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js.map +1 -0
  245. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js +38 -0
  246. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js.map +1 -0
  247. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js +51 -0
  248. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js.map +1 -0
  249. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +43 -0
  250. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js.map +1 -0
  251. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +41 -0
  252. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js.map +1 -0
  253. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +43 -0
  254. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js.map +1 -0
  255. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js +86 -0
  256. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js.map +1 -0
  257. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/set.js +48 -0
  258. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/set.js.map +1 -0
  259. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js +41 -0
  260. package/lib/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js.map +1 -0
  261. package/package.json +26 -24
package/lib/esm/index.js CHANGED
@@ -1,2814 +1,52 @@
1
- const DATE_TYPES = {
2
- Days: "days",
3
- Months: "months",
4
- Years: "years",
5
- Seconds: "seconds",
6
- Minutes: "minutes",
7
- Hours: "hours",
8
- };
9
-
10
- const API_MIDDLEWARES = {
11
- Auth: "auth",
12
- Logger: "logger",
13
- };
14
-
15
- /* eslint-disable no-restricted-globals */
16
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
17
- /* eslint-disable @typescript-eslint/ban-ts-comment */
18
- const IS_JEST = typeof process != "undefined" && process.env.JEST_WORKER_ID !== undefined;
19
- const IS_BUN = typeof process !== "undefined" && process.versions != null && process.versions.bun != null;
20
- const IS_DENO = // @ts-expect-error
21
- typeof Deno !== "undefined" &&
22
- // @ts-expect-error
23
- typeof Deno.version !== "undefined" &&
24
- // @ts-expect-error
25
- typeof Deno.version.deno !== "undefined";
26
- const IS_NODE = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
27
- const IS_WEB_WORKER = typeof self === "object" &&
28
- self.constructor &&
29
- self.constructor.name === "DedicatedWorkerGlobalScope";
30
- const IS_BROWSER = typeof window !== "undefined" && typeof window.document !== "undefined";
31
-
32
- const COLOR_FORMATS = {
33
- Hex: "HEX",
34
- Rgb: "RGB",
35
- Rgba: "RGBA",
36
- Hsl: "HSL",
37
- };
38
-
39
- const FIELD_TYPES = {
40
- Date: "date",
41
- Time: "time",
42
- DateTime: "dateTime",
43
- String: "string",
44
- Number: "number",
45
- Array: "array",
46
- };
47
-
48
- const waitUntil = (condition, checkInterval = 100) => {
49
- return new Promise((resolve) => {
50
- const interval = setInterval(() => {
51
- if (condition())
52
- return;
53
- clearInterval(interval);
54
- resolve(true);
55
- }, checkInterval);
56
- });
57
- };
58
-
59
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
60
-
61
- function getDefaultExportFromCjs (x) {
62
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
63
- }
64
-
65
- /**
66
- * Checks if `value` is classified as an `Array` object.
67
- *
68
- * @static
69
- * @memberOf _
70
- * @since 0.1.0
71
- * @category Lang
72
- * @param {*} value The value to check.
73
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
74
- * @example
75
- *
76
- * _.isArray([1, 2, 3]);
77
- * // => true
78
- *
79
- * _.isArray(document.body.children);
80
- * // => false
81
- *
82
- * _.isArray('abc');
83
- * // => false
84
- *
85
- * _.isArray(_.noop);
86
- * // => false
87
- */
88
-
89
- var isArray_1;
90
- var hasRequiredIsArray;
91
-
92
- function requireIsArray () {
93
- if (hasRequiredIsArray) return isArray_1;
94
- hasRequiredIsArray = 1;
95
- var isArray = Array.isArray;
96
-
97
- isArray_1 = isArray;
98
- return isArray_1;
99
- }
100
-
101
- /** Detect free variable `global` from Node.js. */
102
-
103
- var _freeGlobal;
104
- var hasRequired_freeGlobal;
105
-
106
- function require_freeGlobal () {
107
- if (hasRequired_freeGlobal) return _freeGlobal;
108
- hasRequired_freeGlobal = 1;
109
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
110
-
111
- _freeGlobal = freeGlobal;
112
- return _freeGlobal;
113
- }
114
-
115
- var _root;
116
- var hasRequired_root;
117
-
118
- function require_root () {
119
- if (hasRequired_root) return _root;
120
- hasRequired_root = 1;
121
- var freeGlobal = require_freeGlobal();
122
-
123
- /** Detect free variable `self`. */
124
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
125
-
126
- /** Used as a reference to the global object. */
127
- var root = freeGlobal || freeSelf || Function('return this')();
128
-
129
- _root = root;
130
- return _root;
131
- }
132
-
133
- var _Symbol;
134
- var hasRequired_Symbol;
135
-
136
- function require_Symbol () {
137
- if (hasRequired_Symbol) return _Symbol;
138
- hasRequired_Symbol = 1;
139
- var root = require_root();
140
-
141
- /** Built-in value references. */
142
- var Symbol = root.Symbol;
143
-
144
- _Symbol = Symbol;
145
- return _Symbol;
146
- }
147
-
148
- var _getRawTag;
149
- var hasRequired_getRawTag;
150
-
151
- function require_getRawTag () {
152
- if (hasRequired_getRawTag) return _getRawTag;
153
- hasRequired_getRawTag = 1;
154
- var Symbol = require_Symbol();
155
-
156
- /** Used for built-in method references. */
157
- var objectProto = Object.prototype;
158
-
159
- /** Used to check objects for own properties. */
160
- var hasOwnProperty = objectProto.hasOwnProperty;
161
-
162
- /**
163
- * Used to resolve the
164
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
165
- * of values.
166
- */
167
- var nativeObjectToString = objectProto.toString;
168
-
169
- /** Built-in value references. */
170
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
171
-
172
- /**
173
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
174
- *
175
- * @private
176
- * @param {*} value The value to query.
177
- * @returns {string} Returns the raw `toStringTag`.
178
- */
179
- function getRawTag(value) {
180
- var isOwn = hasOwnProperty.call(value, symToStringTag),
181
- tag = value[symToStringTag];
182
-
183
- try {
184
- value[symToStringTag] = undefined;
185
- var unmasked = true;
186
- } catch (e) {}
187
-
188
- var result = nativeObjectToString.call(value);
189
- if (unmasked) {
190
- if (isOwn) {
191
- value[symToStringTag] = tag;
192
- } else {
193
- delete value[symToStringTag];
194
- }
195
- }
196
- return result;
197
- }
198
-
199
- _getRawTag = getRawTag;
200
- return _getRawTag;
201
- }
202
-
203
- /** Used for built-in method references. */
204
-
205
- var _objectToString;
206
- var hasRequired_objectToString;
207
-
208
- function require_objectToString () {
209
- if (hasRequired_objectToString) return _objectToString;
210
- hasRequired_objectToString = 1;
211
- var objectProto = Object.prototype;
212
-
213
- /**
214
- * Used to resolve the
215
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
216
- * of values.
217
- */
218
- var nativeObjectToString = objectProto.toString;
219
-
220
- /**
221
- * Converts `value` to a string using `Object.prototype.toString`.
222
- *
223
- * @private
224
- * @param {*} value The value to convert.
225
- * @returns {string} Returns the converted string.
226
- */
227
- function objectToString(value) {
228
- return nativeObjectToString.call(value);
229
- }
230
-
231
- _objectToString = objectToString;
232
- return _objectToString;
233
- }
234
-
235
- var _baseGetTag;
236
- var hasRequired_baseGetTag;
237
-
238
- function require_baseGetTag () {
239
- if (hasRequired_baseGetTag) return _baseGetTag;
240
- hasRequired_baseGetTag = 1;
241
- var Symbol = require_Symbol(),
242
- getRawTag = require_getRawTag(),
243
- objectToString = require_objectToString();
244
-
245
- /** `Object#toString` result references. */
246
- var nullTag = '[object Null]',
247
- undefinedTag = '[object Undefined]';
248
-
249
- /** Built-in value references. */
250
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
251
-
252
- /**
253
- * The base implementation of `getTag` without fallbacks for buggy environments.
254
- *
255
- * @private
256
- * @param {*} value The value to query.
257
- * @returns {string} Returns the `toStringTag`.
258
- */
259
- function baseGetTag(value) {
260
- if (value == null) {
261
- return value === undefined ? undefinedTag : nullTag;
262
- }
263
- return (symToStringTag && symToStringTag in Object(value))
264
- ? getRawTag(value)
265
- : objectToString(value);
266
- }
267
-
268
- _baseGetTag = baseGetTag;
269
- return _baseGetTag;
270
- }
271
-
272
- /**
273
- * Checks if `value` is object-like. A value is object-like if it's not `null`
274
- * and has a `typeof` result of "object".
275
- *
276
- * @static
277
- * @memberOf _
278
- * @since 4.0.0
279
- * @category Lang
280
- * @param {*} value The value to check.
281
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
282
- * @example
283
- *
284
- * _.isObjectLike({});
285
- * // => true
286
- *
287
- * _.isObjectLike([1, 2, 3]);
288
- * // => true
289
- *
290
- * _.isObjectLike(_.noop);
291
- * // => false
292
- *
293
- * _.isObjectLike(null);
294
- * // => false
295
- */
296
-
297
- var isObjectLike_1;
298
- var hasRequiredIsObjectLike;
299
-
300
- function requireIsObjectLike () {
301
- if (hasRequiredIsObjectLike) return isObjectLike_1;
302
- hasRequiredIsObjectLike = 1;
303
- function isObjectLike(value) {
304
- return value != null && typeof value == 'object';
305
- }
306
-
307
- isObjectLike_1 = isObjectLike;
308
- return isObjectLike_1;
309
- }
310
-
311
- var isSymbol_1;
312
- var hasRequiredIsSymbol;
313
-
314
- function requireIsSymbol () {
315
- if (hasRequiredIsSymbol) return isSymbol_1;
316
- hasRequiredIsSymbol = 1;
317
- var baseGetTag = require_baseGetTag(),
318
- isObjectLike = requireIsObjectLike();
319
-
320
- /** `Object#toString` result references. */
321
- var symbolTag = '[object Symbol]';
322
-
323
- /**
324
- * Checks if `value` is classified as a `Symbol` primitive or object.
325
- *
326
- * @static
327
- * @memberOf _
328
- * @since 4.0.0
329
- * @category Lang
330
- * @param {*} value The value to check.
331
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
332
- * @example
333
- *
334
- * _.isSymbol(Symbol.iterator);
335
- * // => true
336
- *
337
- * _.isSymbol('abc');
338
- * // => false
339
- */
340
- function isSymbol(value) {
341
- return typeof value == 'symbol' ||
342
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
343
- }
344
-
345
- isSymbol_1 = isSymbol;
346
- return isSymbol_1;
347
- }
348
-
349
- var _isKey;
350
- var hasRequired_isKey;
351
-
352
- function require_isKey () {
353
- if (hasRequired_isKey) return _isKey;
354
- hasRequired_isKey = 1;
355
- var isArray = requireIsArray(),
356
- isSymbol = requireIsSymbol();
357
-
358
- /** Used to match property names within property paths. */
359
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
360
- reIsPlainProp = /^\w*$/;
361
-
362
- /**
363
- * Checks if `value` is a property name and not a property path.
364
- *
365
- * @private
366
- * @param {*} value The value to check.
367
- * @param {Object} [object] The object to query keys on.
368
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
369
- */
370
- function isKey(value, object) {
371
- if (isArray(value)) {
372
- return false;
373
- }
374
- var type = typeof value;
375
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
376
- value == null || isSymbol(value)) {
377
- return true;
378
- }
379
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
380
- (object != null && value in Object(object));
381
- }
382
-
383
- _isKey = isKey;
384
- return _isKey;
385
- }
386
-
387
- /**
388
- * Checks if `value` is the
389
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
390
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
391
- *
392
- * @static
393
- * @memberOf _
394
- * @since 0.1.0
395
- * @category Lang
396
- * @param {*} value The value to check.
397
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
398
- * @example
399
- *
400
- * _.isObject({});
401
- * // => true
402
- *
403
- * _.isObject([1, 2, 3]);
404
- * // => true
405
- *
406
- * _.isObject(_.noop);
407
- * // => true
408
- *
409
- * _.isObject(null);
410
- * // => false
411
- */
412
-
413
- var isObject_1;
414
- var hasRequiredIsObject;
415
-
416
- function requireIsObject () {
417
- if (hasRequiredIsObject) return isObject_1;
418
- hasRequiredIsObject = 1;
419
- function isObject(value) {
420
- var type = typeof value;
421
- return value != null && (type == 'object' || type == 'function');
422
- }
423
-
424
- isObject_1 = isObject;
425
- return isObject_1;
426
- }
427
-
428
- var isFunction_1;
429
- var hasRequiredIsFunction;
430
-
431
- function requireIsFunction () {
432
- if (hasRequiredIsFunction) return isFunction_1;
433
- hasRequiredIsFunction = 1;
434
- var baseGetTag = require_baseGetTag(),
435
- isObject = requireIsObject();
436
-
437
- /** `Object#toString` result references. */
438
- var asyncTag = '[object AsyncFunction]',
439
- funcTag = '[object Function]',
440
- genTag = '[object GeneratorFunction]',
441
- proxyTag = '[object Proxy]';
442
-
443
- /**
444
- * Checks if `value` is classified as a `Function` object.
445
- *
446
- * @static
447
- * @memberOf _
448
- * @since 0.1.0
449
- * @category Lang
450
- * @param {*} value The value to check.
451
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
452
- * @example
453
- *
454
- * _.isFunction(_);
455
- * // => true
456
- *
457
- * _.isFunction(/abc/);
458
- * // => false
459
- */
460
- function isFunction(value) {
461
- if (!isObject(value)) {
462
- return false;
463
- }
464
- // The use of `Object#toString` avoids issues with the `typeof` operator
465
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
466
- var tag = baseGetTag(value);
467
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
468
- }
469
-
470
- isFunction_1 = isFunction;
471
- return isFunction_1;
472
- }
473
-
474
- var _coreJsData;
475
- var hasRequired_coreJsData;
476
-
477
- function require_coreJsData () {
478
- if (hasRequired_coreJsData) return _coreJsData;
479
- hasRequired_coreJsData = 1;
480
- var root = require_root();
481
-
482
- /** Used to detect overreaching core-js shims. */
483
- var coreJsData = root['__core-js_shared__'];
484
-
485
- _coreJsData = coreJsData;
486
- return _coreJsData;
487
- }
488
-
489
- var _isMasked;
490
- var hasRequired_isMasked;
491
-
492
- function require_isMasked () {
493
- if (hasRequired_isMasked) return _isMasked;
494
- hasRequired_isMasked = 1;
495
- var coreJsData = require_coreJsData();
496
-
497
- /** Used to detect methods masquerading as native. */
498
- var maskSrcKey = (function() {
499
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
500
- return uid ? ('Symbol(src)_1.' + uid) : '';
501
- }());
502
-
503
- /**
504
- * Checks if `func` has its source masked.
505
- *
506
- * @private
507
- * @param {Function} func The function to check.
508
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
509
- */
510
- function isMasked(func) {
511
- return !!maskSrcKey && (maskSrcKey in func);
512
- }
513
-
514
- _isMasked = isMasked;
515
- return _isMasked;
516
- }
517
-
518
- /** Used for built-in method references. */
519
-
520
- var _toSource;
521
- var hasRequired_toSource;
522
-
523
- function require_toSource () {
524
- if (hasRequired_toSource) return _toSource;
525
- hasRequired_toSource = 1;
526
- var funcProto = Function.prototype;
527
-
528
- /** Used to resolve the decompiled source of functions. */
529
- var funcToString = funcProto.toString;
530
-
531
- /**
532
- * Converts `func` to its source code.
533
- *
534
- * @private
535
- * @param {Function} func The function to convert.
536
- * @returns {string} Returns the source code.
537
- */
538
- function toSource(func) {
539
- if (func != null) {
540
- try {
541
- return funcToString.call(func);
542
- } catch (e) {}
543
- try {
544
- return (func + '');
545
- } catch (e) {}
546
- }
547
- return '';
548
- }
549
-
550
- _toSource = toSource;
551
- return _toSource;
552
- }
553
-
554
- var _baseIsNative;
555
- var hasRequired_baseIsNative;
556
-
557
- function require_baseIsNative () {
558
- if (hasRequired_baseIsNative) return _baseIsNative;
559
- hasRequired_baseIsNative = 1;
560
- var isFunction = requireIsFunction(),
561
- isMasked = require_isMasked(),
562
- isObject = requireIsObject(),
563
- toSource = require_toSource();
564
-
565
- /**
566
- * Used to match `RegExp`
567
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
568
- */
569
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
570
-
571
- /** Used to detect host constructors (Safari). */
572
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
573
-
574
- /** Used for built-in method references. */
575
- var funcProto = Function.prototype,
576
- objectProto = Object.prototype;
577
-
578
- /** Used to resolve the decompiled source of functions. */
579
- var funcToString = funcProto.toString;
580
-
581
- /** Used to check objects for own properties. */
582
- var hasOwnProperty = objectProto.hasOwnProperty;
583
-
584
- /** Used to detect if a method is native. */
585
- var reIsNative = RegExp('^' +
586
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
587
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
588
- );
589
-
590
- /**
591
- * The base implementation of `_.isNative` without bad shim checks.
592
- *
593
- * @private
594
- * @param {*} value The value to check.
595
- * @returns {boolean} Returns `true` if `value` is a native function,
596
- * else `false`.
597
- */
598
- function baseIsNative(value) {
599
- if (!isObject(value) || isMasked(value)) {
600
- return false;
601
- }
602
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
603
- return pattern.test(toSource(value));
604
- }
605
-
606
- _baseIsNative = baseIsNative;
607
- return _baseIsNative;
608
- }
609
-
610
- /**
611
- * Gets the value at `key` of `object`.
612
- *
613
- * @private
614
- * @param {Object} [object] The object to query.
615
- * @param {string} key The key of the property to get.
616
- * @returns {*} Returns the property value.
617
- */
618
-
619
- var _getValue;
620
- var hasRequired_getValue;
621
-
622
- function require_getValue () {
623
- if (hasRequired_getValue) return _getValue;
624
- hasRequired_getValue = 1;
625
- function getValue(object, key) {
626
- return object == null ? undefined : object[key];
627
- }
628
-
629
- _getValue = getValue;
630
- return _getValue;
631
- }
632
-
633
- var _getNative;
634
- var hasRequired_getNative;
635
-
636
- function require_getNative () {
637
- if (hasRequired_getNative) return _getNative;
638
- hasRequired_getNative = 1;
639
- var baseIsNative = require_baseIsNative(),
640
- getValue = require_getValue();
641
-
642
- /**
643
- * Gets the native function at `key` of `object`.
644
- *
645
- * @private
646
- * @param {Object} object The object to query.
647
- * @param {string} key The key of the method to get.
648
- * @returns {*} Returns the function if it's native, else `undefined`.
649
- */
650
- function getNative(object, key) {
651
- var value = getValue(object, key);
652
- return baseIsNative(value) ? value : undefined;
653
- }
654
-
655
- _getNative = getNative;
656
- return _getNative;
657
- }
658
-
659
- var _nativeCreate;
660
- var hasRequired_nativeCreate;
661
-
662
- function require_nativeCreate () {
663
- if (hasRequired_nativeCreate) return _nativeCreate;
664
- hasRequired_nativeCreate = 1;
665
- var getNative = require_getNative();
666
-
667
- /* Built-in method references that are verified to be native. */
668
- var nativeCreate = getNative(Object, 'create');
669
-
670
- _nativeCreate = nativeCreate;
671
- return _nativeCreate;
672
- }
673
-
674
- var _hashClear;
675
- var hasRequired_hashClear;
676
-
677
- function require_hashClear () {
678
- if (hasRequired_hashClear) return _hashClear;
679
- hasRequired_hashClear = 1;
680
- var nativeCreate = require_nativeCreate();
681
-
682
- /**
683
- * Removes all key-value entries from the hash.
684
- *
685
- * @private
686
- * @name clear
687
- * @memberOf Hash
688
- */
689
- function hashClear() {
690
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
691
- this.size = 0;
692
- }
693
-
694
- _hashClear = hashClear;
695
- return _hashClear;
696
- }
697
-
698
- /**
699
- * Removes `key` and its value from the hash.
700
- *
701
- * @private
702
- * @name delete
703
- * @memberOf Hash
704
- * @param {Object} hash The hash to modify.
705
- * @param {string} key The key of the value to remove.
706
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
707
- */
708
-
709
- var _hashDelete;
710
- var hasRequired_hashDelete;
711
-
712
- function require_hashDelete () {
713
- if (hasRequired_hashDelete) return _hashDelete;
714
- hasRequired_hashDelete = 1;
715
- function hashDelete(key) {
716
- var result = this.has(key) && delete this.__data__[key];
717
- this.size -= result ? 1 : 0;
718
- return result;
719
- }
720
-
721
- _hashDelete = hashDelete;
722
- return _hashDelete;
723
- }
724
-
725
- var _hashGet;
726
- var hasRequired_hashGet;
727
-
728
- function require_hashGet () {
729
- if (hasRequired_hashGet) return _hashGet;
730
- hasRequired_hashGet = 1;
731
- var nativeCreate = require_nativeCreate();
732
-
733
- /** Used to stand-in for `undefined` hash values. */
734
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
735
-
736
- /** Used for built-in method references. */
737
- var objectProto = Object.prototype;
738
-
739
- /** Used to check objects for own properties. */
740
- var hasOwnProperty = objectProto.hasOwnProperty;
741
-
742
- /**
743
- * Gets the hash value for `key`.
744
- *
745
- * @private
746
- * @name get
747
- * @memberOf Hash
748
- * @param {string} key The key of the value to get.
749
- * @returns {*} Returns the entry value.
750
- */
751
- function hashGet(key) {
752
- var data = this.__data__;
753
- if (nativeCreate) {
754
- var result = data[key];
755
- return result === HASH_UNDEFINED ? undefined : result;
756
- }
757
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
758
- }
759
-
760
- _hashGet = hashGet;
761
- return _hashGet;
762
- }
763
-
764
- var _hashHas;
765
- var hasRequired_hashHas;
766
-
767
- function require_hashHas () {
768
- if (hasRequired_hashHas) return _hashHas;
769
- hasRequired_hashHas = 1;
770
- var nativeCreate = require_nativeCreate();
771
-
772
- /** Used for built-in method references. */
773
- var objectProto = Object.prototype;
774
-
775
- /** Used to check objects for own properties. */
776
- var hasOwnProperty = objectProto.hasOwnProperty;
777
-
778
- /**
779
- * Checks if a hash value for `key` exists.
780
- *
781
- * @private
782
- * @name has
783
- * @memberOf Hash
784
- * @param {string} key The key of the entry to check.
785
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
786
- */
787
- function hashHas(key) {
788
- var data = this.__data__;
789
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
790
- }
791
-
792
- _hashHas = hashHas;
793
- return _hashHas;
794
- }
795
-
796
- var _hashSet;
797
- var hasRequired_hashSet;
798
-
799
- function require_hashSet () {
800
- if (hasRequired_hashSet) return _hashSet;
801
- hasRequired_hashSet = 1;
802
- var nativeCreate = require_nativeCreate();
803
-
804
- /** Used to stand-in for `undefined` hash values. */
805
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
806
-
807
- /**
808
- * Sets the hash `key` to `value`.
809
- *
810
- * @private
811
- * @name set
812
- * @memberOf Hash
813
- * @param {string} key The key of the value to set.
814
- * @param {*} value The value to set.
815
- * @returns {Object} Returns the hash instance.
816
- */
817
- function hashSet(key, value) {
818
- var data = this.__data__;
819
- this.size += this.has(key) ? 0 : 1;
820
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
821
- return this;
822
- }
823
-
824
- _hashSet = hashSet;
825
- return _hashSet;
826
- }
827
-
828
- var _Hash;
829
- var hasRequired_Hash;
830
-
831
- function require_Hash () {
832
- if (hasRequired_Hash) return _Hash;
833
- hasRequired_Hash = 1;
834
- var hashClear = require_hashClear(),
835
- hashDelete = require_hashDelete(),
836
- hashGet = require_hashGet(),
837
- hashHas = require_hashHas(),
838
- hashSet = require_hashSet();
839
-
840
- /**
841
- * Creates a hash object.
842
- *
843
- * @private
844
- * @constructor
845
- * @param {Array} [entries] The key-value pairs to cache.
846
- */
847
- function Hash(entries) {
848
- var index = -1,
849
- length = entries == null ? 0 : entries.length;
850
-
851
- this.clear();
852
- while (++index < length) {
853
- var entry = entries[index];
854
- this.set(entry[0], entry[1]);
855
- }
856
- }
857
-
858
- // Add methods to `Hash`.
859
- Hash.prototype.clear = hashClear;
860
- Hash.prototype['delete'] = hashDelete;
861
- Hash.prototype.get = hashGet;
862
- Hash.prototype.has = hashHas;
863
- Hash.prototype.set = hashSet;
864
-
865
- _Hash = Hash;
866
- return _Hash;
867
- }
868
-
869
- /**
870
- * Removes all key-value entries from the list cache.
871
- *
872
- * @private
873
- * @name clear
874
- * @memberOf ListCache
875
- */
876
-
877
- var _listCacheClear;
878
- var hasRequired_listCacheClear;
879
-
880
- function require_listCacheClear () {
881
- if (hasRequired_listCacheClear) return _listCacheClear;
882
- hasRequired_listCacheClear = 1;
883
- function listCacheClear() {
884
- this.__data__ = [];
885
- this.size = 0;
886
- }
887
-
888
- _listCacheClear = listCacheClear;
889
- return _listCacheClear;
890
- }
891
-
892
- /**
893
- * Performs a
894
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
895
- * comparison between two values to determine if they are equivalent.
896
- *
897
- * @static
898
- * @memberOf _
899
- * @since 4.0.0
900
- * @category Lang
901
- * @param {*} value The value to compare.
902
- * @param {*} other The other value to compare.
903
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
904
- * @example
905
- *
906
- * var object = { 'a': 1 };
907
- * var other = { 'a': 1 };
908
- *
909
- * _.eq(object, object);
910
- * // => true
911
- *
912
- * _.eq(object, other);
913
- * // => false
914
- *
915
- * _.eq('a', 'a');
916
- * // => true
917
- *
918
- * _.eq('a', Object('a'));
919
- * // => false
920
- *
921
- * _.eq(NaN, NaN);
922
- * // => true
923
- */
924
-
925
- var eq_1;
926
- var hasRequiredEq;
927
-
928
- function requireEq () {
929
- if (hasRequiredEq) return eq_1;
930
- hasRequiredEq = 1;
931
- function eq(value, other) {
932
- return value === other || (value !== value && other !== other);
933
- }
934
-
935
- eq_1 = eq;
936
- return eq_1;
937
- }
938
-
939
- var _assocIndexOf;
940
- var hasRequired_assocIndexOf;
941
-
942
- function require_assocIndexOf () {
943
- if (hasRequired_assocIndexOf) return _assocIndexOf;
944
- hasRequired_assocIndexOf = 1;
945
- var eq = requireEq();
946
-
947
- /**
948
- * Gets the index at which the `key` is found in `array` of key-value pairs.
949
- *
950
- * @private
951
- * @param {Array} array The array to inspect.
952
- * @param {*} key The key to search for.
953
- * @returns {number} Returns the index of the matched value, else `-1`.
954
- */
955
- function assocIndexOf(array, key) {
956
- var length = array.length;
957
- while (length--) {
958
- if (eq(array[length][0], key)) {
959
- return length;
960
- }
961
- }
962
- return -1;
963
- }
964
-
965
- _assocIndexOf = assocIndexOf;
966
- return _assocIndexOf;
967
- }
968
-
969
- var _listCacheDelete;
970
- var hasRequired_listCacheDelete;
971
-
972
- function require_listCacheDelete () {
973
- if (hasRequired_listCacheDelete) return _listCacheDelete;
974
- hasRequired_listCacheDelete = 1;
975
- var assocIndexOf = require_assocIndexOf();
976
-
977
- /** Used for built-in method references. */
978
- var arrayProto = Array.prototype;
979
-
980
- /** Built-in value references. */
981
- var splice = arrayProto.splice;
982
-
983
- /**
984
- * Removes `key` and its value from the list cache.
985
- *
986
- * @private
987
- * @name delete
988
- * @memberOf ListCache
989
- * @param {string} key The key of the value to remove.
990
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
991
- */
992
- function listCacheDelete(key) {
993
- var data = this.__data__,
994
- index = assocIndexOf(data, key);
995
-
996
- if (index < 0) {
997
- return false;
998
- }
999
- var lastIndex = data.length - 1;
1000
- if (index == lastIndex) {
1001
- data.pop();
1002
- } else {
1003
- splice.call(data, index, 1);
1004
- }
1005
- --this.size;
1006
- return true;
1007
- }
1008
-
1009
- _listCacheDelete = listCacheDelete;
1010
- return _listCacheDelete;
1011
- }
1012
-
1013
- var _listCacheGet;
1014
- var hasRequired_listCacheGet;
1015
-
1016
- function require_listCacheGet () {
1017
- if (hasRequired_listCacheGet) return _listCacheGet;
1018
- hasRequired_listCacheGet = 1;
1019
- var assocIndexOf = require_assocIndexOf();
1020
-
1021
- /**
1022
- * Gets the list cache value for `key`.
1023
- *
1024
- * @private
1025
- * @name get
1026
- * @memberOf ListCache
1027
- * @param {string} key The key of the value to get.
1028
- * @returns {*} Returns the entry value.
1029
- */
1030
- function listCacheGet(key) {
1031
- var data = this.__data__,
1032
- index = assocIndexOf(data, key);
1033
-
1034
- return index < 0 ? undefined : data[index][1];
1035
- }
1036
-
1037
- _listCacheGet = listCacheGet;
1038
- return _listCacheGet;
1039
- }
1040
-
1041
- var _listCacheHas;
1042
- var hasRequired_listCacheHas;
1043
-
1044
- function require_listCacheHas () {
1045
- if (hasRequired_listCacheHas) return _listCacheHas;
1046
- hasRequired_listCacheHas = 1;
1047
- var assocIndexOf = require_assocIndexOf();
1048
-
1049
- /**
1050
- * Checks if a list cache value for `key` exists.
1051
- *
1052
- * @private
1053
- * @name has
1054
- * @memberOf ListCache
1055
- * @param {string} key The key of the entry to check.
1056
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1057
- */
1058
- function listCacheHas(key) {
1059
- return assocIndexOf(this.__data__, key) > -1;
1060
- }
1061
-
1062
- _listCacheHas = listCacheHas;
1063
- return _listCacheHas;
1064
- }
1065
-
1066
- var _listCacheSet;
1067
- var hasRequired_listCacheSet;
1068
-
1069
- function require_listCacheSet () {
1070
- if (hasRequired_listCacheSet) return _listCacheSet;
1071
- hasRequired_listCacheSet = 1;
1072
- var assocIndexOf = require_assocIndexOf();
1073
-
1074
- /**
1075
- * Sets the list cache `key` to `value`.
1076
- *
1077
- * @private
1078
- * @name set
1079
- * @memberOf ListCache
1080
- * @param {string} key The key of the value to set.
1081
- * @param {*} value The value to set.
1082
- * @returns {Object} Returns the list cache instance.
1083
- */
1084
- function listCacheSet(key, value) {
1085
- var data = this.__data__,
1086
- index = assocIndexOf(data, key);
1087
-
1088
- if (index < 0) {
1089
- ++this.size;
1090
- data.push([key, value]);
1091
- } else {
1092
- data[index][1] = value;
1093
- }
1094
- return this;
1095
- }
1096
-
1097
- _listCacheSet = listCacheSet;
1098
- return _listCacheSet;
1099
- }
1100
-
1101
- var _ListCache;
1102
- var hasRequired_ListCache;
1103
-
1104
- function require_ListCache () {
1105
- if (hasRequired_ListCache) return _ListCache;
1106
- hasRequired_ListCache = 1;
1107
- var listCacheClear = require_listCacheClear(),
1108
- listCacheDelete = require_listCacheDelete(),
1109
- listCacheGet = require_listCacheGet(),
1110
- listCacheHas = require_listCacheHas(),
1111
- listCacheSet = require_listCacheSet();
1112
-
1113
- /**
1114
- * Creates an list cache object.
1115
- *
1116
- * @private
1117
- * @constructor
1118
- * @param {Array} [entries] The key-value pairs to cache.
1119
- */
1120
- function ListCache(entries) {
1121
- var index = -1,
1122
- length = entries == null ? 0 : entries.length;
1123
-
1124
- this.clear();
1125
- while (++index < length) {
1126
- var entry = entries[index];
1127
- this.set(entry[0], entry[1]);
1128
- }
1129
- }
1130
-
1131
- // Add methods to `ListCache`.
1132
- ListCache.prototype.clear = listCacheClear;
1133
- ListCache.prototype['delete'] = listCacheDelete;
1134
- ListCache.prototype.get = listCacheGet;
1135
- ListCache.prototype.has = listCacheHas;
1136
- ListCache.prototype.set = listCacheSet;
1137
-
1138
- _ListCache = ListCache;
1139
- return _ListCache;
1140
- }
1141
-
1142
- var _Map;
1143
- var hasRequired_Map;
1144
-
1145
- function require_Map () {
1146
- if (hasRequired_Map) return _Map;
1147
- hasRequired_Map = 1;
1148
- var getNative = require_getNative(),
1149
- root = require_root();
1150
-
1151
- /* Built-in method references that are verified to be native. */
1152
- var Map = getNative(root, 'Map');
1153
-
1154
- _Map = Map;
1155
- return _Map;
1156
- }
1157
-
1158
- var _mapCacheClear;
1159
- var hasRequired_mapCacheClear;
1160
-
1161
- function require_mapCacheClear () {
1162
- if (hasRequired_mapCacheClear) return _mapCacheClear;
1163
- hasRequired_mapCacheClear = 1;
1164
- var Hash = require_Hash(),
1165
- ListCache = require_ListCache(),
1166
- Map = require_Map();
1167
-
1168
- /**
1169
- * Removes all key-value entries from the map.
1170
- *
1171
- * @private
1172
- * @name clear
1173
- * @memberOf MapCache
1174
- */
1175
- function mapCacheClear() {
1176
- this.size = 0;
1177
- this.__data__ = {
1178
- 'hash': new Hash,
1179
- 'map': new (Map || ListCache),
1180
- 'string': new Hash
1181
- };
1182
- }
1183
-
1184
- _mapCacheClear = mapCacheClear;
1185
- return _mapCacheClear;
1186
- }
1187
-
1188
- /**
1189
- * Checks if `value` is suitable for use as unique object key.
1190
- *
1191
- * @private
1192
- * @param {*} value The value to check.
1193
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1194
- */
1195
-
1196
- var _isKeyable;
1197
- var hasRequired_isKeyable;
1198
-
1199
- function require_isKeyable () {
1200
- if (hasRequired_isKeyable) return _isKeyable;
1201
- hasRequired_isKeyable = 1;
1202
- function isKeyable(value) {
1203
- var type = typeof value;
1204
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1205
- ? (value !== '__proto__')
1206
- : (value === null);
1207
- }
1208
-
1209
- _isKeyable = isKeyable;
1210
- return _isKeyable;
1211
- }
1212
-
1213
- var _getMapData;
1214
- var hasRequired_getMapData;
1215
-
1216
- function require_getMapData () {
1217
- if (hasRequired_getMapData) return _getMapData;
1218
- hasRequired_getMapData = 1;
1219
- var isKeyable = require_isKeyable();
1220
-
1221
- /**
1222
- * Gets the data for `map`.
1223
- *
1224
- * @private
1225
- * @param {Object} map The map to query.
1226
- * @param {string} key The reference key.
1227
- * @returns {*} Returns the map data.
1228
- */
1229
- function getMapData(map, key) {
1230
- var data = map.__data__;
1231
- return isKeyable(key)
1232
- ? data[typeof key == 'string' ? 'string' : 'hash']
1233
- : data.map;
1234
- }
1235
-
1236
- _getMapData = getMapData;
1237
- return _getMapData;
1238
- }
1239
-
1240
- var _mapCacheDelete;
1241
- var hasRequired_mapCacheDelete;
1242
-
1243
- function require_mapCacheDelete () {
1244
- if (hasRequired_mapCacheDelete) return _mapCacheDelete;
1245
- hasRequired_mapCacheDelete = 1;
1246
- var getMapData = require_getMapData();
1247
-
1248
- /**
1249
- * Removes `key` and its value from the map.
1250
- *
1251
- * @private
1252
- * @name delete
1253
- * @memberOf MapCache
1254
- * @param {string} key The key of the value to remove.
1255
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1256
- */
1257
- function mapCacheDelete(key) {
1258
- var result = getMapData(this, key)['delete'](key);
1259
- this.size -= result ? 1 : 0;
1260
- return result;
1261
- }
1262
-
1263
- _mapCacheDelete = mapCacheDelete;
1264
- return _mapCacheDelete;
1265
- }
1266
-
1267
- var _mapCacheGet;
1268
- var hasRequired_mapCacheGet;
1269
-
1270
- function require_mapCacheGet () {
1271
- if (hasRequired_mapCacheGet) return _mapCacheGet;
1272
- hasRequired_mapCacheGet = 1;
1273
- var getMapData = require_getMapData();
1274
-
1275
- /**
1276
- * Gets the map value for `key`.
1277
- *
1278
- * @private
1279
- * @name get
1280
- * @memberOf MapCache
1281
- * @param {string} key The key of the value to get.
1282
- * @returns {*} Returns the entry value.
1283
- */
1284
- function mapCacheGet(key) {
1285
- return getMapData(this, key).get(key);
1286
- }
1287
-
1288
- _mapCacheGet = mapCacheGet;
1289
- return _mapCacheGet;
1290
- }
1291
-
1292
- var _mapCacheHas;
1293
- var hasRequired_mapCacheHas;
1294
-
1295
- function require_mapCacheHas () {
1296
- if (hasRequired_mapCacheHas) return _mapCacheHas;
1297
- hasRequired_mapCacheHas = 1;
1298
- var getMapData = require_getMapData();
1299
-
1300
- /**
1301
- * Checks if a map value for `key` exists.
1302
- *
1303
- * @private
1304
- * @name has
1305
- * @memberOf MapCache
1306
- * @param {string} key The key of the entry to check.
1307
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1308
- */
1309
- function mapCacheHas(key) {
1310
- return getMapData(this, key).has(key);
1311
- }
1312
-
1313
- _mapCacheHas = mapCacheHas;
1314
- return _mapCacheHas;
1315
- }
1316
-
1317
- var _mapCacheSet;
1318
- var hasRequired_mapCacheSet;
1319
-
1320
- function require_mapCacheSet () {
1321
- if (hasRequired_mapCacheSet) return _mapCacheSet;
1322
- hasRequired_mapCacheSet = 1;
1323
- var getMapData = require_getMapData();
1324
-
1325
- /**
1326
- * Sets the map `key` to `value`.
1327
- *
1328
- * @private
1329
- * @name set
1330
- * @memberOf MapCache
1331
- * @param {string} key The key of the value to set.
1332
- * @param {*} value The value to set.
1333
- * @returns {Object} Returns the map cache instance.
1334
- */
1335
- function mapCacheSet(key, value) {
1336
- var data = getMapData(this, key),
1337
- size = data.size;
1338
-
1339
- data.set(key, value);
1340
- this.size += data.size == size ? 0 : 1;
1341
- return this;
1342
- }
1343
-
1344
- _mapCacheSet = mapCacheSet;
1345
- return _mapCacheSet;
1346
- }
1347
-
1348
- var _MapCache;
1349
- var hasRequired_MapCache;
1350
-
1351
- function require_MapCache () {
1352
- if (hasRequired_MapCache) return _MapCache;
1353
- hasRequired_MapCache = 1;
1354
- var mapCacheClear = require_mapCacheClear(),
1355
- mapCacheDelete = require_mapCacheDelete(),
1356
- mapCacheGet = require_mapCacheGet(),
1357
- mapCacheHas = require_mapCacheHas(),
1358
- mapCacheSet = require_mapCacheSet();
1359
-
1360
- /**
1361
- * Creates a map cache object to store key-value pairs.
1362
- *
1363
- * @private
1364
- * @constructor
1365
- * @param {Array} [entries] The key-value pairs to cache.
1366
- */
1367
- function MapCache(entries) {
1368
- var index = -1,
1369
- length = entries == null ? 0 : entries.length;
1370
-
1371
- this.clear();
1372
- while (++index < length) {
1373
- var entry = entries[index];
1374
- this.set(entry[0], entry[1]);
1375
- }
1376
- }
1377
-
1378
- // Add methods to `MapCache`.
1379
- MapCache.prototype.clear = mapCacheClear;
1380
- MapCache.prototype['delete'] = mapCacheDelete;
1381
- MapCache.prototype.get = mapCacheGet;
1382
- MapCache.prototype.has = mapCacheHas;
1383
- MapCache.prototype.set = mapCacheSet;
1384
-
1385
- _MapCache = MapCache;
1386
- return _MapCache;
1387
- }
1388
-
1389
- var memoize_1;
1390
- var hasRequiredMemoize;
1391
-
1392
- function requireMemoize () {
1393
- if (hasRequiredMemoize) return memoize_1;
1394
- hasRequiredMemoize = 1;
1395
- var MapCache = require_MapCache();
1396
-
1397
- /** Error message constants. */
1398
- var FUNC_ERROR_TEXT = 'Expected a function';
1399
-
1400
- /**
1401
- * Creates a function that memoizes the result of `func`. If `resolver` is
1402
- * provided, it determines the cache key for storing the result based on the
1403
- * arguments provided to the memoized function. By default, the first argument
1404
- * provided to the memoized function is used as the map cache key. The `func`
1405
- * is invoked with the `this` binding of the memoized function.
1406
- *
1407
- * **Note:** The cache is exposed as the `cache` property on the memoized
1408
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
1409
- * constructor with one whose instances implement the
1410
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1411
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1412
- *
1413
- * @static
1414
- * @memberOf _
1415
- * @since 0.1.0
1416
- * @category Function
1417
- * @param {Function} func The function to have its output memoized.
1418
- * @param {Function} [resolver] The function to resolve the cache key.
1419
- * @returns {Function} Returns the new memoized function.
1420
- * @example
1421
- *
1422
- * var object = { 'a': 1, 'b': 2 };
1423
- * var other = { 'c': 3, 'd': 4 };
1424
- *
1425
- * var values = _.memoize(_.values);
1426
- * values(object);
1427
- * // => [1, 2]
1428
- *
1429
- * values(other);
1430
- * // => [3, 4]
1431
- *
1432
- * object.a = 2;
1433
- * values(object);
1434
- * // => [1, 2]
1435
- *
1436
- * // Modify the result cache.
1437
- * values.cache.set(object, ['a', 'b']);
1438
- * values(object);
1439
- * // => ['a', 'b']
1440
- *
1441
- * // Replace `_.memoize.Cache`.
1442
- * _.memoize.Cache = WeakMap;
1443
- */
1444
- function memoize(func, resolver) {
1445
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1446
- throw new TypeError(FUNC_ERROR_TEXT);
1447
- }
1448
- var memoized = function() {
1449
- var args = arguments,
1450
- key = resolver ? resolver.apply(this, args) : args[0],
1451
- cache = memoized.cache;
1452
-
1453
- if (cache.has(key)) {
1454
- return cache.get(key);
1455
- }
1456
- var result = func.apply(this, args);
1457
- memoized.cache = cache.set(key, result) || cache;
1458
- return result;
1459
- };
1460
- memoized.cache = new (memoize.Cache || MapCache);
1461
- return memoized;
1462
- }
1463
-
1464
- // Expose `MapCache`.
1465
- memoize.Cache = MapCache;
1466
-
1467
- memoize_1 = memoize;
1468
- return memoize_1;
1469
- }
1470
-
1471
- var _memoizeCapped;
1472
- var hasRequired_memoizeCapped;
1473
-
1474
- function require_memoizeCapped () {
1475
- if (hasRequired_memoizeCapped) return _memoizeCapped;
1476
- hasRequired_memoizeCapped = 1;
1477
- var memoize = requireMemoize();
1478
-
1479
- /** Used as the maximum memoize cache size. */
1480
- var MAX_MEMOIZE_SIZE = 500;
1481
-
1482
- /**
1483
- * A specialized version of `_.memoize` which clears the memoized function's
1484
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1485
- *
1486
- * @private
1487
- * @param {Function} func The function to have its output memoized.
1488
- * @returns {Function} Returns the new memoized function.
1489
- */
1490
- function memoizeCapped(func) {
1491
- var result = memoize(func, function(key) {
1492
- if (cache.size === MAX_MEMOIZE_SIZE) {
1493
- cache.clear();
1494
- }
1495
- return key;
1496
- });
1497
-
1498
- var cache = result.cache;
1499
- return result;
1500
- }
1501
-
1502
- _memoizeCapped = memoizeCapped;
1503
- return _memoizeCapped;
1504
- }
1505
-
1506
- var _stringToPath;
1507
- var hasRequired_stringToPath;
1508
-
1509
- function require_stringToPath () {
1510
- if (hasRequired_stringToPath) return _stringToPath;
1511
- hasRequired_stringToPath = 1;
1512
- var memoizeCapped = require_memoizeCapped();
1513
-
1514
- /** Used to match property names within property paths. */
1515
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1516
-
1517
- /** Used to match backslashes in property paths. */
1518
- var reEscapeChar = /\\(\\)?/g;
1519
-
1520
- /**
1521
- * Converts `string` to a property path array.
1522
- *
1523
- * @private
1524
- * @param {string} string The string to convert.
1525
- * @returns {Array} Returns the property path array.
1526
- */
1527
- var stringToPath = memoizeCapped(function(string) {
1528
- var result = [];
1529
- if (string.charCodeAt(0) === 46 /* . */) {
1530
- result.push('');
1531
- }
1532
- string.replace(rePropName, function(match, number, quote, subString) {
1533
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1534
- });
1535
- return result;
1536
- });
1537
-
1538
- _stringToPath = stringToPath;
1539
- return _stringToPath;
1540
- }
1541
-
1542
- /**
1543
- * A specialized version of `_.map` for arrays without support for iteratee
1544
- * shorthands.
1545
- *
1546
- * @private
1547
- * @param {Array} [array] The array to iterate over.
1548
- * @param {Function} iteratee The function invoked per iteration.
1549
- * @returns {Array} Returns the new mapped array.
1550
- */
1551
-
1552
- var _arrayMap;
1553
- var hasRequired_arrayMap;
1554
-
1555
- function require_arrayMap () {
1556
- if (hasRequired_arrayMap) return _arrayMap;
1557
- hasRequired_arrayMap = 1;
1558
- function arrayMap(array, iteratee) {
1559
- var index = -1,
1560
- length = array == null ? 0 : array.length,
1561
- result = Array(length);
1562
-
1563
- while (++index < length) {
1564
- result[index] = iteratee(array[index], index, array);
1565
- }
1566
- return result;
1567
- }
1568
-
1569
- _arrayMap = arrayMap;
1570
- return _arrayMap;
1571
- }
1572
-
1573
- var _baseToString;
1574
- var hasRequired_baseToString;
1575
-
1576
- function require_baseToString () {
1577
- if (hasRequired_baseToString) return _baseToString;
1578
- hasRequired_baseToString = 1;
1579
- var Symbol = require_Symbol(),
1580
- arrayMap = require_arrayMap(),
1581
- isArray = requireIsArray(),
1582
- isSymbol = requireIsSymbol();
1583
-
1584
- /** Used as references for various `Number` constants. */
1585
- var INFINITY = 1 / 0;
1586
-
1587
- /** Used to convert symbols to primitives and strings. */
1588
- var symbolProto = Symbol ? Symbol.prototype : undefined,
1589
- symbolToString = symbolProto ? symbolProto.toString : undefined;
1590
-
1591
- /**
1592
- * The base implementation of `_.toString` which doesn't convert nullish
1593
- * values to empty strings.
1594
- *
1595
- * @private
1596
- * @param {*} value The value to process.
1597
- * @returns {string} Returns the string.
1598
- */
1599
- function baseToString(value) {
1600
- // Exit early for strings to avoid a performance hit in some environments.
1601
- if (typeof value == 'string') {
1602
- return value;
1603
- }
1604
- if (isArray(value)) {
1605
- // Recursively convert values (susceptible to call stack limits).
1606
- return arrayMap(value, baseToString) + '';
1607
- }
1608
- if (isSymbol(value)) {
1609
- return symbolToString ? symbolToString.call(value) : '';
1610
- }
1611
- var result = (value + '');
1612
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1613
- }
1614
-
1615
- _baseToString = baseToString;
1616
- return _baseToString;
1617
- }
1618
-
1619
- var toString_1;
1620
- var hasRequiredToString;
1621
-
1622
- function requireToString () {
1623
- if (hasRequiredToString) return toString_1;
1624
- hasRequiredToString = 1;
1625
- var baseToString = require_baseToString();
1626
-
1627
- /**
1628
- * Converts `value` to a string. An empty string is returned for `null`
1629
- * and `undefined` values. The sign of `-0` is preserved.
1630
- *
1631
- * @static
1632
- * @memberOf _
1633
- * @since 4.0.0
1634
- * @category Lang
1635
- * @param {*} value The value to convert.
1636
- * @returns {string} Returns the converted string.
1637
- * @example
1638
- *
1639
- * _.toString(null);
1640
- * // => ''
1641
- *
1642
- * _.toString(-0);
1643
- * // => '-0'
1644
- *
1645
- * _.toString([1, 2, 3]);
1646
- * // => '1,2,3'
1647
- */
1648
- function toString(value) {
1649
- return value == null ? '' : baseToString(value);
1650
- }
1651
-
1652
- toString_1 = toString;
1653
- return toString_1;
1654
- }
1655
-
1656
- var _castPath;
1657
- var hasRequired_castPath;
1658
-
1659
- function require_castPath () {
1660
- if (hasRequired_castPath) return _castPath;
1661
- hasRequired_castPath = 1;
1662
- var isArray = requireIsArray(),
1663
- isKey = require_isKey(),
1664
- stringToPath = require_stringToPath(),
1665
- toString = requireToString();
1666
-
1667
- /**
1668
- * Casts `value` to a path array if it's not one.
1669
- *
1670
- * @private
1671
- * @param {*} value The value to inspect.
1672
- * @param {Object} [object] The object to query keys on.
1673
- * @returns {Array} Returns the cast property path array.
1674
- */
1675
- function castPath(value, object) {
1676
- if (isArray(value)) {
1677
- return value;
1678
- }
1679
- return isKey(value, object) ? [value] : stringToPath(toString(value));
1680
- }
1681
-
1682
- _castPath = castPath;
1683
- return _castPath;
1684
- }
1685
-
1686
- var _toKey;
1687
- var hasRequired_toKey;
1688
-
1689
- function require_toKey () {
1690
- if (hasRequired_toKey) return _toKey;
1691
- hasRequired_toKey = 1;
1692
- var isSymbol = requireIsSymbol();
1693
-
1694
- /** Used as references for various `Number` constants. */
1695
- var INFINITY = 1 / 0;
1696
-
1697
- /**
1698
- * Converts `value` to a string key if it's not a string or symbol.
1699
- *
1700
- * @private
1701
- * @param {*} value The value to inspect.
1702
- * @returns {string|symbol} Returns the key.
1703
- */
1704
- function toKey(value) {
1705
- if (typeof value == 'string' || isSymbol(value)) {
1706
- return value;
1707
- }
1708
- var result = (value + '');
1709
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1710
- }
1711
-
1712
- _toKey = toKey;
1713
- return _toKey;
1714
- }
1715
-
1716
- var _baseGet;
1717
- var hasRequired_baseGet;
1718
-
1719
- function require_baseGet () {
1720
- if (hasRequired_baseGet) return _baseGet;
1721
- hasRequired_baseGet = 1;
1722
- var castPath = require_castPath(),
1723
- toKey = require_toKey();
1724
-
1725
- /**
1726
- * The base implementation of `_.get` without support for default values.
1727
- *
1728
- * @private
1729
- * @param {Object} object The object to query.
1730
- * @param {Array|string} path The path of the property to get.
1731
- * @returns {*} Returns the resolved value.
1732
- */
1733
- function baseGet(object, path) {
1734
- path = castPath(path, object);
1735
-
1736
- var index = 0,
1737
- length = path.length;
1738
-
1739
- while (object != null && index < length) {
1740
- object = object[toKey(path[index++])];
1741
- }
1742
- return (index && index == length) ? object : undefined;
1743
- }
1744
-
1745
- _baseGet = baseGet;
1746
- return _baseGet;
1747
- }
1748
-
1749
- var get_1;
1750
- var hasRequiredGet;
1751
-
1752
- function requireGet () {
1753
- if (hasRequiredGet) return get_1;
1754
- hasRequiredGet = 1;
1755
- var baseGet = require_baseGet();
1756
-
1757
- /**
1758
- * Gets the value at `path` of `object`. If the resolved value is
1759
- * `undefined`, the `defaultValue` is returned in its place.
1760
- *
1761
- * @static
1762
- * @memberOf _
1763
- * @since 3.7.0
1764
- * @category Object
1765
- * @param {Object} object The object to query.
1766
- * @param {Array|string} path The path of the property to get.
1767
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1768
- * @returns {*} Returns the resolved value.
1769
- * @example
1770
- *
1771
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1772
- *
1773
- * _.get(object, 'a[0].b.c');
1774
- * // => 3
1775
- *
1776
- * _.get(object, ['a', '0', 'b', 'c']);
1777
- * // => 3
1778
- *
1779
- * _.get(object, 'a.b.c', 'default');
1780
- * // => 'default'
1781
- */
1782
- function get(object, path, defaultValue) {
1783
- var result = object == null ? undefined : baseGet(object, path);
1784
- return result === undefined ? defaultValue : result;
1785
- }
1786
-
1787
- get_1 = get;
1788
- return get_1;
1789
- }
1790
-
1791
- var getExports = requireGet();
1792
- const get = /*@__PURE__*/getDefaultExportFromCjs(getExports);
1793
-
1794
- function checkType(value, condition) {
1795
- if (condition) {
1796
- return true;
1797
- }
1798
- return false;
1799
- }
1800
-
1801
- function isArray(value) {
1802
- return Boolean(value && Array.isArray(value));
1803
- }
1804
-
1805
- function isBoolean(value) {
1806
- return typeof value === "boolean";
1807
- }
1808
-
1809
- function isNumber(value) {
1810
- return typeof value === "number" && !Number.isNaN(value);
1811
- }
1812
-
1813
- function isString(value) {
1814
- return typeof value === "string";
1815
- }
1816
-
1817
- function isId(value) {
1818
- return isNumber(value) || isString(value);
1819
- }
1820
-
1821
- function isNull(value) {
1822
- return value === null;
1823
- }
1824
-
1825
- function isNullable(value) {
1826
- return typeof value === "undefined" || value === null;
1827
- }
1828
-
1829
- function isObject(value) {
1830
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
1831
- }
1832
-
1833
- function isUndefined(value) {
1834
- return typeof value === "undefined";
1835
- }
1836
-
1837
- function isDate(value) {
1838
- if (value instanceof Date)
1839
- return !Number.isNaN(value.valueOf());
1840
- return false;
1841
- }
1842
-
1843
- function getByPath(data, path, defaultValue = undefined) {
1844
- if ((!isObject(data) && !isArray(data)) || !isString(path))
1845
- return defaultValue;
1846
- return get(data, path, defaultValue);
1847
- }
1848
-
1849
- var dayjs_min$1 = {exports: {}};
1850
-
1851
- var dayjs_min = dayjs_min$1.exports;
1852
-
1853
- var hasRequiredDayjs_min;
1854
-
1855
- function requireDayjs_min () {
1856
- if (hasRequiredDayjs_min) return dayjs_min$1.exports;
1857
- hasRequiredDayjs_min = 1;
1858
- (function (module, exports) {
1859
- !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
1860
- } (dayjs_min$1));
1861
- return dayjs_min$1.exports;
1862
- }
1863
-
1864
- var dayjs_minExports = requireDayjs_min();
1865
- const dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
1866
-
1867
- function dateDifference(type, firstDate, secondDate = new Date(), float = false) {
1868
- const first = dayjs(firstDate);
1869
- return first.diff(secondDate, type, float);
1870
- }
1871
-
1872
- function getDateByRules(rules, date = new Date()) {
1873
- let result = new Date(date);
1874
- for (const rule of rules) {
1875
- result = getDate(rule.increment, rule.type, result);
1876
- }
1877
- return result;
1878
- }
1879
- function getDate(increment, type, date = new Date()) {
1880
- const result = new Date(date);
1881
- switch (type) {
1882
- case DATE_TYPES.Days: {
1883
- result.setDate(result.getDate() + increment);
1884
- return result;
1885
- }
1886
- case DATE_TYPES.Months: {
1887
- result.setMonth(result.getMonth() + increment);
1888
- return result;
1889
- }
1890
- case DATE_TYPES.Years: {
1891
- result.setFullYear(result.getFullYear() + increment);
1892
- return result;
1893
- }
1894
- case DATE_TYPES.Seconds: {
1895
- result.setSeconds(result.getSeconds() + increment);
1896
- return result;
1897
- }
1898
- case DATE_TYPES.Minutes: {
1899
- result.setMinutes(result.getMinutes() + increment);
1900
- return result;
1901
- }
1902
- case DATE_TYPES.Hours: {
1903
- result.setHours(result.getHours() + increment);
1904
- return result;
1905
- }
1906
- default:
1907
- return result;
1908
- }
1909
- }
1910
-
1911
- function getToday() {
1912
- const startToday = new Date();
1913
- startToday.setHours(0, 0, 0, 0);
1914
- const endToday = new Date();
1915
- endToday.setHours(23, 59, 59, 999);
1916
- return { startToday, endToday };
1917
- }
1918
-
1919
- function getTomorrow() {
1920
- const tomorrow = new Date();
1921
- tomorrow.setHours(0, 0, 0, 0);
1922
- tomorrow.setDate(tomorrow.getDate() + 1);
1923
- return tomorrow;
1924
- }
1925
-
1926
- function getYesterday() {
1927
- const yesterday = new Date();
1928
- yesterday.setHours(0, 0, 0, 0);
1929
- yesterday.setDate(yesterday.getDate() - 1);
1930
- return yesterday;
1931
- }
1932
-
1933
- var isToday$2 = {exports: {}};
1934
-
1935
- var isToday$1 = isToday$2.exports;
1936
-
1937
- var hasRequiredIsToday;
1938
-
1939
- function requireIsToday () {
1940
- if (hasRequiredIsToday) return isToday$2.exports;
1941
- hasRequiredIsToday = 1;
1942
- (function (module, exports) {
1943
- !function(e,o){module.exports=o();}(isToday$1,(function(){return function(e,o,t){o.prototype.isToday=function(){var e="YYYY-MM-DD",o=t();return this.format(e)===o.format(e)};}}));
1944
- } (isToday$2));
1945
- return isToday$2.exports;
1946
- }
1947
-
1948
- var isTodayExports = requireIsToday();
1949
- const todayPlugin = /*@__PURE__*/getDefaultExportFromCjs(isTodayExports);
1950
-
1951
- dayjs.extend(todayPlugin);
1952
- function isToday(date) {
1953
- try {
1954
- return dayjs(date).isToday();
1955
- }
1956
- catch {
1957
- return false;
1958
- }
1959
- }
1960
-
1961
- var isTomorrow$2 = {exports: {}};
1962
-
1963
- var isTomorrow$1 = isTomorrow$2.exports;
1964
-
1965
- var hasRequiredIsTomorrow;
1966
-
1967
- function requireIsTomorrow () {
1968
- if (hasRequiredIsTomorrow) return isTomorrow$2.exports;
1969
- hasRequiredIsTomorrow = 1;
1970
- (function (module, exports) {
1971
- !function(o,e){module.exports=e();}(isTomorrow$1,(function(){return function(o,e,t){e.prototype.isTomorrow=function(){var o="YYYY-MM-DD",e=t().add(1,"day");return this.format(o)===e.format(o)};}}));
1972
- } (isTomorrow$2));
1973
- return isTomorrow$2.exports;
1974
- }
1975
-
1976
- var isTomorrowExports = requireIsTomorrow();
1977
- const tomorrowPlugin = /*@__PURE__*/getDefaultExportFromCjs(isTomorrowExports);
1978
-
1979
- dayjs.extend(tomorrowPlugin);
1980
- function isTomorrow(date) {
1981
- try {
1982
- return dayjs(date).isTomorrow();
1983
- }
1984
- catch {
1985
- return false;
1986
- }
1987
- }
1988
-
1989
- var isYesterday$2 = {exports: {}};
1990
-
1991
- var isYesterday$1 = isYesterday$2.exports;
1992
-
1993
- var hasRequiredIsYesterday;
1994
-
1995
- function requireIsYesterday () {
1996
- if (hasRequiredIsYesterday) return isYesterday$2.exports;
1997
- hasRequiredIsYesterday = 1;
1998
- (function (module, exports) {
1999
- !function(e,t){module.exports=t();}(isYesterday$1,(function(){return function(e,t,n){t.prototype.isYesterday=function(){var e="YYYY-MM-DD",t=n().subtract(1,"day");return this.format(e)===t.format(e)};}}));
2000
- } (isYesterday$2));
2001
- return isYesterday$2.exports;
2002
- }
2003
-
2004
- var isYesterdayExports = requireIsYesterday();
2005
- const yesterdayPlugin = /*@__PURE__*/getDefaultExportFromCjs(isYesterdayExports);
2006
-
2007
- dayjs.extend(yesterdayPlugin);
2008
- function isYesterday(date) {
2009
- try {
2010
- return dayjs(date).isYesterday();
2011
- }
2012
- catch {
2013
- return false;
2014
- }
2015
- }
2016
-
2017
- function dateFormat(date, format) {
2018
- const correctDate = new Date(date);
2019
- if (!isDate(correctDate))
2020
- return "";
2021
- return dayjs(correctDate).format(format);
2022
- }
2023
-
2024
- function transformToNumber(value) {
2025
- let result;
2026
- if (isString(value))
2027
- result = parseInt(value, 10);
2028
- else
2029
- result = Number(value);
2030
- return Number.isNaN(result) ? 0 : result;
2031
- }
2032
-
2033
- function fieldViewFormat(field, type = "string") {
2034
- switch (type) {
2035
- case FIELD_TYPES.Array: {
2036
- return isArray(field) ? field.join(", ") : "";
2037
- }
2038
- case FIELD_TYPES.Date: {
2039
- return isString(field) || isNumber(field) || isDate(field)
2040
- ? dateFormat(field, "DD.MM.YYYY")
2041
- : "";
2042
- }
2043
- case FIELD_TYPES.DateTime: {
2044
- return isString(field) || isNumber(field) || isDate(field)
2045
- ? dateFormat(field, "DD.MM.YYYY HH:mm")
2046
- : "";
2047
- }
2048
- case FIELD_TYPES.Number: {
2049
- return isString(field) || isNumber(field) || isBoolean(field)
2050
- ? String(transformToNumber(field))
2051
- : "";
2052
- }
2053
- case FIELD_TYPES.String: {
2054
- return isString(field) || isNumber(field) || isBoolean(field) ? String(field) : "";
2055
- }
2056
- case FIELD_TYPES.Time: {
2057
- return isString(field) || isNumber(field) || isDate(field) ? dateFormat(field, "HH:mm") : "";
2058
- }
2059
- default: {
2060
- return isString(field) || isNumber(field) || isBoolean(field) ? String(field) : "";
2061
- }
2062
- }
2063
- }
2064
-
2065
- var _defineProperty;
2066
- var hasRequired_defineProperty;
2067
-
2068
- function require_defineProperty () {
2069
- if (hasRequired_defineProperty) return _defineProperty;
2070
- hasRequired_defineProperty = 1;
2071
- var getNative = require_getNative();
2072
-
2073
- var defineProperty = (function() {
2074
- try {
2075
- var func = getNative(Object, 'defineProperty');
2076
- func({}, '', {});
2077
- return func;
2078
- } catch (e) {}
2079
- }());
2080
-
2081
- _defineProperty = defineProperty;
2082
- return _defineProperty;
2083
- }
2084
-
2085
- var _baseAssignValue;
2086
- var hasRequired_baseAssignValue;
2087
-
2088
- function require_baseAssignValue () {
2089
- if (hasRequired_baseAssignValue) return _baseAssignValue;
2090
- hasRequired_baseAssignValue = 1;
2091
- var defineProperty = require_defineProperty();
2092
-
2093
- /**
2094
- * The base implementation of `assignValue` and `assignMergeValue` without
2095
- * value checks.
2096
- *
2097
- * @private
2098
- * @param {Object} object The object to modify.
2099
- * @param {string} key The key of the property to assign.
2100
- * @param {*} value The value to assign.
2101
- */
2102
- function baseAssignValue(object, key, value) {
2103
- if (key == '__proto__' && defineProperty) {
2104
- defineProperty(object, key, {
2105
- 'configurable': true,
2106
- 'enumerable': true,
2107
- 'value': value,
2108
- 'writable': true
2109
- });
2110
- } else {
2111
- object[key] = value;
2112
- }
2113
- }
2114
-
2115
- _baseAssignValue = baseAssignValue;
2116
- return _baseAssignValue;
2117
- }
2118
-
2119
- var _assignValue;
2120
- var hasRequired_assignValue;
2121
-
2122
- function require_assignValue () {
2123
- if (hasRequired_assignValue) return _assignValue;
2124
- hasRequired_assignValue = 1;
2125
- var baseAssignValue = require_baseAssignValue(),
2126
- eq = requireEq();
2127
-
2128
- /** Used for built-in method references. */
2129
- var objectProto = Object.prototype;
2130
-
2131
- /** Used to check objects for own properties. */
2132
- var hasOwnProperty = objectProto.hasOwnProperty;
2133
-
2134
- /**
2135
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
2136
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2137
- * for equality comparisons.
2138
- *
2139
- * @private
2140
- * @param {Object} object The object to modify.
2141
- * @param {string} key The key of the property to assign.
2142
- * @param {*} value The value to assign.
2143
- */
2144
- function assignValue(object, key, value) {
2145
- var objValue = object[key];
2146
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
2147
- (value === undefined && !(key in object))) {
2148
- baseAssignValue(object, key, value);
2149
- }
2150
- }
2151
-
2152
- _assignValue = assignValue;
2153
- return _assignValue;
2154
- }
2155
-
2156
- /** Used as references for various `Number` constants. */
2157
-
2158
- var _isIndex;
2159
- var hasRequired_isIndex;
2160
-
2161
- function require_isIndex () {
2162
- if (hasRequired_isIndex) return _isIndex;
2163
- hasRequired_isIndex = 1;
2164
- var MAX_SAFE_INTEGER = 9007199254740991;
2165
-
2166
- /** Used to detect unsigned integer values. */
2167
- var reIsUint = /^(?:0|[1-9]\d*)$/;
2168
-
2169
- /**
2170
- * Checks if `value` is a valid array-like index.
2171
- *
2172
- * @private
2173
- * @param {*} value The value to check.
2174
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2175
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2176
- */
2177
- function isIndex(value, length) {
2178
- var type = typeof value;
2179
- length = length == null ? MAX_SAFE_INTEGER : length;
2180
-
2181
- return !!length &&
2182
- (type == 'number' ||
2183
- (type != 'symbol' && reIsUint.test(value))) &&
2184
- (value > -1 && value % 1 == 0 && value < length);
2185
- }
2186
-
2187
- _isIndex = isIndex;
2188
- return _isIndex;
2189
- }
2190
-
2191
- var _baseSet;
2192
- var hasRequired_baseSet;
2193
-
2194
- function require_baseSet () {
2195
- if (hasRequired_baseSet) return _baseSet;
2196
- hasRequired_baseSet = 1;
2197
- var assignValue = require_assignValue(),
2198
- castPath = require_castPath(),
2199
- isIndex = require_isIndex(),
2200
- isObject = requireIsObject(),
2201
- toKey = require_toKey();
2202
-
2203
- /**
2204
- * The base implementation of `_.set`.
2205
- *
2206
- * @private
2207
- * @param {Object} object The object to modify.
2208
- * @param {Array|string} path The path of the property to set.
2209
- * @param {*} value The value to set.
2210
- * @param {Function} [customizer] The function to customize path creation.
2211
- * @returns {Object} Returns `object`.
2212
- */
2213
- function baseSet(object, path, value, customizer) {
2214
- if (!isObject(object)) {
2215
- return object;
2216
- }
2217
- path = castPath(path, object);
2218
-
2219
- var index = -1,
2220
- length = path.length,
2221
- lastIndex = length - 1,
2222
- nested = object;
2223
-
2224
- while (nested != null && ++index < length) {
2225
- var key = toKey(path[index]),
2226
- newValue = value;
2227
-
2228
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
2229
- return object;
2230
- }
2231
-
2232
- if (index != lastIndex) {
2233
- var objValue = nested[key];
2234
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
2235
- if (newValue === undefined) {
2236
- newValue = isObject(objValue)
2237
- ? objValue
2238
- : (isIndex(path[index + 1]) ? [] : {});
2239
- }
2240
- }
2241
- assignValue(nested, key, newValue);
2242
- nested = nested[key];
2243
- }
2244
- return object;
2245
- }
2246
-
2247
- _baseSet = baseSet;
2248
- return _baseSet;
2249
- }
2250
-
2251
- var set_1;
2252
- var hasRequiredSet;
2253
-
2254
- function requireSet () {
2255
- if (hasRequiredSet) return set_1;
2256
- hasRequiredSet = 1;
2257
- var baseSet = require_baseSet();
2258
-
2259
- /**
2260
- * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
2261
- * it's created. Arrays are created for missing index properties while objects
2262
- * are created for all other missing properties. Use `_.setWith` to customize
2263
- * `path` creation.
2264
- *
2265
- * **Note:** This method mutates `object`.
2266
- *
2267
- * @static
2268
- * @memberOf _
2269
- * @since 3.7.0
2270
- * @category Object
2271
- * @param {Object} object The object to modify.
2272
- * @param {Array|string} path The path of the property to set.
2273
- * @param {*} value The value to set.
2274
- * @returns {Object} Returns `object`.
2275
- * @example
2276
- *
2277
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2278
- *
2279
- * _.set(object, 'a[0].b.c', 4);
2280
- * console.log(object.a[0].b.c);
2281
- * // => 4
2282
- *
2283
- * _.set(object, ['x', '0', 'y', 'z'], 5);
2284
- * console.log(object.x[0].y.z);
2285
- * // => 5
2286
- */
2287
- function set(object, path, value) {
2288
- return object == null ? object : baseSet(object, path, value);
2289
- }
2290
-
2291
- set_1 = set;
2292
- return set_1;
2293
- }
2294
-
2295
- var setExports = requireSet();
2296
- const set = /*@__PURE__*/getDefaultExportFromCjs(setExports);
2297
-
2298
- function setByPath(data, path, value) {
2299
- try {
2300
- if (!isObject(data) && !isArray(data))
2301
- throw new Error("bad data");
2302
- set(data, path, value);
2303
- }
2304
- catch (error) {
2305
- // eslint-disable-next-line no-console
2306
- console.warn(error);
2307
- }
2308
- }
2309
-
2310
- function jsonParse(json) {
2311
- if (!isString(json))
2312
- return null;
2313
- try {
2314
- return JSON.parse(json);
2315
- }
2316
- catch {
2317
- return null;
2318
- }
2319
- }
2320
-
2321
- const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
2322
- function randomString(length = 10, allowCharacters = characters) {
2323
- let result = "";
2324
- let counter = 0;
2325
- while (counter < length) {
2326
- result += allowCharacters.charAt(Math.floor(Math.random() * allowCharacters.length));
2327
- counter += 1;
2328
- }
2329
- return result;
2330
- }
2331
-
2332
- function wait(delay) {
2333
- return new Promise((resolve) => {
2334
- setTimeout(() => {
2335
- resolve(true);
2336
- }, delay);
2337
- });
2338
- }
2339
-
2340
- function buildQueryString(params) {
2341
- const queryString = [];
2342
- for (const [key, value] of Object.entries(params)) {
2343
- if (isObject(value) || value == undefined)
2344
- continue;
2345
- if (isArray(value)) {
2346
- for (const item of value) {
2347
- if (item != undefined && !isObject(item))
2348
- queryString.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(item))}`);
2349
- }
2350
- }
2351
- else {
2352
- queryString.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
2353
- }
2354
- }
2355
- return queryString.join("&");
2356
- }
2357
-
2358
- function createURLWithParams(options) {
2359
- const url = options.baseURL.replace(/\/$/, "").replace(/\?$/, "");
2360
- if (!options.params) {
2361
- return url;
2362
- }
2363
- const queryString = buildQueryString(options.params);
2364
- return `${url}?${queryString}`;
2365
- }
2366
-
2367
- function trimUrl(url) {
2368
- return url.replace(/^\//, "").replace(/\/$/, "");
2369
- }
2370
-
2371
- function arrayToMapByKey(array, key) {
2372
- const map = {};
2373
- for (const item of array) {
2374
- const keyValue = item[key];
2375
- if (isId(keyValue))
2376
- map[keyValue] = item;
2377
- }
2378
- return map;
2379
- }
2380
-
2381
- function syncObjectValues(oldObj, newObj, exception = []) {
2382
- for (const field in newObj) {
2383
- if (exception.includes(field))
2384
- continue;
2385
- const oldValue = getByPath(oldObj, field, undefined);
2386
- const newValue = getByPath(newObj, field, undefined);
2387
- if (isUndefined(oldValue) || isUndefined(newValue))
2388
- continue;
2389
- if (oldValue === newValue)
2390
- continue;
2391
- setByPath(oldObj, field, newValue);
2392
- }
2393
- }
2394
-
2395
- function randomNumber(min, max) {
2396
- min = Math.ceil(min);
2397
- max = Math.floor(max);
2398
- return Math.floor(Math.random() * (max - min) + min);
2399
- }
2400
-
2401
- const filenameVariables = ["filename=", "filename*=UTF-8''"];
2402
- function getFileNameFromHeader(header) {
2403
- const name = header
2404
- .split(";")
2405
- .find((info) => ~info.indexOf(filenameVariables[0]) || ~info.indexOf(filenameVariables[1]))
2406
- ?.replace(filenameVariables[0], "")
2407
- ?.replace(filenameVariables[1], "")
2408
- ?.replace(/"/g, "")
2409
- ?.trim();
2410
- return name ? decodeURI(name) : null;
2411
- }
2412
-
2413
- function limitStreamOfRequests({ countRequests, maxCountInParallel, promiseGetter, refetchAfterError, resultCb, collectResult, maxTryCount = 3, }) {
2414
- let isStopped = false;
2415
- return {
2416
- cancel: () => {
2417
- isStopped = true;
2418
- },
2419
- promise: new Promise((resolve) => {
2420
- let currentRequests = 0;
2421
- let currentResponses = 0;
2422
- const results = [];
2423
- for (let i = 0; i < maxCountInParallel; i++) {
2424
- request(promiseGetter(++currentRequests), currentRequests);
2425
- }
2426
- function request(promise, position, tryCount = 1) {
2427
- if (isStopped)
2428
- return void resolve(results);
2429
- if (currentResponses === countRequests)
2430
- return void resolve(results);
2431
- if (position > countRequests || promise == undefined)
2432
- return;
2433
- promise
2434
- .then((result) => {
2435
- if (isStopped)
2436
- return void resolve(results);
2437
- if (collectResult)
2438
- results.push(result);
2439
- if (resultCb)
2440
- resultCb(result);
2441
- currentResponses++;
2442
- request(promiseGetter(++currentRequests), currentRequests);
2443
- })
2444
- .catch(() => {
2445
- if (isStopped)
2446
- return void resolve(results);
2447
- if (refetchAfterError && maxTryCount > tryCount) {
2448
- void wait(1000).then(() => request(promiseGetter(position), position, tryCount + 1));
2449
- }
2450
- else {
2451
- currentResponses++;
2452
- request(promiseGetter(++currentRequests), currentRequests);
2453
- }
2454
- });
2455
- }
2456
- }),
2457
- };
2458
- }
2459
-
2460
- function downloadFile({ data, fileName, mimeType }) {
2461
- if (!IS_BROWSER && !IS_JEST)
2462
- return null;
2463
- const name = getFileNameFromHeader(fileName);
2464
- if (!name)
2465
- throw new Error("Bad filename");
2466
- const blob = new Blob([data], {
2467
- type: mimeType,
2468
- });
2469
- const downloadUrl = window.URL.createObjectURL(blob);
2470
- const link = document.createElement("a");
2471
- link.style.display = "none";
2472
- link.download = name;
2473
- link.href = downloadUrl;
2474
- document.body.appendChild(link);
2475
- link.click();
2476
- document.body.removeChild(link);
2477
- link.remove();
2478
- window.URL.revokeObjectURL(downloadUrl);
2479
- return null;
2480
- }
2481
-
2482
- function downloadJson(data, name) {
2483
- if (!IS_BROWSER && !IS_JEST)
2484
- return null;
2485
- const url = `data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(data))}`;
2486
- const link = document.createElement("a");
2487
- link.style.display = "none";
2488
- link.download = name;
2489
- link.href = url;
2490
- document.body.appendChild(link);
2491
- link.click();
2492
- document.body.removeChild(link);
2493
- link.remove();
2494
- }
2495
-
2496
- function readFile(file) {
2497
- return new Promise((resolve) => {
2498
- if (!IS_BROWSER && !IS_JEST) {
2499
- resolve(null);
2500
- return;
2501
- }
2502
- const reader = new FileReader();
2503
- reader.readAsText(file);
2504
- reader.onload = () => {
2505
- resolve(reader.result);
2506
- };
2507
- reader.onerror = () => {
2508
- resolve(null);
2509
- };
2510
- });
2511
- }
2512
-
2513
- const tokenRequest = async (options) => {
2514
- try {
2515
- const response = await fetch(options.authTokenUrl, {
2516
- method: "GET",
2517
- });
2518
- if (!response.ok) {
2519
- throw new Error(`HTTP error! Status: ${response.status}`);
2520
- }
2521
- const result = (await response.json());
2522
- const { expiresToken, token } = transformData(result, options.pathToToken, options.pathToExpires);
2523
- localStorage.setItem(options.storageExpiresTokenName, expiresToken);
2524
- localStorage.setItem(options.storageTokenName, token);
2525
- return token;
2526
- }
2527
- catch (error) {
2528
- // eslint-disable-next-line no-console
2529
- console.log(error);
2530
- window.location.replace(options.authRedirectUrl);
2531
- return null;
2532
- }
2533
- };
2534
- function transformData(data, pathToToken, pathToExpires) {
2535
- if (!isObject(data))
2536
- throw new Error("Bad response data");
2537
- const token = getByPath(data, pathToToken);
2538
- const expiresToken = getByPath(data, pathToExpires);
2539
- if ((!isString(expiresToken) && !isNumber(expiresToken)) || !isString(token))
2540
- throw new Error("Bad response data");
2541
- return {
2542
- expiresToken: String(expiresToken),
2543
- token,
2544
- };
2545
- }
2546
-
2547
- let isFetchingAccessToken = false;
2548
- const generateAuthMiddleWare = (options) => async (request) => {
2549
- if (!options.authRedirectUrl ||
2550
- !options.authRedirectUrl ||
2551
- !options.storageExpiresTokenName ||
2552
- !options.storageTokenName ||
2553
- !options.pathToExpires ||
2554
- !options.pathToToken) {
2555
- // eslint-disable-next-line no-console
2556
- console.error("Auth middleware hasn't required options");
2557
- return;
2558
- }
2559
- const isSameOrigin = !request.path.includes("http") && !request.path.includes("https");
2560
- if (request.token && !isSameOrigin) {
2561
- request.headers = {
2562
- ...request.headers,
2563
- Authorization: `Bearer ${request.token}`,
2564
- };
2565
- return;
2566
- }
2567
- if (isFetchingAccessToken)
2568
- await waitUntil(() => isFetchingAccessToken);
2569
- const expires = localStorage.getItem(options.storageExpiresTokenName);
2570
- let token = localStorage.getItem(options.storageTokenName);
2571
- if (!expires || Date.now() > +expires || !token) {
2572
- isFetchingAccessToken = true;
2573
- token = await tokenRequest(options);
2574
- isFetchingAccessToken = false;
2575
- }
2576
- if (!isSameOrigin)
2577
- request.headers = {
2578
- ...request.headers,
2579
- Authorization: `Bearer ${token}`,
2580
- };
2581
- };
2582
-
2583
- const consoleMiddleware = (response) => {
2584
- return new Promise((resolve) => {
2585
- // eslint-disable-next-line no-console
2586
- console.log(response);
2587
- resolve(true);
2588
- });
2589
- };
2590
-
2591
- function generateMiddlewares(activeMiddlewares, middlewareOptions) {
2592
- const selectedMiddlewares = [];
2593
- for (const key of activeMiddlewares) {
2594
- switch (key) {
2595
- case API_MIDDLEWARES.Auth: {
2596
- if (middlewareOptions.auth && (IS_BROWSER || IS_JEST))
2597
- selectedMiddlewares.push(generateAuthMiddleWare(middlewareOptions.auth));
2598
- continue;
2599
- }
2600
- case API_MIDDLEWARES.Logger: {
2601
- selectedMiddlewares.push(consoleMiddleware);
2602
- continue;
2603
- }
2604
- default: {
2605
- continue;
2606
- }
2607
- }
2608
- }
2609
- return function executeMiddlewares(request) {
2610
- return new Promise((resolve) => {
2611
- void (async () => {
2612
- for (const middleware of selectedMiddlewares) {
2613
- // eslint-disable-next-line no-await-in-loop
2614
- await middleware(request);
2615
- }
2616
- resolve(1);
2617
- })();
2618
- });
2619
- };
2620
- }
2621
-
2622
- class ResponseError extends Error {
2623
- status;
2624
- description;
2625
- constructor({ message, status, description }) {
2626
- super(message);
2627
- this.status = status;
2628
- this.description = description;
2629
- }
2630
- }
2631
- function generateRequestsInstance(activeMiddlewares, middlewareOptions) {
2632
- const executeMiddlewares = generateMiddlewares(activeMiddlewares || [], middlewareOptions || {});
2633
- async function handleRequest(request, responseWithStatus) {
2634
- if (request.delay) {
2635
- await wait(request.delay);
2636
- }
2637
- if (request.mock) {
2638
- const transformedResult = request.transformIncomingData
2639
- ? request.transformIncomingData(request.mock)
2640
- : request.mock;
2641
- return responseWithStatus ? { data: transformedResult, status: 200 } : transformedResult;
2642
- }
2643
- await executeMiddlewares(request);
2644
- const { method, body, path, params, headers } = request;
2645
- const trimedPath = path.replace(/^\//, "").replace(/\/$/, "");
2646
- const fullPath = trimedPath.includes("http") || trimedPath.includes("https")
2647
- ? trimedPath
2648
- : `${window.location.origin}/${trimedPath}`;
2649
- const url = createURLWithParams({ baseURL: fullPath, params });
2650
- let preparedBody = body;
2651
- if (body && !(preparedBody instanceof FormData)) {
2652
- if (request.transformOutcomingData) {
2653
- preparedBody = request.transformOutcomingData(body);
2654
- }
2655
- if (isObject(body) || isArray(body))
2656
- preparedBody = JSON.stringify(preparedBody);
2657
- }
2658
- let response;
2659
- if (IS_BROWSER || IS_JEST) {
2660
- response = await fetch(url, {
2661
- method,
2662
- body: preparedBody,
2663
- headers: {
2664
- ...(body instanceof FormData
2665
- ? {}
2666
- : { "Content-Type": "application/json; charset=UTF-8" }),
2667
- ...headers,
2668
- },
2669
- signal: request.signal,
2670
- });
2671
- }
2672
- if (IS_NODE && !IS_JEST) {
2673
- const nodeFetch = (await import('node-fetch')).default;
2674
- response = await nodeFetch(url, {
2675
- method,
2676
- body: preparedBody,
2677
- headers: {
2678
- ...(body instanceof FormData
2679
- ? {}
2680
- : { "Content-Type": "application/json; charset=UTF-8" }),
2681
- ...headers,
2682
- },
2683
- signal: request.signal,
2684
- });
2685
- }
2686
- if (!response) {
2687
- throw new Error("hasn't response");
2688
- }
2689
- if (!response.ok) {
2690
- throw new ResponseError({
2691
- status: response.status,
2692
- message: `HTTP error! Status: ${response.status}`,
2693
- });
2694
- }
2695
- if (request.downloadFile) {
2696
- const data = await response.blob();
2697
- const mimeType = response.headers.get("content-type");
2698
- const fileName = response.headers.get("content-disposition");
2699
- if (!mimeType || !fileName)
2700
- throw new Error("Download Error! Empty info!");
2701
- if (IS_BROWSER)
2702
- downloadFile({
2703
- data,
2704
- fileName,
2705
- mimeType,
2706
- });
2707
- return responseWithStatus
2708
- ? {
2709
- data: data,
2710
- status: response.status,
2711
- }
2712
- : data;
2713
- }
2714
- if (request.withoutResponse)
2715
- return responseWithStatus ? { data: true, status: response.status } : true;
2716
- const result = (await response.json());
2717
- const transformedResult = request.transformIncomingData
2718
- ? request.transformIncomingData(result)
2719
- : result;
2720
- return responseWithStatus
2721
- ? { data: transformedResult, status: response.status }
2722
- : transformedResult;
2723
- }
2724
- async function requestApi(request) {
2725
- return handleRequest(request, false);
2726
- }
2727
- async function requestApiWithStatus(request) {
2728
- return handleRequest(request, true);
2729
- }
2730
- return {
2731
- requestApi,
2732
- requestApiWithStatus,
2733
- };
2734
- }
2735
-
2736
- function getColorFormat(color) {
2737
- if (color.startsWith("#")) {
2738
- return COLOR_FORMATS.Hex;
2739
- }
2740
- if (color.startsWith("rgba")) {
2741
- return COLOR_FORMATS.Rgba;
2742
- }
2743
- if (color.startsWith("rgb")) {
2744
- return COLOR_FORMATS.Rgb;
2745
- }
2746
- if (color.startsWith("hsl")) {
2747
- return COLOR_FORMATS.Hsl;
2748
- }
2749
- }
2750
-
2751
- function transformHEXtoRGB(hex) {
2752
- return `rgb(${hex.match(/\w\w/g)?.map((x) => +`0x${x}`)})`;
2753
- }
2754
-
2755
- function transformRGBtoRGBA(rgb, opacity) {
2756
- const code = rgb.match(/\d+/g);
2757
- code?.push(String(opacity / 100));
2758
- return `rgba(${code?.join(",")})`;
2759
- }
2760
-
2761
- function transformRGBAtoRGB(rgba) {
2762
- const code = rgba.match(/\d+/g);
2763
- code?.splice(3);
2764
- return `rgb(${code?.join(",")})`;
2765
- }
2766
-
2767
- function takeOpacityColors(color, opacities) {
2768
- let rgbColor = color;
2769
- if (!rgbColor)
2770
- return [];
2771
- if (getColorFormat(rgbColor) === COLOR_FORMATS.Hex) {
2772
- rgbColor = transformHEXtoRGB(rgbColor);
2773
- }
2774
- else if (getColorFormat(rgbColor) === COLOR_FORMATS.Rgba) {
2775
- rgbColor = transformRGBAtoRGB(rgbColor);
2776
- }
2777
- if (getColorFormat(rgbColor) !== COLOR_FORMATS.Rgb)
2778
- return [];
2779
- return [...opacities.map((opacity) => transformRGBtoRGBA(rgbColor, opacity))];
2780
- }
2781
-
2782
- function transformToColor(currentColor, defaultColor = "black", defaultFormat = COLOR_FORMATS.Hex) {
2783
- if (!isString(currentColor))
2784
- return defaultColor;
2785
- let correctColor = currentColor;
2786
- if (!getColorFormat(correctColor)) {
2787
- switch (defaultFormat) {
2788
- case COLOR_FORMATS.Hex: {
2789
- correctColor = `#${correctColor}`;
2790
- break;
2791
- }
2792
- case COLOR_FORMATS.Rgb: {
2793
- correctColor = `rgb(${correctColor})`;
2794
- break;
2795
- }
2796
- case COLOR_FORMATS.Rgba: {
2797
- correctColor = `rgba(${correctColor})`;
2798
- break;
2799
- }
2800
- case COLOR_FORMATS.Hsl: {
2801
- correctColor = `hsl(${correctColor})`;
2802
- break;
2803
- }
2804
- default: {
2805
- correctColor = `#${correctColor}`;
2806
- break;
2807
- }
2808
- }
2809
- }
2810
- return correctColor;
2811
- }
2812
-
2813
- export { API_MIDDLEWARES, COLOR_FORMATS, DATE_TYPES, FIELD_TYPES, IS_BROWSER, IS_BUN, IS_DENO, IS_JEST, IS_NODE, IS_WEB_WORKER, ResponseError, arrayToMapByKey, buildQueryString, checkType, createURLWithParams, dateDifference, dateFormat, downloadFile, downloadJson, fieldViewFormat, generateRequestsInstance, getByPath, getColorFormat, getDateByRules, getFileNameFromHeader, getToday, getTomorrow, getYesterday, isArray, isBoolean, isDate, isId, isNull, isNullable, isNumber, isObject, isString, isToday, isTomorrow, isUndefined, isYesterday, jsonParse, limitStreamOfRequests, randomNumber, randomString, readFile, setByPath, syncObjectValues, takeOpacityColors, transformHEXtoRGB, transformRGBAtoRGB, transformRGBtoRGBA, transformToColor, transformToNumber, trimUrl, wait, waitUntil };
1
+ export { ResponseError, generateRequestsInstance } from './lib/api/core.js';
2
+ export { downloadFile } from './lib/browser/download-file.js';
3
+ export { downloadJson } from './lib/browser/download-json.js';
4
+ export { readFile } from './lib/browser/read-file.js';
5
+ export { getColorFormat } from './lib/colors/get-color-format.js';
6
+ export { takeOpacityColors } from './lib/colors/take-opacity-colors.js';
7
+ export { transformHEXtoRGB } from './lib/colors/transform-hex-to-rgb.js';
8
+ export { transformRGBtoRGBA } from './lib/colors/transform-rgb-to-rgba.js';
9
+ export { transformRGBAtoRGB } from './lib/colors/transform-rgba-to-rgb.js';
10
+ export { transformToColor } from './lib/colors/transform-to-color.js';
11
+ export { dateDifference } from './lib/date/date-difference.js';
12
+ export { getDateByRules } from './lib/date/get-date-by-rules.js';
13
+ export { getToday } from './lib/date/get-today.js';
14
+ export { getTomorrow } from './lib/date/get-tomorrow.js';
15
+ export { getYesterday } from './lib/date/get-yesterday.js';
16
+ export { isToday } from './lib/date/is-today.js';
17
+ export { isTomorrow } from './lib/date/is-tomorrow.js';
18
+ export { isYesterday } from './lib/date/is-yesterday.js';
19
+ export { dateFormat } from './lib/date/date-format.js';
20
+ export { waitUntil } from './lib/utils/wait-until.js';
21
+ export { getByPath } from './lib/utils/get-by-path.js';
22
+ export { fieldViewFormat } from './lib/utils/field-view-format.js';
23
+ export { setByPath } from './lib/utils/set-by-path.js';
24
+ export { jsonParse } from './lib/utils/json-parse.js';
25
+ export { randomString } from './lib/utils/random-string.js';
26
+ export { wait } from './lib/utils/wait.js';
27
+ export { transformToNumber } from './lib/utils/transform-to-number.js';
28
+ export { createURLWithParams } from './lib/utils/create-url-with-params.js';
29
+ export { trimUrl } from './lib/utils/trim-url.js';
30
+ export { arrayToMapByKey } from './lib/utils/array-to-map-by-key.js';
31
+ export { buildQueryString } from './lib/utils/build-query-string.js';
32
+ export { syncObjectValues } from './lib/utils/sync-object-values.js';
33
+ export { randomNumber } from './lib/utils/random-number.js';
34
+ export { getFileNameFromHeader } from './lib/utils/get-file-name-from-header.js';
35
+ export { limitStreamOfRequests } from './lib/utils/limit-stream-of-requests.js';
36
+ export { checkType } from './lib/typings/check-type.js';
37
+ export { isArray } from './lib/typings/is-array.js';
38
+ export { isBoolean } from './lib/typings/is-boolean.js';
39
+ export { isId } from './lib/typings/is-id.js';
40
+ export { isNull } from './lib/typings/is-null.js';
41
+ export { isNullable } from './lib/typings/is-nullable.js';
42
+ export { isNumber } from './lib/typings/is-number.js';
43
+ export { isObject } from './lib/typings/is-object.js';
44
+ export { isString } from './lib/typings/is-string.js';
45
+ export { isUndefined } from './lib/typings/is-undefined.js';
46
+ export { isDate } from './lib/typings/is-date.js';
47
+ export { DATE_TYPES } from './constants/date.js';
48
+ export { API_MIDDLEWARES } from './constants/api.js';
49
+ export { IS_BROWSER, IS_BUN, IS_DENO, IS_JEST, IS_NODE, IS_WEB_WORKER } from './constants/environment.js';
50
+ export { COLOR_FORMATS } from './constants/colors.js';
51
+ export { FIELD_TYPES } from './constants/fields.js';
2814
52
  //# sourceMappingURL=index.js.map