dce-reactkit 4.3.5-beta-progress-size.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/dist/cjs/index.js +405 -2374
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/LogReviewer.d.ts +1 -1
  4. package/dist/cjs/types/helpers/logClientEvent.d.ts +1 -1
  5. package/dist/cjs/types/html/genErrorPage.d.ts +1 -1
  6. package/dist/cjs/types/index.d.ts +2 -64
  7. package/dist/cjs/types/types/IntelliTableColumn.d.ts +1 -1
  8. package/dist/cjs/types/types/ProgressBarSize.d.ts +1 -0
  9. package/dist/esm/index.js +145 -2281
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/types/components/LogReviewer.d.ts +1 -1
  12. package/dist/esm/types/helpers/logClientEvent.d.ts +1 -1
  13. package/dist/esm/types/html/genErrorPage.d.ts +1 -1
  14. package/dist/esm/types/index.d.ts +2 -64
  15. package/dist/esm/types/types/IntelliTableColumn.d.ts +1 -1
  16. package/dist/esm/types/types/ProgressBarSize.d.ts +1 -0
  17. package/dist/index.d.ts +4 -835
  18. package/package.json +4 -3
  19. package/src/components/AppWrapper.tsx +12 -10
  20. package/src/components/AutoscrollToBottomContainer.tsx +5 -3
  21. package/src/components/CopiableBox.tsx +5 -1
  22. package/src/components/DBEntryManagerPanel/helpers/generateEndpointPath.ts +2 -2
  23. package/src/components/ErrorBox.tsx +6 -2
  24. package/src/components/IntelliTable.tsx +7 -5
  25. package/src/components/LogReviewer.tsx +23 -21
  26. package/src/components/Modal/index.tsx +5 -3
  27. package/src/components/MultiSwitch.tsx +5 -1
  28. package/src/components/ProgressBar.tsx +75 -61
  29. package/src/components/Shimmer.tsx +4 -2
  30. package/src/components/SimpleDateChooser.tsx +11 -13
  31. package/src/components/SimpleTimeChooser.tsx +4 -2
  32. package/src/helpers/canReviewLogs.test.ts +5 -3
  33. package/src/helpers/canReviewLogs.ts +5 -3
  34. package/src/helpers/initClient.tsx +8 -8
  35. package/src/helpers/isMobileOrTablet.tsx +2 -1
  36. package/src/helpers/isSelectAdmin.ts +4 -2
  37. package/src/helpers/logClientEvent.tsx +7 -5
  38. package/src/helpers/stubServerEndpoint.tsx +1 -1
  39. package/src/helpers/visitServerEndpoint.tsx +10 -7
  40. package/src/html/genErrorPage.ts +6 -4
  41. package/src/index.ts +105 -98
  42. package/src/types/IntelliTableColumn.ts +4 -1
  43. package/src/types/ProgressBarSize.ts +1 -0
  44. package/dist/cjs/types/constants/DAY_IN_MS.d.ts +0 -6
  45. package/dist/cjs/types/constants/HOUR_IN_MS.d.ts +0 -6
  46. package/dist/cjs/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
  47. package/dist/cjs/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
  48. package/dist/cjs/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
  49. package/dist/cjs/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
  50. package/dist/cjs/types/constants/MINUTE_IN_MS.d.ts +0 -6
  51. package/dist/cjs/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
  52. package/dist/cjs/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
  53. package/dist/cjs/types/errors/ErrorWithCode.d.ts +0 -9
  54. package/dist/cjs/types/helpers/abbreviate.d.ts +0 -10
  55. package/dist/cjs/types/helpers/abbreviate.test.d.ts +0 -5
  56. package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
  57. package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
  58. package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
  59. package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
  60. package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
  61. package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
  62. package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
  63. package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
  64. package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
  65. package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
  66. package/dist/cjs/types/helpers/avg.d.ts +0 -8
  67. package/dist/cjs/types/helpers/avg.test.d.ts +0 -5
  68. package/dist/cjs/types/helpers/capitalize.d.ts +0 -7
  69. package/dist/cjs/types/helpers/ceilToNumDecimals.d.ts +0 -9
  70. package/dist/cjs/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
  71. package/dist/cjs/types/helpers/cloneDeep.d.ts +0 -8
  72. package/dist/cjs/types/helpers/compareArraysByProp.d.ts +0 -13
  73. package/dist/cjs/types/helpers/compareArraysByProp.test.d.ts +0 -5
  74. package/dist/cjs/types/helpers/extractProp.d.ts +0 -12
  75. package/dist/cjs/types/helpers/extractProp.test.d.ts +0 -5
  76. package/dist/cjs/types/helpers/floorToNumDecimals.d.ts +0 -9
  77. package/dist/cjs/types/helpers/floorToNumDecimals.test.d.ts +0 -5
  78. package/dist/cjs/types/helpers/forceNumIntoBounds.d.ts +0 -10
  79. package/dist/cjs/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
  80. package/dist/cjs/types/helpers/genCSV.d.ts +0 -18
  81. package/dist/cjs/types/helpers/genCSV.test.d.ts +0 -5
  82. package/dist/cjs/types/helpers/genCommaList.d.ts +0 -12
  83. package/dist/cjs/types/helpers/genCommaList.test.d.ts +0 -1
  84. package/dist/cjs/types/helpers/getHumanReadableDate.d.ts +0 -8
  85. package/dist/cjs/types/helpers/getHumanReadableDate.test.d.ts +0 -5
  86. package/dist/cjs/types/helpers/getLocalTimeInfo.d.ts +0 -19
  87. package/dist/cjs/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
  88. package/dist/cjs/types/helpers/getMonthName.d.ts +0 -14
  89. package/dist/cjs/types/helpers/getMonthName.test.d.ts +0 -5
  90. package/dist/cjs/types/helpers/getOrdinal.d.ts +0 -8
  91. package/dist/cjs/types/helpers/getOrdinal.test.d.ts +0 -5
  92. package/dist/cjs/types/helpers/getPartOfDay.d.ts +0 -7
  93. package/dist/cjs/types/helpers/getPartOfDay.test.d.ts +0 -5
  94. package/dist/cjs/types/helpers/getTimeInfoInET.d.ts +0 -21
  95. package/dist/cjs/types/helpers/getTimeInfoInET.test.d.ts +0 -5
  96. package/dist/cjs/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
  97. package/dist/cjs/types/helpers/getWordCount.d.ts +0 -10
  98. package/dist/cjs/types/helpers/idify.d.ts +0 -9
  99. package/dist/cjs/types/helpers/onlyKeepLetters.d.ts +0 -8
  100. package/dist/cjs/types/helpers/padDecimalZeros.d.ts +0 -10
  101. package/dist/cjs/types/helpers/padZerosLeft.d.ts +0 -9
  102. package/dist/cjs/types/helpers/parallelLimit.d.ts +0 -12
  103. package/dist/cjs/types/helpers/prefixWithAOrAn.d.ts +0 -10
  104. package/dist/cjs/types/helpers/roundToNumDecimals.d.ts +0 -9
  105. package/dist/cjs/types/helpers/shuffleArray.d.ts +0 -8
  106. package/dist/cjs/types/helpers/startMinWait.d.ts +0 -9
  107. package/dist/cjs/types/helpers/stringsToHumanReadableList.d.ts +0 -10
  108. package/dist/cjs/types/helpers/sum.d.ts +0 -8
  109. package/dist/cjs/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
  110. package/dist/cjs/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
  111. package/dist/cjs/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
  112. package/dist/cjs/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
  113. package/dist/cjs/types/helpers/validators/validURL.d.ts +0 -8
  114. package/dist/cjs/types/helpers/validators/validateEmail.d.ts +0 -11
  115. package/dist/cjs/types/helpers/validators/validateEmail.test.d.ts +0 -1
  116. package/dist/cjs/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
  117. package/dist/cjs/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
  118. package/dist/cjs/types/helpers/validators/validateString.d.ts +0 -22
  119. package/dist/cjs/types/helpers/validators/validateString.test.d.ts +0 -1
  120. package/dist/cjs/types/helpers/waitMs.d.ts +0 -7
  121. package/dist/cjs/types/types/DayOfWeek.d.ts +0 -14
  122. package/dist/cjs/types/types/Log/LogMainInfo.d.ts +0 -39
  123. package/dist/cjs/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
  124. package/dist/cjs/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
  125. package/dist/cjs/types/types/Log/index.d.ts +0 -10
  126. package/dist/cjs/types/types/LogAction.d.ts +0 -29
  127. package/dist/cjs/types/types/LogBuiltInMetadata.d.ts +0 -16
  128. package/dist/cjs/types/types/LogFunction.d.ts +0 -24
  129. package/dist/cjs/types/types/LogLevel.d.ts +0 -10
  130. package/dist/cjs/types/types/LogMetadataContextMap.d.ts +0 -11
  131. package/dist/cjs/types/types/LogMetadataTagMap.d.ts +0 -8
  132. package/dist/cjs/types/types/LogMetadataTargetMap.d.ts +0 -8
  133. package/dist/cjs/types/types/LogMetadataType.d.ts +0 -13
  134. package/dist/cjs/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
  135. package/dist/cjs/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
  136. package/dist/cjs/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
  137. package/dist/cjs/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
  138. package/dist/cjs/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
  139. package/dist/cjs/types/types/LogReviewerFilterState/index.d.ts +0 -17
  140. package/dist/cjs/types/types/LogSource.d.ts +0 -9
  141. package/dist/cjs/types/types/LogType.d.ts +0 -9
  142. package/dist/cjs/types/types/ParamType.d.ts +0 -17
  143. package/dist/cjs/types/types/ReactKitErrorCode.d.ts +0 -14
  144. package/dist/esm/types/constants/DAY_IN_MS.d.ts +0 -6
  145. package/dist/esm/types/constants/HOUR_IN_MS.d.ts +0 -6
  146. package/dist/esm/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
  147. package/dist/esm/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
  148. package/dist/esm/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
  149. package/dist/esm/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
  150. package/dist/esm/types/constants/MINUTE_IN_MS.d.ts +0 -6
  151. package/dist/esm/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
  152. package/dist/esm/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
  153. package/dist/esm/types/errors/ErrorWithCode.d.ts +0 -9
  154. package/dist/esm/types/helpers/abbreviate.d.ts +0 -10
  155. package/dist/esm/types/helpers/abbreviate.test.d.ts +0 -5
  156. package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
  157. package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
  158. package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
  159. package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
  160. package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
  161. package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
  162. package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
  163. package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
  164. package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
  165. package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
  166. package/dist/esm/types/helpers/avg.d.ts +0 -8
  167. package/dist/esm/types/helpers/avg.test.d.ts +0 -5
  168. package/dist/esm/types/helpers/capitalize.d.ts +0 -7
  169. package/dist/esm/types/helpers/ceilToNumDecimals.d.ts +0 -9
  170. package/dist/esm/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
  171. package/dist/esm/types/helpers/cloneDeep.d.ts +0 -8
  172. package/dist/esm/types/helpers/compareArraysByProp.d.ts +0 -13
  173. package/dist/esm/types/helpers/compareArraysByProp.test.d.ts +0 -5
  174. package/dist/esm/types/helpers/extractProp.d.ts +0 -12
  175. package/dist/esm/types/helpers/extractProp.test.d.ts +0 -5
  176. package/dist/esm/types/helpers/floorToNumDecimals.d.ts +0 -9
  177. package/dist/esm/types/helpers/floorToNumDecimals.test.d.ts +0 -5
  178. package/dist/esm/types/helpers/forceNumIntoBounds.d.ts +0 -10
  179. package/dist/esm/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
  180. package/dist/esm/types/helpers/genCSV.d.ts +0 -18
  181. package/dist/esm/types/helpers/genCSV.test.d.ts +0 -5
  182. package/dist/esm/types/helpers/genCommaList.d.ts +0 -12
  183. package/dist/esm/types/helpers/genCommaList.test.d.ts +0 -1
  184. package/dist/esm/types/helpers/getHumanReadableDate.d.ts +0 -8
  185. package/dist/esm/types/helpers/getHumanReadableDate.test.d.ts +0 -5
  186. package/dist/esm/types/helpers/getLocalTimeInfo.d.ts +0 -19
  187. package/dist/esm/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
  188. package/dist/esm/types/helpers/getMonthName.d.ts +0 -14
  189. package/dist/esm/types/helpers/getMonthName.test.d.ts +0 -5
  190. package/dist/esm/types/helpers/getOrdinal.d.ts +0 -8
  191. package/dist/esm/types/helpers/getOrdinal.test.d.ts +0 -5
  192. package/dist/esm/types/helpers/getPartOfDay.d.ts +0 -7
  193. package/dist/esm/types/helpers/getPartOfDay.test.d.ts +0 -5
  194. package/dist/esm/types/helpers/getTimeInfoInET.d.ts +0 -21
  195. package/dist/esm/types/helpers/getTimeInfoInET.test.d.ts +0 -5
  196. package/dist/esm/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
  197. package/dist/esm/types/helpers/getWordCount.d.ts +0 -10
  198. package/dist/esm/types/helpers/idify.d.ts +0 -9
  199. package/dist/esm/types/helpers/onlyKeepLetters.d.ts +0 -8
  200. package/dist/esm/types/helpers/padDecimalZeros.d.ts +0 -10
  201. package/dist/esm/types/helpers/padZerosLeft.d.ts +0 -9
  202. package/dist/esm/types/helpers/parallelLimit.d.ts +0 -12
  203. package/dist/esm/types/helpers/prefixWithAOrAn.d.ts +0 -10
  204. package/dist/esm/types/helpers/roundToNumDecimals.d.ts +0 -9
  205. package/dist/esm/types/helpers/shuffleArray.d.ts +0 -8
  206. package/dist/esm/types/helpers/startMinWait.d.ts +0 -9
  207. package/dist/esm/types/helpers/stringsToHumanReadableList.d.ts +0 -10
  208. package/dist/esm/types/helpers/sum.d.ts +0 -8
  209. package/dist/esm/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
  210. package/dist/esm/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
  211. package/dist/esm/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
  212. package/dist/esm/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
  213. package/dist/esm/types/helpers/validators/validURL.d.ts +0 -8
  214. package/dist/esm/types/helpers/validators/validateEmail.d.ts +0 -11
  215. package/dist/esm/types/helpers/validators/validateEmail.test.d.ts +0 -1
  216. package/dist/esm/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
  217. package/dist/esm/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
  218. package/dist/esm/types/helpers/validators/validateString.d.ts +0 -22
  219. package/dist/esm/types/helpers/validators/validateString.test.d.ts +0 -1
  220. package/dist/esm/types/helpers/waitMs.d.ts +0 -7
  221. package/dist/esm/types/types/DayOfWeek.d.ts +0 -14
  222. package/dist/esm/types/types/Log/LogMainInfo.d.ts +0 -39
  223. package/dist/esm/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
  224. package/dist/esm/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
  225. package/dist/esm/types/types/Log/index.d.ts +0 -10
  226. package/dist/esm/types/types/LogAction.d.ts +0 -29
  227. package/dist/esm/types/types/LogBuiltInMetadata.d.ts +0 -16
  228. package/dist/esm/types/types/LogFunction.d.ts +0 -24
  229. package/dist/esm/types/types/LogLevel.d.ts +0 -10
  230. package/dist/esm/types/types/LogMetadataContextMap.d.ts +0 -11
  231. package/dist/esm/types/types/LogMetadataTagMap.d.ts +0 -8
  232. package/dist/esm/types/types/LogMetadataTargetMap.d.ts +0 -8
  233. package/dist/esm/types/types/LogMetadataType.d.ts +0 -13
  234. package/dist/esm/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
  235. package/dist/esm/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
  236. package/dist/esm/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
  237. package/dist/esm/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
  238. package/dist/esm/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
  239. package/dist/esm/types/types/LogReviewerFilterState/index.d.ts +0 -17
  240. package/dist/esm/types/types/LogSource.d.ts +0 -9
  241. package/dist/esm/types/types/LogType.d.ts +0 -9
  242. package/dist/esm/types/types/ParamType.d.ts +0 -17
  243. package/dist/esm/types/types/ReactKitErrorCode.d.ts +0 -14
  244. package/src/constants/DAY_IN_MS.ts +0 -7
  245. package/src/constants/HOUR_IN_MS.ts +0 -7
  246. package/src/constants/LOG_REVIEW_GET_LOGS_ROUTE.ts +0 -9
  247. package/src/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.ts +0 -9
  248. package/src/constants/LOG_REVIEW_STATUS_ROUTE.ts +0 -10
  249. package/src/constants/LOG_ROUTE_PATH.ts +0 -9
  250. package/src/constants/MINUTE_IN_MS.ts +0 -7
  251. package/src/constants/ROUTE_PATH_PREFIX.ts +0 -7
  252. package/src/constants/SELECT_ADMIN_CHECK_ROUTE.ts +0 -7
  253. package/src/errors/ErrorWithCode.tsx +0 -15
  254. package/src/helpers/abbreviate.test.ts +0 -26
  255. package/src/helpers/abbreviate.ts +0 -25
  256. package/src/helpers/asyncArrayFunctions/everyAsync.test.ts +0 -114
  257. package/src/helpers/asyncArrayFunctions/everyAsync.ts +0 -51
  258. package/src/helpers/asyncArrayFunctions/filterAsync.test.ts +0 -126
  259. package/src/helpers/asyncArrayFunctions/filterAsync.ts +0 -50
  260. package/src/helpers/asyncArrayFunctions/forEachAsync.test.ts +0 -136
  261. package/src/helpers/asyncArrayFunctions/forEachAsync.ts +0 -40
  262. package/src/helpers/asyncArrayFunctions/mapAsync.test.ts +0 -125
  263. package/src/helpers/asyncArrayFunctions/mapAsync.ts +0 -46
  264. package/src/helpers/asyncArrayFunctions/someAsync.test.ts +0 -92
  265. package/src/helpers/asyncArrayFunctions/someAsync.ts +0 -49
  266. package/src/helpers/avg.test.ts +0 -24
  267. package/src/helpers/avg.ts +0 -22
  268. package/src/helpers/capitalize.ts +0 -20
  269. package/src/helpers/ceilToNumDecimals.test.ts +0 -39
  270. package/src/helpers/ceilToNumDecimals.ts +0 -13
  271. package/src/helpers/cloneDeep.ts +0 -11
  272. package/src/helpers/compareArraysByProp.test.ts +0 -147
  273. package/src/helpers/compareArraysByProp.ts +0 -56
  274. package/src/helpers/extractProp.test.ts +0 -34
  275. package/src/helpers/extractProp.ts +0 -17
  276. package/src/helpers/floorToNumDecimals.test.ts +0 -39
  277. package/src/helpers/floorToNumDecimals.ts +0 -13
  278. package/src/helpers/forceNumIntoBounds.test.ts +0 -34
  279. package/src/helpers/forceNumIntoBounds.ts +0 -19
  280. package/src/helpers/genCSV.test.ts +0 -75
  281. package/src/helpers/genCSV.ts +0 -87
  282. package/src/helpers/genCommaList.test.ts +0 -57
  283. package/src/helpers/genCommaList.ts +0 -21
  284. package/src/helpers/getHumanReadableDate.test.ts +0 -29
  285. package/src/helpers/getHumanReadableDate.ts +0 -36
  286. package/src/helpers/getLocalTimeInfo.test.ts +0 -48
  287. package/src/helpers/getLocalTimeInfo.ts +0 -58
  288. package/src/helpers/getMonthName.test.ts +0 -79
  289. package/src/helpers/getMonthName.ts +0 -29
  290. package/src/helpers/getOrdinal.test.ts +0 -84
  291. package/src/helpers/getOrdinal.ts +0 -14
  292. package/src/helpers/getPartOfDay.test.ts +0 -56
  293. package/src/helpers/getPartOfDay.ts +0 -20
  294. package/src/helpers/getTimeInfoInET.test.ts +0 -72
  295. package/src/helpers/getTimeInfoInET.ts +0 -79
  296. package/src/helpers/getTimestampFromTimeInfoInET.ts +0 -179
  297. package/src/helpers/getWordCount.ts +0 -26
  298. package/src/helpers/idify.ts +0 -24
  299. package/src/helpers/onlyKeepLetters.ts +0 -11
  300. package/src/helpers/padDecimalZeros.tsx +0 -32
  301. package/src/helpers/padZerosLeft.tsx +0 -21
  302. package/src/helpers/parallelLimit.ts +0 -76
  303. package/src/helpers/prefixWithAOrAn.ts +0 -29
  304. package/src/helpers/roundToNumDecimals.tsx +0 -13
  305. package/src/helpers/shuffleArray.ts +0 -19
  306. package/src/helpers/startMinWait.ts +0 -33
  307. package/src/helpers/stringsToHumanReadableList.ts +0 -39
  308. package/src/helpers/sum.tsx +0 -16
  309. package/src/helpers/validators/ChicagoTitleCase.test.ts +0 -85
  310. package/src/helpers/validators/ChicagoTitleCase.ts +0 -32
  311. package/src/helpers/validators/findURL.test.ts +0 -83
  312. package/src/helpers/validators/findURL.ts +0 -43
  313. package/src/helpers/validators/shared/constants/ERROR_MESSAGES.ts +0 -18
  314. package/src/helpers/validators/shared/helpers/validateRegex.ts +0 -47
  315. package/src/helpers/validators/shared/types/ValidationResult.ts +0 -20
  316. package/src/helpers/validators/validURL.test.ts +0 -90
  317. package/src/helpers/validators/validURL.ts +0 -18
  318. package/src/helpers/validators/validateEmail.test.ts +0 -110
  319. package/src/helpers/validators/validateEmail.ts +0 -47
  320. package/src/helpers/validators/validatePhoneNumber.test.ts +0 -94
  321. package/src/helpers/validators/validatePhoneNumber.ts +0 -49
  322. package/src/helpers/validators/validateString.test.ts +0 -173
  323. package/src/helpers/validators/validateString.ts +0 -171
  324. package/src/helpers/waitMs.tsx +0 -12
  325. package/src/types/DayOfWeek.ts +0 -15
  326. package/src/types/Log/LogMainInfo.ts +0 -69
  327. package/src/types/Log/LogSourceSpecificInfo.ts +0 -25
  328. package/src/types/Log/LogTypeSpecificInfo.ts +0 -33
  329. package/src/types/Log/index.ts +0 -17
  330. package/src/types/LogAction.ts +0 -52
  331. package/src/types/LogBuiltInMetadata.ts +0 -19
  332. package/src/types/LogFunction.ts +0 -46
  333. package/src/types/LogLevel.ts +0 -11
  334. package/src/types/LogMetadataContextMap.ts +0 -15
  335. package/src/types/LogMetadataTagMap.ts +0 -9
  336. package/src/types/LogMetadataTargetMap.ts +0 -9
  337. package/src/types/LogMetadataType.ts +0 -16
  338. package/src/types/LogReviewerFilterState/ActionErrorFilterState.ts +0 -24
  339. package/src/types/LogReviewerFilterState/AdvancedFilterState.ts +0 -36
  340. package/src/types/LogReviewerFilterState/ContextFilterState.ts +0 -16
  341. package/src/types/LogReviewerFilterState/DateFilterState.ts +0 -26
  342. package/src/types/LogReviewerFilterState/TagFilterState.ts +0 -9
  343. package/src/types/LogReviewerFilterState/index.ts +0 -24
  344. package/src/types/LogSource.ts +0 -12
  345. package/src/types/LogType.ts +0 -12
  346. package/src/types/ParamType.ts +0 -18
  347. package/src/types/ReactKitErrorCode.tsx +0 -17
