dce-reactkit 4.3.4 → 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.
- package/dist/cjs/index.js +338 -2316
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/LogReviewer.d.ts +1 -1
- package/dist/cjs/types/helpers/logClientEvent.d.ts +1 -1
- package/dist/cjs/types/html/genErrorPage.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +2 -64
- package/dist/cjs/types/types/IntelliTableColumn.d.ts +1 -1
- package/dist/esm/index.js +78 -2223
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/LogReviewer.d.ts +1 -1
- package/dist/esm/types/helpers/logClientEvent.d.ts +1 -1
- package/dist/esm/types/html/genErrorPage.d.ts +1 -1
- package/dist/esm/types/index.d.ts +2 -64
- package/dist/esm/types/types/IntelliTableColumn.d.ts +1 -1
- package/dist/index.d.ts +3 -835
- package/package.json +4 -3
- package/src/components/AppWrapper.tsx +12 -10
- package/src/components/AutoscrollToBottomContainer.tsx +5 -3
- package/src/components/CopiableBox.tsx +5 -1
- package/src/components/DBEntryManagerPanel/helpers/generateEndpointPath.ts +2 -2
- package/src/components/ErrorBox.tsx +6 -2
- package/src/components/IntelliTable.tsx +7 -5
- package/src/components/LogReviewer.tsx +23 -21
- package/src/components/Modal/index.tsx +5 -3
- package/src/components/MultiSwitch.tsx +5 -1
- package/src/components/Shimmer.tsx +4 -2
- package/src/components/SimpleDateChooser.tsx +11 -13
- package/src/components/SimpleTimeChooser.tsx +4 -2
- package/src/helpers/canReviewLogs.test.ts +5 -3
- package/src/helpers/canReviewLogs.ts +5 -3
- package/src/helpers/initClient.tsx +8 -8
- package/src/helpers/isMobileOrTablet.tsx +2 -1
- package/src/helpers/isSelectAdmin.ts +4 -2
- package/src/helpers/logClientEvent.tsx +7 -5
- package/src/helpers/stubServerEndpoint.tsx +1 -1
- package/src/helpers/visitServerEndpoint.tsx +10 -7
- package/src/html/genErrorPage.ts +6 -4
- package/src/index.ts +105 -98
- package/src/types/IntelliTableColumn.ts +4 -1
- package/dist/cjs/types/constants/DAY_IN_MS.d.ts +0 -6
- package/dist/cjs/types/constants/HOUR_IN_MS.d.ts +0 -6
- package/dist/cjs/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
- package/dist/cjs/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/cjs/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
- package/dist/cjs/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
- package/dist/cjs/types/constants/MINUTE_IN_MS.d.ts +0 -6
- package/dist/cjs/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/cjs/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
- package/dist/cjs/types/errors/ErrorWithCode.d.ts +0 -9
- package/dist/cjs/types/helpers/abbreviate.d.ts +0 -10
- package/dist/cjs/types/helpers/abbreviate.test.d.ts +0 -5
- package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
- package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
- package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
- package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
- package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
- package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/avg.d.ts +0 -8
- package/dist/cjs/types/helpers/avg.test.d.ts +0 -5
- package/dist/cjs/types/helpers/capitalize.d.ts +0 -7
- package/dist/cjs/types/helpers/ceilToNumDecimals.d.ts +0 -9
- package/dist/cjs/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
- package/dist/cjs/types/helpers/cloneDeep.d.ts +0 -8
- package/dist/cjs/types/helpers/compareArraysByProp.d.ts +0 -13
- package/dist/cjs/types/helpers/compareArraysByProp.test.d.ts +0 -5
- package/dist/cjs/types/helpers/extractProp.d.ts +0 -12
- package/dist/cjs/types/helpers/extractProp.test.d.ts +0 -5
- package/dist/cjs/types/helpers/floorToNumDecimals.d.ts +0 -9
- package/dist/cjs/types/helpers/floorToNumDecimals.test.d.ts +0 -5
- package/dist/cjs/types/helpers/forceNumIntoBounds.d.ts +0 -10
- package/dist/cjs/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
- package/dist/cjs/types/helpers/genCSV.d.ts +0 -18
- package/dist/cjs/types/helpers/genCSV.test.d.ts +0 -5
- package/dist/cjs/types/helpers/genCommaList.d.ts +0 -12
- package/dist/cjs/types/helpers/genCommaList.test.d.ts +0 -1
- package/dist/cjs/types/helpers/getHumanReadableDate.d.ts +0 -8
- package/dist/cjs/types/helpers/getHumanReadableDate.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getLocalTimeInfo.d.ts +0 -19
- package/dist/cjs/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
- package/dist/cjs/types/helpers/getMonthName.d.ts +0 -14
- package/dist/cjs/types/helpers/getMonthName.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getOrdinal.d.ts +0 -8
- package/dist/cjs/types/helpers/getOrdinal.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getPartOfDay.d.ts +0 -7
- package/dist/cjs/types/helpers/getPartOfDay.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getTimeInfoInET.d.ts +0 -21
- package/dist/cjs/types/helpers/getTimeInfoInET.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
- package/dist/cjs/types/helpers/getWordCount.d.ts +0 -10
- package/dist/cjs/types/helpers/idify.d.ts +0 -9
- package/dist/cjs/types/helpers/onlyKeepLetters.d.ts +0 -8
- package/dist/cjs/types/helpers/padDecimalZeros.d.ts +0 -10
- package/dist/cjs/types/helpers/padZerosLeft.d.ts +0 -9
- package/dist/cjs/types/helpers/parallelLimit.d.ts +0 -12
- package/dist/cjs/types/helpers/prefixWithAOrAn.d.ts +0 -10
- package/dist/cjs/types/helpers/roundToNumDecimals.d.ts +0 -9
- package/dist/cjs/types/helpers/shuffleArray.d.ts +0 -8
- package/dist/cjs/types/helpers/startMinWait.d.ts +0 -9
- package/dist/cjs/types/helpers/stringsToHumanReadableList.d.ts +0 -10
- package/dist/cjs/types/helpers/sum.d.ts +0 -8
- package/dist/cjs/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/cjs/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
- package/dist/cjs/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
- package/dist/cjs/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
- package/dist/cjs/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/cjs/types/helpers/validators/validateEmail.d.ts +0 -11
- package/dist/cjs/types/helpers/validators/validateEmail.test.d.ts +0 -1
- package/dist/cjs/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
- package/dist/cjs/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
- package/dist/cjs/types/helpers/validators/validateString.d.ts +0 -22
- package/dist/cjs/types/helpers/validators/validateString.test.d.ts +0 -1
- package/dist/cjs/types/helpers/waitMs.d.ts +0 -7
- package/dist/cjs/types/types/DayOfWeek.d.ts +0 -14
- package/dist/cjs/types/types/Log/LogMainInfo.d.ts +0 -39
- package/dist/cjs/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
- package/dist/cjs/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
- package/dist/cjs/types/types/Log/index.d.ts +0 -10
- package/dist/cjs/types/types/LogAction.d.ts +0 -29
- package/dist/cjs/types/types/LogBuiltInMetadata.d.ts +0 -16
- package/dist/cjs/types/types/LogFunction.d.ts +0 -24
- package/dist/cjs/types/types/LogLevel.d.ts +0 -10
- package/dist/cjs/types/types/LogMetadataContextMap.d.ts +0 -11
- package/dist/cjs/types/types/LogMetadataTagMap.d.ts +0 -8
- package/dist/cjs/types/types/LogMetadataTargetMap.d.ts +0 -8
- package/dist/cjs/types/types/LogMetadataType.d.ts +0 -13
- package/dist/cjs/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
- package/dist/cjs/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
- package/dist/cjs/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
- package/dist/cjs/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
- package/dist/cjs/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
- package/dist/cjs/types/types/LogReviewerFilterState/index.d.ts +0 -17
- package/dist/cjs/types/types/LogSource.d.ts +0 -9
- package/dist/cjs/types/types/LogType.d.ts +0 -9
- package/dist/cjs/types/types/ParamType.d.ts +0 -17
- package/dist/cjs/types/types/ReactKitErrorCode.d.ts +0 -14
- package/dist/esm/types/constants/DAY_IN_MS.d.ts +0 -6
- package/dist/esm/types/constants/HOUR_IN_MS.d.ts +0 -6
- package/dist/esm/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
- package/dist/esm/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/esm/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
- package/dist/esm/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
- package/dist/esm/types/constants/MINUTE_IN_MS.d.ts +0 -6
- package/dist/esm/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/esm/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
- package/dist/esm/types/errors/ErrorWithCode.d.ts +0 -9
- package/dist/esm/types/helpers/abbreviate.d.ts +0 -10
- package/dist/esm/types/helpers/abbreviate.test.d.ts +0 -5
- package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
- package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
- package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
- package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
- package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
- package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/avg.d.ts +0 -8
- package/dist/esm/types/helpers/avg.test.d.ts +0 -5
- package/dist/esm/types/helpers/capitalize.d.ts +0 -7
- package/dist/esm/types/helpers/ceilToNumDecimals.d.ts +0 -9
- package/dist/esm/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
- package/dist/esm/types/helpers/cloneDeep.d.ts +0 -8
- package/dist/esm/types/helpers/compareArraysByProp.d.ts +0 -13
- package/dist/esm/types/helpers/compareArraysByProp.test.d.ts +0 -5
- package/dist/esm/types/helpers/extractProp.d.ts +0 -12
- package/dist/esm/types/helpers/extractProp.test.d.ts +0 -5
- package/dist/esm/types/helpers/floorToNumDecimals.d.ts +0 -9
- package/dist/esm/types/helpers/floorToNumDecimals.test.d.ts +0 -5
- package/dist/esm/types/helpers/forceNumIntoBounds.d.ts +0 -10
- package/dist/esm/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
- package/dist/esm/types/helpers/genCSV.d.ts +0 -18
- package/dist/esm/types/helpers/genCSV.test.d.ts +0 -5
- package/dist/esm/types/helpers/genCommaList.d.ts +0 -12
- package/dist/esm/types/helpers/genCommaList.test.d.ts +0 -1
- package/dist/esm/types/helpers/getHumanReadableDate.d.ts +0 -8
- package/dist/esm/types/helpers/getHumanReadableDate.test.d.ts +0 -5
- package/dist/esm/types/helpers/getLocalTimeInfo.d.ts +0 -19
- package/dist/esm/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
- package/dist/esm/types/helpers/getMonthName.d.ts +0 -14
- package/dist/esm/types/helpers/getMonthName.test.d.ts +0 -5
- package/dist/esm/types/helpers/getOrdinal.d.ts +0 -8
- package/dist/esm/types/helpers/getOrdinal.test.d.ts +0 -5
- package/dist/esm/types/helpers/getPartOfDay.d.ts +0 -7
- package/dist/esm/types/helpers/getPartOfDay.test.d.ts +0 -5
- package/dist/esm/types/helpers/getTimeInfoInET.d.ts +0 -21
- package/dist/esm/types/helpers/getTimeInfoInET.test.d.ts +0 -5
- package/dist/esm/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
- package/dist/esm/types/helpers/getWordCount.d.ts +0 -10
- package/dist/esm/types/helpers/idify.d.ts +0 -9
- package/dist/esm/types/helpers/onlyKeepLetters.d.ts +0 -8
- package/dist/esm/types/helpers/padDecimalZeros.d.ts +0 -10
- package/dist/esm/types/helpers/padZerosLeft.d.ts +0 -9
- package/dist/esm/types/helpers/parallelLimit.d.ts +0 -12
- package/dist/esm/types/helpers/prefixWithAOrAn.d.ts +0 -10
- package/dist/esm/types/helpers/roundToNumDecimals.d.ts +0 -9
- package/dist/esm/types/helpers/shuffleArray.d.ts +0 -8
- package/dist/esm/types/helpers/startMinWait.d.ts +0 -9
- package/dist/esm/types/helpers/stringsToHumanReadableList.d.ts +0 -10
- package/dist/esm/types/helpers/sum.d.ts +0 -8
- package/dist/esm/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/esm/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
- package/dist/esm/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
- package/dist/esm/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
- package/dist/esm/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/esm/types/helpers/validators/validateEmail.d.ts +0 -11
- package/dist/esm/types/helpers/validators/validateEmail.test.d.ts +0 -1
- package/dist/esm/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
- package/dist/esm/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
- package/dist/esm/types/helpers/validators/validateString.d.ts +0 -22
- package/dist/esm/types/helpers/validators/validateString.test.d.ts +0 -1
- package/dist/esm/types/helpers/waitMs.d.ts +0 -7
- package/dist/esm/types/types/DayOfWeek.d.ts +0 -14
- package/dist/esm/types/types/Log/LogMainInfo.d.ts +0 -39
- package/dist/esm/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
- package/dist/esm/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
- package/dist/esm/types/types/Log/index.d.ts +0 -10
- package/dist/esm/types/types/LogAction.d.ts +0 -29
- package/dist/esm/types/types/LogBuiltInMetadata.d.ts +0 -16
- package/dist/esm/types/types/LogFunction.d.ts +0 -24
- package/dist/esm/types/types/LogLevel.d.ts +0 -10
- package/dist/esm/types/types/LogMetadataContextMap.d.ts +0 -11
- package/dist/esm/types/types/LogMetadataTagMap.d.ts +0 -8
- package/dist/esm/types/types/LogMetadataTargetMap.d.ts +0 -8
- package/dist/esm/types/types/LogMetadataType.d.ts +0 -13
- package/dist/esm/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
- package/dist/esm/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
- package/dist/esm/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
- package/dist/esm/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
- package/dist/esm/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
- package/dist/esm/types/types/LogReviewerFilterState/index.d.ts +0 -17
- package/dist/esm/types/types/LogSource.d.ts +0 -9
- package/dist/esm/types/types/LogType.d.ts +0 -9
- package/dist/esm/types/types/ParamType.d.ts +0 -17
- package/dist/esm/types/types/ReactKitErrorCode.d.ts +0 -14
- package/src/constants/DAY_IN_MS.ts +0 -7
- package/src/constants/HOUR_IN_MS.ts +0 -7
- package/src/constants/LOG_REVIEW_GET_LOGS_ROUTE.ts +0 -9
- package/src/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.ts +0 -9
- package/src/constants/LOG_REVIEW_STATUS_ROUTE.ts +0 -10
- package/src/constants/LOG_ROUTE_PATH.ts +0 -9
- package/src/constants/MINUTE_IN_MS.ts +0 -7
- package/src/constants/ROUTE_PATH_PREFIX.ts +0 -7
- package/src/constants/SELECT_ADMIN_CHECK_ROUTE.ts +0 -7
- package/src/errors/ErrorWithCode.tsx +0 -15
- package/src/helpers/abbreviate.test.ts +0 -26
- package/src/helpers/abbreviate.ts +0 -25
- package/src/helpers/asyncArrayFunctions/everyAsync.test.ts +0 -114
- package/src/helpers/asyncArrayFunctions/everyAsync.ts +0 -51
- package/src/helpers/asyncArrayFunctions/filterAsync.test.ts +0 -126
- package/src/helpers/asyncArrayFunctions/filterAsync.ts +0 -50
- package/src/helpers/asyncArrayFunctions/forEachAsync.test.ts +0 -136
- package/src/helpers/asyncArrayFunctions/forEachAsync.ts +0 -40
- package/src/helpers/asyncArrayFunctions/mapAsync.test.ts +0 -125
- package/src/helpers/asyncArrayFunctions/mapAsync.ts +0 -46
- package/src/helpers/asyncArrayFunctions/someAsync.test.ts +0 -92
- package/src/helpers/asyncArrayFunctions/someAsync.ts +0 -49
- package/src/helpers/avg.test.ts +0 -24
- package/src/helpers/avg.ts +0 -22
- package/src/helpers/capitalize.ts +0 -20
- package/src/helpers/ceilToNumDecimals.test.ts +0 -39
- package/src/helpers/ceilToNumDecimals.ts +0 -13
- package/src/helpers/cloneDeep.ts +0 -11
- package/src/helpers/compareArraysByProp.test.ts +0 -147
- package/src/helpers/compareArraysByProp.ts +0 -56
- package/src/helpers/extractProp.test.ts +0 -34
- package/src/helpers/extractProp.ts +0 -17
- package/src/helpers/floorToNumDecimals.test.ts +0 -39
- package/src/helpers/floorToNumDecimals.ts +0 -13
- package/src/helpers/forceNumIntoBounds.test.ts +0 -34
- package/src/helpers/forceNumIntoBounds.ts +0 -19
- package/src/helpers/genCSV.test.ts +0 -75
- package/src/helpers/genCSV.ts +0 -87
- package/src/helpers/genCommaList.test.ts +0 -57
- package/src/helpers/genCommaList.ts +0 -21
- package/src/helpers/getHumanReadableDate.test.ts +0 -29
- package/src/helpers/getHumanReadableDate.ts +0 -36
- package/src/helpers/getLocalTimeInfo.test.ts +0 -48
- package/src/helpers/getLocalTimeInfo.ts +0 -58
- package/src/helpers/getMonthName.test.ts +0 -79
- package/src/helpers/getMonthName.ts +0 -29
- package/src/helpers/getOrdinal.test.ts +0 -84
- package/src/helpers/getOrdinal.ts +0 -14
- package/src/helpers/getPartOfDay.test.ts +0 -56
- package/src/helpers/getPartOfDay.ts +0 -20
- package/src/helpers/getTimeInfoInET.test.ts +0 -72
- package/src/helpers/getTimeInfoInET.ts +0 -79
- package/src/helpers/getTimestampFromTimeInfoInET.ts +0 -179
- package/src/helpers/getWordCount.ts +0 -26
- package/src/helpers/idify.ts +0 -24
- package/src/helpers/onlyKeepLetters.ts +0 -11
- package/src/helpers/padDecimalZeros.tsx +0 -32
- package/src/helpers/padZerosLeft.tsx +0 -21
- package/src/helpers/parallelLimit.ts +0 -63
- package/src/helpers/prefixWithAOrAn.ts +0 -29
- package/src/helpers/roundToNumDecimals.tsx +0 -13
- package/src/helpers/shuffleArray.ts +0 -19
- package/src/helpers/startMinWait.ts +0 -33
- package/src/helpers/stringsToHumanReadableList.ts +0 -39
- package/src/helpers/sum.tsx +0 -16
- package/src/helpers/validators/ChicagoTitleCase.test.ts +0 -85
- package/src/helpers/validators/ChicagoTitleCase.ts +0 -32
- package/src/helpers/validators/findURL.test.ts +0 -83
- package/src/helpers/validators/findURL.ts +0 -43
- package/src/helpers/validators/shared/constants/ERROR_MESSAGES.ts +0 -18
- package/src/helpers/validators/shared/helpers/validateRegex.ts +0 -47
- package/src/helpers/validators/shared/types/ValidationResult.ts +0 -20
- package/src/helpers/validators/validURL.test.ts +0 -90
- package/src/helpers/validators/validURL.ts +0 -18
- package/src/helpers/validators/validateEmail.test.ts +0 -110
- package/src/helpers/validators/validateEmail.ts +0 -47
- package/src/helpers/validators/validatePhoneNumber.test.ts +0 -94
- package/src/helpers/validators/validatePhoneNumber.ts +0 -49
- package/src/helpers/validators/validateString.test.ts +0 -173
- package/src/helpers/validators/validateString.ts +0 -171
- package/src/helpers/waitMs.tsx +0 -12
- package/src/types/DayOfWeek.ts +0 -15
- package/src/types/Log/LogMainInfo.ts +0 -69
- package/src/types/Log/LogSourceSpecificInfo.ts +0 -25
- package/src/types/Log/LogTypeSpecificInfo.ts +0 -33
- package/src/types/Log/index.ts +0 -17
- package/src/types/LogAction.ts +0 -52
- package/src/types/LogBuiltInMetadata.ts +0 -19
- package/src/types/LogFunction.ts +0 -46
- package/src/types/LogLevel.ts +0 -11
- package/src/types/LogMetadataContextMap.ts +0 -15
- package/src/types/LogMetadataTagMap.ts +0 -9
- package/src/types/LogMetadataTargetMap.ts +0 -9
- package/src/types/LogMetadataType.ts +0 -16
- package/src/types/LogReviewerFilterState/ActionErrorFilterState.ts +0 -24
- package/src/types/LogReviewerFilterState/AdvancedFilterState.ts +0 -36
- package/src/types/LogReviewerFilterState/ContextFilterState.ts +0 -16
- package/src/types/LogReviewerFilterState/DateFilterState.ts +0 -26
- package/src/types/LogReviewerFilterState/TagFilterState.ts +0 -9
- package/src/types/LogReviewerFilterState/index.ts +0 -24
- package/src/types/LogSource.ts +0 -12
- package/src/types/LogType.ts +0 -12
- package/src/types/ParamType.ts +0 -18
- 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 :
|
|
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.',
|
|
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 :
|
|
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.',
|
|
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 ===
|
|
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
|
-
||
|
|
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
|
|
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
|
-
?
|
|
1999
|
-
: String((_d = error.code) !== null && _d !== void 0 ? _d :
|
|
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(),
|
|
2231
|
-
: new ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode :
|
|
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',
|
|
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',
|
|
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
|
|
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
|
|
4242
|
-
|| paramType === ParamType
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3451
|
+
type: ParamType.String,
|
|
4568
3452
|
},
|
|
4569
3453
|
{
|
|
4570
3454
|
title: 'Last Name',
|
|
4571
3455
|
param: 'userLastName',
|
|
4572
|
-
type: ParamType
|
|
3456
|
+
type: ParamType.String,
|
|
4573
3457
|
},
|
|
4574
3458
|
{
|
|
4575
3459
|
title: 'Email',
|
|
4576
3460
|
param: 'userEmail',
|
|
4577
|
-
type: ParamType
|
|
3461
|
+
type: ParamType.String,
|
|
4578
3462
|
},
|
|
4579
3463
|
{
|
|
4580
3464
|
title: 'Canvas Id',
|
|
4581
3465
|
param: 'userId',
|
|
4582
|
-
type: ParamType
|
|
3466
|
+
type: ParamType.Int,
|
|
4583
3467
|
},
|
|
4584
3468
|
{
|
|
4585
3469
|
title: 'Student?',
|
|
4586
3470
|
param: 'isLearner',
|
|
4587
|
-
type: ParamType
|
|
3471
|
+
type: ParamType.Boolean,
|
|
4588
3472
|
},
|
|
4589
3473
|
{
|
|
4590
3474
|
title: 'Teaching Staff?',
|
|
4591
3475
|
param: 'isTTM',
|
|
4592
|
-
type: ParamType
|
|
3476
|
+
type: ParamType.Boolean,
|
|
4593
3477
|
startsHidden: true,
|
|
4594
3478
|
},
|
|
4595
3479
|
{
|
|
4596
3480
|
title: 'Admin?',
|
|
4597
3481
|
param: 'isAdmin',
|
|
4598
|
-
type: ParamType
|
|
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
|
|
3488
|
+
type: ParamType.Int,
|
|
4605
3489
|
startsHidden: true,
|
|
4606
3490
|
},
|
|
4607
3491
|
{
|
|
4608
3492
|
title: 'Course Name',
|
|
4609
3493
|
param: 'courseName',
|
|
4610
|
-
type: ParamType
|
|
3494
|
+
type: ParamType.String,
|
|
4611
3495
|
},
|
|
4612
3496
|
{
|
|
4613
3497
|
title: 'Browser Name',
|
|
4614
3498
|
param: 'browser.name',
|
|
4615
|
-
type: ParamType
|
|
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
|
|
3505
|
+
type: ParamType.String,
|
|
4622
3506
|
startsHidden: true,
|
|
4623
3507
|
},
|
|
4624
3508
|
{
|
|
4625
3509
|
title: 'OS',
|
|
4626
3510
|
param: 'device.os',
|
|
4627
|
-
type: ParamType
|
|
3511
|
+
type: ParamType.String,
|
|
4628
3512
|
startsHidden: true,
|
|
4629
3513
|
},
|
|
4630
3514
|
{
|
|
4631
3515
|
title: 'Mobile?',
|
|
4632
3516
|
param: 'device.isMobile',
|
|
4633
|
-
type: ParamType
|
|
3517
|
+
type: ParamType.Boolean,
|
|
4634
3518
|
startsHidden: true,
|
|
4635
3519
|
},
|
|
4636
3520
|
{
|
|
4637
3521
|
title: 'Year',
|
|
4638
3522
|
param: 'year',
|
|
4639
|
-
type: ParamType
|
|
3523
|
+
type: ParamType.Int,
|
|
4640
3524
|
},
|
|
4641
3525
|
{
|
|
4642
3526
|
title: 'Month',
|
|
4643
3527
|
param: 'month',
|
|
4644
|
-
type: ParamType
|
|
3528
|
+
type: ParamType.Int,
|
|
4645
3529
|
},
|
|
4646
3530
|
{
|
|
4647
3531
|
title: 'Day',
|
|
4648
3532
|
param: 'day',
|
|
4649
|
-
type: ParamType
|
|
3533
|
+
type: ParamType.Int,
|
|
4650
3534
|
},
|
|
4651
3535
|
{
|
|
4652
3536
|
title: 'Hour',
|
|
4653
3537
|
param: 'hour',
|
|
4654
|
-
type: ParamType
|
|
3538
|
+
type: ParamType.Int,
|
|
4655
3539
|
},
|
|
4656
3540
|
{
|
|
4657
3541
|
title: 'Minute',
|
|
4658
3542
|
param: 'minute',
|
|
4659
|
-
type: ParamType
|
|
3543
|
+
type: ParamType.Int,
|
|
4660
3544
|
startsHidden: true,
|
|
4661
3545
|
},
|
|
4662
3546
|
{
|
|
4663
3547
|
title: 'Timestamp',
|
|
4664
3548
|
param: 'timestamp',
|
|
4665
|
-
type: ParamType
|
|
3549
|
+
type: ParamType.Int,
|
|
4666
3550
|
startsHidden: true,
|
|
4667
3551
|
},
|
|
4668
3552
|
{
|
|
4669
3553
|
title: 'Context',
|
|
4670
3554
|
param: 'context',
|
|
4671
|
-
type: ParamType
|
|
3555
|
+
type: ParamType.String,
|
|
4672
3556
|
},
|
|
4673
3557
|
{
|
|
4674
3558
|
title: 'Subcontext',
|
|
4675
3559
|
param: 'subcontext',
|
|
4676
|
-
type: ParamType
|
|
3560
|
+
type: ParamType.String,
|
|
4677
3561
|
},
|
|
4678
3562
|
{
|
|
4679
3563
|
title: 'Tags',
|
|
4680
3564
|
param: 'tags',
|
|
4681
|
-
type: ParamType
|
|
3565
|
+
type: ParamType.JSON,
|
|
4682
3566
|
startsHidden: true,
|
|
4683
3567
|
},
|
|
4684
3568
|
{
|
|
4685
3569
|
title: 'Log Level',
|
|
4686
3570
|
param: 'level',
|
|
4687
|
-
type: ParamType
|
|
3571
|
+
type: ParamType.String,
|
|
4688
3572
|
startsHidden: true,
|
|
4689
3573
|
},
|
|
4690
3574
|
{
|
|
4691
3575
|
title: 'Metadata',
|
|
4692
3576
|
param: 'metadata',
|
|
4693
|
-
type: ParamType
|
|
3577
|
+
type: ParamType.JSON,
|
|
4694
3578
|
startsHidden: true,
|
|
4695
3579
|
},
|
|
4696
3580
|
{
|
|
4697
3581
|
title: 'Source',
|
|
4698
3582
|
param: 'source',
|
|
4699
|
-
type: ParamType
|
|
3583
|
+
type: ParamType.String,
|
|
4700
3584
|
},
|
|
4701
3585
|
{
|
|
4702
3586
|
title: 'Server Route Path',
|
|
4703
3587
|
param: 'routePath',
|
|
4704
|
-
type: ParamType
|
|
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
|
|
3594
|
+
type: ParamType.String,
|
|
4711
3595
|
startsHidden: true,
|
|
4712
3596
|
},
|
|
4713
3597
|
{
|
|
4714
3598
|
title: 'Type',
|
|
4715
3599
|
param: 'type',
|
|
4716
|
-
type: ParamType
|
|
3600
|
+
type: ParamType.String,
|
|
4717
3601
|
},
|
|
4718
3602
|
{
|
|
4719
3603
|
title: 'Error Message',
|
|
4720
3604
|
param: 'errorMessage',
|
|
4721
|
-
type: ParamType
|
|
3605
|
+
type: ParamType.String,
|
|
4722
3606
|
startsHidden: true,
|
|
4723
3607
|
},
|
|
4724
3608
|
{
|
|
4725
3609
|
title: 'Error Code',
|
|
4726
3610
|
param: 'errorCode',
|
|
4727
|
-
type: ParamType
|
|
3611
|
+
type: ParamType.String,
|
|
4728
3612
|
startsHidden: true,
|
|
4729
3613
|
},
|
|
4730
3614
|
{
|
|
4731
3615
|
title: 'Error Stack',
|
|
4732
3616
|
param: 'errorStack',
|
|
4733
|
-
type: ParamType
|
|
3617
|
+
type: ParamType.String,
|
|
4734
3618
|
startsHidden: true,
|
|
4735
3619
|
},
|
|
4736
3620
|
{
|
|
4737
3621
|
title: 'Action Target',
|
|
4738
3622
|
param: 'target',
|
|
4739
|
-
type: ParamType
|
|
3623
|
+
type: ParamType.String,
|
|
4740
3624
|
startsHidden: true,
|
|
4741
3625
|
},
|
|
4742
3626
|
{
|
|
4743
3627
|
title: 'Action Type',
|
|
4744
3628
|
param: 'action',
|
|
4745
|
-
type: ParamType
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
5417
|
-
React__default.createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction
|
|
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
|
|
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
|
|
5587
|
-
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource
|
|
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
|
|
5594
|
-
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource
|
|
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
|
|
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__*/
|
|
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-
|
|
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
|
|
@@ -15522,45 +14385,8 @@ const ProgressBar = (props) => {
|
|
|
15522
14385
|
"\u00A0"))));
|
|
15523
14386
|
};
|
|
15524
14387
|
|
|
15525
|
-
/**
|
|
15526
|
-
* One minute in ms
|
|
15527
|
-
* @author Gabe Abrams
|
|
15528
|
-
*/
|
|
15529
|
-
const MINUTE_IN_MS = 60000;
|
|
15530
|
-
|
|
15531
|
-
/**
|
|
15532
|
-
* One hour in ms
|
|
15533
|
-
* @author Gabe Abrams
|
|
15534
|
-
*/
|
|
15535
|
-
const HOUR_IN_MS = 3600000;
|
|
15536
|
-
|
|
15537
|
-
/**
|
|
15538
|
-
* One day in ms
|
|
15539
|
-
* @author Gabe Abrams
|
|
15540
|
-
*/
|
|
15541
|
-
const DAY_IN_MS = 86400000;
|
|
15542
|
-
|
|
15543
|
-
/**
|
|
15544
|
-
* Path of the route for storing client-side logs
|
|
15545
|
-
* @author Gabe Abrams
|
|
15546
|
-
*/
|
|
15547
|
-
const LOG_REVIEW_ROUTE_PATH_PREFIX = `/admin${ROUTE_PATH_PREFIX}/logs`;
|
|
15548
|
-
|
|
15549
|
-
/**
|
|
15550
|
-
* Route for checking the status of the current user's
|
|
15551
|
-
* access to log review
|
|
15552
|
-
* @author Gabe Abrams
|
|
15553
|
-
*/
|
|
15554
|
-
const LOG_REVIEW_STATUS_ROUTE = `${ROUTE_PATH_PREFIX}/logs/access_allowed`;
|
|
15555
|
-
|
|
15556
|
-
/**
|
|
15557
|
-
* Route for checking if the current user is a select admin
|
|
15558
|
-
* @author Gabe Abrams
|
|
15559
|
-
*/
|
|
15560
|
-
const SELECT_ADMIN_CHECK_ROUTE = '/api/admin/select/is-select-admin';
|
|
15561
|
-
|
|
15562
14388
|
// True if user is on mobile or tablet
|
|
15563
|
-
let cachedResult
|
|
14389
|
+
let cachedResult;
|
|
15564
14390
|
/**
|
|
15565
14391
|
* Check if the user is on a mobile device or tablet
|
|
15566
14392
|
* from https://stackoverflow.com/questions/11381673/detecting-a-mobile-browser
|
|
@@ -15573,6 +14399,7 @@ const isMobileOrTablet = () => {
|
|
|
15573
14399
|
}
|
|
15574
14400
|
try {
|
|
15575
14401
|
let check = false;
|
|
14402
|
+
// eslint-disable-next-line max-len, no-useless-escape
|
|
15576
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)))
|
|
15577
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);
|
|
15578
14405
|
cachedResult = check;
|
|
@@ -15613,119 +14440,6 @@ const DynamicWord = {
|
|
|
15613
14440
|
: 'Computer'),
|
|
15614
14441
|
};
|
|
15615
14442
|
|
|
15616
|
-
/**
|
|
15617
|
-
* Shorten text so it fits into a certain number of chars
|
|
15618
|
-
* @author Gabe Abrams
|
|
15619
|
-
* @param text the text to abbreviate
|
|
15620
|
-
* @param maxChars the maximum number of chars to include
|
|
15621
|
-
* @returns abbreviated text with length no greater than maxChars
|
|
15622
|
-
* (including ellipses if applicable)
|
|
15623
|
-
*/
|
|
15624
|
-
const abbreviate = (text, maxChars) => {
|
|
15625
|
-
// Check if already short enough
|
|
15626
|
-
if (text.trim().length < maxChars) {
|
|
15627
|
-
return text.trim();
|
|
15628
|
-
}
|
|
15629
|
-
// Abbreviate
|
|
15630
|
-
const shortenedText = (text
|
|
15631
|
-
.trim()
|
|
15632
|
-
.substring(0, maxChars - 3)
|
|
15633
|
-
.trim());
|
|
15634
|
-
return `${shortenedText}...`;
|
|
15635
|
-
};
|
|
15636
|
-
|
|
15637
|
-
/**
|
|
15638
|
-
* Sum the numbers in an array
|
|
15639
|
-
* @author Gabe Abrams
|
|
15640
|
-
* @param nums the numbers to sum
|
|
15641
|
-
* @returns the sum of the numbers
|
|
15642
|
-
*/
|
|
15643
|
-
const sum = (nums) => {
|
|
15644
|
-
return nums.reduce((a, b) => {
|
|
15645
|
-
return (a + b);
|
|
15646
|
-
}, 0);
|
|
15647
|
-
};
|
|
15648
|
-
|
|
15649
|
-
/**
|
|
15650
|
-
* Get the average of a set of numbers
|
|
15651
|
-
* @author Gabe Abrams
|
|
15652
|
-
* @param nums the numbers to average
|
|
15653
|
-
* @returns average value or 0 if no numbers
|
|
15654
|
-
*/
|
|
15655
|
-
const avg = (nums) => {
|
|
15656
|
-
// Handle empty array case
|
|
15657
|
-
if (nums.length === 0) {
|
|
15658
|
-
return 0;
|
|
15659
|
-
}
|
|
15660
|
-
// Get the total value
|
|
15661
|
-
const total = sum(nums);
|
|
15662
|
-
// Get average
|
|
15663
|
-
return (total / nums.length);
|
|
15664
|
-
};
|
|
15665
|
-
|
|
15666
|
-
/**
|
|
15667
|
-
* Round a number (ceiling) to a certain number of decimals
|
|
15668
|
-
* @author Gabe Abrams
|
|
15669
|
-
* @param num the number to round
|
|
15670
|
-
* @param numDecimals the number of decimals to round to
|
|
15671
|
-
* @returns rounded number
|
|
15672
|
-
*/
|
|
15673
|
-
const ceilToNumDecimals = (num, numDecimals) => {
|
|
15674
|
-
const rounder = 10 ** numDecimals;
|
|
15675
|
-
return (Math.ceil(num * rounder) / rounder);
|
|
15676
|
-
};
|
|
15677
|
-
|
|
15678
|
-
/**
|
|
15679
|
-
* Round a number (floor) to a certain number of decimals
|
|
15680
|
-
* @author Gabe Abrams
|
|
15681
|
-
* @param num the number to round
|
|
15682
|
-
* @param numDecimals the number of decimals to round to
|
|
15683
|
-
* @returns rounded number
|
|
15684
|
-
*/
|
|
15685
|
-
const floorToNumDecimals = (num, numDecimals) => {
|
|
15686
|
-
const rounder = 10 ** numDecimals;
|
|
15687
|
-
return (Math.floor(num * rounder) / rounder);
|
|
15688
|
-
};
|
|
15689
|
-
|
|
15690
|
-
/**
|
|
15691
|
-
* Force a number to stay within specific bounds
|
|
15692
|
-
* @author Gabe Abrams
|
|
15693
|
-
* @param num the number to move into the bounds
|
|
15694
|
-
* @param min the minimum number in the bound
|
|
15695
|
-
* @param max the maximum number in the bound
|
|
15696
|
-
* @returns bounded number
|
|
15697
|
-
*/
|
|
15698
|
-
const forceNumIntoBounds = (num, min, max) => {
|
|
15699
|
-
return Math.max(min, Math.min(max, num));
|
|
15700
|
-
};
|
|
15701
|
-
|
|
15702
|
-
/**
|
|
15703
|
-
* Pad a number's decimal with zeros on the right
|
|
15704
|
-
* (e.g. 5.2 becomes 5.20 with 2 digit padding)
|
|
15705
|
-
* @author Gabe Abrams
|
|
15706
|
-
* @param num the number to pad
|
|
15707
|
-
* @param numDigits the minimum number of digits after the decimal
|
|
15708
|
-
* @returns padded number
|
|
15709
|
-
*/
|
|
15710
|
-
const padDecimalZeros = (num, numDigits) => {
|
|
15711
|
-
// Skip if nothing to do
|
|
15712
|
-
if (numDigits < 1) {
|
|
15713
|
-
return String(num);
|
|
15714
|
-
}
|
|
15715
|
-
// Convert to string
|
|
15716
|
-
let out = String(num);
|
|
15717
|
-
// Add a decimal point if there isn't one
|
|
15718
|
-
if (!out.includes('.')) {
|
|
15719
|
-
out += '.';
|
|
15720
|
-
}
|
|
15721
|
-
// Add zeros
|
|
15722
|
-
while (out.split('.')[1].length < numDigits) {
|
|
15723
|
-
out = `${out}0`;
|
|
15724
|
-
}
|
|
15725
|
-
// Return
|
|
15726
|
-
return out;
|
|
15727
|
-
};
|
|
15728
|
-
|
|
15729
14443
|
/**
|
|
15730
14444
|
* Stub a server endpoint response
|
|
15731
14445
|
* @author Gabe Abrams
|
|
@@ -15738,146 +14452,6 @@ const padDecimalZeros = (num, numDigits) => {
|
|
|
15738
14452
|
*/
|
|
15739
14453
|
const stubServerEndpoint = _setStubResponse;
|
|
15740
14454
|
|
|
15741
|
-
/**
|
|
15742
|
-
* Start a dynamic wait, call the function once the operation has completed and
|
|
15743
|
-
* the dynamic wait will continue waiting for the rest of the minimum time
|
|
15744
|
-
* @author Gabe Abrams
|
|
15745
|
-
* @param minWaitMs the minimum number of ms to wait
|
|
15746
|
-
* @returns async function to call to finish the wait
|
|
15747
|
-
*/
|
|
15748
|
-
const startMinWait = (minWaitMs) => {
|
|
15749
|
-
const startTimestamp = Date.now();
|
|
15750
|
-
/**
|
|
15751
|
-
* Finish the remaining time to wait
|
|
15752
|
-
* @author Gabe Abrams
|
|
15753
|
-
*/
|
|
15754
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15755
|
-
const endTimestamp = Date.now();
|
|
15756
|
-
// Calculate remaining time to wait
|
|
15757
|
-
const elapsedTimeMs = (endTimestamp - startTimestamp);
|
|
15758
|
-
const remainingTimeToWaitMs = minWaitMs - elapsedTimeMs;
|
|
15759
|
-
if (remainingTimeToWaitMs <= 0) {
|
|
15760
|
-
return;
|
|
15761
|
-
}
|
|
15762
|
-
// Perform wait
|
|
15763
|
-
yield waitMs(remainingTimeToWaitMs);
|
|
15764
|
-
});
|
|
15765
|
-
};
|
|
15766
|
-
|
|
15767
|
-
/**
|
|
15768
|
-
* Get the current part of day (morning, evening, etc.)
|
|
15769
|
-
* @author Gabe Abrams
|
|
15770
|
-
* @returns the part of day (morning, evening, etc.)
|
|
15771
|
-
*/
|
|
15772
|
-
const getPartOfDay = () => {
|
|
15773
|
-
// Setup the post-it time of day
|
|
15774
|
-
let partOfDay = 'day';
|
|
15775
|
-
const hours = new Date().getHours();
|
|
15776
|
-
if (hours < 12) {
|
|
15777
|
-
partOfDay = 'morning';
|
|
15778
|
-
}
|
|
15779
|
-
else if (hours >= 12 && hours <= 16) {
|
|
15780
|
-
partOfDay = 'afternoon';
|
|
15781
|
-
}
|
|
15782
|
-
else if (hours > 16 && hours <= 24) {
|
|
15783
|
-
partOfDay = 'evening';
|
|
15784
|
-
}
|
|
15785
|
-
return partOfDay;
|
|
15786
|
-
};
|
|
15787
|
-
|
|
15788
|
-
/**
|
|
15789
|
-
* Create a human readable list from an array of strings.
|
|
15790
|
-
* For example, ['apple', 'orange'] becomes "apple and orange"
|
|
15791
|
-
* and ['apple', 'orange', 'mango'] becomes "apple, orange, and mango"
|
|
15792
|
-
* @author Gabe Abrams
|
|
15793
|
-
* @param items list of items in the list
|
|
15794
|
-
* @returns human-readable list
|
|
15795
|
-
*/
|
|
15796
|
-
const stringsToHumanReadableList = (items) => {
|
|
15797
|
-
// Handle 0-item case
|
|
15798
|
-
if (items.length === 0) {
|
|
15799
|
-
return '';
|
|
15800
|
-
}
|
|
15801
|
-
// Handle 1-item case
|
|
15802
|
-
if (items.length === 1) {
|
|
15803
|
-
return items[0];
|
|
15804
|
-
}
|
|
15805
|
-
// Handle 2-item case
|
|
15806
|
-
if (items.length === 2) {
|
|
15807
|
-
return `${items[0]} and ${items[1]}`;
|
|
15808
|
-
}
|
|
15809
|
-
// Handle 3+ item case
|
|
15810
|
-
let list = '';
|
|
15811
|
-
items.forEach((item, i) => {
|
|
15812
|
-
if (i === items.length - 1) {
|
|
15813
|
-
// Last item
|
|
15814
|
-
list += `, and ${item}`;
|
|
15815
|
-
}
|
|
15816
|
-
// Previous items
|
|
15817
|
-
list += `, ${item}`;
|
|
15818
|
-
});
|
|
15819
|
-
return list;
|
|
15820
|
-
};
|
|
15821
|
-
|
|
15822
|
-
/**
|
|
15823
|
-
* Given a string, only keep the letters inside it
|
|
15824
|
-
* @author Gabe Abrams
|
|
15825
|
-
* @param str the string to parse
|
|
15826
|
-
* @returns only the letters inside of the string
|
|
15827
|
-
*/
|
|
15828
|
-
const onlyKeepLetters = (str) => {
|
|
15829
|
-
return str.replace(/[^a-zA-Z]+/g, '');
|
|
15830
|
-
};
|
|
15831
|
-
|
|
15832
|
-
/**
|
|
15833
|
-
* Run tasks in parallel with a limit on how many tasks can execute at once.
|
|
15834
|
-
* No guarantees are made about the order of task execution
|
|
15835
|
-
* @author Gabe Abrams
|
|
15836
|
-
* @param taskFunctions functions that start asynchronous tasks and optionally
|
|
15837
|
-
* resolve with values
|
|
15838
|
-
* @param [limit=no limit] maximum number of asynchronous tasks to permit to run at
|
|
15839
|
-
* once
|
|
15840
|
-
* @returns array of resolved values in the same order as the task functions
|
|
15841
|
-
*/
|
|
15842
|
-
const parallelLimit = (taskFunctions, limit) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15843
|
-
const results = [];
|
|
15844
|
-
// Wait until finished with all tasks
|
|
15845
|
-
yield new Promise((resolve) => {
|
|
15846
|
-
/* ------------- Helpers ------------ */
|
|
15847
|
-
let nextTaskIndex = 0;
|
|
15848
|
-
let numFinishedTasks = 0;
|
|
15849
|
-
/**
|
|
15850
|
-
* Start the next task
|
|
15851
|
-
* @author Gabe Abrams
|
|
15852
|
-
*/
|
|
15853
|
-
const startTask = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15854
|
-
const taskIndex = nextTaskIndex++;
|
|
15855
|
-
// Get the task
|
|
15856
|
-
const taskFunction = taskFunctions[taskIndex];
|
|
15857
|
-
if (!taskFunction) {
|
|
15858
|
-
return;
|
|
15859
|
-
}
|
|
15860
|
-
// Execute task
|
|
15861
|
-
const result = yield taskFunction();
|
|
15862
|
-
// Add results
|
|
15863
|
-
results[taskIndex] = result;
|
|
15864
|
-
// Tally and finish
|
|
15865
|
-
if (++numFinishedTasks === taskFunctions.length) {
|
|
15866
|
-
return resolve();
|
|
15867
|
-
}
|
|
15868
|
-
// Not finished! Start another task
|
|
15869
|
-
startTask();
|
|
15870
|
-
});
|
|
15871
|
-
/* ----------- Start Tasks ---------- */
|
|
15872
|
-
// If no limit, start all tasks. At least start 1 task
|
|
15873
|
-
const numTasks = Math.max((limit || taskFunctions.length), 1);
|
|
15874
|
-
for (let i = 0; i < numTasks; i++) {
|
|
15875
|
-
startTask();
|
|
15876
|
-
}
|
|
15877
|
-
});
|
|
15878
|
-
return results;
|
|
15879
|
-
});
|
|
15880
|
-
|
|
15881
14455
|
/*------------------------------------------------------------------------*/
|
|
15882
14456
|
/* -------------------------------- Cache ------------------------------- */
|
|
15883
14457
|
/*------------------------------------------------------------------------*/
|
|
@@ -15909,355 +14483,6 @@ const canReviewLogs = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
15909
14483
|
return canReview;
|
|
15910
14484
|
});
|
|
15911
14485
|
|
|
15912
|
-
/**
|
|
15913
|
-
* For every element in an array, extract the value of a prop
|
|
15914
|
-
* (e.g. for all user objects, extract their ages and put that into a new
|
|
15915
|
-
* ages array)
|
|
15916
|
-
* @author Gabe Abrams
|
|
15917
|
-
* @param arr the array of objects to operate on
|
|
15918
|
-
* @param prop the property to extract from each object
|
|
15919
|
-
* @returns new array containing the corresponding values, in order, of each
|
|
15920
|
-
* object in the original array
|
|
15921
|
-
*/
|
|
15922
|
-
const extractProp = (arr, prop) => {
|
|
15923
|
-
return arr.map((item) => {
|
|
15924
|
-
return item[prop];
|
|
15925
|
-
});
|
|
15926
|
-
};
|
|
15927
|
-
|
|
15928
|
-
/**
|
|
15929
|
-
* Compare two arrays of objects by only comparing the values in a specific
|
|
15930
|
-
* property (e.g. compare user arrays by comparing their user.id values)
|
|
15931
|
-
* @author Gabe Abrams
|
|
15932
|
-
* @param a the first array
|
|
15933
|
-
* @param b the second array
|
|
15934
|
-
* @param prop the property to compare with, or an array of props to compare
|
|
15935
|
-
* with (if array, all values associated with those props must match)
|
|
15936
|
-
* @returns true if the arrays contain the same objects as determined by
|
|
15937
|
-
* the values associated with each object's prop
|
|
15938
|
-
*/
|
|
15939
|
-
const compareArraysByProp = (a, b, prop) => {
|
|
15940
|
-
// Immediately return if size of arrays is different
|
|
15941
|
-
if (a.length !== b.length) {
|
|
15942
|
-
return false;
|
|
15943
|
-
}
|
|
15944
|
-
// Get all props
|
|
15945
|
-
const props = (Array.isArray(prop) ? prop : [prop]);
|
|
15946
|
-
// Clone second array so we can work on it
|
|
15947
|
-
const bCloned = [...b];
|
|
15948
|
-
// Remove elements from b as we find them in a
|
|
15949
|
-
for (let i = 0; i < a.length; i++) {
|
|
15950
|
-
// Find matching element in b
|
|
15951
|
-
const matchingIndex = bCloned.findIndex((bItem) => {
|
|
15952
|
-
// Compare based on all props
|
|
15953
|
-
return props.every((propToCompareBy) => {
|
|
15954
|
-
var _a;
|
|
15955
|
-
const aVal = ((_a = a[i]) !== null && _a !== void 0 ? _a : {})[propToCompareBy];
|
|
15956
|
-
const bVal = (bItem !== null && bItem !== void 0 ? bItem : {})[propToCompareBy];
|
|
15957
|
-
return aVal === bVal;
|
|
15958
|
-
});
|
|
15959
|
-
});
|
|
15960
|
-
// Check if no match
|
|
15961
|
-
const noMatch = (matchingIndex < 0);
|
|
15962
|
-
// If no match, there's no corresponding element in b
|
|
15963
|
-
if (noMatch) {
|
|
15964
|
-
return false;
|
|
15965
|
-
}
|
|
15966
|
-
// Remove the matching element
|
|
15967
|
-
bCloned.splice(matchingIndex, 1);
|
|
15968
|
-
}
|
|
15969
|
-
// If we made it here, all elements in a have a corresponding element in b
|
|
15970
|
-
return true;
|
|
15971
|
-
};
|
|
15972
|
-
|
|
15973
|
-
/**
|
|
15974
|
-
* Get current time info in local time
|
|
15975
|
-
* @author Gabe Abrams
|
|
15976
|
-
* @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp
|
|
15977
|
-
* @returns object with timestamp (ms since epoch) and numbers
|
|
15978
|
-
* corresponding to time values for year, month, day, hour, hour12, minute, isPM
|
|
15979
|
-
* where hour is in 24hr time and hour12 is in 12hr time.
|
|
15980
|
-
*/
|
|
15981
|
-
const getLocalTimeInfo = (dateOrTimestamp) => {
|
|
15982
|
-
// Create a time string
|
|
15983
|
-
let d;
|
|
15984
|
-
if (!dateOrTimestamp) {
|
|
15985
|
-
// Use now
|
|
15986
|
-
d = new Date();
|
|
15987
|
-
}
|
|
15988
|
-
else if (typeof dateOrTimestamp === 'number') {
|
|
15989
|
-
// Convert to date
|
|
15990
|
-
d = new Date(dateOrTimestamp);
|
|
15991
|
-
}
|
|
15992
|
-
else {
|
|
15993
|
-
// Already a date
|
|
15994
|
-
d = dateOrTimestamp;
|
|
15995
|
-
}
|
|
15996
|
-
// Create all time numbers
|
|
15997
|
-
const timestamp = d.getTime();
|
|
15998
|
-
const year = d.getFullYear();
|
|
15999
|
-
const month = d.getMonth() + 1;
|
|
16000
|
-
const day = d.getDate();
|
|
16001
|
-
const hour = d.getHours();
|
|
16002
|
-
const isPM = hour >= 12;
|
|
16003
|
-
let hour12 = hour % 12;
|
|
16004
|
-
if (hour12 === 0) {
|
|
16005
|
-
hour12 = 12;
|
|
16006
|
-
}
|
|
16007
|
-
const minute = d.getMinutes();
|
|
16008
|
-
// Return
|
|
16009
|
-
return {
|
|
16010
|
-
timestamp,
|
|
16011
|
-
year,
|
|
16012
|
-
month,
|
|
16013
|
-
day,
|
|
16014
|
-
hour,
|
|
16015
|
-
hour12,
|
|
16016
|
-
isPM,
|
|
16017
|
-
minute,
|
|
16018
|
-
};
|
|
16019
|
-
};
|
|
16020
|
-
|
|
16021
|
-
/**
|
|
16022
|
-
* Given an array of strings, create a single comma-separated string that includes
|
|
16023
|
-
* 'and' as well as an oxford comma.
|
|
16024
|
-
* Ex: ['apples'] => 'apples'
|
|
16025
|
-
* Ex: ['apples', 'bananas'] => 'apples and bananas'
|
|
16026
|
-
* Ex: ['apples', 'bananas', 'grapes'] => 'apples, bananas, and grapes'
|
|
16027
|
-
* @author Austen Money
|
|
16028
|
-
* @param list an array of elements to be made into a single comma-separated string.
|
|
16029
|
-
* @returns a comma-separated string.
|
|
16030
|
-
*/
|
|
16031
|
-
const genCommaList = (list) => {
|
|
16032
|
-
const { length } = list;
|
|
16033
|
-
return (length < 2
|
|
16034
|
-
? list.join('')
|
|
16035
|
-
: `${list.slice(0, length - 1).join(', ')}${length < 3 ? ' and ' : ', and '}${list[length - 1]}`);
|
|
16036
|
-
};
|
|
16037
|
-
|
|
16038
|
-
/*------------------------------------------------------------------------*/
|
|
16039
|
-
/* ------------------------------ Constants ----------------------------- */
|
|
16040
|
-
/*------------------------------------------------------------------------*/
|
|
16041
|
-
const INVALID_REGEX_ERROR = 'input does not follow the requested format';
|
|
16042
|
-
const INVALID_EMAIL_ERROR = 'Please provide a valid email address.';
|
|
16043
|
-
const INVALID_PHONE_ERROR = 'Please provide a valid phone number.';
|
|
16044
|
-
const INVALID_STRING_ERRORS = {
|
|
16045
|
-
MIN_LEN: (minLen) => {
|
|
16046
|
-
return `input must not be under ${minLen} character(s)`;
|
|
16047
|
-
},
|
|
16048
|
-
MAX_LEN: (maxLen) => {
|
|
16049
|
-
return `input must not be over ${maxLen} character(s)`;
|
|
16050
|
-
},
|
|
16051
|
-
LETTERS_ONLY: 'input must only contain letters',
|
|
16052
|
-
NUMBERS_ONLY: 'input must only contain numbers',
|
|
16053
|
-
MESSAGE_INTRO: 'The following error(s) occurred: ',
|
|
16054
|
-
};
|
|
16055
|
-
|
|
16056
|
-
// Import constants
|
|
16057
|
-
/**
|
|
16058
|
-
* Determines whether a given input string is considered valid based on
|
|
16059
|
-
* the provided regex.
|
|
16060
|
-
* @author Austen Money
|
|
16061
|
-
* @param opts object containing all args
|
|
16062
|
-
* @param opts.input user-provided input to validate
|
|
16063
|
-
* @param opts.regex regular expression to check against input
|
|
16064
|
-
* @param [opts.regexDescription] description of what regexString is checking
|
|
16065
|
-
* for, used to customize error message
|
|
16066
|
-
* @returns the unchanged input if valid, or a customized error message if
|
|
16067
|
-
* invalid
|
|
16068
|
-
*/
|
|
16069
|
-
const validateRegex = (opts) => {
|
|
16070
|
-
// customize error message in case of invalid input
|
|
16071
|
-
const errorMessage = `${INVALID_REGEX_ERROR}${opts.regexDescription
|
|
16072
|
-
? ': '
|
|
16073
|
-
: ''}${opts.regexDescription}`;
|
|
16074
|
-
// return error message if test is invalid, or input string if valid
|
|
16075
|
-
return (opts.regex.test(opts.input)
|
|
16076
|
-
? {
|
|
16077
|
-
isValid: true,
|
|
16078
|
-
cleanedValue: opts.input,
|
|
16079
|
-
}
|
|
16080
|
-
: {
|
|
16081
|
-
isValid: false,
|
|
16082
|
-
errorMessage,
|
|
16083
|
-
});
|
|
16084
|
-
};
|
|
16085
|
-
|
|
16086
|
-
// Import helpers
|
|
16087
|
-
/**
|
|
16088
|
-
* Determines whether a given email address is valid.
|
|
16089
|
-
* @author Austen Money
|
|
16090
|
-
* @param email email address to validate
|
|
16091
|
-
* @returns whether email fulfills proper formatting requirements, includes a
|
|
16092
|
-
* cleaned version of the address without leading or trailing
|
|
16093
|
-
* whitespace if valid or an error message if invalid.
|
|
16094
|
-
*/
|
|
16095
|
-
const validateEmail = (email) => {
|
|
16096
|
-
// validation regex, sourced from HTML living standard: http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email)
|
|
16097
|
-
// eslint-disable-next-line max-len
|
|
16098
|
-
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])?)*$/;
|
|
16099
|
-
// remove leading and trailing whitespace
|
|
16100
|
-
const cleanedValue = email.replace(/^\s+|\s+$/g, '');
|
|
16101
|
-
// validate email with regex, and return error if not valid
|
|
16102
|
-
return (validateRegex({
|
|
16103
|
-
input: cleanedValue,
|
|
16104
|
-
regex: emailRegex,
|
|
16105
|
-
}).isValid
|
|
16106
|
-
? {
|
|
16107
|
-
isValid: true,
|
|
16108
|
-
cleanedValue,
|
|
16109
|
-
}
|
|
16110
|
-
: {
|
|
16111
|
-
isValid: false,
|
|
16112
|
-
errorMessage: INVALID_EMAIL_ERROR,
|
|
16113
|
-
});
|
|
16114
|
-
};
|
|
16115
|
-
|
|
16116
|
-
// Import helpers
|
|
16117
|
-
/**
|
|
16118
|
-
* Determines whether a given phone number is valid.
|
|
16119
|
-
* @author Austen Money
|
|
16120
|
-
* @param phoneNumber phone number to validate
|
|
16121
|
-
* @returns whether phone number is considered valid - if valid, also returns
|
|
16122
|
-
* a cleaned version of the number without any formatting. If invalid,
|
|
16123
|
-
* returns an error message.
|
|
16124
|
-
*/
|
|
16125
|
-
const validatePhoneNumber = (phoneNumber) => {
|
|
16126
|
-
// regex to validate phone number
|
|
16127
|
-
const validationRegex = /^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/;
|
|
16128
|
-
// validate phone number with regex
|
|
16129
|
-
const validationResponse = validateRegex({
|
|
16130
|
-
input: phoneNumber,
|
|
16131
|
-
regex: validationRegex,
|
|
16132
|
-
});
|
|
16133
|
-
// remove all non-digits from number
|
|
16134
|
-
const cleanedValue = phoneNumber.replace(/\D/g, '');
|
|
16135
|
-
// return cleaned value if valid, or error message if invalid
|
|
16136
|
-
return (validationResponse.isValid
|
|
16137
|
-
? {
|
|
16138
|
-
isValid: true,
|
|
16139
|
-
cleanedValue,
|
|
16140
|
-
}
|
|
16141
|
-
: {
|
|
16142
|
-
isValid: false,
|
|
16143
|
-
errorMessage: INVALID_PHONE_ERROR,
|
|
16144
|
-
});
|
|
16145
|
-
};
|
|
16146
|
-
|
|
16147
|
-
// Import helpers
|
|
16148
|
-
/*------------------------------------------------------------------------*/
|
|
16149
|
-
/* ------------------------------ Constants ----------------------------- */
|
|
16150
|
-
/*------------------------------------------------------------------------*/
|
|
16151
|
-
// define minimum and maximum range for lowercase ASCII chars
|
|
16152
|
-
const LOWERCASE_MIN = 65;
|
|
16153
|
-
const LOWERCASE_MAX = 90;
|
|
16154
|
-
// define minimum and maximum range for uppercase ASCII chars
|
|
16155
|
-
const UPPERCASE_MIN = 97;
|
|
16156
|
-
const UPPERCASE_MAX = 122;
|
|
16157
|
-
// define minimum and maximum range for ASCII digits
|
|
16158
|
-
const DIGIT_MIN = 48;
|
|
16159
|
-
const DIGIT_MAX = 57;
|
|
16160
|
-
/*------------------------------------------------------------------------*/
|
|
16161
|
-
/* ---------------------------- Main Function --------------------------- */
|
|
16162
|
-
/*------------------------------------------------------------------------*/
|
|
16163
|
-
/**
|
|
16164
|
-
* Determines whether a given input string is considered valid based on
|
|
16165
|
-
* the provided requirements.
|
|
16166
|
-
* @author Austen Money
|
|
16167
|
-
* @param input input string
|
|
16168
|
-
* @param opts options for validation
|
|
16169
|
-
* @returns whether input is considered valid according to reqs - if
|
|
16170
|
-
* valid, returns a cleaned version of input; if invalid, returns
|
|
16171
|
-
* a string containing error messages describing which requirements
|
|
16172
|
-
* were not met.
|
|
16173
|
-
*/
|
|
16174
|
-
const validateString = (input, opts) => {
|
|
16175
|
-
// stores all invalid input errors
|
|
16176
|
-
const errorMessages = [];
|
|
16177
|
-
// contains version of input that will be returned
|
|
16178
|
-
let cleanedValue = input;
|
|
16179
|
-
// remove whitespace if required
|
|
16180
|
-
if (opts.ignoreWhitespace) {
|
|
16181
|
-
cleanedValue = input.replace(/\s+/g, '');
|
|
16182
|
-
}
|
|
16183
|
-
// apply max char requirement
|
|
16184
|
-
if (opts.minLen) {
|
|
16185
|
-
if (cleanedValue.length < opts.minLen) {
|
|
16186
|
-
errorMessages.push(INVALID_STRING_ERRORS.MIN_LEN(opts.minLen));
|
|
16187
|
-
}
|
|
16188
|
-
}
|
|
16189
|
-
// apply max char requirement
|
|
16190
|
-
if (opts.maxLen) {
|
|
16191
|
-
if (cleanedValue.length > opts.maxLen) {
|
|
16192
|
-
errorMessages.push(INVALID_STRING_ERRORS.MAX_LEN(opts.maxLen));
|
|
16193
|
-
}
|
|
16194
|
-
}
|
|
16195
|
-
// apply alphabetical requirement
|
|
16196
|
-
if (opts.lettersOnly) {
|
|
16197
|
-
// remove diacritics
|
|
16198
|
-
cleanedValue = cleanedValue.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
16199
|
-
const containsNonLetters = (cleanedValue
|
|
16200
|
-
// split into characters
|
|
16201
|
-
.split('')
|
|
16202
|
-
// convert into character codes
|
|
16203
|
-
.map((curr) => {
|
|
16204
|
-
return curr.charCodeAt(0);
|
|
16205
|
-
})
|
|
16206
|
-
// check for non-letters
|
|
16207
|
-
.some((currCode) => {
|
|
16208
|
-
return (!(currCode >= LOWERCASE_MIN && currCode <= LOWERCASE_MAX)
|
|
16209
|
-
&& !(currCode >= UPPERCASE_MIN && currCode <= UPPERCASE_MAX));
|
|
16210
|
-
}));
|
|
16211
|
-
if (containsNonLetters) {
|
|
16212
|
-
errorMessages.push(INVALID_STRING_ERRORS.LETTERS_ONLY);
|
|
16213
|
-
}
|
|
16214
|
-
}
|
|
16215
|
-
// apply numerical requirement
|
|
16216
|
-
if (opts.numbersOnly) {
|
|
16217
|
-
const containsNonNumbers = (cleanedValue
|
|
16218
|
-
// split into characters
|
|
16219
|
-
.split('')
|
|
16220
|
-
// convert into character codes
|
|
16221
|
-
.map((curr) => {
|
|
16222
|
-
return curr.charCodeAt(0);
|
|
16223
|
-
})
|
|
16224
|
-
// check for non-numbers
|
|
16225
|
-
.some((currCode) => {
|
|
16226
|
-
return (!(currCode >= DIGIT_MIN && currCode <= DIGIT_MAX));
|
|
16227
|
-
}));
|
|
16228
|
-
if (containsNonNumbers) {
|
|
16229
|
-
errorMessages.push(INVALID_STRING_ERRORS.NUMBERS_ONLY);
|
|
16230
|
-
}
|
|
16231
|
-
}
|
|
16232
|
-
// apply regex requirement
|
|
16233
|
-
if (opts.regexTest) {
|
|
16234
|
-
const regex = opts.regexTest;
|
|
16235
|
-
// validate and create customized error message if description is provided
|
|
16236
|
-
const result = validateRegex({
|
|
16237
|
-
input: cleanedValue,
|
|
16238
|
-
regex,
|
|
16239
|
-
regexDescription: opts.regexDescription,
|
|
16240
|
-
});
|
|
16241
|
-
// if string did not pass regex validation, add error message
|
|
16242
|
-
if (result.isValid === false) {
|
|
16243
|
-
errorMessages.push(result.errorMessage);
|
|
16244
|
-
}
|
|
16245
|
-
}
|
|
16246
|
-
// combine all error messages into one string to return
|
|
16247
|
-
const errorMessage = `${INVALID_STRING_ERRORS.MESSAGE_INTRO}${genCommaList(errorMessages)}.`;
|
|
16248
|
-
return (
|
|
16249
|
-
// if no error messages, string is valid; if not, it is invalid
|
|
16250
|
-
errorMessages.length === 0
|
|
16251
|
-
? {
|
|
16252
|
-
isValid: true,
|
|
16253
|
-
cleanedValue,
|
|
16254
|
-
}
|
|
16255
|
-
: {
|
|
16256
|
-
isValid: false,
|
|
16257
|
-
errorMessage,
|
|
16258
|
-
});
|
|
16259
|
-
};
|
|
16260
|
-
|
|
16261
14486
|
// Import React
|
|
16262
14487
|
// Regular express that matches urls
|
|
16263
14488
|
const urlRegex = /(https?:\/\/)?([a-z0-9-]+\.)+[a-z0-9]{2,6}(:[0-9]{1,5})?(\/\S*)?/g;
|
|
@@ -16317,30 +14542,6 @@ const makeLinksClickable = (text, opts) => {
|
|
|
16317
14542
|
return elements;
|
|
16318
14543
|
};
|
|
16319
14544
|
|
|
16320
|
-
// Constants
|
|
16321
|
-
const VOWELS = ['a', 'e', 'i', 'o', 'u'];
|
|
16322
|
-
/**
|
|
16323
|
-
* Prefix a word or name with "a" or "an" depending on whether it starts with a
|
|
16324
|
-
* vowel or not
|
|
16325
|
-
* @author Gabe Abrams
|
|
16326
|
-
* @param text the text to prefix
|
|
16327
|
-
* @param capitalize whether to capitalize the "A" or "An"
|
|
16328
|
-
* @returns the text prefixed with "a" or "an"
|
|
16329
|
-
*/
|
|
16330
|
-
const prefixWithAOrAn = (text, capitalize = false) => {
|
|
16331
|
-
// Get the first letter
|
|
16332
|
-
const firstLetter = text.charAt(0).toLowerCase();
|
|
16333
|
-
// Check if starts with vowel
|
|
16334
|
-
const startsWithVowel = VOWELS.includes(firstLetter);
|
|
16335
|
-
// Determine prefix
|
|
16336
|
-
let prefix = startsWithVowel ? 'an' : 'a';
|
|
16337
|
-
if (capitalize) {
|
|
16338
|
-
prefix = prefix.charAt(0).toUpperCase() + prefix.substring(1);
|
|
16339
|
-
}
|
|
16340
|
-
// Return the text prefixed with "a" or "an"
|
|
16341
|
-
return `${prefix} ${text}`;
|
|
16342
|
-
};
|
|
16343
|
-
|
|
16344
14545
|
/* -------- State Definition -------- */
|
|
16345
14546
|
/* ------------- Reducer ------------ */
|
|
16346
14547
|
/**
|
|
@@ -16375,336 +14576,6 @@ const useForceRender = (useReducer) => {
|
|
|
16375
14576
|
};
|
|
16376
14577
|
};
|
|
16377
14578
|
|
|
16378
|
-
/**
|
|
16379
|
-
* Run the operator function on each item in the array, returning true if
|
|
16380
|
-
* the operator function returns true for every item in the array
|
|
16381
|
-
* @author Gabe Abrams
|
|
16382
|
-
* @param operatorFunction the operator function to apply. If it returns true
|
|
16383
|
-
* for every item, this function will return true
|
|
16384
|
-
* @returns true if the operator function returns true for every item in the array
|
|
16385
|
-
*/
|
|
16386
|
-
const everyAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16387
|
-
// Create break logic
|
|
16388
|
-
let done = false;
|
|
16389
|
-
/**
|
|
16390
|
-
* Break the loop (checking stops here)
|
|
16391
|
-
* @author Gabe Abrams
|
|
16392
|
-
*/
|
|
16393
|
-
const breakNow = () => {
|
|
16394
|
-
done = true;
|
|
16395
|
-
};
|
|
16396
|
-
// Loop through each item, checking
|
|
16397
|
-
for (let i = 0; i < array.length && !done; i++) {
|
|
16398
|
-
const passed = yield operatorFunction(array[i], i, {
|
|
16399
|
-
breakNow,
|
|
16400
|
-
array,
|
|
16401
|
-
});
|
|
16402
|
-
// Check if this one failed or if loop was broken
|
|
16403
|
-
if (!passed || done) {
|
|
16404
|
-
return false;
|
|
16405
|
-
}
|
|
16406
|
-
}
|
|
16407
|
-
// Return true because none returned false
|
|
16408
|
-
return true;
|
|
16409
|
-
});
|
|
16410
|
-
|
|
16411
|
-
/**
|
|
16412
|
-
* Run the operator function on each item in the array, returning a new array
|
|
16413
|
-
* that only contains the items that pass the filter
|
|
16414
|
-
* @author Gabe Abrams
|
|
16415
|
-
* @param operatorFunction the operator function to apply. If it returns true
|
|
16416
|
-
* for an item, the item will be included in the returned array
|
|
16417
|
-
* @returns the filtered array
|
|
16418
|
-
*/
|
|
16419
|
-
const filterAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16420
|
-
// Create break logic
|
|
16421
|
-
let done = false;
|
|
16422
|
-
/**
|
|
16423
|
-
* Break the loop (filtering stops here)
|
|
16424
|
-
* @author Gabe Abrams
|
|
16425
|
-
*/
|
|
16426
|
-
const breakNow = () => {
|
|
16427
|
-
done = true;
|
|
16428
|
-
};
|
|
16429
|
-
// Loop through each item, filtering
|
|
16430
|
-
const output = [];
|
|
16431
|
-
for (let i = 0; i < array.length && !done; i++) {
|
|
16432
|
-
const included = yield operatorFunction(array[i], i, {
|
|
16433
|
-
breakNow,
|
|
16434
|
-
array,
|
|
16435
|
-
});
|
|
16436
|
-
if (included && !done) {
|
|
16437
|
-
output.push(array[i]);
|
|
16438
|
-
}
|
|
16439
|
-
}
|
|
16440
|
-
// Return results
|
|
16441
|
-
return output;
|
|
16442
|
-
});
|
|
16443
|
-
|
|
16444
|
-
/**
|
|
16445
|
-
* Run the operator function on each item in the array
|
|
16446
|
-
* @author Gabe Abrams
|
|
16447
|
-
* @param operatorFunction the operator function to apply
|
|
16448
|
-
*/
|
|
16449
|
-
const forEachAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16450
|
-
// Create break logic
|
|
16451
|
-
let done = false;
|
|
16452
|
-
/**
|
|
16453
|
-
* Break the loop
|
|
16454
|
-
* @author Gabe Abrams
|
|
16455
|
-
*/
|
|
16456
|
-
const breakNow = () => {
|
|
16457
|
-
done = true;
|
|
16458
|
-
};
|
|
16459
|
-
// Loop through each item
|
|
16460
|
-
for (let i = 0; i < array.length && !done; i++) {
|
|
16461
|
-
yield operatorFunction(array[i], i, {
|
|
16462
|
-
breakNow,
|
|
16463
|
-
array,
|
|
16464
|
-
});
|
|
16465
|
-
}
|
|
16466
|
-
});
|
|
16467
|
-
|
|
16468
|
-
/**
|
|
16469
|
-
* Run the operator function on each item in the array, collecting all results
|
|
16470
|
-
* @author Gabe Abrams
|
|
16471
|
-
* @param operatorFunction the operator function to apply
|
|
16472
|
-
* @returns the array of results
|
|
16473
|
-
*/
|
|
16474
|
-
const mapAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16475
|
-
// Create break logic
|
|
16476
|
-
let done = false;
|
|
16477
|
-
/**
|
|
16478
|
-
* Break the loop
|
|
16479
|
-
* @author Gabe Abrams
|
|
16480
|
-
*/
|
|
16481
|
-
const breakNow = () => {
|
|
16482
|
-
done = true;
|
|
16483
|
-
};
|
|
16484
|
-
// Loop through each item, collecting results
|
|
16485
|
-
const results = [];
|
|
16486
|
-
for (let i = 0; i < array.length && !done; i++) {
|
|
16487
|
-
const result = yield operatorFunction(array[i], i, {
|
|
16488
|
-
breakNow,
|
|
16489
|
-
array,
|
|
16490
|
-
});
|
|
16491
|
-
results.push(result);
|
|
16492
|
-
}
|
|
16493
|
-
// Return results
|
|
16494
|
-
return results;
|
|
16495
|
-
});
|
|
16496
|
-
|
|
16497
|
-
/**
|
|
16498
|
-
* Run the operator function on each item in the array, returning true if
|
|
16499
|
-
* the operator function returns true for any item in the array
|
|
16500
|
-
* @author Gabe Abrams
|
|
16501
|
-
* @param operatorFunction the operator function to apply. If it returns true
|
|
16502
|
-
* for any item, this function will return true
|
|
16503
|
-
* @returns true if the operator function returns true for any item in the array
|
|
16504
|
-
*/
|
|
16505
|
-
const someAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16506
|
-
// Create break logic
|
|
16507
|
-
let done = false;
|
|
16508
|
-
/**
|
|
16509
|
-
* Break the loop (checking stops here)
|
|
16510
|
-
* @author Gabe Abrams
|
|
16511
|
-
*/
|
|
16512
|
-
const breakNow = () => {
|
|
16513
|
-
done = true;
|
|
16514
|
-
};
|
|
16515
|
-
// Loop through each item, checking
|
|
16516
|
-
for (let i = 0; i < array.length && !done; i++) {
|
|
16517
|
-
const passed = yield operatorFunction(array[i], i, {
|
|
16518
|
-
breakNow,
|
|
16519
|
-
array,
|
|
16520
|
-
});
|
|
16521
|
-
if (passed && !done) {
|
|
16522
|
-
return true;
|
|
16523
|
-
}
|
|
16524
|
-
}
|
|
16525
|
-
// Return false because none returned true
|
|
16526
|
-
return false;
|
|
16527
|
-
});
|
|
16528
|
-
|
|
16529
|
-
/**
|
|
16530
|
-
* Capitalize every word in a string (just the first letter)
|
|
16531
|
-
* @param str string to capitalize
|
|
16532
|
-
* @returns string with every word capitalized
|
|
16533
|
-
*/
|
|
16534
|
-
const capitalize = (str) => {
|
|
16535
|
-
return (str
|
|
16536
|
-
// Split into words
|
|
16537
|
-
.split(' ')
|
|
16538
|
-
// Capitalize first letter of each word
|
|
16539
|
-
.map((word) => {
|
|
16540
|
-
return word.charAt(0).toUpperCase() + word.substring(1);
|
|
16541
|
-
})
|
|
16542
|
-
// Join back together
|
|
16543
|
-
.join(' '));
|
|
16544
|
-
};
|
|
16545
|
-
|
|
16546
|
-
/**
|
|
16547
|
-
* Shuffle a given array
|
|
16548
|
-
* @author Austen Money
|
|
16549
|
-
* @param arr the array to shuffle
|
|
16550
|
-
* @returns the shuffled array
|
|
16551
|
-
*/
|
|
16552
|
-
const shuffleArray = (arr) => {
|
|
16553
|
-
const newArr = [...arr];
|
|
16554
|
-
// Shuffle using Durstenfeld algorithm
|
|
16555
|
-
for (let i = arr.length - 1; i > 0; i--) {
|
|
16556
|
-
const j = Math.floor(Math.random() * (i + 1));
|
|
16557
|
-
[newArr[i], newArr[j]] = [newArr[j], newArr[i]];
|
|
16558
|
-
}
|
|
16559
|
-
return newArr;
|
|
16560
|
-
};
|
|
16561
|
-
|
|
16562
|
-
const punctuationRegex = /[!@#$%^&*(),.?\/;:'"\-\[\]]/g;
|
|
16563
|
-
/**
|
|
16564
|
-
* Get number of words in string
|
|
16565
|
-
* @author Gardenia Liu
|
|
16566
|
-
* @author Allison Zhang
|
|
16567
|
-
* @author Gabe Abrams
|
|
16568
|
-
* @param text the string to check
|
|
16569
|
-
* @returns number of words in the string
|
|
16570
|
-
*/
|
|
16571
|
-
const getWordCount = (text) => {
|
|
16572
|
-
const trimmedTextWithoutPunctuation = (text
|
|
16573
|
-
// Remove leading and trailing whitespace
|
|
16574
|
-
.trim()
|
|
16575
|
-
// Remove punctuation
|
|
16576
|
-
.replace(punctuationRegex, ''));
|
|
16577
|
-
if (trimmedTextWithoutPunctuation.length === 0) {
|
|
16578
|
-
return 0;
|
|
16579
|
-
}
|
|
16580
|
-
return trimmedTextWithoutPunctuation.split(/\s+/g).length;
|
|
16581
|
-
};
|
|
16582
|
-
|
|
16583
|
-
// Import shared types
|
|
16584
|
-
/*----------------------------------------*/
|
|
16585
|
-
/* --------------- Helpers -------------- */
|
|
16586
|
-
/*----------------------------------------*/
|
|
16587
|
-
/**
|
|
16588
|
-
* Check if a timestamp is valid
|
|
16589
|
-
* @author Gabe Abrams
|
|
16590
|
-
* @author Gardenia Liu
|
|
16591
|
-
* @param opts object containing all arguments
|
|
16592
|
-
* @param opts.timestamp Timestamp in milliseconds since epoch
|
|
16593
|
-
* @param opts.expectedYear Expected year
|
|
16594
|
-
* @param opts.expectedMonth Expected month
|
|
16595
|
-
* @param opts.expectedDay Expected day
|
|
16596
|
-
* @param opts.expectedHour Expected hour
|
|
16597
|
-
* @param opts.expectedMinute Expected minute
|
|
16598
|
-
* @returns 1 if the timestamp needs to be increased, -1 if it needs to be decreased, 0 if it is valid
|
|
16599
|
-
*/
|
|
16600
|
-
const checkTimestamp = (opts) => {
|
|
16601
|
-
const { timestamp, expectedYear, expectedMonth, expectedDay, expectedHour, expectedMinute, } = opts;
|
|
16602
|
-
const timeInfoInET = getTimeInfoInET(timestamp);
|
|
16603
|
-
if (timeInfoInET.year < expectedYear) {
|
|
16604
|
-
return 1;
|
|
16605
|
-
}
|
|
16606
|
-
if (timeInfoInET.year > expectedYear) {
|
|
16607
|
-
return -1;
|
|
16608
|
-
}
|
|
16609
|
-
if (timeInfoInET.month < expectedMonth) {
|
|
16610
|
-
return 1;
|
|
16611
|
-
}
|
|
16612
|
-
if (timeInfoInET.month > expectedMonth) {
|
|
16613
|
-
return -1;
|
|
16614
|
-
}
|
|
16615
|
-
if (timeInfoInET.day < expectedDay) {
|
|
16616
|
-
return 1;
|
|
16617
|
-
}
|
|
16618
|
-
if (timeInfoInET.day > expectedDay) {
|
|
16619
|
-
return -1;
|
|
16620
|
-
}
|
|
16621
|
-
if (timeInfoInET.hour < expectedHour) {
|
|
16622
|
-
return 1;
|
|
16623
|
-
}
|
|
16624
|
-
if (timeInfoInET.hour > expectedHour) {
|
|
16625
|
-
return -1;
|
|
16626
|
-
}
|
|
16627
|
-
if (timeInfoInET.minute < expectedMinute) {
|
|
16628
|
-
return 1;
|
|
16629
|
-
}
|
|
16630
|
-
if (timeInfoInET.minute > expectedMinute) {
|
|
16631
|
-
return -1;
|
|
16632
|
-
}
|
|
16633
|
-
return 0;
|
|
16634
|
-
};
|
|
16635
|
-
/*----------------------------------------*/
|
|
16636
|
-
/* ---------------- Main ---------------- */
|
|
16637
|
-
/*----------------------------------------*/
|
|
16638
|
-
/**
|
|
16639
|
-
* Get a timestamp (ms since epoch) from time info (year, month, day, hour, minute, etc.) in Eastern Time (ET)
|
|
16640
|
-
* @author Gardenia Liu
|
|
16641
|
-
* @author Gabe Abrams
|
|
16642
|
-
* @param opts object containing all arguments
|
|
16643
|
-
* @param opts.year Year (e.g. 2023)
|
|
16644
|
-
* @param opts.month Month (1-12)
|
|
16645
|
-
* @param opts.day Day of the month (1-31)
|
|
16646
|
-
* @param opts.hour Hour (0-23)
|
|
16647
|
-
* @param opts.minute Minute (0-59)
|
|
16648
|
-
* @returns Timestamp in milliseconds since epoch
|
|
16649
|
-
*/
|
|
16650
|
-
const getTimestampFromTimeInfoInET = (opts) => {
|
|
16651
|
-
// Destructure opts
|
|
16652
|
-
const { year, month, day, hour, minute, } = opts;
|
|
16653
|
-
// Determine if the date is in DST in Eastern Time
|
|
16654
|
-
const tempDate = new Date(year, month - 1, day);
|
|
16655
|
-
const janOffset = new Date(year, 0, 1).getTimezoneOffset();
|
|
16656
|
-
const isDST = tempDate.getTimezoneOffset() < janOffset;
|
|
16657
|
-
const etOffset = isDST ? '-04:00' : '-05:00';
|
|
16658
|
-
// Format with leading zeroes
|
|
16659
|
-
const mm = padZerosLeft(month, 2);
|
|
16660
|
-
const dd = padZerosLeft(day, 2);
|
|
16661
|
-
const hh = padZerosLeft(hour, 2);
|
|
16662
|
-
const min = padZerosLeft(minute, 2);
|
|
16663
|
-
// Build ET ISO string and convert to UTC timestamp
|
|
16664
|
-
const etISOString = `${year}-${mm}-${dd}T${hh}:${min}:00${etOffset}`;
|
|
16665
|
-
const baseTimestamp = (new Date(etISOString)).getTime();
|
|
16666
|
-
let timestamp = baseTimestamp;
|
|
16667
|
-
// Heat seek to get the right timestamp
|
|
16668
|
-
const maxOffset = 24 * 60; // 24 hours in minutes
|
|
16669
|
-
let currentOffset = 0; // minutes
|
|
16670
|
-
const offsetIncrement = 15; // minutes
|
|
16671
|
-
const offsetDirection = checkTimestamp({
|
|
16672
|
-
timestamp,
|
|
16673
|
-
expectedYear: year,
|
|
16674
|
-
expectedMonth: month,
|
|
16675
|
-
expectedDay: day,
|
|
16676
|
-
expectedHour: hour,
|
|
16677
|
-
expectedMinute: minute,
|
|
16678
|
-
});
|
|
16679
|
-
if (offsetDirection === 0) {
|
|
16680
|
-
// Valid! Return the timestamp
|
|
16681
|
-
return timestamp;
|
|
16682
|
-
}
|
|
16683
|
-
// Heat seek
|
|
16684
|
-
while (Math.abs(currentOffset) < maxOffset) {
|
|
16685
|
-
// Update offset
|
|
16686
|
-
currentOffset += (offsetDirection * offsetIncrement);
|
|
16687
|
-
// Update timestamp
|
|
16688
|
-
const offsetMs = currentOffset * 60 * 1000;
|
|
16689
|
-
timestamp = baseTimestamp + offsetMs;
|
|
16690
|
-
// Check timestamp again
|
|
16691
|
-
const newDirection = checkTimestamp({
|
|
16692
|
-
timestamp,
|
|
16693
|
-
expectedYear: year,
|
|
16694
|
-
expectedMonth: month,
|
|
16695
|
-
expectedDay: day,
|
|
16696
|
-
expectedHour: hour,
|
|
16697
|
-
expectedMinute: minute,
|
|
16698
|
-
});
|
|
16699
|
-
if (newDirection === 0) {
|
|
16700
|
-
// Valid! Return the timestamp
|
|
16701
|
-
return timestamp;
|
|
16702
|
-
}
|
|
16703
|
-
// Invalid. Keep looping.
|
|
16704
|
-
}
|
|
16705
|
-
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);
|
|
16706
|
-
};
|
|
16707
|
-
|
|
16708
14579
|
/*------------------------------------------------------------------------*/
|
|
16709
14580
|
/* ------------------------------- Caching ------------------------------ */
|
|
16710
14581
|
/*------------------------------------------------------------------------*/
|
|
@@ -16741,21 +14612,5 @@ const isSelectAdmin = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
16741
14612
|
}
|
|
16742
14613
|
});
|
|
16743
14614
|
|
|
16744
|
-
|
|
16745
|
-
* Days of the week
|
|
16746
|
-
* @author Gabe Abrams
|
|
16747
|
-
*/
|
|
16748
|
-
var DayOfWeek;
|
|
16749
|
-
(function (DayOfWeek) {
|
|
16750
|
-
DayOfWeek["Monday"] = "m";
|
|
16751
|
-
DayOfWeek["Tuesday"] = "t";
|
|
16752
|
-
DayOfWeek["Wednesday"] = "w";
|
|
16753
|
-
DayOfWeek["Thursday"] = "r";
|
|
16754
|
-
DayOfWeek["Friday"] = "f";
|
|
16755
|
-
DayOfWeek["Saturday"] = "s";
|
|
16756
|
-
DayOfWeek["Sunday"] = "u";
|
|
16757
|
-
})(DayOfWeek || (DayOfWeek = {}));
|
|
16758
|
-
var DayOfWeek$1 = DayOfWeek;
|
|
16759
|
-
|
|
16760
|
-
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 };
|
|
16761
14616
|
//# sourceMappingURL=index.js.map
|