package/dist/esm/index.js CHANGED
@@ -1,9 +1,11 @@
1
+ import { CommonKitErrorCode, waitMs, ErrorWithCode, LOG_ROUTE_PATH, LogBuiltInMetadata, LogLevel, getOrdinal, getMonthName, getTimeInfoInET, padZerosLeft, ParamType, roundToNumDecimals, genCSV, LogAction, cloneDeep, LogType, LogSource, getHumanReadableDate, LOG_REVIEW_GET_LOGS_ROUTE, idify, LOG_REVIEW_STATUS_ROUTE, SELECT_ADMIN_CHECK_ROUTE } from 'dce-commonkit';
2
+ export { CommonKitErrorCode, DAY_IN_MS, DayOfWeek, ErrorWithCode, HOUR_IN_MS, LOG_REVIEW_GET_LOGS_ROUTE, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_REVIEW_STATUS_ROUTE, LOG_ROUTE_PATH, LogAction, LogBuiltInMetadata, LogLevel, LogSource, LogType, MINUTE_IN_MS, ParamType, SELECT_ADMIN_CHECK_ROUTE, abbreviate, avg, capitalize, ceilToNumDecimals, cloneDeep, compareArraysByProp, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, getTimestampFromTimeInfoInET, getWordCount, idify, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, sum, validateEmail, validatePhoneNumber, validateString, waitMs } from 'dce-commonkit';
1
3
  import * as React from 'react';
2
4
  import React__default, { useState, useRef, useEffect, useReducer, forwardRef, useContext, useLayoutEffect, createContext, useMemo, useCallback, Component, Fragment } from 'react';
3
5
  import { faExclamationTriangle, faCircle, faHourglassEnd, faDotCircle, faCheckSquare, faHourglass, faClipboard, faChevronDown, faChevronRight, faCloudDownloadAlt, faMinus, faCheckCircle, faXmarkCircle, faSort, faSortDown, faSortUp, faArrowLeft, faArrowRight, faCalendar, faTag, faHammer, faList, faTimes, faSearch, faSave, faTrash, faCog, faPlus } from '@fortawesome/free-solid-svg-icons';
4
6
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
7
+ import ReactDOM, { createPortal } from 'react-dom';
5
8
  import { faCircle as faCircle$1, faSquareMinus, faSquare } from '@fortawesome/free-regular-svg-icons';
6
- import clone from 'nanoclone';
7
9
 
8
10
  /*! *****************************************************************************
9
11
  Copyright (c) Microsoft Corporation.
@@ -30,23 +32,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
30
32
  });
31
33
  }
32
34
 
33
- // Highest error code = DRK37
34
- /**
35
- * List of error codes built into the react kit
36
- * @author Gabe Abrams
37
- */
38
- var ReactKitErrorCode;
39
- (function (ReactKitErrorCode) {
40
- ReactKitErrorCode["NoResponse"] = "DRK1";
41
- ReactKitErrorCode["NoCode"] = "DRK2";
42
- ReactKitErrorCode["SessionExpired"] = "DRK3";
43
- ReactKitErrorCode["NoCACCLSendRequestFunction"] = "DRK7";
44
- ReactKitErrorCode["SimpleDateChooserInvalidDateRange"] = "DRK35";
45
- ReactKitErrorCode["SimpleDateChooserInvalidNumMonths"] = "DRK36";
46
- ReactKitErrorCode["ETTimestampInvalid"] = "DRK37";
47
- })(ReactKitErrorCode || (ReactKitErrorCode = {}));
48
- var ReactKitErrorCode$1 = ReactKitErrorCode;
49
-
50
35
  /**
51
36
  * Bootstrap variants
52
37
  * @author Gabe Abrams
@@ -102,7 +87,7 @@ const ErrorBox = (props) => {
102
87
  } },
103
88
  "code:",
104
89
  ' ',
105
- String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$1.NoCode).toUpperCase())));
90
+ String((_a = error.code) !== null && _a !== void 0 ? _a : CommonKitErrorCode.NoCode).toUpperCase())));
106
91
  }
107
92
  // Main UI
108
93
  return (React__default.createElement("div", { className: `alert alert-${variant} text-center`, style: {
@@ -157,724 +142,6 @@ var ModalType;
157
142
  })(ModalType || (ModalType = {}));
158
143
  var ModalType$1 = ModalType;
159
144
 
160
- /**
161
- * Built-in metadata for logs
162
- * @author Gabe Abrams
163
- */
164
- const LogBuiltInMetadata = {
165
- // Contexts
166
- Context: {
167
- Uncategorized: 'Uncategorized',
168
- ServerRenderedErrorPage: 'ServerRenderedErrorPage',
169
- ServerEndpointError: 'ServerEndpointError',
170
- ClientFatalError: 'ClientFatalError',
171
- },
172
- // Targets
173
- Target: {
174
- NoTarget: 'NoTarget',
175
- },
176
- };
177
-
178
- function getDefaultExportFromCjs (x) {
179
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
180
- }
181
-
182
- var reactDom = {exports: {}};
183
-
184
- var reactDom_production = {};
185
-
186
- /**
187
- * @license React
188
- * react-dom.production.js
189
- *
190
- * Copyright (c) Meta Platforms, Inc. and affiliates.
191
- *
192
- * This source code is licensed under the MIT license found in the
193
- * LICENSE file in the root directory of this source tree.
194
- */
195
-
196
- var hasRequiredReactDom_production;
197
-
198
- function requireReactDom_production () {
199
- if (hasRequiredReactDom_production) return reactDom_production;
200
- hasRequiredReactDom_production = 1;
201
- var React = React__default;
202
- function formatProdErrorMessage(code) {
203
- var url = "https://react.dev/errors/" + code;
204
- if (1 < arguments.length) {
205
- url += "?args[]=" + encodeURIComponent(arguments[1]);
206
- for (var i = 2; i < arguments.length; i++)
207
- url += "&args[]=" + encodeURIComponent(arguments[i]);
208
- }
209
- return (
210
- "Minified React error #" +
211
- code +
212
- "; visit " +
213
- url +
214
- " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
215
- );
216
- }
217
- function noop() {}
218
- var Internals = {
219
- d: {
220
- f: noop,
221
- r: function () {
222
- throw Error(formatProdErrorMessage(522));
223
- },
224
- D: noop,
225
- C: noop,
226
- L: noop,
227
- m: noop,
228
- X: noop,
229
- S: noop,
230
- M: noop
231
- },
232
- p: 0,
233
- findDOMNode: null
234
- },
235
- REACT_PORTAL_TYPE = Symbol.for("react.portal");
236
- function createPortal$1(children, containerInfo, implementation) {
237
- var key =
238
- 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
239
- return {
240
- $$typeof: REACT_PORTAL_TYPE,
241
- key: null == key ? null : "" + key,
242
- children: children,
243
- containerInfo: containerInfo,
244
- implementation: implementation
245
- };
246
- }
247
- var ReactSharedInternals =
248
- React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
249
- function getCrossOriginStringAs(as, input) {
250
- if ("font" === as) return "";
251
- if ("string" === typeof input)
252
- return "use-credentials" === input ? input : "";
253
- }
254
- reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
255
- Internals;
256
- reactDom_production.createPortal = function (children, container) {
257
- var key =
258
- 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
259
- if (
260
- !container ||
261
- (1 !== container.nodeType &&
262
- 9 !== container.nodeType &&
263
- 11 !== container.nodeType)
264
- )
265
- throw Error(formatProdErrorMessage(299));
266
- return createPortal$1(children, container, null, key);
267
- };
268
- reactDom_production.flushSync = function (fn) {
269
- var previousTransition = ReactSharedInternals.T,
270
- previousUpdatePriority = Internals.p;
271
- try {
272
- if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();
273
- } finally {
274
- (ReactSharedInternals.T = previousTransition),
275
- (Internals.p = previousUpdatePriority),
276
- Internals.d.f();
277
- }
278
- };
279
- reactDom_production.preconnect = function (href, options) {
280
- "string" === typeof href &&
281
- (options
282
- ? ((options = options.crossOrigin),
283
- (options =
284
- "string" === typeof options
285
- ? "use-credentials" === options
286
- ? options
287
- : ""
288
- : void 0))
289
- : (options = null),
290
- Internals.d.C(href, options));
291
- };
292
- reactDom_production.prefetchDNS = function (href) {
293
- "string" === typeof href && Internals.d.D(href);
294
- };
295
- reactDom_production.preinit = function (href, options) {
296
- if ("string" === typeof href && options && "string" === typeof options.as) {
297
- var as = options.as,
298
- crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
299
- integrity =
300
- "string" === typeof options.integrity ? options.integrity : void 0,
301
- fetchPriority =
302
- "string" === typeof options.fetchPriority
303
- ? options.fetchPriority
304
- : void 0;
305
- "style" === as
306
- ? Internals.d.S(
307
- href,
308
- "string" === typeof options.precedence ? options.precedence : void 0,
309
- {
310
- crossOrigin: crossOrigin,
311
- integrity: integrity,
312
- fetchPriority: fetchPriority
313
- }
314
- )
315
- : "script" === as &&
316
- Internals.d.X(href, {
317
- crossOrigin: crossOrigin,
318
- integrity: integrity,
319
- fetchPriority: fetchPriority,
320
- nonce: "string" === typeof options.nonce ? options.nonce : void 0
321
- });
322
- }
323
- };
324
- reactDom_production.preinitModule = function (href, options) {
325
- if ("string" === typeof href)
326
- if ("object" === typeof options && null !== options) {
327
- if (null == options.as || "script" === options.as) {
328
- var crossOrigin = getCrossOriginStringAs(
329
- options.as,
330
- options.crossOrigin
331
- );
332
- Internals.d.M(href, {
333
- crossOrigin: crossOrigin,
334
- integrity:
335
- "string" === typeof options.integrity ? options.integrity : void 0,
336
- nonce: "string" === typeof options.nonce ? options.nonce : void 0
337
- });
338
- }
339
- } else null == options && Internals.d.M(href);
340
- };
341
- reactDom_production.preload = function (href, options) {
342
- if (
343
- "string" === typeof href &&
344
- "object" === typeof options &&
345
- null !== options &&
346
- "string" === typeof options.as
347
- ) {
348
- var as = options.as,
349
- crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
350
- Internals.d.L(href, as, {
351
- crossOrigin: crossOrigin,
352
- integrity:
353
- "string" === typeof options.integrity ? options.integrity : void 0,
354
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
355
- type: "string" === typeof options.type ? options.type : void 0,
356
- fetchPriority:
357
- "string" === typeof options.fetchPriority
358
- ? options.fetchPriority
359
- : void 0,
360
- referrerPolicy:
361
- "string" === typeof options.referrerPolicy
362
- ? options.referrerPolicy
363
- : void 0,
364
- imageSrcSet:
365
- "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
366
- imageSizes:
367
- "string" === typeof options.imageSizes ? options.imageSizes : void 0,
368
- media: "string" === typeof options.media ? options.media : void 0
369
- });
370
- }
371
- };
372
- reactDom_production.preloadModule = function (href, options) {
373
- if ("string" === typeof href)
374
- if (options) {
375
- var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
376
- Internals.d.m(href, {
377
- as:
378
- "string" === typeof options.as && "script" !== options.as
379
- ? options.as
380
- : void 0,
381
- crossOrigin: crossOrigin,
382
- integrity:
383
- "string" === typeof options.integrity ? options.integrity : void 0
384
- });
385
- } else Internals.d.m(href);
386
- };
387
- reactDom_production.requestFormReset = function (form) {
388
- Internals.d.r(form);
389
- };
390
- reactDom_production.unstable_batchedUpdates = function (fn, a) {
391
- return fn(a);
392
- };
393
- reactDom_production.useFormState = function (action, initialState, permalink) {
394
- return ReactSharedInternals.H.useFormState(action, initialState, permalink);
395
- };
396
- reactDom_production.useFormStatus = function () {
397
- return ReactSharedInternals.H.useHostTransitionStatus();
398
- };
399
- reactDom_production.version = "19.2.1";
400
- return reactDom_production;
401
- }
402
-
403
- var reactDom_development = {};
404
-
405
- /**
406
- * @license React
407
- * react-dom.development.js
408
- *
409
- * Copyright (c) Meta Platforms, Inc. and affiliates.
410
- *
411
- * This source code is licensed under the MIT license found in the
412
- * LICENSE file in the root directory of this source tree.
413
- */
414
-
415
- var hasRequiredReactDom_development;
416
-
417
- function requireReactDom_development () {
418
- if (hasRequiredReactDom_development) return reactDom_development;
419
- hasRequiredReactDom_development = 1;
420
- "production" !== process.env.NODE_ENV &&
421
- (function () {
422
- function noop() {}
423
- function testStringCoercion(value) {
424
- return "" + value;
425
- }
426
- function createPortal$1(children, containerInfo, implementation) {
427
- var key =
428
- 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
429
- try {
430
- testStringCoercion(key);
431
- var JSCompiler_inline_result = !1;
432
- } catch (e) {
433
- JSCompiler_inline_result = !0;
434
- }
435
- JSCompiler_inline_result &&
436
- (console.error(
437
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
438
- ("function" === typeof Symbol &&
439
- Symbol.toStringTag &&
440
- key[Symbol.toStringTag]) ||
441
- key.constructor.name ||
442
- "Object"
443
- ),
444
- testStringCoercion(key));
445
- return {
446
- $$typeof: REACT_PORTAL_TYPE,
447
- key: null == key ? null : "" + key,
448
- children: children,
449
- containerInfo: containerInfo,
450
- implementation: implementation
451
- };
452
- }
453
- function getCrossOriginStringAs(as, input) {
454
- if ("font" === as) return "";
455
- if ("string" === typeof input)
456
- return "use-credentials" === input ? input : "";
457
- }
458
- function getValueDescriptorExpectingObjectForWarning(thing) {
459
- return null === thing
460
- ? "`null`"
461
- : void 0 === thing
462
- ? "`undefined`"
463
- : "" === thing
464
- ? "an empty string"
465
- : 'something with type "' + typeof thing + '"';
466
- }
467
- function getValueDescriptorExpectingEnumForWarning(thing) {
468
- return null === thing
469
- ? "`null`"
470
- : void 0 === thing
471
- ? "`undefined`"
472
- : "" === thing
473
- ? "an empty string"
474
- : "string" === typeof thing
475
- ? JSON.stringify(thing)
476
- : "number" === typeof thing
477
- ? "`" + thing + "`"
478
- : 'something with type "' + typeof thing + '"';
479
- }
480
- function resolveDispatcher() {
481
- var dispatcher = ReactSharedInternals.H;
482
- null === dispatcher &&
483
- console.error(
484
- "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
485
- );
486
- return dispatcher;
487
- }
488
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
489
- "function" ===
490
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
491
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
492
- var React = React__default,
493
- Internals = {
494
- d: {
495
- f: noop,
496
- r: function () {
497
- throw Error(
498
- "Invalid form element. requestFormReset must be passed a form that was rendered by React."
499
- );
500
- },
501
- D: noop,
502
- C: noop,
503
- L: noop,
504
- m: noop,
505
- X: noop,
506
- S: noop,
507
- M: noop
508
- },
509
- p: 0,
510
- findDOMNode: null
511
- },
512
- REACT_PORTAL_TYPE = Symbol.for("react.portal"),
513
- ReactSharedInternals =
514
- React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
515
- ("function" === typeof Map &&
516
- null != Map.prototype &&
517
- "function" === typeof Map.prototype.forEach &&
518
- "function" === typeof Set &&
519
- null != Set.prototype &&
520
- "function" === typeof Set.prototype.clear &&
521
- "function" === typeof Set.prototype.forEach) ||
522
- console.error(
523
- "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
524
- );
525
- reactDom_development.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
526
- Internals;
527
- reactDom_development.createPortal = function (children, container) {
528
- var key =
529
- 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
530
- if (
531
- !container ||
532
- (1 !== container.nodeType &&
533
- 9 !== container.nodeType &&
534
- 11 !== container.nodeType)
535
- )
536
- throw Error("Target container is not a DOM element.");
537
- return createPortal$1(children, container, null, key);
538
- };
539
- reactDom_development.flushSync = function (fn) {
540
- var previousTransition = ReactSharedInternals.T,
541
- previousUpdatePriority = Internals.p;
542
- try {
543
- if (((ReactSharedInternals.T = null), (Internals.p = 2), fn))
544
- return fn();
545
- } finally {
546
- (ReactSharedInternals.T = previousTransition),
547
- (Internals.p = previousUpdatePriority),
548
- Internals.d.f() &&
549
- console.error(
550
- "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
551
- );
552
- }
553
- };
554
- reactDom_development.preconnect = function (href, options) {
555
- "string" === typeof href && href
556
- ? null != options && "object" !== typeof options
557
- ? console.error(
558
- "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
559
- getValueDescriptorExpectingEnumForWarning(options)
560
- )
561
- : null != options &&
562
- "string" !== typeof options.crossOrigin &&
563
- console.error(
564
- "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
565
- getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
566
- )
567
- : console.error(
568
- "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
569
- getValueDescriptorExpectingObjectForWarning(href)
570
- );
571
- "string" === typeof href &&
572
- (options
573
- ? ((options = options.crossOrigin),
574
- (options =
575
- "string" === typeof options
576
- ? "use-credentials" === options
577
- ? options
578
- : ""
579
- : void 0))
580
- : (options = null),
581
- Internals.d.C(href, options));
582
- };
583
- reactDom_development.prefetchDNS = function (href) {
584
- if ("string" !== typeof href || !href)
585
- console.error(
586
- "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
587
- getValueDescriptorExpectingObjectForWarning(href)
588
- );
589
- else if (1 < arguments.length) {
590
- var options = arguments[1];
591
- "object" === typeof options && options.hasOwnProperty("crossOrigin")
592
- ? console.error(
593
- "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
594
- getValueDescriptorExpectingEnumForWarning(options)
595
- )
596
- : console.error(
597
- "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
598
- getValueDescriptorExpectingEnumForWarning(options)
599
- );
600
- }
601
- "string" === typeof href && Internals.d.D(href);
602
- };
603
- reactDom_development.preinit = function (href, options) {
604
- "string" === typeof href && href
605
- ? null == options || "object" !== typeof options
606
- ? console.error(
607
- "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
608
- getValueDescriptorExpectingEnumForWarning(options)
609
- )
610
- : "style" !== options.as &&
611
- "script" !== options.as &&
612
- console.error(
613
- 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
614
- getValueDescriptorExpectingEnumForWarning(options.as)
615
- )
616
- : console.error(
617
- "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
618
- getValueDescriptorExpectingObjectForWarning(href)
619
- );
620
- if (
621
- "string" === typeof href &&
622
- options &&
623
- "string" === typeof options.as
624
- ) {
625
- var as = options.as,
626
- crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
627
- integrity =
628
- "string" === typeof options.integrity ? options.integrity : void 0,
629
- fetchPriority =
630
- "string" === typeof options.fetchPriority
631
- ? options.fetchPriority
632
- : void 0;
633
- "style" === as
634
- ? Internals.d.S(
635
- href,
636
- "string" === typeof options.precedence
637
- ? options.precedence
638
- : void 0,
639
- {
640
- crossOrigin: crossOrigin,
641
- integrity: integrity,
642
- fetchPriority: fetchPriority
643
- }
644
- )
645
- : "script" === as &&
646
- Internals.d.X(href, {
647
- crossOrigin: crossOrigin,
648
- integrity: integrity,
649
- fetchPriority: fetchPriority,
650
- nonce: "string" === typeof options.nonce ? options.nonce : void 0
651
- });
652
- }
653
- };
654
- reactDom_development.preinitModule = function (href, options) {
655
- var encountered = "";
656
- ("string" === typeof href && href) ||
657
- (encountered +=
658
- " The `href` argument encountered was " +
659
- getValueDescriptorExpectingObjectForWarning(href) +
660
- ".");
661
- void 0 !== options && "object" !== typeof options
662
- ? (encountered +=
663
- " The `options` argument encountered was " +
664
- getValueDescriptorExpectingObjectForWarning(options) +
665
- ".")
666
- : options &&
667
- "as" in options &&
668
- "script" !== options.as &&
669
- (encountered +=
670
- " The `as` option encountered was " +
671
- getValueDescriptorExpectingEnumForWarning(options.as) +
672
- ".");
673
- if (encountered)
674
- console.error(
675
- "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
676
- encountered
677
- );
678
- else
679
- switch (
680
- ((encountered =
681
- options && "string" === typeof options.as ? options.as : "script"),
682
- encountered)
683
- ) {
684
- case "script":
685
- break;
686
- default:
687
- (encountered =
688
- getValueDescriptorExpectingEnumForWarning(encountered)),
689
- console.error(
690
- 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
691
- encountered,
692
- href
693
- );
694
- }
695
- if ("string" === typeof href)
696
- if ("object" === typeof options && null !== options) {
697
- if (null == options.as || "script" === options.as)
698
- (encountered = getCrossOriginStringAs(
699
- options.as,
700
- options.crossOrigin
701
- )),
702
- Internals.d.M(href, {
703
- crossOrigin: encountered,
704
- integrity:
705
- "string" === typeof options.integrity
706
- ? options.integrity
707
- : void 0,
708
- nonce:
709
- "string" === typeof options.nonce ? options.nonce : void 0
710
- });
711
- } else null == options && Internals.d.M(href);
712
- };
713
- reactDom_development.preload = function (href, options) {
714
- var encountered = "";
715
- ("string" === typeof href && href) ||
716
- (encountered +=
717
- " The `href` argument encountered was " +
718
- getValueDescriptorExpectingObjectForWarning(href) +
719
- ".");
720
- null == options || "object" !== typeof options
721
- ? (encountered +=
722
- " The `options` argument encountered was " +
723
- getValueDescriptorExpectingObjectForWarning(options) +
724
- ".")
725
- : ("string" === typeof options.as && options.as) ||
726
- (encountered +=
727
- " The `as` option encountered was " +
728
- getValueDescriptorExpectingObjectForWarning(options.as) +
729
- ".");
730
- encountered &&
731
- console.error(
732
- 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
733
- encountered
734
- );
735
- if (
736
- "string" === typeof href &&
737
- "object" === typeof options &&
738
- null !== options &&
739
- "string" === typeof options.as
740
- ) {
741
- encountered = options.as;
742
- var crossOrigin = getCrossOriginStringAs(
743
- encountered,
744
- options.crossOrigin
745
- );
746
- Internals.d.L(href, encountered, {
747
- crossOrigin: crossOrigin,
748
- integrity:
749
- "string" === typeof options.integrity ? options.integrity : void 0,
750
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
751
- type: "string" === typeof options.type ? options.type : void 0,
752
- fetchPriority:
753
- "string" === typeof options.fetchPriority
754
- ? options.fetchPriority
755
- : void 0,
756
- referrerPolicy:
757
- "string" === typeof options.referrerPolicy
758
- ? options.referrerPolicy
759
- : void 0,
760
- imageSrcSet:
761
- "string" === typeof options.imageSrcSet
762
- ? options.imageSrcSet
763
- : void 0,
764
- imageSizes:
765
- "string" === typeof options.imageSizes
766
- ? options.imageSizes
767
- : void 0,
768
- media: "string" === typeof options.media ? options.media : void 0
769
- });
770
- }
771
- };
772
- reactDom_development.preloadModule = function (href, options) {
773
- var encountered = "";
774
- ("string" === typeof href && href) ||
775
- (encountered +=
776
- " The `href` argument encountered was " +
777
- getValueDescriptorExpectingObjectForWarning(href) +
778
- ".");
779
- void 0 !== options && "object" !== typeof options
780
- ? (encountered +=
781
- " The `options` argument encountered was " +
782
- getValueDescriptorExpectingObjectForWarning(options) +
783
- ".")
784
- : options &&
785
- "as" in options &&
786
- "string" !== typeof options.as &&
787
- (encountered +=
788
- " The `as` option encountered was " +
789
- getValueDescriptorExpectingObjectForWarning(options.as) +
790
- ".");
791
- encountered &&
792
- console.error(
793
- 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
794
- encountered
795
- );
796
- "string" === typeof href &&
797
- (options
798
- ? ((encountered = getCrossOriginStringAs(
799
- options.as,
800
- options.crossOrigin
801
- )),
802
- Internals.d.m(href, {
803
- as:
804
- "string" === typeof options.as && "script" !== options.as
805
- ? options.as
806
- : void 0,
807
- crossOrigin: encountered,
808
- integrity:
809
- "string" === typeof options.integrity
810
- ? options.integrity
811
- : void 0
812
- }))
813
- : Internals.d.m(href));
814
- };
815
- reactDom_development.requestFormReset = function (form) {
816
- Internals.d.r(form);
817
- };
818
- reactDom_development.unstable_batchedUpdates = function (fn, a) {
819
- return fn(a);
820
- };
821
- reactDom_development.useFormState = function (action, initialState, permalink) {
822
- return resolveDispatcher().useFormState(action, initialState, permalink);
823
- };
824
- reactDom_development.useFormStatus = function () {
825
- return resolveDispatcher().useHostTransitionStatus();
826
- };
827
- reactDom_development.version = "19.2.1";
828
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
829
- "function" ===
830
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
831
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
832
- })();
833
- return reactDom_development;
834
- }
835
-
836
- (function (module) {
837
-
838
- function checkDCE() {
839
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
840
- if (
841
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
842
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
843
- ) {
844
- return;
845
- }
846
- if (process.env.NODE_ENV !== 'production') {
847
- // This branch is unreachable because this function is only called
848
- // in production, but the condition is true only in development.
849
- // Therefore if the branch is still here, dead code elimination wasn't
850
- // properly applied.
851
- // Don't change the message. React DevTools relies on it. Also make sure
852
- // this message doesn't occur elsewhere in this function, or it will cause
853
- // a false positive.
854
- throw new Error('^_^');
855
- }
856
- try {
857
- // Verify that the code above has been dead code eliminated (DCE'd).
858
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
859
- } catch (err) {
860
- // DevTools shouldn't crash React, no matter what.
861
- // We should still report in case we break this code.
862
- console.error(err);
863
- }
864
- }
865
-
866
- if (process.env.NODE_ENV === 'production') {
867
- // DCE check should happen before ReactDOM bundle executes so that
868
- // DevTools can report bad minification during injection.
869
- checkDCE();
870
- module.exports = requireReactDom_production();
871
- } else {
872
- module.exports = requireReactDom_development();
873
- }
874
- } (reactDom));
875
-
876
- var ReactDOM = /*@__PURE__*/getDefaultExportFromCjs(reactDom.exports);
877
-
878
145
  /**
879
146
  * Loading spinner/indicator
880
147
  * @author Gabe Abrams
@@ -967,17 +234,6 @@ const LoadingSpinner = () => {
967
234
  React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-4" })));
968
235
  };
969
236
 
970
- /**
971
- * Wait for a certain number of ms
972
- * @author Gabe Abrams
973
- * @param ms number of ms to wait
974
- */
975
- const waitMs = (ms = 0) => __awaiter(void 0, void 0, void 0, function* () {
976
- return new Promise((resolve) => {
977
- setTimeout(resolve, ms);
978
- });
979
- });
980
-
981
237
  /**
982
238
  * Modal sizes
983
239
  * @author Gabe Abrams
@@ -997,18 +253,6 @@ var ModalSize$1 = ModalSize;
997
253
  */
998
254
  const NUM_MODAL_PORTALS = 50;
999
255
 
1000
- /**
1001
- * An error with a code
1002
- * @author Gabe Abrams
1003
- */
1004
- class ErrorWithCode extends Error {
1005
- constructor(message, code) {
1006
- super(message);
1007
- this.name = 'ErrorWithCode';
1008
- this.code = code;
1009
- }
1010
- }
1011
-
1012
256
  /*----------------------------------------*/
1013
257
  /* ---- Static Variables and Getters ---- */
1014
258
  /*----------------------------------------*/
@@ -1039,7 +283,7 @@ const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
1039
283
  (() => __awaiter(void 0, void 0, void 0, function* () {
1040
284
  yield waitMs(5000);
1041
285
  if (!successful) {
1042
- showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
286
+ showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', CommonKitErrorCode.NoCACCLSendRequestFunction));
1043
287
  }
1044
288
  }))();
1045
289
  // Wait for initialization
@@ -1510,30 +754,6 @@ const Modal = (props) => {
1510
754
  return ReactDOM.createPortal(contentToRender, document.getElementById(`modal-portal-${portalNumber}`));
1511
755
  };
1512
756
 
1513
- /**
1514
- * Path that all routes start with
1515
- * @author Gabe Abrams
1516
- */
1517
- const ROUTE_PATH_PREFIX = '/dce-reactkit';
1518
-
1519
- /**
1520
- * Path of the route for storing client-side logs
1521
- * @author Gabe Abrams
1522
- */
1523
- const LOG_ROUTE_PATH = `${ROUTE_PATH_PREFIX}/log`;
1524
-
1525
- /**
1526
- * Allowed log levels
1527
- * @author Gabe Abrams
1528
- */
1529
- var LogLevel;
1530
- (function (LogLevel) {
1531
- LogLevel["Warn"] = "Warn";
1532
- LogLevel["Info"] = "Info";
1533
- LogLevel["Debug"] = "Debug";
1534
- })(LogLevel || (LogLevel = {}));
1535
- var LogLevel$1 = LogLevel;
1536
-
1537
757
  /*------------------------------------------------------------------------*/
1538
758
  /* Stub Logic */
1539
759
  /*------------------------------------------------------------------------*/
@@ -1554,7 +774,7 @@ const _setStubResponse = (opts) => {
1554
774
  const { path, body, } = opts;
1555
775
  const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET').toUpperCase();
1556
776
  const errorMessage = ((_b = opts.errorMessage) !== null && _b !== void 0 ? _b : 'An unknown error has occurred.');
1557
- const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$1.NoCode);
777
+ const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : CommonKitErrorCode.NoCode);
1558
778
  // Store to stub responses
1559
779
  if (!stubResponses[method]) {
1560
780
  stubResponses[method] = {};
@@ -1632,11 +852,11 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function
1632
852
  });
1633
853
  // Check for failure
1634
854
  if (!response || !response.body) {
1635
- throw new ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$1.NoResponse);
855
+ throw new ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', CommonKitErrorCode.NoResponse);
1636
856
  }
1637
857
  if (!response.body.success) {
1638
858
  // Session expired
1639
- if (response.body.code === ReactKitErrorCode$1.SessionExpired) {
859
+ if (response.body.code === CommonKitErrorCode.SessionExpired) {
1640
860
  showSessionExpiredMessage();
1641
861
  // Never return (don't continue execution)
1642
862
  yield new Promise(() => {
@@ -1646,7 +866,7 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function
1646
866
  // Other errors
1647
867
  throw new ErrorWithCode((response.body.message
1648
868
  || 'An unknown error occurred. Please contact an admin.'), (response.body.code
1649
- || ReactKitErrorCode$1.NoCode));
869
+ || CommonKitErrorCode.NoCode));
1650
870
  }
1651
871
  // Success! Extract the body
1652
872
  const { body } = response.body;
@@ -1699,7 +919,7 @@ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* ()
1699
919
  ? opts.context
1700
920
  : ((_c = ((_b = opts.context) !== null && _b !== void 0 ? _b : {})._) !== null && _c !== void 0 ? _c : LogBuiltInMetadata.Context.Uncategorized)),
1701
921
  subcontext: ((_d = opts.subcontext) !== null && _d !== void 0 ? _d : LogBuiltInMetadata.Context.Uncategorized),
1702
- level: ((_e = opts.level) !== null && _e !== void 0 ? _e : LogLevel$1.Info),
922
+ level: ((_e = opts.level) !== null && _e !== void 0 ? _e : LogLevel.Info),
1703
923
  tags: JSON.stringify((_f = opts.tags) !== null && _f !== void 0 ? _f : []),
1704
924
  metadata: JSON.stringify(metadata),
1705
925
  errorMessage: (opts.error
@@ -1995,8 +1215,8 @@ const showFatalError = (error, errorTitle = 'An Error Occurred') => __awaiter(vo
1995
1215
  ? error.trim()
1996
1216
  : String((_c = error.message) !== null && _c !== void 0 ? _c : 'An unknown error occurred.'));
1997
1217
  const code = (typeof error === 'string'
1998
- ? ReactKitErrorCode$1.NoCode
1999
- : String((_d = error.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$1.NoCode));
1218
+ ? CommonKitErrorCode.NoCode
1219
+ : String((_d = error.code) !== null && _d !== void 0 ? _d : CommonKitErrorCode.NoCode));
2000
1220
  // Call all fatal error listeners
2001
1221
  try {
2002
1222
  fatalErrorHandlers.forEach((handler) => {
@@ -2227,8 +1447,8 @@ const AppWrapper = (props) => {
2227
1447
  && (fatalErrorMessage || fatalErrorCode || sessionHasExpired)) {
2228
1448
  // Re-encapsulate in an error
2229
1449
  const error = (sessionHasExpired
2230
- ? new ErrorWithCode(getSessionExpiredMessage(), ReactKitErrorCode$1.SessionExpired)
2231
- : new ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : ReactKitErrorCode$1.NoCode)));
1450
+ ? new ErrorWithCode(getSessionExpiredMessage(), CommonKitErrorCode.SessionExpired)
1451
+ : new ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : CommonKitErrorCode.NoCode)));
2232
1452
  // Choose error box variant
2233
1453
  let errorBoxVariant = Variant$1.Danger;
2234
1454
  if (sessionHasExpired) {
@@ -2525,111 +1745,6 @@ const ButtonInputGroup = (props) => {
2525
1745
  : children))));
2526
1746
  };
2527
1747
 
2528
- // Constants
2529
- const ORDINALS = ['th', 'st', 'nd', 'rd'];
2530
- /**
2531
- * Get a number's ordinal
2532
- * @author Gabe Abrams
2533
- * @param num the number being analyzed
2534
- * @returns ordinal
2535
- */
2536
- const getOrdinal = (num) => {
2537
- var _a, _b;
2538
- return ((_b = (_a = ORDINALS[(num - 20) % 10]) !== null && _a !== void 0 ? _a : ORDINALS[num]) !== null && _b !== void 0 ? _b : ORDINALS[0]);
2539
- };
2540
-
2541
- const monthNames = [
2542
- { short: 'Jan', full: 'January' },
2543
- { short: 'Feb', full: 'February' },
2544
- { short: 'Mar', full: 'March' },
2545
- { short: 'Apr', full: 'April' },
2546
- { short: 'May', full: 'May' },
2547
- { short: 'Jun', full: 'June' },
2548
- { short: 'Jul', full: 'July' },
2549
- { short: 'Aug', full: 'August' },
2550
- { short: 'Sep', full: 'September' },
2551
- { short: 'Oct', full: 'October' },
2552
- { short: 'Nov', full: 'November' },
2553
- { short: 'Dec', full: 'December' },
2554
- ];
2555
- /**
2556
- * Get the name of a month given the month number (1 = January, etc.)
2557
- * If an invalid number is provided, we will treat it like January
2558
- * @author Gabe Abrams
2559
- * @param month the number of the month
2560
- * @returns object containing multiple month name formats:
2561
- * { short, full } where short will look like "Jan" and full will look like
2562
- * "January"
2563
- */
2564
- const getMonthName = (month) => {
2565
- var _a;
2566
- return ((_a = monthNames[month - 1]) !== null && _a !== void 0 ? _a : monthNames[0]);
2567
- };
2568
-
2569
- /**
2570
- * Get current time info in US Boston Eastern Time, independent of machine
2571
- * timezone
2572
- * @author Gabe Abrams
2573
- * @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp
2574
- * @returns object with timestamp (ms since epoch) and numbers
2575
- * corresponding to ET time values for year, month, day, hour, hour12, minute, second, isPM
2576
- * where hour is in 24hr time and hour12 is in 12hr time.
2577
- */
2578
- const getTimeInfoInET = (dateOrTimestamp) => {
2579
- // Create a time string
2580
- let d;
2581
- if (!dateOrTimestamp) {
2582
- // Use now
2583
- d = new Date();
2584
- }
2585
- else if (typeof dateOrTimestamp === 'number') {
2586
- // Convert to date
2587
- d = new Date(dateOrTimestamp);
2588
- }
2589
- else {
2590
- // Already a date
2591
- d = dateOrTimestamp;
2592
- }
2593
- const str = d.toLocaleString('en-US', // Using US encoding (it's the only one installed on containers)
2594
- { timeZone: 'America/New_York' });
2595
- // Parse the string for the date/time info
2596
- const [dateStr, timeStr] = str.split(', '); // Format: MM/DD/YYYY, HH:MM:SS AM
2597
- const [monthStr, dayStr, yearStr] = dateStr.split('/'); // Format: MM/DD/YYYY
2598
- const [hourStr, minStr, ending] = timeStr.split(':'); // Format: HH:MM:SS AM
2599
- // Create all time numbers
2600
- const timestamp = d.getTime();
2601
- const year = Number.parseInt(yearStr, 10);
2602
- const month = Number.parseInt(monthStr, 10);
2603
- const day = Number.parseInt(dayStr, 10);
2604
- const minute = Number.parseInt(minStr, 10);
2605
- const second = (ending.split(' ')[0]
2606
- ? Number.parseInt(ending.split(' ')[0], 10)
2607
- : 0);
2608
- const hour12 = Number.parseInt(hourStr, 10);
2609
- // Convert from am/pm to 24hr
2610
- const isAM = ending.toLowerCase().includes('am');
2611
- const isPM = !isAM;
2612
- let hour = hour12;
2613
- if (isPM && hour12 !== 12) {
2614
- hour += 12;
2615
- }
2616
- else if (isAM && hour12 === 12) {
2617
- hour = 0;
2618
- }
2619
- // Return
2620
- return {
2621
- timestamp,
2622
- year,
2623
- month,
2624
- day,
2625
- hour,
2626
- hour12,
2627
- isPM,
2628
- minute,
2629
- second,
2630
- };
2631
- };
2632
-
2633
1748
  /**
2634
1749
  * A very simple, lightweight date chooser
2635
1750
  * @author Gabe Abrams
@@ -2693,11 +1808,11 @@ const getChoices = (opts) => {
2693
1808
  let startMonth = today.month;
2694
1809
  // Don't allow past or future dates
2695
1810
  if (dontAllowPast && dontAllowFuture) {
2696
- throw new ErrorWithCode('No past or future dates allowed', ReactKitErrorCode$1.SimpleDateChooserInvalidDateRange);
1811
+ throw new ErrorWithCode('No past or future dates allowed', CommonKitErrorCode.SimpleDateChooserInvalidDateRange);
2697
1812
  }
2698
1813
  // Require numMonthsToShow to be positive
2699
1814
  if (numMonthsToShow <= 0) {
2700
- throw new ErrorWithCode('numMonthsToShow must be positive', ReactKitErrorCode$1.SimpleDateChooserInvalidNumMonths);
1815
+ throw new ErrorWithCode('numMonthsToShow must be positive', CommonKitErrorCode.SimpleDateChooserInvalidNumMonths);
2701
1816
  }
2702
1817
  // Recalculate startMonth and startYear when allowing past dates
2703
1818
  if (!dontAllowPast) {
@@ -2899,24 +2014,6 @@ const SimpleDateChooser = (props) => {
2899
2014
  return (React__default.createElement("span", { className: "SimpleDateChooser-outer-container" }, body));
2900
2015
  };
2901
2016
 
2902
- /**
2903
- * Pad a number with zeros on the left (e.g. 5 becomes 05 with 2 digit padding)
2904
- * @author Gabe Abrams
2905
- * @param num the number to pad
2906
- * @param numDigits the minimum number of digits before the decimal
2907
- * @returns padded number
2908
- */
2909
- const padZerosLeft = (num, numDigits) => {
2910
- // Convert to string
2911
- let out = String(num);
2912
- // Add zeros
2913
- while (out.split('.')[0].length < numDigits) {
2914
- out = `0${out}`;
2915
- }
2916
- // Return
2917
- return out;
2918
- };
2919
-
2920
2017
  /**
2921
2018
  * A very simple, lightweight time chooser
2922
2019
  * @author Gardenia Liu
@@ -3749,211 +2846,6 @@ const ItemPicker = (props) => {
3749
2846
  React__default.createElement(NestableItemList, { items: items, onChanged: onChanged }))));
3750
2847
  };
3751
2848
 
3752
- // Import shared helpers
3753
- /**
3754
- * Get a human-readable description of a date (all in ET)
3755
- * @author Gabe Abrams
3756
- * @param [dateOrTimestamp=today] the date or timestamp for the date to describe
3757
- * @returns human-readable description of the date
3758
- */
3759
- const getHumanReadableDate = (dateOrTimestamp) => {
3760
- // Get the date info
3761
- const { month, day, year, } = getTimeInfoInET(dateOrTimestamp);
3762
- const currYear = getTimeInfoInET().year;
3763
- // Get the short month description
3764
- const monthName = getMonthName(month).short;
3765
- // Create start of description
3766
- let description = `${monthName} ${day}${getOrdinal(day)}`;
3767
- // Add on year if it's different
3768
- if (year !== currYear) {
3769
- description += ` ${year}`;
3770
- }
3771
- // Return description
3772
- return description;
3773
- };
3774
-
3775
- /**
3776
- * Path of the route for getting logs for log review
3777
- * @author Gabe Abrams
3778
- */
3779
- const LOG_REVIEW_GET_LOGS_ROUTE = `/admin${ROUTE_PATH_PREFIX}/logs`;
3780
-
3781
- /**
3782
- * Source of a log event
3783
- * @author Gabe Abrams
3784
- */
3785
- var LogSource;
3786
- (function (LogSource) {
3787
- // Client
3788
- LogSource["Client"] = "client";
3789
- // Server
3790
- LogSource["Server"] = "server";
3791
- })(LogSource || (LogSource = {}));
3792
- var LogSource$1 = LogSource;
3793
-
3794
- /**
3795
- * Type of a log event
3796
- * @author Gabe Abrams
3797
- */
3798
- var LogType;
3799
- (function (LogType) {
3800
- // User action
3801
- LogType["Action"] = "action";
3802
- // Error
3803
- LogType["Error"] = "error";
3804
- })(LogType || (LogType = {}));
3805
- var LogType$1 = LogType;
3806
-
3807
- /**
3808
- * Types of actions
3809
- * @author Gabe Abrams
3810
- */
3811
- var LogAction;
3812
- (function (LogAction) {
3813
- // Target was opened by the user (it was not on screen, but now it is)
3814
- LogAction["Open"] = "Open";
3815
- // Target was closed by the user (it was on screen, but now it is not)
3816
- LogAction["Close"] = "Close";
3817
- // Target was cancelled by the user (it was on closed without saving)
3818
- LogAction["Cancel"] = "Cancel";
3819
- // Target was expanded by the user (it always remains on screen, but size was changed)
3820
- LogAction["Expand"] = "Expand";
3821
- // Target was collapsed by the user (it always remains on screen, but size was changed)
3822
- LogAction["Collapse"] = "Collapse";
3823
- // Target was viewed by the user (only for items that are not opened or closed, those must use Open/Close actions)
3824
- LogAction["View"] = "View";
3825
- // Target interrupted the user (popup, dialog, validation message, etc. appeared without user prompting)
3826
- LogAction["Interrupt"] = "Interrupt";
3827
- // Target was created by the user (it did not exist before)
3828
- LogAction["Create"] = "Create";
3829
- // Target was modified by the user (it existed and was changed)
3830
- LogAction["Modify"] = "Modify";
3831
- // Target was deleted by the user (it existed and now it doesn't)
3832
- LogAction["Delete"] = "Delete";
3833
- // Target was added by the user (it already existed and was added to another place)
3834
- LogAction["Add"] = "Add";
3835
- // Target was removed by the user (it was removed from something but still exists)
3836
- LogAction["Remove"] = "Remove";
3837
- // Target was activated by the user (click, check, tap, keypress, etc.)
3838
- LogAction["Activate"] = "Activate";
3839
- // Target was deactivated by the user (click away, uncheck, tap outside of, tab away, etc.)
3840
- LogAction["Deactivate"] = "Deactivate";
3841
- // User showed interest in a target (hover, peek, etc.)
3842
- LogAction["Peek"] = "Peek";
3843
- // Halt a process (pause, etc.)
3844
- LogAction["Halt"] = "Halt";
3845
- // Resume a process (resume a halted process)
3846
- LogAction["Resume"] = "Resume";
3847
- // Jump to/seek to/reveal/go to/navigate to a target
3848
- LogAction["Jump"] = "Jump";
3849
- // Post a submission/message/etc. into the target
3850
- LogAction["Post"] = "Post";
3851
- // Like something
3852
- LogAction["Like"] = "Like";
3853
- // Dislike something
3854
- LogAction["Dislike"] = "Dislike";
3855
- // Unknown action
3856
- LogAction["Unknown"] = "Unknown";
3857
- })(LogAction || (LogAction = {}));
3858
- var LogAction$1 = LogAction;
3859
-
3860
- /**
3861
- * Server-side API param types
3862
- * @author Gabe Abrams
3863
- */
3864
- var ParamType;
3865
- (function (ParamType) {
3866
- ParamType["Boolean"] = "Boolean";
3867
- ParamType["BooleanOptional"] = "BooleanOptional";
3868
- ParamType["Float"] = "Float";
3869
- ParamType["FloatOptional"] = "FloatOptional";
3870
- ParamType["Int"] = "Int";
3871
- ParamType["IntOptional"] = "IntOptional";
3872
- ParamType["JSON"] = "JSON";
3873
- ParamType["JSONOptional"] = "JSONOptional";
3874
- ParamType["String"] = "String";
3875
- ParamType["StringOptional"] = "StringOptional";
3876
- })(ParamType || (ParamType = {}));
3877
- var ParamType$1 = ParamType;
3878
-
3879
- /**
3880
- * Round a number to a certain number of decimals
3881
- * @author Gabe Abrams
3882
- * @param num the number to round
3883
- * @param numDecimals the number of decimals to round to
3884
- * @returns rounded number
3885
- */
3886
- const roundToNumDecimals = (num, numDecimals) => {
3887
- const rounder = 10 ** numDecimals;
3888
- return (Math.round(num * rounder) / rounder);
3889
- };
3890
-
3891
- /**
3892
- * Escape a CSV cell if needed
3893
- * @author Gabe Abrams
3894
- * @param text the cell contents
3895
- * @returns escaped cell text
3896
- */
3897
- const escapeCellText = (text) => {
3898
- if (!String(text).includes(',')
3899
- && !String(text).includes('"')) {
3900
- // No need to escape
3901
- return String(text);
3902
- }
3903
- // Perform escape
3904
- return `"${String(text).replace(/"/g, '""')}"`;
3905
- };
3906
- /**
3907
- * Generate a CSV file
3908
- * @author Gabe Abrams
3909
- * @param data list of row data in the form of json objects
3910
- * @param columns list of columns to include in the csv where each column is an object with:
3911
- * - title: the column title
3912
- * - param: the key in the data object to use for this column
3913
- * - textIfUndefined: optional text to use if the value is undefined (defaults to empty string)
3914
- * @returns multiline csv string
3915
- */
3916
- const genCSV = (data, columns) => {
3917
- let csv = '';
3918
- // Add header
3919
- csv += (columns
3920
- .map((column) => {
3921
- return escapeCellText(column.title);
3922
- })
3923
- .join(','));
3924
- // Add each row
3925
- data.forEach((datum) => {
3926
- csv += '\n';
3927
- csv += (columns
3928
- .map((column) => {
3929
- var _a;
3930
- let contents;
3931
- const cell = datum[column.param];
3932
- if (typeof cell === 'string'
3933
- || typeof cell === 'number'
3934
- || typeof cell === 'boolean') {
3935
- contents = String(cell);
3936
- }
3937
- else if (cell === null) {
3938
- contents = '';
3939
- }
3940
- else if (typeof cell === 'undefined') {
3941
- contents = ((_a = column.textIfUndefined) !== null && _a !== void 0 ? _a : '');
3942
- }
3943
- else if (typeof cell === 'object') {
3944
- contents = JSON.stringify(cell);
3945
- }
3946
- else {
3947
- contents = '';
3948
- }
3949
- return escapeCellText(contents);
3950
- })
3951
- .join(','));
3952
- });
3953
- // Return
3954
- return csv;
3955
- };
3956
-
3957
2849
  /**
3958
2850
  * Button for downloading a csv file
3959
2851
  * @author Gabe Abrams
@@ -4228,7 +3120,7 @@ const IntelliTable = (props) => {
4228
3120
  }
4229
3121
  // Sort differently based on the data type
4230
3122
  // > Boolean
4231
- if (paramType === ParamType$1.Boolean) {
3123
+ if (paramType === ParamType.Boolean) {
4232
3124
  if (aVal && !bVal) {
4233
3125
  return (descending ? -1 : 1);
4234
3126
  }
@@ -4238,14 +3130,14 @@ const IntelliTable = (props) => {
4238
3130
  return tiebreaker;
4239
3131
  }
4240
3132
  // > Number
4241
- if (paramType === ParamType$1.Int
4242
- || paramType === ParamType$1.Float) {
3133
+ if (paramType === ParamType.Int
3134
+ || paramType === ParamType.Float) {
4243
3135
  return (descending
4244
3136
  ? (bVal - aVal)
4245
3137
  : (aVal - bVal));
4246
3138
  }
4247
3139
  // > String
4248
- if (paramType === ParamType$1.String) {
3140
+ if (paramType === ParamType.String) {
4249
3141
  if (aVal < bVal) {
4250
3142
  return (descending ? 1 : -1);
4251
3143
  }
@@ -4255,7 +3147,7 @@ const IntelliTable = (props) => {
4255
3147
  return tiebreaker;
4256
3148
  }
4257
3149
  // > JSON
4258
- if (paramType === ParamType$1.JSON) {
3150
+ if (paramType === ParamType.JSON) {
4259
3151
  const aSize = (Array.isArray(aVal)
4260
3152
  ? aVal.length
4261
3153
  : Object.keys(aVal).length);
@@ -4287,7 +3179,7 @@ const IntelliTable = (props) => {
4287
3179
  let fullValue;
4288
3180
  let visibleValue;
4289
3181
  let colTitle = '';
4290
- if (column.type === ParamType$1.Boolean) {
3182
+ if (column.type === ParamType.Boolean) {
4291
3183
  fullValue = !!(value);
4292
3184
  const noValue = (value === undefined
4293
3185
  || value === null);
@@ -4299,7 +3191,7 @@ const IntelliTable = (props) => {
4299
3191
  colTitle = 'Empty Cell';
4300
3192
  }
4301
3193
  }
4302
- else if (column.type === ParamType$1.Int) {
3194
+ else if (column.type === ParamType.Int) {
4303
3195
  fullValue = Number.parseInt(value, 10);
4304
3196
  const noValue = Number.isNaN(fullValue);
4305
3197
  visibleValue = (noValue
@@ -4310,7 +3202,7 @@ const IntelliTable = (props) => {
4310
3202
  colTitle = 'Empty Cell';
4311
3203
  }
4312
3204
  }
4313
- else if (column.type === ParamType$1.Float) {
3205
+ else if (column.type === ParamType.Float) {
4314
3206
  fullValue = Number.parseFloat(value);
4315
3207
  const noValue = Number.isNaN(fullValue);
4316
3208
  visibleValue = (noValue
@@ -4321,7 +3213,7 @@ const IntelliTable = (props) => {
4321
3213
  colTitle = 'Empty Cell';
4322
3214
  }
4323
3215
  }
4324
- else if (column.type === ParamType$1.String) {
3216
+ else if (column.type === ParamType.String) {
4325
3217
  fullValue = String(value).trim();
4326
3218
  const noValue = (value === undefined
4327
3219
  || value === null
@@ -4334,7 +3226,7 @@ const IntelliTable = (props) => {
4334
3226
  colTitle = 'Empty Cell';
4335
3227
  }
4336
3228
  }
4337
- else if (column.type === ParamType$1.JSON) {
3229
+ else if (column.type === ParamType.JSON) {
4338
3230
  fullValue = JSON.stringify(value);
4339
3231
  const noValue = (Array.isArray(value)
4340
3232
  ? (!value || value.length === 0)
@@ -4449,14 +3341,6 @@ const Pagination = (props) => {
4449
3341
  React__default.createElement(FontAwesomeIcon, { icon: faArrowRight }))))));
4450
3342
  };
4451
3343
 
4452
- /**
4453
- * Deeply clones an object
4454
- * @author Yuen Ler Chow
4455
- * @param obj the object to clone
4456
- * @returns a deep clone of the object
4457
- */
4458
- const cloneDeep = clone;
4459
-
4460
3344
  /**
4461
3345
  * Log reviewer panel that allows users (must be approved admins) to
4462
3346
  * review logs written by dce-reactkit
@@ -4564,185 +3448,185 @@ const columns = [
4564
3448
  {
4565
3449
  title: 'First Name',
4566
3450
  param: 'userFirstName',
4567
- type: ParamType$1.String,
3451
+ type: ParamType.String,
4568
3452
  },
4569
3453
  {
4570
3454
  title: 'Last Name',
4571
3455
  param: 'userLastName',
4572
- type: ParamType$1.String,
3456
+ type: ParamType.String,
4573
3457
  },
4574
3458
  {
4575
3459
  title: 'Email',
4576
3460
  param: 'userEmail',
4577
- type: ParamType$1.String,
3461
+ type: ParamType.String,
4578
3462
  },
4579
3463
  {
4580
3464
  title: 'Canvas Id',
4581
3465
  param: 'userId',
4582
- type: ParamType$1.Int,
3466
+ type: ParamType.Int,
4583
3467
  },
4584
3468
  {
4585
3469
  title: 'Student?',
4586
3470
  param: 'isLearner',
4587
- type: ParamType$1.Boolean,
3471
+ type: ParamType.Boolean,
4588
3472
  },
4589
3473
  {
4590
3474
  title: 'Teaching Staff?',
4591
3475
  param: 'isTTM',
4592
- type: ParamType$1.Boolean,
3476
+ type: ParamType.Boolean,
4593
3477
  startsHidden: true,
4594
3478
  },
4595
3479
  {
4596
3480
  title: 'Admin?',
4597
3481
  param: 'isAdmin',
4598
- type: ParamType$1.Boolean,
3482
+ type: ParamType.Boolean,
4599
3483
  startsHidden: true,
4600
3484
  },
4601
3485
  {
4602
3486
  title: 'Course Canvas Id',
4603
3487
  param: 'courseId',
4604
- type: ParamType$1.Int,
3488
+ type: ParamType.Int,
4605
3489
  startsHidden: true,
4606
3490
  },
4607
3491
  {
4608
3492
  title: 'Course Name',
4609
3493
  param: 'courseName',
4610
- type: ParamType$1.String,
3494
+ type: ParamType.String,
4611
3495
  },
4612
3496
  {
4613
3497
  title: 'Browser Name',
4614
3498
  param: 'browser.name',
4615
- type: ParamType$1.String,
3499
+ type: ParamType.String,
4616
3500
  startsHidden: true,
4617
3501
  },
4618
3502
  {
4619
3503
  title: 'Browser Version',
4620
3504
  param: 'browser.version',
4621
- type: ParamType$1.String,
3505
+ type: ParamType.String,
4622
3506
  startsHidden: true,
4623
3507
  },
4624
3508
  {
4625
3509
  title: 'OS',
4626
3510
  param: 'device.os',
4627
- type: ParamType$1.String,
3511
+ type: ParamType.String,
4628
3512
  startsHidden: true,
4629
3513
  },
4630
3514
  {
4631
3515
  title: 'Mobile?',
4632
3516
  param: 'device.isMobile',
4633
- type: ParamType$1.Boolean,
3517
+ type: ParamType.Boolean,
4634
3518
  startsHidden: true,
4635
3519
  },
4636
3520
  {
4637
3521
  title: 'Year',
4638
3522
  param: 'year',
4639
- type: ParamType$1.Int,
3523
+ type: ParamType.Int,
4640
3524
  },
4641
3525
  {
4642
3526
  title: 'Month',
4643
3527
  param: 'month',
4644
- type: ParamType$1.Int,
3528
+ type: ParamType.Int,
4645
3529
  },
4646
3530
  {
4647
3531
  title: 'Day',
4648
3532
  param: 'day',
4649
- type: ParamType$1.Int,
3533
+ type: ParamType.Int,
4650
3534
  },
4651
3535
  {
4652
3536
  title: 'Hour',
4653
3537
  param: 'hour',
4654
- type: ParamType$1.Int,
3538
+ type: ParamType.Int,
4655
3539
  },
4656
3540
  {
4657
3541
  title: 'Minute',
4658
3542
  param: 'minute',
4659
- type: ParamType$1.Int,
3543
+ type: ParamType.Int,
4660
3544
  startsHidden: true,
4661
3545
  },
4662
3546
  {
4663
3547
  title: 'Timestamp',
4664
3548
  param: 'timestamp',
4665
- type: ParamType$1.Int,
3549
+ type: ParamType.Int,
4666
3550
  startsHidden: true,
4667
3551
  },
4668
3552
  {
4669
3553
  title: 'Context',
4670
3554
  param: 'context',
4671
- type: ParamType$1.String,
3555
+ type: ParamType.String,
4672
3556
  },
4673
3557
  {
4674
3558
  title: 'Subcontext',
4675
3559
  param: 'subcontext',
4676
- type: ParamType$1.String,
3560
+ type: ParamType.String,
4677
3561
  },
4678
3562
  {
4679
3563
  title: 'Tags',
4680
3564
  param: 'tags',
4681
- type: ParamType$1.JSON,
3565
+ type: ParamType.JSON,
4682
3566
  startsHidden: true,
4683
3567
  },
4684
3568
  {
4685
3569
  title: 'Log Level',
4686
3570
  param: 'level',
4687
- type: ParamType$1.String,
3571
+ type: ParamType.String,
4688
3572
  startsHidden: true,
4689
3573
  },
4690
3574
  {
4691
3575
  title: 'Metadata',
4692
3576
  param: 'metadata',
4693
- type: ParamType$1.JSON,
3577
+ type: ParamType.JSON,
4694
3578
  startsHidden: true,
4695
3579
  },
4696
3580
  {
4697
3581
  title: 'Source',
4698
3582
  param: 'source',
4699
- type: ParamType$1.String,
3583
+ type: ParamType.String,
4700
3584
  },
4701
3585
  {
4702
3586
  title: 'Server Route Path',
4703
3587
  param: 'routePath',
4704
- type: ParamType$1.String,
3588
+ type: ParamType.String,
4705
3589
  startsHidden: true,
4706
3590
  },
4707
3591
  {
4708
3592
  title: 'Server Route Template',
4709
3593
  param: 'routeTemplate',
4710
- type: ParamType$1.String,
3594
+ type: ParamType.String,
4711
3595
  startsHidden: true,
4712
3596
  },
4713
3597
  {
4714
3598
  title: 'Type',
4715
3599
  param: 'type',
4716
- type: ParamType$1.String,
3600
+ type: ParamType.String,
4717
3601
  },
4718
3602
  {
4719
3603
  title: 'Error Message',
4720
3604
  param: 'errorMessage',
4721
- type: ParamType$1.String,
3605
+ type: ParamType.String,
4722
3606
  startsHidden: true,
4723
3607
  },
4724
3608
  {
4725
3609
  title: 'Error Code',
4726
3610
  param: 'errorCode',
4727
- type: ParamType$1.String,
3611
+ type: ParamType.String,
4728
3612
  startsHidden: true,
4729
3613
  },
4730
3614
  {
4731
3615
  title: 'Error Stack',
4732
3616
  param: 'errorStack',
4733
- type: ParamType$1.String,
3617
+ type: ParamType.String,
4734
3618
  startsHidden: true,
4735
3619
  },
4736
3620
  {
4737
3621
  title: 'Action Target',
4738
3622
  param: 'target',
4739
- type: ParamType$1.String,
3623
+ type: ParamType.String,
4740
3624
  startsHidden: true,
4741
3625
  },
4742
3626
  {
4743
3627
  title: 'Action Type',
4744
3628
  param: 'action',
4745
- type: ParamType$1.String,
3629
+ type: ParamType.String,
4746
3630
  startsHidden: true,
4747
3631
  },
4748
3632
  ];
@@ -5002,7 +3886,7 @@ const LogReviewer = (props) => {
5002
3886
  Object.values(targetMap).forEach((target) => {
5003
3887
  initActionErrorFilterState.target[target] = true;
5004
3888
  });
5005
- Object.values(LogAction$1).forEach((action) => {
3889
+ Object.values(LogAction).forEach((action) => {
5006
3890
  initActionErrorFilterState.action[action] = true;
5007
3891
  });
5008
3892
  // Initial state
@@ -5399,22 +4283,22 @@ const LogReviewer = (props) => {
5399
4283
  });
5400
4284
  }, ariaLabel: "show logs of all types", selected: pendingActionErrorFilterState.type === undefined, unselectedVariant: Variant$1.Light }),
5401
4285
  React__default.createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
5402
- const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType$1.Action });
4286
+ const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType.Action });
5403
4287
  dispatch({
5404
4288
  type: ActionType$6.UpdateActionErrorFilterState,
5405
4289
  actionErrorFilterState: newActionErrorFilterState,
5406
4290
  });
5407
- }, ariaLabel: "only show action logs", selected: pendingActionErrorFilterState.type === LogType$1.Action, unselectedVariant: Variant$1.Light }),
4291
+ }, ariaLabel: "only show action logs", selected: pendingActionErrorFilterState.type === LogType.Action, unselectedVariant: Variant$1.Light }),
5408
4292
  React__default.createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
5409
- const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType$1.Error });
4293
+ const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType.Error });
5410
4294
  dispatch({
5411
4295
  type: ActionType$6.UpdateActionErrorFilterState,
5412
4296
  actionErrorFilterState: newActionErrorFilterState,
5413
4297
  });
5414
- }, ariaLabel: "only show error logs", selected: pendingActionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
4298
+ }, ariaLabel: "only show error logs", selected: pendingActionErrorFilterState.type === LogType.Error, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
5415
4299
  (pendingActionErrorFilterState.type === undefined
5416
- || pendingActionErrorFilterState.type === LogType$1.Action) && (React__default.createElement(TabBox, { title: "Action Log Details" },
5417
- React__default.createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction$1)
4300
+ || pendingActionErrorFilterState.type === LogType.Action) && (React__default.createElement(TabBox, { title: "Action Log Details" },
4301
+ React__default.createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction)
5418
4302
  .map((action) => {
5419
4303
  const description = genHumanReadableName(action);
5420
4304
  return (React__default.createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: pendingActionErrorFilterState.action[action], onChanged: (checked) => {
@@ -5437,7 +4321,7 @@ const LogReviewer = (props) => {
5437
4321
  }, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
5438
4322
  })))),
5439
4323
  (pendingActionErrorFilterState.type === undefined
5440
- || pendingActionErrorFilterState.type === LogType$1.Error) && (React__default.createElement(TabBox, { title: "Error Log Details" },
4324
+ || pendingActionErrorFilterState.type === LogType.Error) && (React__default.createElement(TabBox, { title: "Error Log Details" },
5441
4325
  React__default.createElement("div", { className: "input-group mb-2" },
5442
4326
  React__default.createElement("span", { className: "input-group-text" }, "Error Message"),
5443
4327
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: pendingActionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => {
@@ -5583,21 +4467,21 @@ const LogReviewer = (props) => {
5583
4467
  advancedFilterState: newAdvancedFilterState,
5584
4468
  });
5585
4469
  }, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
5586
- React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: pendingAdvancedFilterState.source === LogSource$1.Client, onSelected: () => {
5587
- const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource$1.Client });
4470
+ React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: pendingAdvancedFilterState.source === LogSource.Client, onSelected: () => {
4471
+ const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource.Client });
5588
4472
  dispatch({
5589
4473
  type: ActionType$6.UpdateAdvancedFilterState,
5590
4474
  advancedFilterState: newAdvancedFilterState,
5591
4475
  });
5592
4476
  }, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
5593
- React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: pendingAdvancedFilterState.source === LogSource$1.Server, onSelected: () => {
5594
- const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource$1.Server });
4477
+ React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: pendingAdvancedFilterState.source === LogSource.Server, onSelected: () => {
4478
+ const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource.Server });
5595
4479
  dispatch({
5596
4480
  type: ActionType$6.UpdateAdvancedFilterState,
5597
4481
  advancedFilterState: newAdvancedFilterState,
5598
4482
  });
5599
4483
  }, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
5600
- pendingAdvancedFilterState.source !== LogSource$1.Client && (React__default.createElement("div", { className: "mt-2" },
4484
+ pendingAdvancedFilterState.source !== LogSource.Client && (React__default.createElement("div", { className: "mt-2" },
5601
4485
  React__default.createElement("div", { className: "input-group mb-2" },
5602
4486
  React__default.createElement("span", { className: "input-group-text" }, "Server Route Path"),
5603
4487
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for server route path", value: pendingAdvancedFilterState.routePath, placeholder: "e.g. /api/ttm/courses/12345", onChange: (e) => {
@@ -10192,7 +9076,7 @@ var MenuPortal = function MenuPortal(props) {
10192
9076
  }), innerProps), children);
10193
9077
  return jsx(PortalPlacementContext.Provider, {
10194
9078
  value: portalPlacementContext
10195
- }, appendTo ? /*#__PURE__*/reactDom.exports.createPortal(menuWrapper, appendTo) : menuWrapper);
9079
+ }, appendTo ? /*#__PURE__*/createPortal(menuWrapper, appendTo) : menuWrapper);
10196
9080
  };
10197
9081
 
10198
9082
  // ==============================
@@ -14295,11 +13179,11 @@ const AddOrEditDBEntry = (props) => {
14295
13179
  * @param [adminsOnly] true if the endpoint is for admins only
14296
13180
  * @returns the endpoint path
14297
13181
  */
14298
- const generateEndpointPath = (collectionName, adminsOnly) => {
13182
+ const generateEndpointPath = (collectionName, adminsOnly = true) => {
14299
13183
  // Determine prefix based on whether the endpoint is for admins only
14300
13184
  const userPath = adminsOnly ? 'admin' : 'ttm';
14301
13185
  // Return the endpoint path
14302
- return `/api/${userPath}/dce-reactkit/dbeditor/${collectionName}`;
13186
+ return `/api/${userPath}/dce-commonkit/dbeditor/${collectionName}`;
14303
13187
  };
14304
13188
 
14305
13189
  /**
@@ -14628,27 +13512,6 @@ const ToggleSwitch = (props) => {
14628
13512
  } })));
14629
13513
  };
14630
13514
 
14631
- /**
14632
- * Convert a string to hyphenated lowercase format with no space or
14633
- * non-alphanumeric characters
14634
- * @author Gabe Abrams
14635
- * @param str the string to convert
14636
- * @returns the idified string
14637
- */
14638
- const idify = (str) => {
14639
- return (str
14640
- // Trim whitespace
14641
- .trim()
14642
- // Convert to lowercase
14643
- .toLowerCase()
14644
- // Replace non-alphanumeric characters with hyphens
14645
- .replace(/[^a-z0-9]+/g, '-')
14646
- // Change multiple hyphens in a row for a single hyphen
14647
- .replace(/-+/g, '-')
14648
- // Remove hyphens at the beginning and end of the string
14649
- .replace(/^-+|-+$/g, ''));
14650
- };
14651
-
14652
13515
  /**
14653
13516
  * Container that automatically scrolls when new items are added,
14654
13517
  * lets the user scroll up to see old items, but resumes
@@ -15305,38 +14168,12 @@ const Dropdown = (props) => {
15305
14168
  */
15306
14169
  var ProgressBarSize;
15307
14170
  (function (ProgressBarSize) {
14171
+ ProgressBarSize["Small"] = "Small";
15308
14172
  ProgressBarSize["Medium"] = "Medium";
15309
14173
  ProgressBarSize["Large"] = "Large";
15310
14174
  })(ProgressBarSize || (ProgressBarSize = {}));
15311
14175
  var ProgressBarSize$1 = ProgressBarSize;
15312
14176
 
15313
- /**
15314
- * Pad a number's decimal with zeros on the right
15315
- * (e.g. 5.2 becomes 5.20 with 2 digit padding)
15316
- * @author Gabe Abrams
15317
- * @param num the number to pad
15318
- * @param numDigits the minimum number of digits after the decimal
15319
- * @returns padded number
15320
- */
15321
- const padDecimalZeros = (num, numDigits) => {
15322
- // Skip if nothing to do
15323
- if (numDigits < 1) {
15324
- return String(num);
15325
- }
15326
- // Convert to string
15327
- let out = String(num);
15328
- // Add a decimal point if there isn't one
15329
- if (!out.includes('.')) {
15330
- out += '.';
15331
- }
15332
- // Add zeros
15333
- while (out.split('.')[1].length < numDigits) {
15334
- out = `${out}0`;
15335
- }
15336
- // Return
15337
- return out;
15338
- };
15339
-
15340
14177
  /**
15341
14178
  * Customizable Progress Bar component using Bootstrap styles
15342
14179
  * @author Allison Zhang
@@ -15347,7 +14184,7 @@ const padDecimalZeros = (num, numDigits) => {
15347
14184
  // Multiplier for calculating width of number of items
15348
14185
  const ITEM_WIDTH_MULTIPLIER = 1.3;
15349
14186
  // Constant for percent width
15350
- const PERCENT_WIDTH = 2.7;
14187
+ const PERCENT_WIDTH = 3;
15351
14188
  // Constant for item width
15352
14189
  const ITEM_WIDTH = 2;
15353
14190
  /*------------------------------------------------------------------------*/
@@ -15357,9 +14194,11 @@ const ITEM_WIDTH = 2;
15357
14194
  let style = `
15358
14195
  .ProgressBar-number-of,
15359
14196
  .ProgressBar-percent {
14197
+ flex: 0 0 auto;
15360
14198
  white-space: nowrap;
15361
- padding-right: 0.3em;
15362
- text-align: left;
14199
+ padding-right: 0.5em;
14200
+ padding-left: 0.25em;
14201
+ text-align: right;
15363
14202
  transition: width .25s ease;
15364
14203
  }
15365
14204
 
@@ -15379,7 +14218,7 @@ const ProgressBar = (props) => {
15379
14218
  /*------------------------------------------------------------------------*/
15380
14219
  /* -------------------------------- Setup ------------------------------- */
15381
14220
  /*------------------------------------------------------------------------*/
15382
- var _a, _b, _c, _d;
14221
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
15383
14222
  /* -------------- Props ------------- */
15384
14223
  // Destructure props
15385
14224
  const { striped, variant = Variant$1.Warning, bgVariant = Variant$1.Secondary, showOutline, size = ProgressBarSize$1.Medium, } = props;
@@ -15411,19 +14250,10 @@ const ProgressBar = (props) => {
15411
14250
  /*----------------------------------------*/
15412
14251
  /* ---------------- Sizes --------------- */
15413
14252
  /*----------------------------------------*/
15414
- // Add dynamic general style
15415
- style += `
15416
- .ProgressBar-percent {
15417
- min-width: ${(status.usePercent ? (_a = status.numDecimalPlaces) !== null && _a !== void 0 ? _a : 0 : 0) + PERCENT_WIDTH}em;
15418
- }
15419
- .ProgressBar-number-of {
15420
- min-width: ${((!status.usePercent ? String((_b = status.total) !== null && _b !== void 0 ? _b : 0).length || 1 : 0) * ITEM_WIDTH_MULTIPLIER) + ITEM_WIDTH}em;
15421
- }
15422
- `;
15423
14253
  // Size styles
15424
14254
  switch (size) {
15425
- case ProgressBarSize$1.Medium:
15426
- // Medium size
14255
+ case ProgressBarSize$1.Small:
14256
+ // Small size
15427
14257
  style += `
15428
14258
  .ProgressBar-container .ProgressBar-number-of, .ProgressBar-container .ProgressBar-percent {
15429
14259
  font-size: 1em;
@@ -15436,10 +14266,18 @@ const ProgressBar = (props) => {
15436
14266
  height: 1.5em;
15437
14267
  border-radius: 0.5em;
15438
14268
  }
14269
+ .ProgressBar-percent {
14270
+ min-width: ${((status.usePercent ? (_a = status.numDecimalPlaces) !== null && _a !== void 0 ? _a : 0 : 0) * 1) + PERCENT_WIDTH}em;
14271
+ max-width: ${((status.usePercent ? (_b = status.numDecimalPlaces) !== null && _b !== void 0 ? _b : 0 : 0) * 1) + PERCENT_WIDTH}em;
14272
+ }
14273
+ .ProgressBar-number-of {
14274
+ min-width: ${((!status.usePercent ? ((_c = status.total) === null || _c === void 0 ? void 0 : _c.toString().length) || 1 : 0) * ITEM_WIDTH_MULTIPLIER) + ITEM_WIDTH}em;
14275
+ max-width: ${((!status.usePercent ? ((_d = status.total) === null || _d === void 0 ? void 0 : _d.toString().length) || 1 : 0) * ITEM_WIDTH_MULTIPLIER) + ITEM_WIDTH}em;
14276
+ }
15439
14277
  `;
15440
14278
  break;
15441
- case ProgressBarSize$1.Large:
15442
- // Large size
14279
+ case ProgressBarSize$1.Medium:
14280
+ // Medium size
15443
14281
  style += `
15444
14282
  .ProgressBar-container .ProgressBar-number-of, .ProgressBar-container .ProgressBar-percent {
15445
14283
  font-size: 1.5em;
@@ -15452,14 +14290,47 @@ const ProgressBar = (props) => {
15452
14290
  height: 2em;
15453
14291
  border-radius: 0.7em;
15454
14292
  }
14293
+ .ProgressBar-percent {
14294
+ min-width: ${((status.usePercent ? (_e = status.numDecimalPlaces) !== null && _e !== void 0 ? _e : 0 : 0) * 1) + PERCENT_WIDTH}em;
14295
+ max-width: ${((status.usePercent ? (_f = status.numDecimalPlaces) !== null && _f !== void 0 ? _f : 0 : 0) * 1) + PERCENT_WIDTH}em;
14296
+ }
14297
+ .ProgressBar-number-of {
14298
+ min-width: ${((!status.usePercent ? ((_g = status.total) === null || _g === void 0 ? void 0 : _g.toString().length) || 1 : 0) * ITEM_WIDTH_MULTIPLIER) + ITEM_WIDTH}em;
14299
+ max-width: ${((!status.usePercent ? ((_h = status.total) === null || _h === void 0 ? void 0 : _h.toString().length) || 1 : 0) * ITEM_WIDTH_MULTIPLIER) + ITEM_WIDTH}em;
14300
+ }
14301
+ `;
14302
+ break;
14303
+ case ProgressBarSize$1.Large:
14304
+ // Large size
14305
+ style += `
14306
+ .ProgressBar-container .ProgressBar-number-of, .ProgressBar-container .ProgressBar-percent {
14307
+ font-size: 2em;
14308
+ }
14309
+ .ProgressBar-container .ProgressBar-background {
14310
+ height: 3em;
14311
+ border-radius: 1em;
14312
+ }
14313
+ .ProgressBar-container .ProgressBar-bar {
14314
+ height: 3em;
14315
+ border-radius: 1em;
14316
+ }
14317
+ .ProgressBar-percent {
14318
+ min-width: ${((status.usePercent ? (_j = status.numDecimalPlaces) !== null && _j !== void 0 ? _j : 0 : 0) * 1) + PERCENT_WIDTH}em;
14319
+ max-width: ${((status.usePercent ? (_k = status.numDecimalPlaces) !== null && _k !== void 0 ? _k : 0 : 0) * 1) + PERCENT_WIDTH}em;
14320
+ }
14321
+ .ProgressBar-number-of {
14322
+ min-width: ${((!status.usePercent ? ((_l = status.total) === null || _l === void 0 ? void 0 : _l.toString().length) || 1 : 0) * ITEM_WIDTH_MULTIPLIER) + ITEM_WIDTH}em;
14323
+ max-width: ${((!status.usePercent ? ((_m = status.total) === null || _m === void 0 ? void 0 : _m.toString().length) || 1 : 0) * ITEM_WIDTH_MULTIPLIER) + ITEM_WIDTH}em;
14324
+ }
15455
14325
  `;
15456
14326
  break;
15457
14327
  }
15458
14328
  // Get the width of the outline based on size
15459
14329
  const outlineWidth = (() => {
15460
14330
  switch (size) {
15461
- case ProgressBarSize$1.Medium: return '0.05em';
15462
- case ProgressBarSize$1.Large: return '0.08em';
14331
+ case ProgressBarSize$1.Small: return '0.05em';
14332
+ case ProgressBarSize$1.Medium: return '0.08em';
14333
+ case ProgressBarSize$1.Large: return '0.1em';
15463
14334
  default: return '0.05em';
15464
14335
  }
15465
14336
  })();
@@ -15484,88 +14355,38 @@ const ProgressBar = (props) => {
15484
14355
  }
15485
14356
  `;
15486
14357
  // Stripes for striped effect
15487
- let stripes = null;
15488
- if (striped) {
15489
- stripes = (React__default.createElement("div", null,
15490
- React__default.createElement("style", null, stripesStyle),
15491
- React__default.createElement("div", { className: "ProgressBar-stripes position-absolute", style: {
15492
- width: '200%',
15493
- height: '100%',
15494
- } }, "\u00A0")));
15495
- }
14358
+ const stripes = (React__default.createElement("div", null,
14359
+ React__default.createElement("style", null, stripesStyle),
14360
+ React__default.createElement("div", { className: "ProgressBar-stripes position-absolute ", style: {
14361
+ width: '200%',
14362
+ height: '100%',
14363
+ } }, "\u00A0")));
15496
14364
  /*----------------------------------------*/
15497
14365
  /* --------------- Main UI -------------- */
15498
14366
  /*----------------------------------------*/
15499
- // Calculate the width of the progress bar
15500
- let progressBarWidthPercent = 0;
15501
- if (status.usePercent) {
15502
- // Use percent progress directly
15503
- progressBarWidthPercent = status.percentProgress;
15504
- }
15505
- else if (status.total > 0) {
15506
- // Calculate percent progress from items
15507
- progressBarWidthPercent = (status.numComplete / status.total) * 100;
15508
- }
15509
14367
  // Render the progress bar
15510
14368
  return (React__default.createElement("div", { className: "ProgressBar-container d-flex align-items-center" },
15511
14369
  React__default.createElement("style", null, style),
15512
- !status.usePercent && status.numComplete && (React__default.createElement("span", { className: "ProgressBar-number-of" },
14370
+ !status.usePercent && status.numComplete && (React__default.createElement("span", { className: "ProgressBar-number-of pe-2 align-self-center" },
15513
14371
  status.numComplete,
15514
14372
  "\u00A0of\u00A0",
15515
14373
  status.total)),
15516
- status.usePercent && status.percentProgress && (React__default.createElement("span", { className: "ProgressBar-percent" },
15517
- padDecimalZeros(roundToNumDecimals(status.percentProgress, (_c = status === null || status === void 0 ? void 0 : status.numDecimalPlaces) !== null && _c !== void 0 ? _c : 0), (_d = status === null || status === void 0 ? void 0 : status.numDecimalPlaces) !== null && _d !== void 0 ? _d : 0),
14374
+ status.usePercent && status.percentProgress && (React__default.createElement("span", { className: "ProgressBar-percent pe-2 align-self-center" },
14375
+ status.percentProgress.toFixed((_o = status === null || status === void 0 ? void 0 : status.numDecimalPlaces) !== null && _o !== void 0 ? _o : 0),
15518
14376
  "%")),
15519
- React__default.createElement("div", { className: `ProgressBar-background bg-${bgVariant} flex-grow-1`, style: {
14377
+ React__default.createElement("div", { className: `ProgressBar-background bg-${bgVariant} w-100`, style: {
15520
14378
  boxShadow: `0 0 0 ${outlineWidth} ${showOutline ? '#000' : '#DEE2E6'}`,
15521
14379
  }, "aria-valuenow": status.usePercent ? status.percentProgress : status.numComplete, "aria-valuemin": 0, "aria-valuemax": status.usePercent ? 100 : status.total },
15522
14380
  React__default.createElement("div", { className: `ProgressBar-bar bg-${variant} text-start position-relative`, style: {
15523
- width: `${progressBarWidthPercent}%`,
14381
+ width: `${(status.usePercent ? status.percentProgress : (status.numComplete / status.total) * 100)}%`,
15524
14382
  overflow: 'hidden',
15525
14383
  } },
15526
- stripes,
14384
+ striped && stripes,
15527
14385
  "\u00A0"))));
15528
14386
  };
15529
14387
 
15530
- /**
15531
- * One minute in ms
15532
- * @author Gabe Abrams
15533
- */
15534
- const MINUTE_IN_MS = 60000;
15535
-
15536
- /**
15537
- * One hour in ms
15538
- * @author Gabe Abrams
15539
- */
15540
- const HOUR_IN_MS = 3600000;
15541
-
15542
- /**
15543
- * One day in ms
15544
- * @author Gabe Abrams
15545
- */
15546
- const DAY_IN_MS = 86400000;
15547
-
15548
- /**
15549
- * Path of the route for storing client-side logs
15550
- * @author Gabe Abrams
15551
- */
15552
- const LOG_REVIEW_ROUTE_PATH_PREFIX = `/admin${ROUTE_PATH_PREFIX}/logs`;
15553
-
15554
- /**
15555
- * Route for checking the status of the current user's
15556
- * access to log review
15557
- * @author Gabe Abrams
15558
- */
15559
- const LOG_REVIEW_STATUS_ROUTE = `${ROUTE_PATH_PREFIX}/logs/access_allowed`;
15560
-
15561
- /**
15562
- * Route for checking if the current user is a select admin
15563
- * @author Gabe Abrams
15564
- */
15565
- const SELECT_ADMIN_CHECK_ROUTE = '/api/admin/select/is-select-admin';
15566
-
15567
14388
  // True if user is on mobile or tablet
15568
- let cachedResult = undefined;
14389
+ let cachedResult;
15569
14390
  /**
15570
14391
  * Check if the user is on a mobile device or tablet
15571
14392
  * from https://stackoverflow.com/questions/11381673/detecting-a-mobile-browser
@@ -15578,6 +14399,7 @@ const isMobileOrTablet = () => {
15578
14399
  }
15579
14400
  try {
15580
14401
  let check = false;
14402
+ // eslint-disable-next-line max-len, no-useless-escape
15581
14403
  ((a) => { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)))
15582
14404
  check = true; })((navigator !== null && navigator !== void 0 ? navigator : {}).userAgent || (navigator !== null && navigator !== void 0 ? navigator : {}).vendor || ((_a = window) !== null && _a !== void 0 ? _a : {}).opera);
15583
14405
  cachedResult = check;
@@ -15619,93 +14441,7 @@ const DynamicWord = {
15619
14441
  };
15620
14442
 
15621
14443
  /**
15622
- * Shorten text so it fits into a certain number of chars
15623
- * @author Gabe Abrams
15624
- * @param text the text to abbreviate
15625
- * @param maxChars the maximum number of chars to include
15626
- * @returns abbreviated text with length no greater than maxChars
15627
- * (including ellipses if applicable)
15628
- */
15629
- const abbreviate = (text, maxChars) => {
15630
- // Check if already short enough
15631
- if (text.trim().length < maxChars) {
15632
- return text.trim();
15633
- }
15634
- // Abbreviate
15635
- const shortenedText = (text
15636
- .trim()
15637
- .substring(0, maxChars - 3)
15638
- .trim());
15639
- return `${shortenedText}...`;
15640
- };
15641
-
15642
- /**
15643
- * Sum the numbers in an array
15644
- * @author Gabe Abrams
15645
- * @param nums the numbers to sum
15646
- * @returns the sum of the numbers
15647
- */
15648
- const sum = (nums) => {
15649
- return nums.reduce((a, b) => {
15650
- return (a + b);
15651
- }, 0);
15652
- };
15653
-
15654
- /**
15655
- * Get the average of a set of numbers
15656
- * @author Gabe Abrams
15657
- * @param nums the numbers to average
15658
- * @returns average value or 0 if no numbers
15659
- */
15660
- const avg = (nums) => {
15661
- // Handle empty array case
15662
- if (nums.length === 0) {
15663
- return 0;
15664
- }
15665
- // Get the total value
15666
- const total = sum(nums);
15667
- // Get average
15668
- return (total / nums.length);
15669
- };
15670
-
15671
- /**
15672
- * Round a number (ceiling) to a certain number of decimals
15673
- * @author Gabe Abrams
15674
- * @param num the number to round
15675
- * @param numDecimals the number of decimals to round to
15676
- * @returns rounded number
15677
- */
15678
- const ceilToNumDecimals = (num, numDecimals) => {
15679
- const rounder = 10 ** numDecimals;
15680
- return (Math.ceil(num * rounder) / rounder);
15681
- };
15682
-
15683
- /**
15684
- * Round a number (floor) to a certain number of decimals
15685
- * @author Gabe Abrams
15686
- * @param num the number to round
15687
- * @param numDecimals the number of decimals to round to
15688
- * @returns rounded number
15689
- */
15690
- const floorToNumDecimals = (num, numDecimals) => {
15691
- const rounder = 10 ** numDecimals;
15692
- return (Math.floor(num * rounder) / rounder);
15693
- };
15694
-
15695
- /**
15696
- * Force a number to stay within specific bounds
15697
- * @author Gabe Abrams
15698
- * @param num the number to move into the bounds
15699
- * @param min the minimum number in the bound
15700
- * @param max the maximum number in the bound
15701
- * @returns bounded number
15702
- */
15703
- const forceNumIntoBounds = (num, min, max) => {
15704
- return Math.max(min, Math.min(max, num));
15705
- };
15706
-
15707
- /**
15708
- * Stub a server endpoint response
14444
+ * Stub a server endpoint response
15709
14445
  * @author Gabe Abrams
15710
14446
  * @param opts object containing all arguments
15711
14447
  * @param [opts.method=GET] http method to stub
@@ -15716,159 +14452,6 @@ const forceNumIntoBounds = (num, min, max) => {
15716
14452
  */
15717
14453
  const stubServerEndpoint = _setStubResponse;
15718
14454
 
15719
- /**
15720
- * Start a dynamic wait, call the function once the operation has completed and
15721
- * the dynamic wait will continue waiting for the rest of the minimum time
15722
- * @author Gabe Abrams
15723
- * @param minWaitMs the minimum number of ms to wait
15724
- * @returns async function to call to finish the wait
15725
- */
15726
- const startMinWait = (minWaitMs) => {
15727
- const startTimestamp = Date.now();
15728
- /**
15729
- * Finish the remaining time to wait
15730
- * @author Gabe Abrams
15731
- */
15732
- return () => __awaiter(void 0, void 0, void 0, function* () {
15733
- const endTimestamp = Date.now();
15734
- // Calculate remaining time to wait
15735
- const elapsedTimeMs = (endTimestamp - startTimestamp);
15736
- const remainingTimeToWaitMs = minWaitMs - elapsedTimeMs;
15737
- if (remainingTimeToWaitMs <= 0) {
15738
- return;
15739
- }
15740
- // Perform wait
15741
- yield waitMs(remainingTimeToWaitMs);
15742
- });
15743
- };
15744
-
15745
- /**
15746
- * Get the current part of day (morning, evening, etc.)
15747
- * @author Gabe Abrams
15748
- * @returns the part of day (morning, evening, etc.)
15749
- */
15750
- const getPartOfDay = () => {
15751
- // Setup the post-it time of day
15752
- let partOfDay = 'day';
15753
- const hours = new Date().getHours();
15754
- if (hours < 12) {
15755
- partOfDay = 'morning';
15756
- }
15757
- else if (hours >= 12 && hours <= 16) {
15758
- partOfDay = 'afternoon';
15759
- }
15760
- else if (hours > 16 && hours <= 24) {
15761
- partOfDay = 'evening';
15762
- }
15763
- return partOfDay;
15764
- };
15765
-
15766
- /**
15767
- * Create a human readable list from an array of strings.
15768
- * For example, ['apple', 'orange'] becomes "apple and orange"
15769
- * and ['apple', 'orange', 'mango'] becomes "apple, orange, and mango"
15770
- * @author Gabe Abrams
15771
- * @param items list of items in the list
15772
- * @returns human-readable list
15773
- */
15774
- const stringsToHumanReadableList = (items) => {
15775
- // Handle 0-item case
15776
- if (items.length === 0) {
15777
- return '';
15778
- }
15779
- // Handle 1-item case
15780
- if (items.length === 1) {
15781
- return items[0];
15782
- }
15783
- // Handle 2-item case
15784
- if (items.length === 2) {
15785
- return `${items[0]} and ${items[1]}`;
15786
- }
15787
- // Handle 3+ item case
15788
- let list = '';
15789
- items.forEach((item, i) => {
15790
- if (i === items.length - 1) {
15791
- // Last item
15792
- list += `, and ${item}`;
15793
- }
15794
- // Previous items
15795
- list += `, ${item}`;
15796
- });
15797
- return list;
15798
- };
15799
-
15800
- /**
15801
- * Given a string, only keep the letters inside it
15802
- * @author Gabe Abrams
15803
- * @param str the string to parse
15804
- * @returns only the letters inside of the string
15805
- */
15806
- const onlyKeepLetters = (str) => {
15807
- return str.replace(/[^a-zA-Z]+/g, '');
15808
- };
15809
-
15810
- /**
15811
- * Run tasks in parallel with a limit on how many tasks can execute at once.
15812
- * No guarantees are made about the order of task execution
15813
- * @author Gabe Abrams
15814
- * @param taskFunctions functions that start asynchronous tasks and optionally
15815
- * resolve with values
15816
- * @param [limit=no limit] maximum number of asynchronous tasks to permit to run at
15817
- * once
15818
- * @returns array of resolved values in the same order as the task functions
15819
- */
15820
- const parallelLimit = (taskFunctions, limit) => __awaiter(void 0, void 0, void 0, function* () {
15821
- const results = [];
15822
- let exited = false;
15823
- // Wait until finished with all tasks
15824
- yield new Promise((resolve, reject) => {
15825
- /* ------------- Helpers ------------ */
15826
- let nextTaskIndex = 0;
15827
- let numFinishedTasks = 0;
15828
- /**
15829
- * Start the next task
15830
- * @author Gabe Abrams
15831
- */
15832
- const startTask = () => __awaiter(void 0, void 0, void 0, function* () {
15833
- const taskIndex = nextTaskIndex++;
15834
- // Get the task
15835
- const taskFunction = taskFunctions[taskIndex];
15836
- if (!taskFunction) {
15837
- return;
15838
- }
15839
- try {
15840
- // Execute task
15841
- const result = yield taskFunction();
15842
- // Add results
15843
- results[taskIndex] = result;
15844
- // Tally and finish
15845
- if (++numFinishedTasks === taskFunctions.length) {
15846
- exited = true;
15847
- return resolve();
15848
- }
15849
- if (!exited) {
15850
- // Not finished! Start another task
15851
- startTask();
15852
- }
15853
- }
15854
- catch (err) {
15855
- // Reject only once
15856
- if (!exited) {
15857
- exited = true;
15858
- return reject(err);
15859
- }
15860
- }
15861
- });
15862
- /* ----------- Start Tasks ---------- */
15863
- // If no limit, start all tasks. At least start 1 task
15864
- const numTasks = Math.max((limit || taskFunctions.length), 1);
15865
- for (let i = 0; i < numTasks; i++) {
15866
- startTask();
15867
- }
15868
- });
15869
- return results;
15870
- });
15871
-
15872
14455
  /*------------------------------------------------------------------------*/
15873
14456
  /* -------------------------------- Cache ------------------------------- */
15874
14457
  /*------------------------------------------------------------------------*/
@@ -15900,355 +14483,6 @@ const canReviewLogs = () => __awaiter(void 0, void 0, void 0, function* () {
15900
14483
  return canReview;
15901
14484
  });
15902
14485
 
15903
- /**
15904
- * For every element in an array, extract the value of a prop
15905
- * (e.g. for all user objects, extract their ages and put that into a new
15906
- * ages array)
15907
- * @author Gabe Abrams
15908
- * @param arr the array of objects to operate on
15909
- * @param prop the property to extract from each object
15910
- * @returns new array containing the corresponding values, in order, of each
15911
- * object in the original array
15912
- */
15913
- const extractProp = (arr, prop) => {
15914
- return arr.map((item) => {
15915
- return item[prop];
15916
- });
15917
- };
15918
-
15919
- /**
15920
- * Compare two arrays of objects by only comparing the values in a specific
15921
- * property (e.g. compare user arrays by comparing their user.id values)
15922
- * @author Gabe Abrams
15923
- * @param a the first array
15924
- * @param b the second array
15925
- * @param prop the property to compare with, or an array of props to compare
15926
- * with (if array, all values associated with those props must match)
15927
- * @returns true if the arrays contain the same objects as determined by
15928
- * the values associated with each object's prop
15929
- */
15930
- const compareArraysByProp = (a, b, prop) => {
15931
- // Immediately return if size of arrays is different
15932
- if (a.length !== b.length) {
15933
- return false;
15934
- }
15935
- // Get all props
15936
- const props = (Array.isArray(prop) ? prop : [prop]);
15937
- // Clone second array so we can work on it
15938
- const bCloned = [...b];
15939
- // Remove elements from b as we find them in a
15940
- for (let i = 0; i < a.length; i++) {
15941
- // Find matching element in b
15942
- const matchingIndex = bCloned.findIndex((bItem) => {
15943
- // Compare based on all props
15944
- return props.every((propToCompareBy) => {
15945
- var _a;
15946
- const aVal = ((_a = a[i]) !== null && _a !== void 0 ? _a : {})[propToCompareBy];
15947
- const bVal = (bItem !== null && bItem !== void 0 ? bItem : {})[propToCompareBy];
15948
- return aVal === bVal;
15949
- });
15950
- });
15951
- // Check if no match
15952
- const noMatch = (matchingIndex < 0);
15953
- // If no match, there's no corresponding element in b
15954
- if (noMatch) {
15955
- return false;
15956
- }
15957
- // Remove the matching element
15958
- bCloned.splice(matchingIndex, 1);
15959
- }
15960
- // If we made it here, all elements in a have a corresponding element in b
15961
- return true;
15962
- };
15963
-
15964
- /**
15965
- * Get current time info in local time
15966
- * @author Gabe Abrams
15967
- * @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp
15968
- * @returns object with timestamp (ms since epoch) and numbers
15969
- * corresponding to time values for year, month, day, hour, hour12, minute, isPM
15970
- * where hour is in 24hr time and hour12 is in 12hr time.
15971
- */
15972
- const getLocalTimeInfo = (dateOrTimestamp) => {
15973
- // Create a time string
15974
- let d;
15975
- if (!dateOrTimestamp) {
15976
- // Use now
15977
- d = new Date();
15978
- }
15979
- else if (typeof dateOrTimestamp === 'number') {
15980
- // Convert to date
15981
- d = new Date(dateOrTimestamp);
15982
- }
15983
- else {
15984
- // Already a date
15985
- d = dateOrTimestamp;
15986
- }
15987
- // Create all time numbers
15988
- const timestamp = d.getTime();
15989
- const year = d.getFullYear();
15990
- const month = d.getMonth() + 1;
15991
- const day = d.getDate();
15992
- const hour = d.getHours();
15993
- const isPM = hour >= 12;
15994
- let hour12 = hour % 12;
15995
- if (hour12 === 0) {
15996
- hour12 = 12;
15997
- }
15998
- const minute = d.getMinutes();
15999
- // Return
16000
- return {
16001
- timestamp,
16002
- year,
16003
- month,
16004
- day,
16005
- hour,
16006
- hour12,
16007
- isPM,
16008
- minute,
16009
- };
16010
- };
16011
-
16012
- /**
16013
- * Given an array of strings, create a single comma-separated string that includes
16014
- * 'and' as well as an oxford comma.
16015
- * Ex: ['apples'] => 'apples'
16016
- * Ex: ['apples', 'bananas'] => 'apples and bananas'
16017
- * Ex: ['apples', 'bananas', 'grapes'] => 'apples, bananas, and grapes'
16018
- * @author Austen Money
16019
- * @param list an array of elements to be made into a single comma-separated string.
16020
- * @returns a comma-separated string.
16021
- */
16022
- const genCommaList = (list) => {
16023
- const { length } = list;
16024
- return (length < 2
16025
- ? list.join('')
16026
- : `${list.slice(0, length - 1).join(', ')}${length < 3 ? ' and ' : ', and '}${list[length - 1]}`);
16027
- };
16028
-
16029
- /*------------------------------------------------------------------------*/
16030
- /* ------------------------------ Constants ----------------------------- */
16031
- /*------------------------------------------------------------------------*/
16032
- const INVALID_REGEX_ERROR = 'input does not follow the requested format';
16033
- const INVALID_EMAIL_ERROR = 'Please provide a valid email address.';
16034
- const INVALID_PHONE_ERROR = 'Please provide a valid phone number.';
16035
- const INVALID_STRING_ERRORS = {
16036
- MIN_LEN: (minLen) => {
16037
- return `input must not be under ${minLen} character(s)`;
16038
- },
16039
- MAX_LEN: (maxLen) => {
16040
- return `input must not be over ${maxLen} character(s)`;
16041
- },
16042
- LETTERS_ONLY: 'input must only contain letters',
16043
- NUMBERS_ONLY: 'input must only contain numbers',
16044
- MESSAGE_INTRO: 'The following error(s) occurred: ',
16045
- };
16046
-
16047
- // Import constants
16048
- /**
16049
- * Determines whether a given input string is considered valid based on
16050
- * the provided regex.
16051
- * @author Austen Money
16052
- * @param opts object containing all args
16053
- * @param opts.input user-provided input to validate
16054
- * @param opts.regex regular expression to check against input
16055
- * @param [opts.regexDescription] description of what regexString is checking
16056
- * for, used to customize error message
16057
- * @returns the unchanged input if valid, or a customized error message if
16058
- * invalid
16059
- */
16060
- const validateRegex = (opts) => {
16061
- // customize error message in case of invalid input
16062
- const errorMessage = `${INVALID_REGEX_ERROR}${opts.regexDescription
16063
- ? ': '
16064
- : ''}${opts.regexDescription}`;
16065
- // return error message if test is invalid, or input string if valid
16066
- return (opts.regex.test(opts.input)
16067
- ? {
16068
- isValid: true,
16069
- cleanedValue: opts.input,
16070
- }
16071
- : {
16072
- isValid: false,
16073
- errorMessage,
16074
- });
16075
- };
16076
-
16077
- // Import helpers
16078
- /**
16079
- * Determines whether a given email address is valid.
16080
- * @author Austen Money
16081
- * @param email email address to validate
16082
- * @returns whether email fulfills proper formatting requirements, includes a
16083
- * cleaned version of the address without leading or trailing
16084
- * whitespace if valid or an error message if invalid.
16085
- */
16086
- const validateEmail = (email) => {
16087
- // validation regex, sourced from HTML living standard: http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email)
16088
- // eslint-disable-next-line max-len
16089
- const emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
16090
- // remove leading and trailing whitespace
16091
- const cleanedValue = email.replace(/^\s+|\s+$/g, '');
16092
- // validate email with regex, and return error if not valid
16093
- return (validateRegex({
16094
- input: cleanedValue,
16095
- regex: emailRegex,
16096
- }).isValid
16097
- ? {
16098
- isValid: true,
16099
- cleanedValue,
16100
- }
16101
- : {
16102
- isValid: false,
16103
- errorMessage: INVALID_EMAIL_ERROR,
16104
- });
16105
- };
16106
-
16107
- // Import helpers
16108
- /**
16109
- * Determines whether a given phone number is valid.
16110
- * @author Austen Money
16111
- * @param phoneNumber phone number to validate
16112
- * @returns whether phone number is considered valid - if valid, also returns
16113
- * a cleaned version of the number without any formatting. If invalid,
16114
- * returns an error message.
16115
- */
16116
- const validatePhoneNumber = (phoneNumber) => {
16117
- // regex to validate phone number
16118
- const validationRegex = /^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/;
16119
- // validate phone number with regex
16120
- const validationResponse = validateRegex({
16121
- input: phoneNumber,
16122
- regex: validationRegex,
16123
- });
16124
- // remove all non-digits from number
16125
- const cleanedValue = phoneNumber.replace(/\D/g, '');
16126
- // return cleaned value if valid, or error message if invalid
16127
- return (validationResponse.isValid
16128
- ? {
16129
- isValid: true,
16130
- cleanedValue,
16131
- }
16132
- : {
16133
- isValid: false,
16134
- errorMessage: INVALID_PHONE_ERROR,
16135
- });
16136
- };
16137
-
16138
- // Import helpers
16139
- /*------------------------------------------------------------------------*/
16140
- /* ------------------------------ Constants ----------------------------- */
16141
- /*------------------------------------------------------------------------*/
16142
- // define minimum and maximum range for lowercase ASCII chars
16143
- const LOWERCASE_MIN = 65;
16144
- const LOWERCASE_MAX = 90;
16145
- // define minimum and maximum range for uppercase ASCII chars
16146
- const UPPERCASE_MIN = 97;
16147
- const UPPERCASE_MAX = 122;
16148
- // define minimum and maximum range for ASCII digits
16149
- const DIGIT_MIN = 48;
16150
- const DIGIT_MAX = 57;
16151
- /*------------------------------------------------------------------------*/
16152
- /* ---------------------------- Main Function --------------------------- */
16153
- /*------------------------------------------------------------------------*/
16154
- /**
16155
- * Determines whether a given input string is considered valid based on
16156
- * the provided requirements.
16157
- * @author Austen Money
16158
- * @param input input string
16159
- * @param opts options for validation
16160
- * @returns whether input is considered valid according to reqs - if
16161
- * valid, returns a cleaned version of input; if invalid, returns
16162
- * a string containing error messages describing which requirements
16163
- * were not met.
16164
- */
16165
- const validateString = (input, opts) => {
16166
- // stores all invalid input errors
16167
- const errorMessages = [];
16168
- // contains version of input that will be returned
16169
- let cleanedValue = input;
16170
- // remove whitespace if required
16171
- if (opts.ignoreWhitespace) {
16172
- cleanedValue = input.replace(/\s+/g, '');
16173
- }
16174
- // apply max char requirement
16175
- if (opts.minLen) {
16176
- if (cleanedValue.length < opts.minLen) {
16177
- errorMessages.push(INVALID_STRING_ERRORS.MIN_LEN(opts.minLen));
16178
- }
16179
- }
16180
- // apply max char requirement
16181
- if (opts.maxLen) {
16182
- if (cleanedValue.length > opts.maxLen) {
16183
- errorMessages.push(INVALID_STRING_ERRORS.MAX_LEN(opts.maxLen));
16184
- }
16185
- }
16186
- // apply alphabetical requirement
16187
- if (opts.lettersOnly) {
16188
- // remove diacritics
16189
- cleanedValue = cleanedValue.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
16190
- const containsNonLetters = (cleanedValue
16191
- // split into characters
16192
- .split('')
16193
- // convert into character codes
16194
- .map((curr) => {
16195
- return curr.charCodeAt(0);
16196
- })
16197
- // check for non-letters
16198
- .some((currCode) => {
16199
- return (!(currCode >= LOWERCASE_MIN && currCode <= LOWERCASE_MAX)
16200
- && !(currCode >= UPPERCASE_MIN && currCode <= UPPERCASE_MAX));
16201
- }));
16202
- if (containsNonLetters) {
16203
- errorMessages.push(INVALID_STRING_ERRORS.LETTERS_ONLY);
16204
- }
16205
- }
16206
- // apply numerical requirement
16207
- if (opts.numbersOnly) {
16208
- const containsNonNumbers = (cleanedValue
16209
- // split into characters
16210
- .split('')
16211
- // convert into character codes
16212
- .map((curr) => {
16213
- return curr.charCodeAt(0);
16214
- })
16215
- // check for non-numbers
16216
- .some((currCode) => {
16217
- return (!(currCode >= DIGIT_MIN && currCode <= DIGIT_MAX));
16218
- }));
16219
- if (containsNonNumbers) {
16220
- errorMessages.push(INVALID_STRING_ERRORS.NUMBERS_ONLY);
16221
- }
16222
- }
16223
- // apply regex requirement
16224
- if (opts.regexTest) {
16225
- const regex = opts.regexTest;
16226
- // validate and create customized error message if description is provided
16227
- const result = validateRegex({
16228
- input: cleanedValue,
16229
- regex,
16230
- regexDescription: opts.regexDescription,
16231
- });
16232
- // if string did not pass regex validation, add error message
16233
- if (result.isValid === false) {
16234
- errorMessages.push(result.errorMessage);
16235
- }
16236
- }
16237
- // combine all error messages into one string to return
16238
- const errorMessage = `${INVALID_STRING_ERRORS.MESSAGE_INTRO}${genCommaList(errorMessages)}.`;
16239
- return (
16240
- // if no error messages, string is valid; if not, it is invalid
16241
- errorMessages.length === 0
16242
- ? {
16243
- isValid: true,
16244
- cleanedValue,
16245
- }
16246
- : {
16247
- isValid: false,
16248
- errorMessage,
16249
- });
16250
- };
16251
-
16252
14486
  // Import React
16253
14487
  // Regular express that matches urls
16254
14488
  const urlRegex = /(https?:\/\/)?([a-z0-9-]+\.)+[a-z0-9]{2,6}(:[0-9]{1,5})?(\/\S*)?/g;
@@ -16308,30 +14542,6 @@ const makeLinksClickable = (text, opts) => {
16308
14542
  return elements;
16309
14543
  };
16310
14544
 
16311
- // Constants
16312
- const VOWELS = ['a', 'e', 'i', 'o', 'u'];
16313
- /**
16314
- * Prefix a word or name with "a" or "an" depending on whether it starts with a
16315
- * vowel or not
16316
- * @author Gabe Abrams
16317
- * @param text the text to prefix
16318
- * @param capitalize whether to capitalize the "A" or "An"
16319
- * @returns the text prefixed with "a" or "an"
16320
- */
16321
- const prefixWithAOrAn = (text, capitalize = false) => {
16322
- // Get the first letter
16323
- const firstLetter = text.charAt(0).toLowerCase();
16324
- // Check if starts with vowel
16325
- const startsWithVowel = VOWELS.includes(firstLetter);
16326
- // Determine prefix
16327
- let prefix = startsWithVowel ? 'an' : 'a';
16328
- if (capitalize) {
16329
- prefix = prefix.charAt(0).toUpperCase() + prefix.substring(1);
16330
- }
16331
- // Return the text prefixed with "a" or "an"
16332
- return `${prefix} ${text}`;
16333
- };
16334
-
16335
14545
  /* -------- State Definition -------- */
16336
14546
  /* ------------- Reducer ------------ */
16337
14547
  /**
@@ -16366,336 +14576,6 @@ const useForceRender = (useReducer) => {
16366
14576
  };
16367
14577
  };
16368
14578
 
16369
- /**
16370
- * Run the operator function on each item in the array, returning true if
16371
- * the operator function returns true for every item in the array
16372
- * @author Gabe Abrams
16373
- * @param operatorFunction the operator function to apply. If it returns true
16374
- * for every item, this function will return true
16375
- * @returns true if the operator function returns true for every item in the array
16376
- */
16377
- const everyAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
16378
- // Create break logic
16379
- let done = false;
16380
- /**
16381
- * Break the loop (checking stops here)
16382
- * @author Gabe Abrams
16383
- */
16384
- const breakNow = () => {
16385
- done = true;
16386
- };
16387
- // Loop through each item, checking
16388
- for (let i = 0; i < array.length && !done; i++) {
16389
- const passed = yield operatorFunction(array[i], i, {
16390
- breakNow,
16391
- array,
16392
- });
16393
- // Check if this one failed or if loop was broken
16394
- if (!passed || done) {
16395
- return false;
16396
- }
16397
- }
16398
- // Return true because none returned false
16399
- return true;
16400
- });
16401
-
16402
- /**
16403
- * Run the operator function on each item in the array, returning a new array
16404
- * that only contains the items that pass the filter
16405
- * @author Gabe Abrams
16406
- * @param operatorFunction the operator function to apply. If it returns true
16407
- * for an item, the item will be included in the returned array
16408
- * @returns the filtered array
16409
- */
16410
- const filterAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
16411
- // Create break logic
16412
- let done = false;
16413
- /**
16414
- * Break the loop (filtering stops here)
16415
- * @author Gabe Abrams
16416
- */
16417
- const breakNow = () => {
16418
- done = true;
16419
- };
16420
- // Loop through each item, filtering
16421
- const output = [];
16422
- for (let i = 0; i < array.length && !done; i++) {
16423
- const included = yield operatorFunction(array[i], i, {
16424
- breakNow,
16425
- array,
16426
- });
16427
- if (included && !done) {
16428
- output.push(array[i]);
16429
- }
16430
- }
16431
- // Return results
16432
- return output;
16433
- });
16434
-
16435
- /**
16436
- * Run the operator function on each item in the array
16437
- * @author Gabe Abrams
16438
- * @param operatorFunction the operator function to apply
16439
- */
16440
- const forEachAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
16441
- // Create break logic
16442
- let done = false;
16443
- /**
16444
- * Break the loop
16445
- * @author Gabe Abrams
16446
- */
16447
- const breakNow = () => {
16448
- done = true;
16449
- };
16450
- // Loop through each item
16451
- for (let i = 0; i < array.length && !done; i++) {
16452
- yield operatorFunction(array[i], i, {
16453
- breakNow,
16454
- array,
16455
- });
16456
- }
16457
- });
16458
-
16459
- /**
16460
- * Run the operator function on each item in the array, collecting all results
16461
- * @author Gabe Abrams
16462
- * @param operatorFunction the operator function to apply
16463
- * @returns the array of results
16464
- */
16465
- const mapAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
16466
- // Create break logic
16467
- let done = false;
16468
- /**
16469
- * Break the loop
16470
- * @author Gabe Abrams
16471
- */
16472
- const breakNow = () => {
16473
- done = true;
16474
- };
16475
- // Loop through each item, collecting results
16476
- const results = [];
16477
- for (let i = 0; i < array.length && !done; i++) {
16478
- const result = yield operatorFunction(array[i], i, {
16479
- breakNow,
16480
- array,
16481
- });
16482
- results.push(result);
16483
- }
16484
- // Return results
16485
- return results;
16486
- });
16487
-
16488
- /**
16489
- * Run the operator function on each item in the array, returning true if
16490
- * the operator function returns true for any item in the array
16491
- * @author Gabe Abrams
16492
- * @param operatorFunction the operator function to apply. If it returns true
16493
- * for any item, this function will return true
16494
- * @returns true if the operator function returns true for any item in the array
16495
- */
16496
- const someAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
16497
- // Create break logic
16498
- let done = false;
16499
- /**
16500
- * Break the loop (checking stops here)
16501
- * @author Gabe Abrams
16502
- */
16503
- const breakNow = () => {
16504
- done = true;
16505
- };
16506
- // Loop through each item, checking
16507
- for (let i = 0; i < array.length && !done; i++) {
16508
- const passed = yield operatorFunction(array[i], i, {
16509
- breakNow,
16510
- array,
16511
- });
16512
- if (passed && !done) {
16513
- return true;
16514
- }
16515
- }
16516
- // Return false because none returned true
16517
- return false;
16518
- });
16519
-
16520
- /**
16521
- * Capitalize every word in a string (just the first letter)
16522
- * @param str string to capitalize
16523
- * @returns string with every word capitalized
16524
- */
16525
- const capitalize = (str) => {
16526
- return (str
16527
- // Split into words
16528
- .split(' ')
16529
- // Capitalize first letter of each word
16530
- .map((word) => {
16531
- return word.charAt(0).toUpperCase() + word.substring(1);
16532
- })
16533
- // Join back together
16534
- .join(' '));
16535
- };
16536
-
16537
- /**
16538
- * Shuffle a given array
16539
- * @author Austen Money
16540
- * @param arr the array to shuffle
16541
- * @returns the shuffled array
16542
- */
16543
- const shuffleArray = (arr) => {
16544
- const newArr = [...arr];
16545
- // Shuffle using Durstenfeld algorithm
16546
- for (let i = arr.length - 1; i > 0; i--) {
16547
- const j = Math.floor(Math.random() * (i + 1));
16548
- [newArr[i], newArr[j]] = [newArr[j], newArr[i]];
16549
- }
16550
- return newArr;
16551
- };
16552
-
16553
- const punctuationRegex = /[!@#$%^&*(),.?\/;:'"\-\[\]]/g;
16554
- /**
16555
- * Get number of words in string
16556
- * @author Gardenia Liu
16557
- * @author Allison Zhang
16558
- * @author Gabe Abrams
16559
- * @param text the string to check
16560
- * @returns number of words in the string
16561
- */
16562
- const getWordCount = (text) => {
16563
- const trimmedTextWithoutPunctuation = (text
16564
- // Remove leading and trailing whitespace
16565
- .trim()
16566
- // Remove punctuation
16567
- .replace(punctuationRegex, ''));
16568
- if (trimmedTextWithoutPunctuation.length === 0) {
16569
- return 0;
16570
- }
16571
- return trimmedTextWithoutPunctuation.split(/\s+/g).length;
16572
- };
16573
-
16574
- // Import shared types
16575
- /*----------------------------------------*/
16576
- /* --------------- Helpers -------------- */
16577
- /*----------------------------------------*/
16578
- /**
16579
- * Check if a timestamp is valid
16580
- * @author Gabe Abrams
16581
- * @author Gardenia Liu
16582
- * @param opts object containing all arguments
16583
- * @param opts.timestamp Timestamp in milliseconds since epoch
16584
- * @param opts.expectedYear Expected year
16585
- * @param opts.expectedMonth Expected month
16586
- * @param opts.expectedDay Expected day
16587
- * @param opts.expectedHour Expected hour
16588
- * @param opts.expectedMinute Expected minute
16589
- * @returns 1 if the timestamp needs to be increased, -1 if it needs to be decreased, 0 if it is valid
16590
- */
16591
- const checkTimestamp = (opts) => {
16592
- const { timestamp, expectedYear, expectedMonth, expectedDay, expectedHour, expectedMinute, } = opts;
16593
- const timeInfoInET = getTimeInfoInET(timestamp);
16594
- if (timeInfoInET.year < expectedYear) {
16595
- return 1;
16596
- }
16597
- if (timeInfoInET.year > expectedYear) {
16598
- return -1;
16599
- }
16600
- if (timeInfoInET.month < expectedMonth) {
16601
- return 1;
16602
- }
16603
- if (timeInfoInET.month > expectedMonth) {
16604
- return -1;
16605
- }
16606
- if (timeInfoInET.day < expectedDay) {
16607
- return 1;
16608
- }
16609
- if (timeInfoInET.day > expectedDay) {
16610
- return -1;
16611
- }
16612
- if (timeInfoInET.hour < expectedHour) {
16613
- return 1;
16614
- }
16615
- if (timeInfoInET.hour > expectedHour) {
16616
- return -1;
16617
- }
16618
- if (timeInfoInET.minute < expectedMinute) {
16619
- return 1;
16620
- }
16621
- if (timeInfoInET.minute > expectedMinute) {
16622
- return -1;
16623
- }
16624
- return 0;
16625
- };
16626
- /*----------------------------------------*/
16627
- /* ---------------- Main ---------------- */
16628
- /*----------------------------------------*/
16629
- /**
16630
- * Get a timestamp (ms since epoch) from time info (year, month, day, hour, minute, etc.) in Eastern Time (ET)
16631
- * @author Gardenia Liu
16632
- * @author Gabe Abrams
16633
- * @param opts object containing all arguments
16634
- * @param opts.year Year (e.g. 2023)
16635
- * @param opts.month Month (1-12)
16636
- * @param opts.day Day of the month (1-31)
16637
- * @param opts.hour Hour (0-23)
16638
- * @param opts.minute Minute (0-59)
16639
- * @returns Timestamp in milliseconds since epoch
16640
- */
16641
- const getTimestampFromTimeInfoInET = (opts) => {
16642
- // Destructure opts
16643
- const { year, month, day, hour, minute, } = opts;
16644
- // Determine if the date is in DST in Eastern Time
16645
- const tempDate = new Date(year, month - 1, day);
16646
- const janOffset = new Date(year, 0, 1).getTimezoneOffset();
16647
- const isDST = tempDate.getTimezoneOffset() < janOffset;
16648
- const etOffset = isDST ? '-04:00' : '-05:00';
16649
- // Format with leading zeroes
16650
- const mm = padZerosLeft(month, 2);
16651
- const dd = padZerosLeft(day, 2);
16652
- const hh = padZerosLeft(hour, 2);
16653
- const min = padZerosLeft(minute, 2);
16654
- // Build ET ISO string and convert to UTC timestamp
16655
- const etISOString = `${year}-${mm}-${dd}T${hh}:${min}:00${etOffset}`;
16656
- const baseTimestamp = (new Date(etISOString)).getTime();
16657
- let timestamp = baseTimestamp;
16658
- // Heat seek to get the right timestamp
16659
- const maxOffset = 24 * 60; // 24 hours in minutes
16660
- let currentOffset = 0; // minutes
16661
- const offsetIncrement = 15; // minutes
16662
- const offsetDirection = checkTimestamp({
16663
- timestamp,
16664
- expectedYear: year,
16665
- expectedMonth: month,
16666
- expectedDay: day,
16667
- expectedHour: hour,
16668
- expectedMinute: minute,
16669
- });
16670
- if (offsetDirection === 0) {
16671
- // Valid! Return the timestamp
16672
- return timestamp;
16673
- }
16674
- // Heat seek
16675
- while (Math.abs(currentOffset) < maxOffset) {
16676
- // Update offset
16677
- currentOffset += (offsetDirection * offsetIncrement);
16678
- // Update timestamp
16679
- const offsetMs = currentOffset * 60 * 1000;
16680
- timestamp = baseTimestamp + offsetMs;
16681
- // Check timestamp again
16682
- const newDirection = checkTimestamp({
16683
- timestamp,
16684
- expectedYear: year,
16685
- expectedMonth: month,
16686
- expectedDay: day,
16687
- expectedHour: hour,
16688
- expectedMinute: minute,
16689
- });
16690
- if (newDirection === 0) {
16691
- // Valid! Return the timestamp
16692
- return timestamp;
16693
- }
16694
- // Invalid. Keep looping.
16695
- }
16696
- throw new ErrorWithCode(`Timestamp mismatch: expected ${year}-${mm}-${dd} ${hh}:${min}, seeked to offset ${currentOffset} minutes but could not find a valid timestamp.`, ReactKitErrorCode$1.ETTimestampInvalid);
16697
- };
16698
-
16699
14579
  /*------------------------------------------------------------------------*/
16700
14580
  /* ------------------------------- Caching ------------------------------ */
16701
14581
  /*------------------------------------------------------------------------*/
@@ -16732,21 +14612,5 @@ const isSelectAdmin = () => __awaiter(void 0, void 0, void 0, function* () {
16732
14612
  }
16733
14613
  });
16734
14614
 
16735
- /**
16736
- * Days of the week
16737
- * @author Gabe Abrams
16738
- */
16739
- var DayOfWeek;
16740
- (function (DayOfWeek) {
16741
- DayOfWeek["Monday"] = "m";
16742
- DayOfWeek["Tuesday"] = "t";
16743
- DayOfWeek["Wednesday"] = "w";
16744
- DayOfWeek["Thursday"] = "r";
16745
- DayOfWeek["Friday"] = "f";
16746
- DayOfWeek["Saturday"] = "s";
16747
- DayOfWeek["Sunday"] = "u";
16748
- })(DayOfWeek || (DayOfWeek = {}));
16749
- var DayOfWeek$1 = DayOfWeek;
16750
-
16751
- export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, Dropdown, DropdownItemType$1 as DropdownItemType, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LOG_REVIEW_GET_LOGS_ROUTE, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_REVIEW_STATUS_ROUTE, LOG_ROUTE_PATH, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogLevel$1 as LogLevel, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, ProgressBar, ProgressBarSize$1 as ProgressBarSize, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SELECT_ADMIN_CHECK_ROUTE, SimpleDateChooser, SimpleTimeChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, cloneDeep, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, getTimestampFromTimeInfoInET, getWordCount, idify, initClient, isMobileOrTablet, isSelectAdmin, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, prompt, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
14615
+ export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, Drawer, Dropdown, DropdownItemType$1 as DropdownItemType, DynamicWord, ErrorBox, IntelliTable, ItemPicker, LoadingSpinner, LogReviewer, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, PopFailureMark, PopPendingMark, PopSuccessMark, ProgressBar, ProgressBarSize$1 as ProgressBarSize, RadioButton, SimpleDateChooser, SimpleTimeChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, addFatalErrorHandler, alert, canReviewLogs, combineClassNames, confirm, initClient, isMobileOrTablet, isSelectAdmin, leaveToURL, logClientEvent, makeLinksClickable, prompt, setClientEventMetadataPopulator, showFatalError, stubServerEndpoint, useForceRender, visitServerEndpoint };
16752
14616
  //# sourceMappingURL=index.js.map