{"version":3,"sources":["shared/analytics/index.tsx","components/error-boundary/ErrorBoundary.tsx","components/i18n/I18nProvider.tsx","components/profiler/Profiler.tsx","hooks/use-format-message.ts","hooks/use-format-phone-number.ts","providers/auth-provider/reducer.ts","providers/app-provider/AppProvider.tsx","providers/app-provider/reducer.ts","providers/auth-provider/AuthProvider.tsx","providers/location-provider/LocationProvider.tsx","providers/location-provider/reducer.ts","providers/update-provider/UpdateProvider.tsx","providers/update-provider/reducer.ts","hooks/use-result.tsx","hooks/use-network-detection.ts","components/customer-info-modal/CustomerInfoModal.tsx","components/app-header/AppHeader.tsx","components/result-message/ResultMessage.tsx","components/schedule-return-time/ScheduleReturnTime.tsx","components/add-phone-number/AddPhoneNumber.tsx","components/reason-for-visit/ReasonForVisit.tsx","components/private-route/PrivateRoute.tsx","components/location-pane/LocationPane.tsx","components/app-menu/AppMenu.tsx","components/location-search/LocationSearch.tsx","components/update-alert/UpdateAlert.tsx","shared/client/customer.ts","pages/queue/hooks/use-customer-action.ts","pages/queue/components/CustomerActions.tsx","pages/queue/components/CustomerInfo.tsx","pages/queue/components/RequestFirstCustomerButton.tsx","pages/queue/components/QueueCard.tsx","pages/queue/hooks/use-manually-add-customer.ts","pages/queue/hooks/use-customer-queue.ts","pages/queue/components/AddCustomerModal.tsx","pages/queue/Queue.tsx","pages/landing/Landing.tsx","pages/locations/Locations.tsx","pages/history/components/customer-history-info.tsx","pages/history/hooks/use-queue-history.ts","pages/history/History.tsx","pages/report/components/SelectLocationsModal.tsx","pages/report/components/LocationInput.tsx","pages/report/Report.tsx","App.tsx","index.tsx","shared/client/auth-client.ts","shared/get-environment.ts","shared/index.tsx","shared/get-environment-suffix.ts","shared/authenticated-fetch.ts","shared/compare-string-values.ts","shared/constants.ts","shared/endpoints.ts","shared/filter-locations.ts","shared/get-response-message.ts","shared/errors.ts","shared/i18n/en.ts","shared/i18n/index.ts","shared/i18n/fr.ts"],"names":["EventActions","TrackerId","getEnvironment","withGARouter","WrappedComponent","options","trackPage","page","ReactGA","set","send","hitType","HOC","props","location","pathname","useEffect","Fallback","error","resetError","componentStack","eventId","icon","response","message","ErrorBoundary","children","fallback","getLocale","navigator","language","split","getAntdLocale","fr_FR","es_ES","en_US","I18nProvider","locale","messages","Profiler","useFormatMessage","id","values","useIntl","formatMessage","useFormatPhoneNumber","phoneNumber","match","formattedPhoneNumber","reducer","state","action","type","AuthType","Error","isAuthLoading","Success","isAuthenticated","user","hasPermission","Load","Logout","AppType","isLoadingApp","availableLocations","config","ClearLocations","locationId","SelectLocation","initialState","appStore","createContext","selectLocation","clearLocations","Provider","AppProvider","useReducer","dispatch","authContext","useContext","authStore","routerLocation","useLocation","routerHistory","useHistory","routeToPage","locations","from","length","replace","locationIdFromRoute","parseInt","getLocations","userId","companyId","a","authenticatedFetch","getUserLocationsEndpoint","ok","json","userLocations","sortedLocations","data","sort","compareStringValues","getCompanyConfig","entityId","getCompanyConfigEndpoint","result","Id","ParentEntityId","TypeError","doFetch","value","LocationAction","logout","login","AuthProvider","appContext","fetchAccessToken","authenticate","authUser","authorize","queueManagementPermission","Granted","Object","keys","Sentry","toString","email","Email","username","UserName","clearTokenFromStorage","isLoading","reasonCodes","UpdateType","locationStore","LocationProvider","getLocationConfig","getLocationConfigEndpoint","getReasonCodes","url","getReasonCodesEndpoint","ResponseError","create","getLocationDetails","UpdateAppVersion","newAppVersion","appVersion","currentAppVersion","localStorage","getItem","hasCurrentVersion","isNewVersion","setItem","showBanners","isUpdateAvailable","isUpdateSuccessful","HideReleaseNotes","updateStore","updateAppVersion","hideReleaseNotes","UpdateProvider","fetch","getAppVersionEndpoint","ApplicationVersion","listen","useResult","isOnline","useState","window","onLine","setIsOnline","updateNetwork","addEventListener","removeEventListener","useNetworkDetection","resultContent","showResult","Paragraph","Typography","Text","CustomerInfoModal","showModal","setShowModal","callString","cancelString","customerInfoTitle","name","queueState","changeModalState","trackEvent","event","category","label","undefined","size","className","onClick","title","closable","visible","footer","key","href","Header","Layout","Title","AppHeader","history","isOnQueuePage","includes","changeLocationText","logOut","appName","DropdownMenu","overlay","menu","trigger","FirstName","LastName","Item","to","signInProps","items","text","link","hidden","onclick","level","push","ResultMessage","permissionTitle","permissionSubTitle","pageNotWorkingTitle","pageNotWorkingSubTitle","hasNoLocationsSubTitle","noNetworkTitle","noNetworkSubTitle","timeOutSubTitle","getTitle","statusText","subTitle","getSubTitle","ScheduleReturnTime","requiredText","dateFuture","scheduleReturnTimeLabel","rules","required","getFieldValue","validator","rule","now","moment","isAfter","Promise","resolve","reject","use12Hours","format","timeFormat","minuteStep","showNow","AddPhoneNumber","isRequired","phoneLabel","phoneNumberMinLength","phoneNumberNotValid","validateTrigger","normalize","parsePhoneNumber","formatNational","isPossible","isValid","addonBefore","maxLength","phoneMaxNumber","ReasonForVisit","reasonForVisitLabel","spinning","Group","map","code","displayName","PrivateRoute","Component","component","render","routeProps","LocationPane","configuration","PhoneNumber","span","halfGutter","paragraph","rows","loading","AppMenu","pathName","activeQueueTitle","historyTitle","reportTitle","currentMenuItem","mode","selectedKeys","LocationSearch","onChange","inputPlaceholder","placeholder","prefix","target","UpdateAlert","reloadApp","reload","IsUpdateAvailable","IsUpdateSuccessful","banner","onClose","doCustomerAction","customer","getActionEndpoint","method","body","JSON","stringify","Action","res","getResponseMessage","resMessage","success","errorRes","status","useCustomerAction","doAction","remove","requestReturn","requestApproach","markDone","getMoreActions","actions","buttonText","disabled","danger","CustomerActions","reloadQueue","actionState","activeAction","requestReturnAgainText","requestReturnText","removeText","markDoneText","getMoreActionsText","primaryButton","secondaryButton","gutter","horizontalGutter","verticalGutter","align","flex","CustomerInfo","date","reasonCode","arrivedDate","preferredLanguage","localizedDatetimeFormat","localizedCalendarSpec","lastWeek","nextWeek","sameElse","parsedDate","calendar","parsedArriveDate","returnRequestedString","queuedDate","scheduledForString","arrivedString","joinedString","dateString","returnedString","timestampAtString","verticalGutterValue","colSpan","hasReasonCode","features","supportsReasonCodes","hasPreferredLanguage","smsLanguageOptionsEnabled","formatTimeString","wholeGutter","justify","RequestFirstCustomerButton","requestReturnButtonText","block","QueueCard","customersByState","isCollapsible","isCollapsed","setIsCollapsed","customers","customersToShow","slice","queueMaxCardsShown","cardHeader","cardDescription","showMoreButtonText","number","showLessButtonText","direction","scheduledDateTime","waitingSinceDateTime","returnRequestedDateTime","entryPoint","INTERVAL_ID","AddCustomerModal","toggleModal","userOptedIntoText","setUserOptedIntoText","manuallyAddState","manuallyAddCustomer","getCustomerEndpoint","CustomerName","SMSNotificationsEnabled","textCommunicationEnabled","ReasonCode","ScheduledDateTime","errorMessage","reset","useManuallyAddCustomer","Form","useForm","addCustomerForm","closeModal","resetFields","nameLabel","textCommunicationLabel","textMessageText","textMessageSmallText","scheduleText","scheduleSmallText","addCustomerText","okText","onCancel","onOk","validateFields","then","utc","catch","info","console","log","okButtonProps","cancelButtonProps","maskClosable","destroyOnClose","centered","form","layout","initialValues","Button","counter","failedInitially","useBreakpoint","Grid","appQueueStates","queueStates","Waiting","ReturnRequested","HelpNext","Queue","setCustomersByState","fetchQueue","useCallback","dateFormat","results","getCustomerQueue","getQueue","clearInterval","setInterval","pollCustomerQueue","useCustomerQueue","alertTitle","alertDescription","screens","showDesktopView","lg","alertContent","customersInQueue","grouping","reduce","grouped","customerA","customerB","Date","parse","toggleAddCustomerModal","maxRepeatedError","description","disableButtons","responsiveColumnsHorizontal","Landing","Locations","search","setSearch","filterLocations","showSearch","locationsHeader","responsiveColumnsVertical","dataSource","renderItem","x","CustomerHistoryInfo","actionDate","firstQueueState","otherQueueState","toLowerCase","join","formatQueueStateToTitleCase","History","historyState","fetchQueueHistory","getHistoryEndpoint","intervalId","useQueueHistory","cardTitle","cardSubTitle","actionDateTime","SelectLocationsModal","onSubmit","selectedLocationsIds","selectedIds","setSelectedIds","filteredLocations","entireCompanySelected","modalHeader","byLocationText","entireCompanyText","selectedLocationText","numberOf","cancelText","selectText","checked","isChecked","newValue","item","checkEntireCompany","itemLayout","e","filter","selectedId","LocationInput","locationsSelectedText","ids","Report","isRequestingReport","setIsRequestingReport","successfullDownload","setSuccessfulDownload","setErrorMessage","createReportForm","exportText","cardSubtitle","locationsLabel","startDate","endDate","defaultReportName","onValuesChange","disabledDate","current","endOf","initialValue","locationIds","getCustomerHistoryReport","contentDispositionHeader","headers","get","filename","blob","saveAs","TagManager","initialize","gtmId","auth","Content","App","exact","path","env","isOldUrl","dsn","process","environment","attachStacktrace","release","packageJson","ignoreErrors","Application","getEnvironmentSuffix","ReactDOM","document","getElementById","init","token","redirectUrl","origin","protocol","host","getAccessToken","setAccessToken","getAuthUser","getPermissions","permissionsResponse","permissions","getLoginUrl","removeItem","getLogoutEndpoint","encodeURIComponent","getAccessTokenFromUrl","getAccessTokenFromStorage","params","param","getLoginEndpoint","getMeEndpoint","getQueryStrings","hash","prev","curr","parts","exec","environmentSuffix","requestInit","authenticationToken","Authorization","b","localeCompare","sm","md","xl","suffix","QueueManagementAPIRoot","IQAccountsAPIRoot","customerId","URLSearchParams","URL","filterValue","resJson","errors","_response","this","en","DatetimeFormat","Joined","Arrived","Requested","Returned","fr"],"mappings":"8jHAQA,IAIYA,EAFCC,EAAqB,SAFtBC,cAEgC,eAAiB,gB,SAEjDF,K,4BAAAA,M,KAKL,IAAMG,EAA6B,SAACC,GAAoC,IAAlBC,EAAiB,uDAAP,GAC7DC,EAAY,SAACC,GACjBC,IAAQC,IAAR,aACEF,QACGF,IAELG,IAAQE,KAAK,CAAEC,QAAS,WAAYJ,UAGhCK,EAAqC,SAACC,GAAgC,IAEpEN,EADeM,EAAbC,SACcC,UAAY,GAMlC,OAJAC,qBAAU,WACJT,GAAMD,EAAUC,KACnB,CAACA,IAEG,gBAACH,EAAqBS,IAG/B,OAAOD,I,6iEC/BLK,EAA2B,SAAC,GAAoD,IAAlDC,EAAiD,EAAjDA,MAAuBC,GAA0B,EAA1CC,eAA0C,EAA1BD,YAA0B,EAAdE,QAErE,OADAF,IACO,gBAAC,SAAD,CAAQG,KAAM,KAAMC,SAAUL,EAAMM,WAGhC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mB,GACnB,gBAAiB,SACjB,sBAAuB,GACvB,iBAAkB,GAClB,eAAgB,GAChB,eAAgB,GAChB,yBAA0B,GAC1B,iBAAkB,GAClB,eAAgB,GAChB,sBAAuB,GACvB,0BAA2B,GAC3B,4BAA6B,GAC7B,8BAA+B,GAC/B,gCAAiC,GACjC,kCAAmC,GACnC,kCAAmC,GACnC,yCAA0C,GAC1C,sCAAuC,GACvC,8CAA+C,GAC/C,kDAAmD,GACnD,yDAA0D,GAC1D,6DAA8D,GAC9D,2BAA4B,GAC5B,0CAA2C,GAC3C,iDAAkD,GAClD,4CAA6C,GAC7C,0BAA2B,GAC3B,8BAA+B,GAC/B,iCAAkC,GAClC,qBAAsB,GACtB,wBAAyB,GACzB,8BAA+B,GAC/B,yBAA0B,GAC1B,wBAAyB,GACzB,sCAAuC,GACvC,kCAAmC,GACnC,qCAAsC,GACtC,yCAA0C,GAC1C,4BAA6B,GAC7B,+BAAgC,GAChC,4BAA6B,GAC7B,qCAAsC,GACtC,wCAAyC,GACzC,qBAAsB,GACtB,6BAA8B,GAC9B,mCAAoC,GACpC,4BAA6B,GAC7B,0BAA2B,GAC3B,8BAA+B,GAC/B,mBAAoB,GACpB,mBAAoB,GACpB,yBAA0B,GAC1B,yBAA0B,GAC1B,4BAA6B,GAC7B,4BAA6B,GAC7B,+BAAgC,M","file":"static/js/main.3ea0730b.chunk.js","sourcesContent":["import * as React from \"react\";\nimport { useEffect } from \"react\";\nimport ReactGA from \"react-ga4\";\n\nimport { RouteComponentProps, WithGARouter } from \"./interfaces\";\n\nimport { getEnvironment } from \"../get-environment\";\n\nconst env = getEnvironment();\n\nexport const TrackerId = env === \"prod\" ? \"G-P1L127CHCP\": \"G-NTSXWV4HBQ\";\n\nexport enum EventActions {\n AppAccessed = \"App Accessed\",\n}\n\n\nexport const withGARouter: WithGARouter = (WrappedComponent, options = {}) => {\n const trackPage = (page: string) => {\n ReactGA.set({\n page,\n ...options,\n });\n ReactGA.send({ hitType: \"pageview\", page });\n };\n \n const HOC: React.FC = (props: RouteComponentProps) => {\n const { location } = props;\n const page = location.pathname || \"\";\n \n useEffect(() => {\n if (page) trackPage(page);\n }, [page]);\n \n return ;\n };\n \n return HOC;\n };\n \n export * from \"./interfaces\";","import * as React from \"react\";\n\nimport { Result } from \"@iqmetrix/antd\";\nimport * as Sentry from \"@sentry/react\";\nimport { FallbackRender } from \"@sentry/react/dist/errorboundary\";\n\nconst Fallback: FallbackRender = ({ error, componentStack, resetError, eventId }) => {\n resetError();\n return ;\n};\n\nexport const ErrorBoundary = ({ children }: React.PropsWithChildren<{}>) => (\n \n {children}\n \n);\n","/* eslint-disable @typescript-eslint/camelcase */\nimport React from \"react\";\nimport { IntlProvider } from \"react-intl\";\nimport { ConfigProvider } from \"@iqmetrix/antd\";\n\nimport en_US from \"antd/es/locale/en_US\";\nimport es_ES from \"antd/es/locale/es_ES\";\nimport fr_FR from \"antd/es/locale/fr_FR\";\nimport { Locale } from \"antd/lib/locale-provider\";\n\nimport { messages } from \"shared\";\n\nfunction getLocale(): string {\n return navigator.language.split(/[-_]/)[0]; // language without region code\n}\nconst getMessages = () => messages[getLocale()];\n\nfunction getAntdLocale(): Locale {\n switch (getLocale()) {\n case \"fr\":\n return fr_FR;\n case \"es\":\n return es_ES;\n default:\n return en_US;\n }\n}\n\nexport const I18nProvider: React.FC = (props) => (\n \n \n {props?.children}\n \n \n);\n","import React from \"react\";\n\nconst onRenderCallback: React.ProfilerOnRenderCallback = (id, phase, actualDuration) =>\n console.info(`Phase: ${phase}, Duration: ${actualDuration.toFixed(2)}ms`);\n\nexport const Profiler: React.FC = ({ children }) =>\n process.env.NODE_ENV === \"development\" ? (\n \n {children}\n \n ) : (\n <>{children}\n );\n","import { useIntl } from \"react-intl\";\nimport { Messages } from \"shared\";\n\ntype MessageFormatPrimitiveValue = string | number | boolean | null | undefined;\n\nexport function useFormatMessage(id: keyof Messages, values?: Record) {\n const intl = useIntl();\n return intl.formatMessage({ id }, values);\n}\n","export const useFormatPhoneNumber = (phoneNumber: string) => {\n const phoneRegex = /^(1|)?(\\d{3})(\\d{3})(\\d{4})$/;\n let match = phoneNumber?.match(phoneRegex);\n let formattedPhoneNumber = \"\";\n if (match) {\n formattedPhoneNumber = `${match[2]}-${match[3]}-${match[4]}`;\n }\n return formattedPhoneNumber;\n};\n","import { AuthState, AuthType } from \"./AuthProvider\";\nimport { AuthUser } from \"models\";\n\ntype Action =\n | { type: \"load\" }\n | { type: \"success\"; user: AuthUser; hasPermission: boolean }\n | { type: \"logout\"; user: AuthUser }\n | { type: \"select location\" }\n | { type: \"error\"; error: Error | null };\n\nexport function reducer(state: AuthState, action: Action): AuthState {\n switch (action.type) {\n case AuthType.Error:\n return {\n ...state,\n isAuthLoading: false,\n error: action.error ? action.error : null,\n };\n case AuthType.Success:\n return {\n ...state,\n isAuthLoading: false,\n error: null,\n isAuthenticated: true,\n user: action.user,\n hasPermission: action.hasPermission,\n };\n case AuthType.Load:\n return { ...state, isAuthLoading: true };\n case AuthType.Logout:\n return {\n ...state,\n isAuthLoading: false,\n error: null,\n isAuthenticated: false,\n user: {} as AuthUser,\n hasPermission: false,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n","// *******************************************************************\n// App provider provides the application with every functionality\n// related to the application as a whole; get all locations, select\n// and clear the selected location, and toggle the add customer modal\n// *******************************************************************\nimport React, { useEffect, useReducer, createContext, ReactChild, useContext } from \"react\";\nimport { useLocation, useHistory } from \"react-router-dom\";\nimport { CompanyConfig, Location } from \"models\";\nimport { reducer } from \"./reducer\";\nimport { authStore } from \"../auth-provider\";\nimport { authenticatedFetch, getUserLocationsEndpoint, compareStringValues, getCompanyConfigEndpoint } from \"shared\";\n\nexport type AppState = {\n locationId: number | null;\n availableLocations: Array;\n error: Error | null;\n isLoadingApp: boolean;\n config: CompanyConfig | null;\n};\n\nexport enum AppType {\n SelectLocation = \"select location\",\n ClearLocations = \"clear locations\",\n Error = \"error\",\n Success = \"success\",\n Load = \"load\",\n}\n\ninterface LocationState {\n from: {\n pathname: string;\n };\n}\n\ntype InitialStateType = {\n state: AppState;\n selectLocation: (locationId: number) => void;\n clearLocations: () => void;\n};\n\nconst initialState: AppState = {\n locationId: null,\n availableLocations: [],\n isLoadingApp: false,\n error: null,\n config: null,\n};\n\nconst appStore = createContext({\n state: initialState,\n selectLocation: function (locationId: number) {\n // implemented inside the provider\n },\n clearLocations: function () {\n // implemented inside the provider\n },\n});\n\nconst { Provider } = appStore;\n\nconst AppProvider = ({ children }: { children: ReactChild }) => {\n const [state, dispatch] = useReducer(reducer, initialState);\n const authContext = useContext(authStore);\n const routerLocation = useLocation();\n const routerHistory = useHistory();\n\n const selectLocation = (locationId: number) => {\n dispatch({ type: AppType.SelectLocation, locationId });\n };\n\n const clearLocations = () => {\n dispatch({ type: AppType.ClearLocations });\n };\n\n const routeToPage = (locations: Location[]) => {\n const { from } = routerLocation.state || { from: { pathname: \"/\" } };\n if (locations.length === 1) {\n // If there is only one location we route straight to the queue page\n const locationId = locations[0].id;\n selectLocation(locationId);\n routerHistory.replace(`/locations/${locationId}/queue`);\n } else {\n const locationIdFromRoute = from.pathname.replace(/\\D/g, \"\");\n if (locationIdFromRoute) {\n selectLocation(parseInt(locationIdFromRoute, 10));\n routerHistory.replace(from.pathname);\n } else {\n routerHistory.replace(\"/locations\");\n }\n }\n };\n\n const getLocations = async (userId: number, companyId: number): Promise => {\n try {\n const response = await authenticatedFetch(getUserLocationsEndpoint(companyId, userId));\n if (!response.ok) throw response;\n const userLocations = await response.json();\n const sortedLocations = userLocations.data?.sort(compareStringValues(\"displayName\")) || [];\n return sortedLocations;\n } catch (error) {\n throw error;\n }\n };\n\n const getCompanyConfig = async (entityId: number) => {\n try {\n const response = await authenticatedFetch(getCompanyConfigEndpoint(entityId));\n if (!response.ok) throw response;\n const result = await response.json();\n return result.data;\n } catch (error) {\n throw error;\n }\n };\n\n useEffect(() => {\n dispatch({ type: AppType.Load });\n const doFetch = async () => {\n if (authContext.state.isAuthenticated) {\n const user = authContext.state.user;\n try {\n const availableLocations: Location[] = await getLocations(user.Id, user.ParentEntityId);\n const config = await getCompanyConfig(user.ParentEntityId);\n routeToPage(availableLocations);\n dispatch({ type: AppType.Success, availableLocations, config });\n } catch (error) {\n if (error instanceof TypeError) {\n dispatch({\n type: AppType.Error,\n error,\n });\n } else {\n dispatch({\n type: AppType.Error,\n error,\n });\n const { from } = routerLocation.state || { from: { pathname: \"/\" } };\n routerHistory.replace(from.pathname);\n }\n }\n } else {\n dispatch({ type: AppType.ClearLocations });\n }\n };\n doFetch();\n // If I add routeToPage() here it will create an infinite loop\n // eslint-disable-next-line\n }, [authContext.state.isAuthenticated]);\n\n return (\n \n {children}\n \n );\n};\n\nexport { appStore, AppProvider, Provider} ;\n","import { AppState, AppType } from \"./AppProvider\";\nimport { CompanyConfig, Location } from \"models\";\n\ntype Action =\n | { type: \"load\" }\n | { type: \"success\"; availableLocations: Array; config: CompanyConfig }\n | { type: \"clear locations\" }\n | { type: \"select location\"; locationId: number | null }\n | { type: \"error\"; error: Error | null };\n\nexport function reducer(state: AppState, action: Action): AppState {\n switch (action.type) {\n case AppType.Error:\n return {\n ...state,\n isLoadingApp: false,\n error: action.error ? action.error : null,\n };\n case AppType.Success:\n return {\n ...state,\n isLoadingApp: false,\n error: null,\n availableLocations: action.availableLocations,\n config: action.config,\n };\n case AppType.Load:\n return { ...state, isLoadingApp: true };\n case AppType.ClearLocations:\n return {\n ...state,\n isLoadingApp: false,\n error: null,\n locationId: null,\n availableLocations: [],\n };\n case AppType.SelectLocation:\n return {\n ...state,\n locationId: action.locationId,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n","// *******************************************************************\n// Auth provider provides the application with every functionality\n// related to the authentication; login and logout\n// *******************************************************************\nimport React, { useEffect, useReducer, createContext, ReactChild, useContext } from \"react\";\nimport * as Sentry from \"@sentry/react\";\nimport { fetchAccessToken, authenticate, authorize, clearTokenFromStorage } from \"shared/client\";\nimport { AuthUser } from \"models\";\nimport { reducer } from \"./reducer\";\nimport { appStore } from \"../app-provider\";\n\nexport type AuthState = {\n isAuthenticated: boolean;\n hasPermission: boolean;\n user: AuthUser;\n error: Error | null;\n isAuthLoading: boolean;\n};\n\nexport enum AuthType {\n Logout = \"logout\",\n Error = \"error\",\n Success = \"success\",\n Load = \"load\",\n}\n\ntype InitialStateType = {\n state: AuthState;\n logout: () => void;\n login: () => void;\n};\n\nconst initialState: AuthState = {\n isAuthLoading: false,\n hasPermission: false,\n isAuthenticated: false,\n user: {} as AuthUser,\n error: null,\n};\n\nconst authStore = createContext({\n state: initialState,\n logout: function () {\n // implemented inside the provider\n },\n login: function () {\n // implemented inside the provider\n },\n});\nconst { Provider } = authStore;\n\nconst AuthProvider = ({ children }: { children: ReactChild }) => {\n const [state, dispatch] = useReducer(reducer, initialState);\n const appContext = useContext(appStore);\n\n const login = async () => {\n try {\n fetchAccessToken();\n } catch (error) {\n dispatch({ type: AuthType.Error, error });\n }\n };\n\n const logout = () => {\n dispatch({ type: AuthType.Load });\n try {\n clearTokenFromStorage();\n appContext.clearLocations();\n dispatch({ type: AuthType.Logout, user: {} as AuthUser });\n } catch (error) {\n dispatch({ type: AuthType.Error, error });\n }\n };\n\n useEffect(() => {\n dispatch({ type: AuthType.Load });\n const doFetch = async () => {\n try {\n const authUser: AuthUser = await authenticate();\n const queueManagementPermission = await authorize();\n const hasPermission = queueManagementPermission.Granted;\n const type = Object.keys(authUser).length > 0 ? AuthType.Success : AuthType.Logout;\n dispatch({ type, user: authUser, hasPermission });\n Sentry.setUser({\n id: authUser?.Id.toString(),\n email: authUser.Email,\n username: authUser.UserName,\n });\n Sentry.setTag(\"parentEntityId\", authUser.ParentEntityId.toString());\n } catch (error) {\n dispatch({ type: AuthType.Logout, user: {} as AuthUser });\n }\n };\n doFetch();\n }, []);\n\n return {children};\n};\nexport { authStore, AuthProvider };\n","import React, { useReducer, createContext, ReactChild, useContext, useEffect } from \"react\";\nimport { LocationConfig, ReasonCode } from \"models\";\nimport { reducer } from \"./reducer\";\nimport { authStore } from \"../auth-provider\";\nimport { appStore } from \"../app-provider\";\nimport { ResponseError, authenticatedFetch, getLocationConfigEndpoint, getReasonCodesEndpoint } from \"shared\";\n\nexport type LocationState = {\n error: Error | null;\n isLoading: boolean;\n config: LocationConfig | null;\n reasonCodes: Array;\n};\n\nexport enum LocationAction {\n Error = \"error\",\n Load = \"loading\",\n Success = \"success\",\n}\n\nexport type InitialStateType = {\n state: LocationState;\n};\n\nconst initialState: LocationState = {\n error: null,\n isLoading: false,\n config: null,\n reasonCodes: [],\n};\n\nconst locationStore = createContext({\n state: initialState,\n});\n\nconst { Provider } = locationStore;\n\nconst LocationProvider = ({ children }: { children: ReactChild }) => {\n const [state, dispatch] = useReducer(reducer, initialState);\n const authContext = useContext(authStore);\n const appContext = useContext(appStore);\n\n const getLocationConfig = async (entityId: number, locationId: number) => {\n try {\n const response = await authenticatedFetch(getLocationConfigEndpoint(entityId, locationId));\n if (!response.ok) throw response;\n const result = await response.json();\n const config = result.data;\n return config;\n } catch (error) {\n throw error;\n }\n };\n\n const getReasonCodes = async (entityId: number, locationId: number) => {\n try {\n const url = getReasonCodesEndpoint(entityId, locationId);\n const response = await authenticatedFetch(url);\n if (!response.ok) {\n throw await ResponseError.create(response);\n }\n const json = await response.json();\n const reasonCodes = json.data as Array;\n return reasonCodes;\n } catch (error) {\n throw error;\n }\n };\n\n useEffect(() => {\n dispatch({ type: LocationAction.Load });\n const entityId = authContext.state.user.ParentEntityId;\n const locationId = appContext.state.locationId;\n const getLocationDetails = async () => {\n if (locationId) {\n try {\n const config = await getLocationConfig(entityId, locationId);\n const reasonCodes = await getReasonCodes(entityId, locationId);\n dispatch({ type: \"success\", reasonCodes, config });\n } catch (error) {\n dispatch({ type: \"error\", error });\n }\n }\n };\n\n getLocationDetails();\n }, [authContext.state.user.ParentEntityId, appContext.state.locationId]);\n\n return (\n \n {children}\n \n );\n};\n\nexport { locationStore, LocationProvider };\n","import { LocationState, LocationAction } from \"./LocationProvider\";\nimport { ReasonCode, LocationConfig } from \"models\";\n\ntype Action =\n | { type: \"error\"; error: Error }\n | { type: \"loading\" }\n | { type: \"success\"; config: LocationConfig; reasonCodes: Array };\n\nexport function reducer(state: LocationState, action: Action): LocationState {\n switch (action.type) {\n case LocationAction.Error:\n return {\n ...state,\n isLoading: false,\n error: action.error ? action.error : null,\n };\n case LocationAction.Load:\n return {\n ...state,\n isLoading: true,\n };\n case LocationAction.Success:\n return {\n ...state,\n isLoading: false,\n reasonCodes: action.reasonCodes,\n config: action.config,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n","// *******************************************************************\n// Update provider provides the application with every functionality\n// related to the retrieving and displaying update notifications;\n// *******************************************************************\nimport React, { useReducer, createContext, ReactChild, useEffect } from \"react\";\nimport { getAppVersionEndpoint } from \"shared\";\nimport { useHistory } from \"react-router-dom\";\nimport { reducer } from \"./reducer\";\n\nexport type UpdateState = {\n appVersion: string | null;\n isUpdateAvailable: boolean | false;\n isUpdateSuccessful: boolean | false;\n};\n\nexport enum UpdateType {\n UpdateAppVersion = \"update app version\",\n HideReleaseNotes = \"hide release notes\",\n}\n\ntype InitialStateType = {\n state: UpdateState;\n updateAppVersion: () => void;\n hideReleaseNotes: () => void;\n};\n\nconst initialState: UpdateState = {\n appVersion: localStorage.getItem(\"appVersion\") || null,\n isUpdateAvailable: false,\n isUpdateSuccessful: localStorage.getItem(\"isUpdateSuccessful\") === \"true\",\n};\n\nconst updateStore = createContext({\n state: initialState,\n updateAppVersion: function () {\n // implemented inside the provider\n },\n hideReleaseNotes: function () {\n // implemented inside the provider\n },\n});\n\nconst { Provider } = updateStore;\n\nconst UpdateProvider = ({ children }: { children: ReactChild }) => {\n const [state, dispatch] = useReducer(reducer, initialState);\n const routerHistory = useHistory();\n\n const updateAppVersion = async () => {\n try {\n const response = await fetch(getAppVersionEndpoint());\n if (!response.ok) throw response;\n const { ApplicationVersion: appVersion } = await response.json();\n if (state.appVersion !== appVersion) {\n dispatch({ type: UpdateType.UpdateAppVersion, appVersion });\n }\n } catch (error) {\n throw error;\n }\n };\n\n const hideReleaseNotes = () => {\n dispatch({ type: UpdateType.HideReleaseNotes });\n };\n\n useEffect(() => {\n routerHistory.listen((location, action) => {\n updateAppVersion();\n });\n });\n\n return (\n \n {children}\n \n );\n};\n\nexport { updateStore, UpdateProvider };\n","import { UpdateState, UpdateType } from \"./UpdateProvider\";\n\ntype Action = { type: UpdateType.UpdateAppVersion; appVersion: string | null } | { type: UpdateType.HideReleaseNotes };\n\nexport function reducer(state: UpdateState, action: Action): UpdateState {\n switch (action.type) {\n case UpdateType.UpdateAppVersion:\n let newAppVersion = action.appVersion || \"\";\n const currentAppVersion = (state || []).appVersion || localStorage.getItem(\"appVersion\");\n\n let hasCurrentVersion = !!currentAppVersion;\n\n let isNewVersion = newAppVersion !== currentAppVersion;\n\n if (hasCurrentVersion && !isNewVersion) return state;\n\n localStorage.setItem(\"appVersion\", newAppVersion);\n\n const showBanners = hasCurrentVersion && isNewVersion;\n\n if (showBanners) localStorage.setItem(\"isUpdateSuccessful\", \"true\");\n\n return {\n ...state,\n appVersion: newAppVersion,\n isUpdateAvailable: showBanners,\n isUpdateSuccessful: showBanners,\n };\n\n case UpdateType.HideReleaseNotes:\n localStorage.setItem(\"isUpdateSuccessful\", \"false\");\n return {\n ...state,\n isUpdateSuccessful: false,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n","import React, { useContext } from \"react\";\nimport { useNetworkDetection } from \"./use-network-detection\";\nimport { ResultMessage } from \"../components\";\nimport { appStore, authStore } from \"../providers\";\n\nexport const useResult = (): { showResult: boolean; resultContent: JSX.Element } => {\n const isOnline = useNetworkDetection();\n const {\n state: { hasPermission },\n } = useContext(authStore);\n const {\n state: { availableLocations },\n } = useContext(appStore);\n\n let resultContent: JSX.Element = ;\n let showResult = !isOnline || !hasPermission || availableLocations.length === 0;\n\n if (!isOnline) {\n resultContent = ;\n } else if (!hasPermission) {\n resultContent = ;\n } else if (availableLocations.length === 0) {\n resultContent = ;\n }\n\n return { showResult, resultContent };\n};\n","import { useEffect, useState } from \"react\";\n\nexport const useNetworkDetection = () => {\n const [isOnline, setIsOnline] = useState(window.navigator.onLine);\n\n const updateNetwork = () => {\n setIsOnline(window.navigator.onLine);\n };\n\n useEffect(() => {\n window.addEventListener(\"offline\", updateNetwork);\n window.addEventListener(\"online\", updateNetwork);\n return () => {\n window.removeEventListener(\"offline\", updateNetwork);\n window.removeEventListener(\"online\", updateNetwork);\n };\n });\n return isOnline;\n};\n","import React, { useContext, useState } from \"react\";\nimport ReactGA from \"react-ga4\";\nimport { Modal, Button, Typography } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { useFormatPhoneNumber } from \"hooks\";\nimport { authStore, appStore } from \"providers\";\nimport { QueueState } from \"models\";\n\nconst { Paragraph, Text } = Typography;\n\ninterface CustomerInfoModal {\n phoneNumber: string;\n name: string;\n queueState: QueueState;\n}\n\nexport const CustomerInfoModal: React.FC = (props: CustomerInfoModal) => {\n const [showModal, setShowModal] = useState(false);\n\n const callString = useFormatMessage(\"Customer.call\");\n const cancelString = useFormatMessage(\"Customer.cancel\");\n const customerInfoTitle = useFormatMessage(\"Customer.info.title\");\n const { name, phoneNumber, queueState } = props;\n const {\n state: { locationId },\n } = useContext(appStore);\n const {\n state: { user },\n } = useContext(authStore);\n const formattedPhoneNumber: string = useFormatPhoneNumber(phoneNumber);\n\n const changeModalState = (showModal: boolean) => {\n setShowModal(showModal);\n if (showModal) {\n trackEvent(\"Open customer modal\");\n }\n };\n\n const trackEvent = (action: string) => {\n ReactGA.event({\n category: `LocationID ${locationId} `,\n action: action,\n label: `CustomerID ${user.Id}`,\n });\n };\n\n return (\n <>\n {queueState === \"OptedOut\" || phoneNumber === undefined ? (\n {name} \n ) : (\n \n )}\n changeModalState(false)}>\n {cancelString}\n ,\n trackEvent(\"Call Customer\")}\n >\n {callString}\n ,\n ]}\n >\n {name} \n {formattedPhoneNumber} \n \n \n );\n};\n","import React, { useContext } from \"react\";\nimport { Layout, Affix, Button, Typography, Menu, Dropdown, CaretDownFilled } from \"@iqmetrix/antd\";\nimport { SignIn, SignInProps } from \"@iqmetrix/antd/dist/components/signin\";\nimport { Link, useLocation, useHistory } from \"react-router-dom\";\nimport { useFormatMessage } from \"hooks\";\nimport { authStore, appStore, UpdateProvider } from \"providers\";\nimport { UpdateAlert } from \"components\";\n\nconst { Header } = Layout;\nconst { Title } = Typography;\n\nexport const AppHeader: React.FC = () => {\n const {\n logout,\n state: { isAuthenticated, user },\n } = useContext(authStore);\n const {\n state: { locationId, availableLocations },\n } = useContext(appStore);\n\n const history = useHistory();\n const { pathname } = useLocation();\n const isOnQueuePage = pathname.includes(\"/queue\");\n\n const changeLocationText = useFormatMessage(\"Drawer.change.location\");\n const logOut = useFormatMessage(\"Drawer.log.out\");\n const appName = useFormatMessage(\"appName\");\n\n const DropdownMenu = () => {\n return (\n \n \n \n );\n };\n\n const menu = (\n \n \n {\n logout();\n }}\n >\n {logOut}\n \n \n \n );\n\n const redirectToQueue = (event: any) => {\n if (isAuthenticated && !!locationId) history.push(`/locations/${locationId}/queue`);\n };\n\n const signInProps: SignInProps = {\n visible: true,\n items: [\n {\n text: changeLocationText,\n link: \"#/locations\",\n hidden: !isAuthenticated || availableLocations.length <= 1 || !isOnQueuePage,\n },\n {\n text: logOut,\n onclick: () => logout(),\n hidden: !isAuthenticated,\n className: \"signout-link\",\n },\n ],\n };\n\n return (\n \n \n
\n \n <span onClick={redirectToQueue} className=\"clickable\">\n {appName}\n </span>\n \n {isAuthenticated && (\n
\n
\n {availableLocations.length > 1 && isOnQueuePage && (\n \n {changeLocationText}\n \n )}\n \n
\n
\n \n
\n
\n )}\n
\n \n
\n
\n );\n};\n","import React from \"react\";\nimport { Result } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\n\nexport interface ResultMessageProps {\n error: Error;\n}\n\nexport const ResultMessage = ({ error }: ResultMessageProps) => {\n const permissionTitle = useFormatMessage(\"Error.permission.header\");\n const permissionSubTitle = useFormatMessage(\"Error.permission.subTitle\");\n const pageNotWorkingTitle = useFormatMessage(\"Error.page.not.working.header\");\n const pageNotWorkingSubTitle = useFormatMessage(\"Error.page.not.working.subTitle\");\n const hasNoLocationsSubTitle = useFormatMessage(\"Error.no.locations.subTitle\");\n const noNetworkTitle = useFormatMessage(\"Error.no.network.title\");\n const noNetworkSubTitle = useFormatMessage(\"Error.no.network.subTitle\");\n const timeOutSubTitle = useFormatMessage(\"Error.timeout.subTitle\");\n\n const getTitle = () => {\n switch (error.message) {\n case \"PermissionsDenied\": {\n return permissionTitle;\n }\n case \"NoLocations\": {\n return permissionTitle;\n }\n case \"NetworkLost\":\n case \"Timeout\": {\n return noNetworkTitle;\n }\n default: {\n return pageNotWorkingTitle;\n }\n }\n };\n\n const getSubTitle = () => {\n switch (error.message) {\n case \"PermissionsDenied\": {\n return permissionSubTitle;\n }\n case \"NoLocations\": {\n return hasNoLocationsSubTitle;\n }\n case \"Timeout\": {\n return (\n

\n {timeOutSubTitle}\n  \n support@iqmetrix.com\n

\n );\n }\n case \"NetworkLost\": {\n return (\n

\n {noNetworkSubTitle}\n  \n support@iqmetrix.com\n

\n );\n }\n default: {\n return pageNotWorkingSubTitle;\n }\n }\n };\n\n return ;\n};\n","import React from \"react\";\nimport moment from \"moment\";\nimport { Form, TimePicker } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { minuteStep, timeFormat } from \"shared\";\n\nexport const ScheduleReturnTime: React.FC = () => {\n const requiredText: string = useFormatMessage(\"Add.customer.required.field\");\n const dateFuture: string = useFormatMessage(\"Add.customer.modal.date.future\");\n const scheduleReturnTimeLabel: string = useFormatMessage(\"Add.customer.modal.schedule.return.time\");\n\n return (\n ({\n validator(rule, value) {\n const now = moment();\n if (value) {\n if (value.isAfter(now)) {\n return Promise.resolve();\n }\n return Promise.reject(dateFuture);\n } else {\n return Promise.reject();\n }\n },\n }),\n ]}\n >\n \n \n );\n};\n","import React from \"react\";\nimport { Form, Input } from \"@iqmetrix/antd\";\nimport parsePhoneNumber from \"libphonenumber-js\";\nimport { useFormatMessage } from \"hooks\";\nimport { phoneMaxNumber } from \"shared\";\n\ninterface AddPhoneNumber {\n isRequired: boolean;\n}\n\nexport const AddPhoneNumber: React.FC = ({ isRequired }: AddPhoneNumber) => {\n const phoneLabel: string = useFormatMessage(\"Add.customer.modal.phone\");\n const requiredText: string = useFormatMessage(\"Add.customer.required.field\");\n const phoneNumberMinLength: string = useFormatMessage(\"Add.customer.modal.phone.number.must.be.length\");\n const phoneNumberNotValid: string = useFormatMessage(\"Add.customer.modal.phone.number.not.valid\");\n\n const normalizePhoneNumber = (value: string) => {\n if (value) {\n const phoneNumber = parsePhoneNumber(value, \"US\");\n return phoneNumber?.formatNational();\n }\n };\n\n return (\n ({\n validator(rule, value) {\n if (value) {\n const phoneNumber = parsePhoneNumber(value, \"US\");\n if (phoneNumber?.isPossible()) {\n if (phoneNumber?.isValid()) {\n return Promise.resolve();\n }\n // phone number is not a valid number like 0000000000\n return Promise.reject(new Error(phoneNumberNotValid));\n } else {\n // phone number needs min length\n return Promise.reject(new Error(phoneNumberMinLength));\n }\n } else {\n // phone number is required\n if (isRequired) {\n return Promise.reject();\n } else {\n return Promise.resolve();\n }\n }\n },\n }),\n ]}\n >\n \n \n );\n};\n","import React, { useContext } from \"react\";\nimport { Form, Radio, Spin } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { ReasonCode } from \"models\";\nimport { locationStore } from \"providers\";\n\nexport const ReasonForVisit: React.FC = () => {\n const {\n state: { reasonCodes, isLoading },\n } = useContext(locationStore);\n const requiredText: string = useFormatMessage(\"Add.customer.required.field\");\n const reasonForVisitLabel: string = useFormatMessage(\"Add.customer.modal.reason.for.visit\");\n\n return (\n \n \n \n {reasonCodes?.map((code: ReasonCode) => (\n \n {code.displayName}\n \n ))}\n \n \n \n );\n};\n","import React, { useContext } from \"react\";\nimport { Route, Redirect, RouteProps } from \"react-router-dom\";\nimport { authStore } from \"providers\";\n\ninterface PrivateRouteProps extends RouteProps {\n component: React.FC\n}\n\nexport const PrivateRoute = ({ component: Component }: PrivateRouteProps) => {\n const {\n state: { isAuthenticated, isAuthLoading },\n } = useContext(authStore);\n\n return (\n \n !isAuthenticated && !isAuthLoading ? (\n \n ) : (\n \n )\n }\n />\n );\n};\n","import React, { useContext } from \"react\";\nimport { Skeleton, Row, Col, Typography } from \"@iqmetrix/antd\";\nimport { halfGutter } from \"shared\";\nimport { locationStore } from \"providers\";\nimport { useFormatPhoneNumber } from \"hooks\";\n\nconst { Title, Paragraph } = Typography;\n\nexport const LocationPane: React.FC = (props) => {\n const {\n state: { config, isLoading },\n } = useContext(locationStore);\n\n const formattedPhoneNumber = useFormatPhoneNumber(config ? config.configuration.PhoneNumber : \"\");\n\n return (\n \n \n \n {config?.displayName} \n {formattedPhoneNumber} \n \n \n {props.children && (\n \n {props.children}\n \n )}\n \n );\n};\n","import React, { useContext } from \"react\";\nimport { useLocation, useHistory } from \"react-router-dom\";\nimport { Menu } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { appStore } from \"providers\";\n\nexport const AppMenu: React.FC = () => {\n const {\n state: { locationId },\n } = useContext(appStore);\n const location = useLocation();\n let history = useHistory();\n const pathName = location.pathname;\n const activeQueueTitle = useFormatMessage(\"App.menu.active.queue.title\");\n const historyTitle = useFormatMessage(\"App.menu.history.title\");\n const reportTitle = useFormatMessage(\"App.menu.report.title\");\n\n const changeMenu = (event: any) => {\n history.push(`/locations/${locationId}/${event.key}`);\n };\n\n let currentMenuItem = \"queue\";\n\n if (pathName.includes(\"history\")) {\n currentMenuItem = \"queue/history\";\n } else if (pathName.includes(\"report\")) {\n currentMenuItem = \"queue/report\";\n }\n\n return (\n \n \n {activeQueueTitle}\n \n \n {historyTitle}\n \n \n {reportTitle}\n \n \n );\n};\n","import React from \"react\";\nimport { Input, SearchOutlined } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\n\ninterface LocationSearch {\n onChange: (search: string) => void;\n}\n\nexport const LocationSearch: React.FC = ({ onChange}) => {\n const inputPlaceholder = useFormatMessage(\"Input.search\");\n\n return (\n }\n onChange={(event) => onChange(event.target.value)}\n />\n );\n};\n","import React, { useContext } from \"react\";\nimport { Alert, Button, InfoCircleOutlined } from \"@iqmetrix/antd\";\nimport { updateStore } from \"providers\";\nimport \"./update-alert.scss\";\n\nexport const UpdateAlert: React.FC = () => {\n const {\n state: { isUpdateAvailable, isUpdateSuccessful },\n hideReleaseNotes,\n } = useContext(updateStore);\n\n const reloadApp = () => {\n window.location.reload();\n };\n\n interface UpdateAlertProps {\n IsUpdateAvailable: boolean;\n IsUpdateSuccessful: boolean;\n }\n\n const releaseNotesUrl = \"https://support.iqmetrix.com/s/queuemanagement\";\n\n const UpdateAlert: any = (props: UpdateAlertProps) => {\n const { IsUpdateAvailable, IsUpdateSuccessful } = props;\n\n if (IsUpdateAvailable) {\n return (\n }\n type=\"info\"\n message={\n <>\n A new version of this application is now available. Press refresh to update.\n \n \n }\n />\n );\n } else if (IsUpdateSuccessful) {\n return (\n }\n type=\"success\"\n closable\n message={\n <>\n The app has been updated successfully. Learn more about the new version\n \n \n }\n onClose={hideReleaseNotes}\n />\n );\n } else {\n return null;\n }\n };\n\n return ;\n};\n","import { message } from \"@iqmetrix/antd\";\nimport ReactGA from \"react-ga4\";\nimport { authenticatedFetch, getActionEndpoint, getResponseMessage, ResponseError } from \"shared\";\nimport { Customer, CustomerAction } from \"models\";\n\nexport async function doCustomerAction(action: CustomerAction, customer: Customer, userId: number) {\n const url = getActionEndpoint(customer.companyId, customer.locationId, customer.id, userId);\n try {\n const res = await authenticatedFetch(url, { method: \"POST\", body: JSON.stringify({ Action: action }) });\n if (!res.ok) {\n throw ResponseError.create(res);\n }\n const resMessage = await getResponseMessage(res);\n message.success(resMessage);\n ReactGA.event({\n category: `CompanyID ${customer.companyId} `,\n action: action,\n label: `CustomerID ${customer.id}`,\n });\n } catch (error) {\n const errorRes = await error;\n message.error(errorRes.message);\n throw error;\n }\n}\n","import { useContext } from \"react\";\nimport { useReducer } from \"react\";\nimport { Customer, CustomerAction } from \"models\";\nimport { doCustomerAction } from \"shared/client/customer\";\nimport { authStore } from \"providers\";\n\ntype Action =\n | { type: \"reset\" }\n | { type: \"action\"; action: CustomerAction }\n | { type: \"success\" }\n | { type: \"error\"; error: Error };\n\ntype State =\n | { status: \"empty\" }\n | { status: \"ready\" }\n | { status: \"loading\"; action: CustomerAction }\n | { status: \"error\"; error: Error };\n\nconst initialState: State = { status: \"empty\" };\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case \"reset\":\n return {\n status: \"empty\",\n };\n case \"action\":\n return {\n status: \"loading\",\n action: action.action,\n };\n case \"success\":\n return {\n status: \"ready\",\n };\n case \"error\":\n return {\n status: \"error\",\n error: action.error,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n\nexport function useCustomerAction(customer: Customer) {\n const [state, dispatch] = useReducer(reducer, initialState);\n const authContext = useContext(authStore);\n const { user } = authContext.state;\n\n async function doAction(action: CustomerAction) {\n dispatch({ type: \"action\", action });\n try {\n await doCustomerAction(action, customer, user.Id);\n dispatch({ type: \"success\" });\n } catch (error) {\n dispatch({ type: \"error\", error });\n }\n }\n\n const remove = () => doAction(\"Remove\");\n const requestReturn = () => doAction(\"RequestReturn\");\n const requestApproach = () => doAction(\"RequestApproach\");\n const markDone = () => doAction(\"MarkDone\");\n\n return {\n state,\n remove,\n requestReturn,\n requestApproach,\n markDone,\n };\n}\n","import React, { useEffect } from \"react\";\nimport { Button, Row, Col, Dropdown, DownOutlined, Menu } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { horizontalGutter, verticalGutter } from \"shared\";\nimport { Customer, QueueState } from \"models\";\nimport { useCustomerAction } from \"../hooks/use-customer-action\";\n\ninterface ActionMenuProps {\n text: string;\n danger?: boolean;\n action: () => void;\n}\n\nconst getMoreActions = (actions: ActionMenuProps[], buttonText: string, disabled: boolean) => {\n const menu = (\n \n {actions.map((action) => {\n return (\n \n {action.text}\n \n );\n })}\n \n );\n return (\n \n \n \n );\n};\n\ninterface CustomerActionsProps {\n customer: Customer;\n queueState: QueueState;\n reloadQueue: () => void;\n disabled: boolean;\n}\n\nexport const CustomerActions: React.FC = ({ customer, queueState, reloadQueue, disabled }) => {\n const { state: actionState, remove, requestReturn, requestApproach, markDone } = useCustomerAction(customer);\n const activeAction = actionState.status === \"loading\" ? actionState.action : null;\n const requestReturnAgainText = useFormatMessage(\"Button.request.return.again\");\n const requestReturnText = useFormatMessage(\"Button.request.return\");\n const removeText = useFormatMessage(\"Button.remove\");\n const markDoneText = useFormatMessage(\"Button.mark.as.done\");\n const getMoreActionsText = useFormatMessage(\"Button.more.actions\");\n\n let primaryButton: JSX.Element | null = null;\n let secondaryButton: JSX.Element | null = null;\n\n useEffect(() => {\n if (actionState.status === \"ready\") {\n reloadQueue();\n }\n }, [actionState, reloadQueue]);\n\n switch (queueState) {\n case \"HelpNext\":\n primaryButton = (\n \n {markDoneText}\n \n );\n if (customer.queueState === \"Scheduled\") {\n secondaryButton = (\n \n {removeText}\n \n );\n } else {\n secondaryButton = getMoreActions(\n [\n { text: requestReturnAgainText, action: requestApproach },\n { text: removeText, action: remove, danger: true },\n ],\n getMoreActionsText,\n disabled\n );\n }\n break;\n case \"ReturnRequested\":\n primaryButton = (\n \n {markDoneText}\n \n );\n secondaryButton = (\n \n {removeText}\n \n );\n break;\n case \"Waiting\":\n primaryButton = (\n \n {requestReturnText}\n \n );\n secondaryButton = getMoreActions(\n [\n { text: markDoneText, action: markDone },\n { text: removeText, action: remove, danger: true },\n ],\n getMoreActionsText,\n disabled\n );\n break;\n default:\n break;\n }\n\n return (\n \n {secondaryButton && (\n \n {secondaryButton}\n \n )}\n {primaryButton && {primaryButton}}\n \n );\n};\n","import React, { useContext } from \"react\";\nimport moment, { CalendarSpec } from \"moment\";\nimport { Row, Col, Tag } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { horizontalGutter, verticalGutter, halfGutter, wholeGutter, timeFormat } from \"shared\";\nimport { appStore } from \"providers\";\nimport { QueueState, ReasonCode } from \"models\";\nimport { CustomerInfoModal } from \"components\";\n\ninterface CustomerInfo {\n name: string;\n phoneNumber: string;\n date: string;\n queueState: QueueState;\n reasonCode?: ReasonCode;\n arrivedDate?: string;\n preferredLanguage?: string;\n}\n\nexport const CustomerInfo: React.FC = (props: CustomerInfo) => {\n const { name, date, phoneNumber, queueState, reasonCode, arrivedDate, preferredLanguage } = props;\n\n const localizedDatetimeFormat = useFormatMessage(\"DatetimeFormat\");\n const localizedCalendarSpec: CalendarSpec = {\n lastWeek: localizedDatetimeFormat,\n nextWeek: localizedDatetimeFormat,\n sameElse: localizedDatetimeFormat,\n };\n\n const parsedDate: string = moment(date).calendar(null, localizedCalendarSpec);\n const parsedArriveDate: string = moment(arrivedDate).format(timeFormat);\n const returnRequestedString = useFormatMessage(\"Requested\", { queuedDate: parsedDate });\n const scheduledForString = useFormatMessage(\"Scheduled.for\", { queuedDate: parsedDate });\n const arrivedString = useFormatMessage(\"Arrived\", { arrivedDate: parsedArriveDate });\n const joinedString = useFormatMessage(\"Joined\", { dateString: parsedDate });\n const returnedString = useFormatMessage(\"Returned\", { dateString: parsedDate });\n const timestampAtString = useFormatMessage(\"Timestamp.at\", { queuedDate: moment(date).format(timeFormat) });\n\n const {\n state: { config },\n } = useContext(appStore);\n\n const verticalGutterValue = verticalGutter;\n const colSpan = halfGutter;\n\n const formatTimeString = (queueState: QueueState) => {\n switch (queueState) {\n case \"ReturnRequested\":\n return returnRequestedString;\n case \"InLine\":\n return joinedString;\n case \"Scheduled\":\n return scheduledForString;\n case \"Waiting\":\n return returnedString;\n default:\n return timestampAtString;\n }\n };\n\n const hasReasonCode = config?.features.supportsReasonCodes && reasonCode;\n const hasPreferredLanguage = config?.features.smsLanguageOptionsEnabled && preferredLanguage;\n\n return (\n <>\n \n \n \n \n \n {formatTimeString(queueState)}\n \n \n {arrivedDate && (\n \n \n {arrivedString}\n \n \n )}\n \n {(hasReasonCode || hasPreferredLanguage) && (\n \n \n {hasReasonCode && (\n {reasonCode?.displayName} \n )}\n \n {hasPreferredLanguage && (\n {preferredLanguage} \n )}\n \n \n )}\n \n );\n};\n","import React from \"react\";\nimport { Button } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { Customer } from \"models\";\nimport { useCustomerAction } from \"../hooks/use-customer-action\";\n\ninterface RequestFirstCustomerButtonProps {\n customer: Customer;\n}\n\nexport const RequestFirstCustomerButton = ({ customer }: RequestFirstCustomerButtonProps) => {\n const { state: actionState, requestReturn } = useCustomerAction(customer);\n\n const requestReturnButtonText = useFormatMessage(\"Button.request.next.return\");\n\n return (\n \n );\n};\n","import React, { useState } from \"react\";\nimport { Card, Skeleton, Typography, Row, Col, Button, Space, Empty } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { Customer, QueueState, CustomerByState } from \"models\";\nimport { Messages, verticalGutter, wholeGutter, queueMaxCardsShown } from \"shared\";\nimport { CustomerActions } from \"./CustomerActions\";\nimport { CustomerInfo } from \"./CustomerInfo\";\nimport { RequestFirstCustomerButton } from \"./RequestFirstCustomerButton\";\n\nconst { Paragraph } = Typography;\n\ninterface QueueCardProps {\n queueState: QueueState;\n customersByState: CustomerByState;\n isCollapsible?: boolean;\n loading: boolean;\n reloadQueue: () => void;\n disabled: boolean;\n}\n\nexport const QueueCard: React.FC = ({\n queueState,\n customersByState,\n loading,\n isCollapsible = false,\n disabled,\n reloadQueue,\n}: QueueCardProps) => {\n const [isCollapsed, setIsCollapsed] = useState(isCollapsible);\n const customers: Customer[] = customersByState ? customersByState[queueState] : [];\n // only show first 3 customers if it is collapsed\n const customersToShow = isCollapsed ? customers.slice(0, queueMaxCardsShown) : customers;\n const cardHeader: keyof Messages = `Queue.category.${queueState}` as keyof Messages;\n const cardDescription: keyof Messages = `Queue.category.${queueState}.description` as keyof Messages;\n const showMoreButtonText = useFormatMessage(\"Button.show.more\", { number: customers.length - queueMaxCardsShown });\n const showLessButtonText = useFormatMessage(\"Button.show.less\");\n\n const toggleCollapse = () => {\n setIsCollapsed((isCollapsed) => !isCollapsed);\n };\n\n return (\n \n {useFormatMessage(cardDescription)}\n \n {!customers || customers.length === 0 ? (\n \n {queueState === \"ReturnRequested\" && customersByState[\"Waiting\"].length > 0 && (\n \n )}\n \n ) : (\n \n \n \n \n {customersToShow.map((customer: Customer) => (\n \n \n \n \n ))}\n \n \n \n {customers.length > queueMaxCardsShown && isCollapsible && (\n \n \n \n \n \n )}\n \n )}\n \n \n );\n};\n","import { useReducer, useContext } from \"react\";\nimport ReactGA from \"react-ga4\";\nimport { getCustomerEndpoint, authenticatedFetch, getResponseMessage } from \"shared\";\nimport { authStore, appStore } from \"providers\";\n\ntype Action = { type: \"reset\" } | { type: \"success\" } | { type: \"loading\" } | { type: \"error\"; error: string };\n\ninterface State {\n status: \"empty\" | \"error\" | \"ready\" | \"load\";\n error: string | null;\n}\n\nconst initialState: State = { status: \"empty\", error: null };\n\ninterface ManuallyAddCustomerValues {\n name: string;\n textCommunicationEnabled: boolean;\n phoneNumber: string;\n scheduledDateTime: string | null;\n reasonCode: { id: string };\n}\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case \"reset\":\n return {\n ...state,\n error: null,\n status: \"empty\",\n };\n case \"success\":\n return {\n ...state,\n error: null,\n status: \"ready\",\n };\n case \"loading\":\n return {\n ...state,\n status: \"load\",\n };\n case \"error\":\n return {\n ...state,\n status: \"error\",\n error: action.error,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n\nexport function useManuallyAddCustomer() {\n const [state, dispatch] = useReducer(reducer, initialState);\n const authContext = useContext(authStore);\n const appContext = useContext(appStore);\n const { user } = authContext.state;\n const { locationId } = appContext.state;\n\n const reset = () => {\n dispatch({ type: \"reset\" });\n };\n\n const manuallyAddCustomer = async (values: ManuallyAddCustomerValues) => {\n dispatch({ type: \"loading\" });\n if (locationId) {\n const url = getCustomerEndpoint(user.ParentEntityId, locationId, user.Id);\n try {\n const res = await authenticatedFetch(url, {\n method: \"POST\",\n body: JSON.stringify({\n CustomerName: values.name,\n SMSNotificationsEnabled: values.textCommunicationEnabled,\n ...(values.reasonCode && {\n ReasonCode: {\n id: values.reasonCode,\n },\n }),\n ...(values.phoneNumber && {\n PhoneNumber: values.phoneNumber,\n }),\n ...(values.scheduledDateTime && {\n ScheduledDateTime: values.scheduledDateTime,\n }),\n }),\n });\n if (!res.ok && res.status >= 300) throw res;\n const action = values.scheduledDateTime !== null ? \"Schedule\" : \"Text\";\n ReactGA.event({\n category: `CompanyID ${user.ParentEntityId}`,\n action: `Add customer - ${action}`,\n label: `CustomerID ${user.Id}`,\n });\n dispatch({ type: \"success\" });\n } catch (error) {\n const errorMessage = await getResponseMessage(error);\n dispatch({ type: \"error\", error: errorMessage });\n throw error;\n }\n }\n };\n\n return { manuallyAddState: state, manuallyAddCustomer, reset };\n}\n","import { useReducer, useContext, useEffect, useCallback } from \"react\";\nimport moment from \"moment\";\nimport { getCustomerEndpoint, authenticatedFetch, dateFormat } from \"shared\";\nimport { Customer } from \"models\";\nimport { authStore, appStore } from \"providers\";\n\ntype Action =\n | { type: \"reset\" }\n | { type: \"success\"; customers: Array }\n | { type: \"loading\" }\n | { type: \"error\"; error: Response; failedInitially?: boolean };\n\ninterface State {\n status: \"empty\" | \"error\" | \"ready\" | \"load\";\n error: Response | null;\n counter: number;\n failedInitially: boolean;\n customers: Array;\n}\nconst initialState: State = { status: \"empty\", error: null, counter: 0, failedInitially: false, customers: [] };\nlet INTERVAL_ID: number;\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case \"reset\":\n return {\n failedInitially: false,\n error: null,\n counter: 0,\n customers: [],\n status: \"empty\",\n };\n case \"success\":\n return {\n failedInitially: false,\n status: \"ready\",\n error: null,\n customers: action.customers,\n counter: 0,\n };\n case \"loading\":\n return {\n ...state,\n status: \"load\",\n };\n case \"error\":\n return {\n ...state,\n status: \"error\",\n error: action.error,\n failedInitially: action.failedInitially || state.failedInitially,\n counter: (state.counter || 0) + 1,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n\nexport function useCustomerQueue(): [State, () => Promise] {\n const [state, dispatch] = useReducer(reducer, initialState);\n const authContext = useContext(authStore);\n const appContext = useContext(appStore);\n const { user } = authContext.state;\n const { locationId } = appContext.state;\n\n const fetchQueue = useCallback(async () => {\n const entityId = user.ParentEntityId;\n if (entityId && locationId) {\n const date = moment().format(dateFormat);\n const url = getCustomerEndpoint(entityId, locationId, user.Id, date);\n const res = await authenticatedFetch(url);\n if (!res.ok && res.status >= 300) throw res;\n const results = await res.json();\n return results.data;\n }\n }, [locationId, user.Id, user.ParentEntityId]);\n\n const getCustomerQueue = useCallback(async () => {\n try {\n const customers = await fetchQueue();\n dispatch({ type: \"success\", customers });\n } catch (error) {\n dispatch({ type: \"error\", error });\n }\n }, [fetchQueue]);\n\n useEffect(() => {\n // only show loading on first page load\n dispatch({ type: \"loading\" });\n const getQueue = async () => {\n try {\n const customers = await fetchQueue();\n dispatch({ type: \"success\", customers });\n } catch (error) {\n dispatch({ type: \"error\", error, failedInitially: true });\n }\n };\n getQueue();\n }, [fetchQueue]);\n\n useEffect(() => {\n const pollCustomerQueue = () => {\n if (INTERVAL_ID) {\n window.clearInterval(INTERVAL_ID); // if there is already polling happening we stop all subsequent requests\n }\n const id = window.setInterval(getCustomerQueue, 10000); //every 10 seconds\n INTERVAL_ID = id;\n };\n pollCustomerQueue();\n return () => {\n return window.clearInterval(INTERVAL_ID);\n };\n }, [getCustomerQueue]);\n\n return [state, getCustomerQueue];\n}\n","import React, { useState, useContext, useEffect } from \"react\";\nimport { Input, Radio, Typography, Modal, Form, Alert, Skeleton } from \"@iqmetrix/antd\";\nimport { ScheduleReturnTime, AddPhoneNumber, ReasonForVisit } from \"components\";\nimport { useFormatMessage } from \"hooks\";\nimport { appStore } from \"providers\";\nimport moment from \"moment\";\nimport { useManuallyAddCustomer } from \"../hooks/use-manually-add-customer\";\n\nconst { Paragraph } = Typography;\n\ninterface Props {\n visible: boolean;\n toggleModal: (showModal: boolean) => void;\n reloadQueue: () => void;\n}\n\nexport const AddCustomerModal: React.FC = ({ visible, toggleModal, reloadQueue }) => {\n const [userOptedIntoText, setUserOptedIntoText] = useState(true);\n const { manuallyAddState, manuallyAddCustomer, reset } = useManuallyAddCustomer();\n const [addCustomerForm] = Form.useForm();\n const {\n state: { config },\n } = useContext(appStore);\n\n const closeModal = () => {\n setUserOptedIntoText(true);\n toggleModal(false);\n addCustomerForm.resetFields();\n reset();\n };\n\n useEffect(() => {\n if (manuallyAddState.status === \"ready\") {\n reloadQueue();\n closeModal();\n }\n // eslint-disable-next-line\n }, [manuallyAddState]);\n\n const onFormSubmit = () => {\n addCustomerForm\n .validateFields()\n .then(async (values) => {\n const scheduledDateTime = values.scheduledDateTime\n ? moment.utc(values.scheduledDateTime).format(\"YYYY-MM-DDTHH:mm\")\n : null;\n // strip non-digit characters\n const phoneNumber = values?.phoneNumber?.replace(/[^0-9]/g, \"\");\n manuallyAddCustomer({\n name: values.name,\n textCommunicationEnabled: values.textCommunicationEnabled,\n phoneNumber,\n scheduledDateTime,\n reasonCode: values.reasonCode,\n });\n })\n .catch((info) => {\n console.log(\"Validate Failed:\", info);\n });\n };\n\n const nameLabel: string = useFormatMessage(\"Add.customer.modal.name\");\n const textCommunicationLabel: string = useFormatMessage(\"Add.customer.modal.how.to.add.customer\");\n const requiredText: string = useFormatMessage(\"Add.customer.required.field\");\n const textMessageText: string = useFormatMessage(\"Add.customer.modal.how.to.add.customer.text\");\n const textMessageSmallText: string = useFormatMessage(\"Add.customer.modal.how.to.add.customer.text.small.text\");\n const scheduleText: string = useFormatMessage(\"Add.customer.modal.how.to.add.customer.schedule\");\n const scheduleSmallText: string = useFormatMessage(\"Add.customer.modal.how.to.add.customer.schedule.small.text\");\n const addCustomerText: string = useFormatMessage(\"Add.customer.modal.add.customer\");\n\n return (\n \n {manuallyAddState.status === \"error\" && }\n \n \n \n \n setUserOptedIntoText(true)}>\n {textMessageText}\n \n setUserOptedIntoText(false)}>\n {scheduleText}\n \n \n \n {userOptedIntoText ? textMessageSmallText : scheduleSmallText} \n \n \n \n \n {!userOptedIntoText && }\n {config?.features.supportsReasonCodes && }\n \n \n \n );\n};\n","import React, { useState, useEffect, useContext } from \"react\";\nimport ReactGA from \"react-ga4\";\nimport { Row, Col, Grid, Layout, Space, Button, Result, Alert } from \"@iqmetrix/antd\";\nimport { Customer, QueueState, CustomerByState } from \"models\";\nimport {\n responsiveColumnsHorizontal,\n queueStates,\n horizontalGutter,\n verticalGutter,\n wholeGutter,\n maxRepeatedError,\n} from \"shared\";\nimport { LocationPane, AppMenu } from \"components\";\nimport { appStore, authStore } from \"providers\";\nimport { QueueCard } from \"./components/QueueCard\";\nimport { AddCustomerModal } from \"./components/AddCustomerModal\";\nimport { useResult, useFormatMessage } from \"hooks\";\nimport { useCustomerQueue } from \"./hooks/use-customer-queue\";\n\nconst { useBreakpoint } = Grid;\n\nconst appQueueStates: QueueState[] = queueStates;\n\nconst groupCustomersByState = (customers: Array) => {\n return customers.reduce(\n (grouped: CustomerByState, customer: Customer) => {\n switch (customer.queueState) {\n case \"InLine\":\n grouped[\"Waiting\"].push(customer);\n break;\n case \"ReturnRequested\":\n grouped[\"ReturnRequested\"].push(customer);\n break;\n case \"Scheduled\":\n case \"HelpNext\":\n case \"Waiting\":\n grouped[\"HelpNext\"].push(customer);\n break;\n }\n return grouped;\n },\n {\n Waiting: [] as Customer[],\n ReturnRequested: [] as Customer[],\n HelpNext: [] as Customer[],\n } as CustomerByState\n );\n};\n\nconst initialState = {\n Waiting: [] as Customer[],\n ReturnRequested: [] as Customer[],\n HelpNext: [] as Customer[],\n} as CustomerByState;\n\nexport const Queue: React.FC = () => {\n const authContext = useContext(authStore);\n const appContext = useContext(appStore);\n const [customersByState, setCustomersByState] = useState(initialState);\n const [showModal, setShowModal] = useState(false);\n // For perimssion, network and no assigned locations errors\n const { showResult, resultContent } = useResult();\n const [queueState, getCustomerQueue] = useCustomerQueue();\n const addCustomerText = useFormatMessage(\"Add.customer.modal.add.customer\");\n const alertTitle = useFormatMessage(\"Error.queue.problem.title\");\n const alertDescription = useFormatMessage(\"Error.queue.problem.subTitle\");\n const screens = useBreakpoint();\n const { user } = authContext.state;\n const { locationId } = appContext.state;\n const showDesktopView = screens.lg;\n const isLoading = queueState.status === \"load\";\n let alertContent = null;\n\n useEffect(() => {\n if (queueState.status === \"ready\") {\n const customersInQueue = queueState.customers ?? [];\n const grouping = groupCustomersByState(customersInQueue);\n // Sort scheduled customers by scheduledDateTime\n if (grouping[\"Scheduled\"]) {\n grouping[\"Scheduled\"].sort((customerA: Customer, customerB: Customer) => {\n if (customerA.scheduledDateTime && customerB.scheduledDateTime) {\n return Date.parse(customerA.scheduledDateTime) - Date.parse(customerB.scheduledDateTime);\n } else {\n return Date.parse(customerA.queuedDate) - Date.parse(customerB.queuedDate);\n }\n });\n }\n setCustomersByState(grouping);\n }\n }, [queueState]);\n\n const toggleAddCustomerModal = (showModal: boolean, action?: string) => {\n setShowModal(showModal);\n if (action) {\n ReactGA.event({\n category: `LocationID ${locationId} `,\n action,\n label: `CustomerID ${user.Id}`,\n });\n }\n };\n\n // For permission, network and no assigned locations errors show result page\n if (showResult && resultContent) return resultContent;\n\n // For fetching the queue related errors, show reult page on initial fail,\n // show alert when it fails after it has previously been fetched\n if (queueState.error) {\n if (queueState.failedInitially || queueState.counter > maxRepeatedError) {\n return ;\n } else {\n alertContent = (\n \n );\n }\n }\n\n const disableButtons = queueState.status === \"error\";\n\n return (\n \n \n {alertContent}\n \n toggleAddCustomerModal(true, \"Open modal\")}\n >\n {addCustomerText}\n \n \n \n \n {showDesktopView ? (\n \n {appQueueStates.map((queueState: QueueState) => (\n \n \n \n ))}\n \n ) : (\n appQueueStates.map((queueState: QueueState) => (\n \n \n \n \n \n ))\n )}\n \n \n );\n};\n","import React, { useContext } from \"react\";\nimport { useFormatMessage } from \"hooks\";\nimport { Button, Row, Col, Typography } from \"@iqmetrix/antd\";\nimport { authStore } from \"providers\";\n\nconst { Title } = Typography;\n\nexport const Landing: React.FC = () => {\n const { login } = useContext(authStore);\n\n return (\n \n \n {useFormatMessage(\"Landing.page\")}\n \n \n \n );\n};\n","import React, { useContext, useState } from \"react\";\nimport { useHistory } from \"react-router-dom\";\nimport { Row, Col, Card, Form, List, Space } from \"@iqmetrix/antd\";\nimport { useFormatMessage, useResult } from \"hooks\";\nimport { LocationSearch } from \"components\";\nimport { appStore } from \"providers\";\nimport { filterLocations, responsiveColumnsVertical } from \"shared\";\n\nconst MINIMUM_LOCATIONS_TO_SHOW_SEARCH = 10;\n\nexport const Locations: React.FC = () => {\n const { showResult, resultContent } = useResult();\n const [search, setSearch] = useState(\"\");\n const {\n selectLocation,\n state: { availableLocations },\n } = useContext(appStore);\n\n const locations = filterLocations(search, availableLocations);\n const showSearch = availableLocations.length >= MINIMUM_LOCATIONS_TO_SHOW_SEARCH;\n\n const history = useHistory();\n const locationsHeader = useFormatMessage(\"Locations.page\");\n\n const onClickLocation = (locationId: number) => {\n selectLocation(locationId);\n history.push(`/locations/${locationId}/queue`);\n };\n\n if (showResult && resultContent) return resultContent;\n\n return (\n \n \n \n \n {showSearch && (\n \n \n \n )}\n (\n onClickLocation(x.id)}>{x.displayName}\n )}\n />\n \n \n \n \n );\n};\n","import React, { useContext } from \"react\";\nimport moment from \"moment\";\nimport { Row, Col, Card, Typography } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { appStore } from \"providers\";\nimport { ReasonCode, QueueState } from \"models\";\nimport { CustomerInfoModal } from \"components\";\nimport { timeFormat } from \"shared\";\n\nconst { Text } = Typography;\n\ninterface CustomerInfo {\n name: string;\n phoneNumber: string;\n queueState: QueueState;\n actionDate: string;\n reasonCode: ReasonCode;\n}\n\nexport const CustomerHistoryInfo: React.FC = (props: CustomerInfo) => {\n const { name, phoneNumber, queueState, actionDate, reasonCode } = props;\n const {\n state: { config },\n } = useContext(appStore);\n\n const timestampAtString = useFormatMessage(\"Timestamp.at\", { queuedDate: moment(actionDate).format(timeFormat) });\n\n const formatQueueStateToTitleCase = (queueState: QueueState) => {\n const [firstQueueState, ...otherQueueState] = queueState.split(/(?=[A-Z])/);\n return [firstQueueState, ...otherQueueState.map((x) => x.toLowerCase())].join(\" \");\n };\n\n return (\n \n \n \n \n \n {config?.features.supportsReasonCodes && reasonCode && (\n \n {reasonCode.displayName} \n \n )}\n \n \n {formatQueueStateToTitleCase(queueState)} {timestampAtString}\n \n \n \n \n );\n};\n","import { useEffect, useReducer } from \"react\";\nimport ReactGA from \"react-ga4\";\nimport moment from \"moment\";\nimport { CustomerHistory } from \"models\";\nimport { ResponseError, authenticatedFetch, dateFormat, getHistoryEndpoint } from \"shared\";\n\nconst POLLING_RATE = 10000; // ms\n\ntype Action = { type: \"success\"; customers: Array } | { type: \"error\"; error: Error };\n\ntype State =\n | { status: \"empty\" }\n | { status: \"error\"; error: Error }\n | { status: \"ready\"; customers: Array };\n\nconst initialState: State = { status: \"empty\" };\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case \"success\":\n return {\n status: \"ready\",\n customers: action.customers,\n };\n case \"error\":\n return {\n status: \"error\",\n error: action.error,\n };\n default:\n throw new Error(\"Invalid action\");\n }\n}\n\nexport function useQueueHistory(companyId: number, locationId: number | null) {\n const [state, dispatch] = useReducer(reducer, initialState);\n\n async function fetchQueueHistory(companyId: number, locationId: number) {\n try {\n const date = moment().format(dateFormat);\n const url = getHistoryEndpoint(companyId, locationId, date);\n const response = await authenticatedFetch(url);\n if (!response.ok) {\n throw ResponseError.create(response);\n }\n const json = await response.json();\n const customers = json.data as Array;\n ReactGA.event({\n category: `CompanyID ${companyId}`,\n action: \"View History\",\n label: `LocationId ${locationId}`,\n });\n dispatch({ type: \"success\", customers });\n } catch (error) {\n dispatch({ type: \"error\", error });\n }\n }\n\n useEffect(() => {\n let intervalId: NodeJS.Timeout;\n if (companyId && locationId) {\n fetchQueueHistory(companyId, locationId);\n const doFetch = () => fetchQueueHistory(companyId, locationId);\n intervalId = setInterval(doFetch, POLLING_RATE);\n }\n return () => {\n clearInterval(intervalId);\n };\n }, [companyId, locationId]);\n\n return state;\n}\n","import React, { useContext } from \"react\";\nimport { Row, Col, Card, Skeleton, Empty, Typography, Layout, Space } from \"@iqmetrix/antd\";\nimport { appStore, authStore } from \"providers\";\nimport { verticalGutter, wholeGutter } from \"shared\";\nimport { CustomerHistory } from \"models\";\nimport { useFormatMessage, useResult } from \"hooks\";\nimport { LocationPane, AppMenu } from \"components\";\nimport { CustomerHistoryInfo } from \"./components/customer-history-info\";\nimport { useQueueHistory } from \"./hooks/use-queue-history\";\n\nconst { Paragraph } = Typography;\n\nexport const History: React.FC = () => {\n const { showResult, resultContent } = useResult();\n const {\n state: { locationId },\n } = useContext(appStore);\n const {\n state: { user },\n } = useContext(authStore);\n const historyState = useQueueHistory(user.ParentEntityId, locationId);\n\n const cardTitle: string = useFormatMessage(\"History.card.title\");\n const cardSubTitle: string = useFormatMessage(\"History.card.subTitle\");\n\n const isLoading = historyState.status === \"empty\";\n const customers = historyState.status === \"ready\" ? historyState.customers : [];\n if (showResult && resultContent) return resultContent;\n return (\n \n \n \n \n \n {cardSubTitle}\n \n {customers.length === 0 ? (\n \n ) : (\n customers.map((customer: CustomerHistory) => (\n \n \n \n \n \n ))\n )}\n \n \n \n \n );\n};\n","import React, { useContext, useEffect, useState } from \"react\";\nimport { Form, Typography, Checkbox, Divider, List, Button, Modal } from \"@iqmetrix/antd\";\nimport { useFormatMessage } from \"hooks\";\nimport { LocationSearch } from \"components\";\nimport { appStore } from \"providers\";\nimport { filterLocations } from \"shared\";\n\nconst { Paragraph } = Typography;\n\ninterface CreateReportForm {\n visible: boolean;\n onCancel: () => void;\n onSubmit: (ids: string[]) => void;\n selectedLocationsIds: string[];\n}\n\nexport const SelectLocationsModal: React.FC = ({\n visible,\n onCancel,\n onSubmit,\n selectedLocationsIds,\n}: CreateReportForm) => {\n const {\n state: { availableLocations },\n } = useContext(appStore);\n\n const [selectedIds, setSelectedIds] = useState(selectedLocationsIds);\n const [search, setSearch] = useState(\"\");\n\n const filteredLocations = filterLocations(search, availableLocations);\n const entireCompanySelected = selectedIds.length === availableLocations.length;\n\n const resetSelectedIds = () => {\n setSelectedIds(selectedLocationsIds);\n };\n\n const onLocationFormSubmit = () => {\n onSubmit(selectedIds);\n };\n\n const checkEntireCompany = (isChecked: boolean) => {\n const newValue = isChecked ? availableLocations.map((item) => item.id.toString()) : [];\n setSelectedIds(newValue);\n };\n\n const toggleCheckbox = (id: string, isChecked: boolean) => {\n if (isChecked) {\n setSelectedIds([...selectedIds, id]);\n } else {\n setSelectedIds(selectedIds.filter((selectedId) => selectedId !== id));\n }\n };\n\n useEffect(resetSelectedIds, [selectedLocationsIds, visible]);\n\n const modalHeader = useFormatMessage(\"Create.report.modal.select.location\");\n const byLocationText = useFormatMessage(\"Create.report.modal.by.location\");\n const entireCompanyText = useFormatMessage(\"Create.report.modal.entire.company\");\n const selectedLocationText = useFormatMessage(\"Create.report.modal.locations.selected\", {\n numberOf: selectedIds.length,\n });\n const cancelText = useFormatMessage(\"Customer.cancel\");\n const selectText = useFormatMessage(\"Button.select\");\n\n return (\n \n {selectedLocationText}\n ,\n ,\n ,\n ]}\n >\n
\n \n checkEntireCompany(event.target.checked)}\n >\n {entireCompanyText}\n \n \n \n {byLocationText} \n \n {availableLocations.length > 1 && (\n \n \n \n )}\n \n (\n \n toggleCheckbox(x.id.toString(), e.target.checked)}\n >\n {x.displayName}\n \n \n )}\n />\n \n \n \n );\n};\n","import React, { useState } from \"react\";\nimport { Input } from \"@iqmetrix/antd\";\nimport { SelectLocationsModal } from \"./SelectLocationsModal\";\nimport { useFormatMessage } from \"hooks\";\n\nexport interface LocationInputProps {\n value?: string[];\n onChange?: (value: string[]) => void;\n}\n\nexport const LocationInput: React.FC = ({ value, onChange }) => {\n const inputPlaceholder = useFormatMessage(\"Request.report.card.input.placeholder\");\n const locationsSelectedText = useFormatMessage(\"Create.report.modal.locations.selected\", {\n numberOf: value?.length,\n });\n\n const [showModal, setShowModal] = useState(false);\n\n const onLocationsModalSubmit = (ids: string[]) => {\n setShowModal(false);\n onChange?.(ids);\n };\n\n const onLocationsModalCancel = () => {\n setShowModal(false);\n };\n\n return (\n <>\n setShowModal(true)}\n value={value?.length ? locationsSelectedText : undefined}\n />\n \n \n );\n};\n","import React, { useState, useContext } from \"react\";\nimport ReactGA from \"react-ga4\";\nimport { saveAs } from \"file-saver\";\nimport { Card, Typography, Space, Button, DatePicker, Form, Layout, Spin, Alert, Row, Grid } from \"@iqmetrix/antd\";\nimport { AppMenu } from \"components\";\nimport { LocationInput } from \"./components/LocationInput\";\nimport { authStore, appStore } from \"providers\";\nimport moment from \"moment\";\nimport { useFormatMessage, useResult } from \"hooks\";\nimport { authenticatedFetch, dateFormat, getCustomerHistoryReport, getResponseMessage } from \"shared\";\n\nconst { Paragraph } = Typography;\nconst { useBreakpoint } = Grid;\n\nexport const Report: React.FC = () => {\n const { showResult, resultContent } = useResult();\n\n const [isRequestingReport, setIsRequestingReport] = useState(false);\n const [successfullDownload, setSuccessfulDownload] = useState(false);\n const [errorMessage, setErrorMessage] = useState(\"\");\n const {\n state: { user },\n } = useContext(authStore);\n const {\n state: { availableLocations },\n } = useContext(appStore);\n const [createReportForm] = Form.useForm();\n\n const requiredText = useFormatMessage(\"Add.customer.required.field\");\n const exportText = useFormatMessage(\"Button.text.export\");\n const cardTitle = useFormatMessage(\"Request.report.card.title\");\n const cardSubtitle = useFormatMessage(\"Request.report.card.subtitle\");\n const locationsLabel = useFormatMessage(\"Request.report.card.location.label\");\n const alertTitle = useFormatMessage(\"Request.report.alert.title\");\n const alertDescription = useFormatMessage(\"Request.report.alert.description\");\n const startDate = useFormatMessage(\"Request.report.start.date\");\n const endDate = useFormatMessage(\"Request.report.end.date\");\n const defaultReportName = useFormatMessage(\"Request.report.default.name\");\n\n const onFormSubmit = () => {\n createReportForm\n .validateFields()\n .then(async (values) => {\n setIsRequestingReport(true);\n try {\n const startDate = moment(values.startDate).format(dateFormat);\n const endDate = moment(values.endDate).format(dateFormat);\n const locationIds = values.selectedLocationsIds.join(\",\");\n const response = await authenticatedFetch(\n getCustomerHistoryReport(user.ParentEntityId, startDate, endDate, locationIds)\n );\n if (!response.ok) throw response;\n ReactGA.event({\n category: `CompanyID ${user.ParentEntityId}`,\n action: \"Run Report\",\n label: `UserId ${user.Id}`,\n }); \n // get the content-disposition header to find the file name\n const contentDispositionHeader = response.headers.get(\"content-disposition\");\n // assign the filename a default name incase we can not get the value from the header\n const filename = contentDispositionHeader?.match(/(?:filename=)\"(.*?)\"/)?.[1] || defaultReportName;\n // get the content of the file\n const blob = await response.blob();\n // download the file\n saveAs(blob, filename);\n setIsRequestingReport(false);\n setSuccessfulDownload(true);\n createReportForm.resetFields();\n } catch (error) {\n setIsRequestingReport(false);\n const errorMessage = await getResponseMessage(error);\n setErrorMessage(errorMessage);\n throw error;\n }\n })\n .catch((info) => {\n console.log(\"Validate Failed:\", info);\n });\n };\n\n const screens = useBreakpoint();\n const showDesktopView = screens.lg;\n\n const startDateDisabled = (current: moment.Moment) => {\n // Can not select days before today, today or after end date\n const endDate = createReportForm.getFieldValue(\"endDate\");\n return (current && current > moment().endOf(\"day\")) || (endDate && current > endDate);\n };\n\n const endDateDisabled = (current: moment.Moment) => {\n // Can not select days before today, today or before start date\n const startDate = createReportForm.getFieldValue(\"startDate\");\n return (current && current > moment().endOf(\"day\")) || (startDate && current < startDate);\n };\n\n const onCloseAlert = () => {\n setSuccessfulDownload(false);\n };\n\n const onCloseErrorAlert = () => {\n setErrorMessage(\"\");\n };\n\n const onFormValuesChange = () => {\n setSuccessfulDownload(false);\n setErrorMessage(\"\");\n };\n\n if (showResult && resultContent) return resultContent;\n\n return (\n \n \n \n {successfullDownload && (\n \n )}\n {errorMessage?.length > 0 && (\n \n )}\n \n \n {cardSubtitle}\n \n {isRequestingReport ? (\n \n \n \n ) : (\n \n \n \n \n \n \n \n\n x.id.toString())\n : []\n }\n >\n \n \n \n \n {exportText}\n \n \n \n )}\n \n \n \n \n \n );\n};\n","import React, { useContext, useEffect } from \"react\";\nimport { withGARouter } from \"shared/analytics\"\nimport { Switch, Route } from \"react-router-dom\";\nimport ReactGA from \"react-ga4\";\nimport { Layout, Spin, Row } from \"@iqmetrix/antd\";\nimport { Queue, Landing, Locations, History, Report } from \"pages\";\nimport { AppHeader, PrivateRoute } from \"components\";\nimport { appStore, authStore, LocationProvider, updateStore } from \"providers\";\nimport TagManager from \"react-gtm-module\";\n\nTagManager.initialize({\n gtmId: \"GTM-5R7XPHB\",\n auth: \"A0OyBsFoWOa_uHsQWMAvXQ\",\n});\n\nconst { Content } = Layout;\n\nexport const App: React.FC = () => {\n const {\n state: { user, isAuthenticated, isAuthLoading },\n } = useContext(authStore);\n const {\n state: { isLoadingApp },\n } = useContext(appStore);\n\n const { updateAppVersion } = useContext(updateStore);\n\n useEffect(() => {\n setInterval(updateAppVersion, 10 * 60 * 1000);\n }, [updateAppVersion]);\n\n // Add your app's routes below\n // Routing Docs: https://reacttraining.com/react-router/web/guides/quick-start\n // Routing Standards: https://design-system.iqmetrix.net/docs/web-dev-docs/guides/routing-standards\n\n if (process.env.NODE_ENV !== \"development\" && isAuthenticated && user) {\n ReactGA.set({ userId: user.Id });\n }\n\n return (\n \n \n \n {isLoadingApp || isAuthLoading ? (\n \n \n \n ) : (\n \n \n \n \n \n \n \n \n \n \n )}\n \n \n );\n};\n","import \"@iqmetrix/antd/dist/antd.css\";\n\nimport \"core-js\";\nimport \"react-app-polyfill/ie11\";\nimport \"react-app-polyfill/stable\";\n\nimport * as Sentry from \"@sentry/react\";\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport ReactGA from \"react-ga4\";\n\nimport { ErrorBoundary, Profiler, I18nProvider } from \"./components\";\nimport { AuthProvider, AppProvider } from \"./providers\";\nimport { HashRouter as Router } from \"react-router-dom\";\n\nimport { App } from \"./App\";\nimport { getEnvironment, getEnvironmentSuffix } from \"shared\";\n\nimport \"index.scss\";\nimport { TrackerId } from \"shared/analytics\";\nimport * as packageJson from \"../package.json\";\n\nasync function init() {\n const env = getEnvironment();\n const isOldUrl = window.location.href.includes(\"checkin\");\n\n\n ReactGA.initialize(TrackerId);\n ReactGA.set({ env: env });\n\n if (process.env.NODE_ENV !== \"development\" && !isOldUrl) {\n Sentry.init({\n dsn: process.env.REACT_APP_SENTRY_DSN,\n environment: env,\n attachStacktrace: true,\n release: `${packageJson.name}@${packageJson.version}`,\n ignoreErrors: [\n // Ignore errors that are unactionable. These are due to the user's network.\n \"TypeError: Failed to fetch\",\n \"TypeError: NetworkError when attempting to fetch resource.\",\n \"TypeError: Cancelled\",\n ],\n });\n }\n\n const Application = () => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n\n if (isOldUrl) {\n // redirect from old url\n window.location.replace(`https://queue${getEnvironmentSuffix()}.iqmetrix.net`);\n } else {\n ReactDOM.render(, document.getElementById(\"root\"));\n }\n}\n\ninit();\n","import {\n getLoginEndpoint,\n getLogoutEndpoint,\n getMeEndpoint,\n authenticatedFetch,\n getPermissions,\n queueManagementPermission,\n} from \"../\";\nimport { AuthUser } from \"models\";\n\nlet token: string | undefined | null;\nconst tokenName = \"oauthToken\";\nconst redirectUrl: string = `${window.location.origin}` || `${window.location.protocol}//${window.location.host}`;\n\ninterface QueryString {\n access_token?: string;\n state?: string;\n token_type?: string;\n expires_in?: string;\n [key: string]: string | undefined;\n}\n\nexport const authenticate = async (): Promise => {\n token = getAccessToken();\n if (token && token !== \"null\") {\n try {\n setAccessToken(token);\n const authUser: AuthUser = await getAuthUser();\n return authUser;\n } catch (error) {\n fetchAccessToken(); // token has expired, get new token\n throw new Error(error);\n }\n } else {\n throw new Error(\"User is not logged in\");\n }\n};\n\nexport const authorize = async () => {\n try {\n const permissionsResponse = await authenticatedFetch(getPermissions(queueManagementPermission));\n const permissions = await permissionsResponse.json();\n return permissions[0];\n } catch (error) {\n throw error;\n }\n};\n\nexport const fetchAccessToken = () => {\n window.location.href = getLoginUrl();\n};\n\nexport const clearTokenFromStorage = () => {\n try {\n window.localStorage.removeItem(tokenName);\n window.location.href = `${getLogoutEndpoint()}?accessToken=${token}&returnUrl=${encodeURIComponent(\n redirectUrl\n )}`;\n } catch (error) {\n throw error;\n }\n};\n\nexport const getAccessToken = () => {\n let token;\n token = getAccessTokenFromUrl();\n if (!token) {\n token = getAccessTokenFromStorage();\n }\n return token;\n};\n\nconst getLoginUrl = () => {\n const params = [\n { key: \"response_type\", value: \"token\" },\n { key: \"client_id\", value: \"queue-management\" },\n { key: \"redirect_uri\", value: redirectUrl },\n ].map((param) => param.key + \"=\" + param.value);\n return `${getLoginEndpoint()}?${params.join(\"&\")}`;\n};\n\nconst getAuthUser = async (): Promise => {\n try {\n const response = await authenticatedFetch(getMeEndpoint());\n if (!response.ok) throw response;\n const results: AuthUser = await response.json();\n return results;\n } catch (error) {\n throw error;\n }\n};\n\nconst getAccessTokenFromUrl = () => {\n return getQueryStrings(window.location.hash, \"access_token\");\n};\n\nconst getAccessTokenFromStorage = (): string | null => {\n return window?.localStorage?.getItem(tokenName);\n};\n\nconst setAccessToken = (token: string) => {\n window.localStorage.setItem(tokenName, token);\n};\n\nconst getQueryStrings = (hash: string, key: string): string | undefined => {\n const queryStrings: QueryString = hash\n .replace(\"#\", \"\")\n .split(\"&\")\n .reduce((prev: QueryString, curr: string) => {\n const [key, value] = curr.split(\"=\");\n return {\n ...prev,\n [key]: value,\n };\n }, {});\n return queryStrings[key];\n};\n","export const getEnvironment = (): string => {\n const host = window.location.host.toLowerCase();\n const parts = /(?:checkin|queue)(.*?)\\./.exec(host);\n const environmentSuffix = parts && parts[1];\n switch (environmentSuffix) {\n case \"int\":\n case \"rc\":\n return environmentSuffix;\n case \"\":\n return \"prod\";\n default:\n return \"int\";\n }\n};\n","export * from \"./analytics\";\nexport * from \"./authenticated-fetch\";\nexport * from \"./compare-string-values\";\nexport * from \"./constants\";\nexport * from \"./endpoints\";\nexport * from \"./filter-locations\";\nexport * from \"./get-environment-suffix\";\nexport * from \"./get-environment\";\nexport * from \"./get-response-message\";\nexport * from \"./i18n\";\nexport * from \"./errors\";\n","export const getEnvironmentSuffix = (): string => {\n const host = window.location.host.toLowerCase();\n const parts = /(?:checkin|queue)(.*?)\\./.exec(host);\n const environmentSuffix = parts && parts[1];\n switch (environmentSuffix) {\n case \"int\":\n case \"rc\":\n case \"\":\n return environmentSuffix;\n default:\n return \"int\";\n }\n};\n","import { getAccessToken, clearTokenFromStorage } from \"./client\";\nimport * as Sentry from \"@sentry/minimal\";\n\nexport type AuthenticatedFetch = (url: RequestInfo, requestInit?: RequestInit) => Promise;\n\nexport const authenticatedFetch: AuthenticatedFetch = async (url, requestInit?) => {\n try {\n let authenticationToken;\n let options = requestInit || {};\n let headers = (options && options.headers) || {};\n try {\n authenticationToken = getAccessToken();\n } catch (error) {\n window.location.href = \"/\";\n }\n\n headers = { ...headers, \"Content-Type\": \"application/json\", Authorization: `Bearer ${authenticationToken}` };\n options = { ...options, headers };\n\n const response = await fetch(url, options);\n if (response && response.status === 401) {\n clearTokenFromStorage();\n }\n\n return response;\n } catch (error) {\n /* istanbul ignore next */\n Sentry.captureException(error);\n throw error;\n }\n};\n","export function compareStringValues(\n key: keyof T\n): (a: T, b: T) => number {\n return (a: T, b: T) => {\n return a[key].toString().localeCompare(b[key].toString());\n };\n}\n","import { QueueState } from \"models\";\n\nexport const horizontalGutter = 8;\nexport const verticalGutter = 8;\nexport const halfGutter = 12;\nexport const wholeGutter = 24;\n\nexport const responsiveColumnsVertical = { sm: 24, md: 12, lg: 10, xl: 8 };\nexport const responsiveColumnsHorizontal = { sm: 8, md: 8, lg: 8, xl: 8 };\n\nexport const queueStates: QueueState[] = [\"HelpNext\", \"ReturnRequested\", \"Waiting\"];\n\nexport const queueManagementPermission = \"ManageCheckInQueue\";\n\nexport const phoneMaxNumber = 10;\n\nexport const minuteStep = 15;\n\nexport const timeFormat = \"h:mma\";\n\nexport const dateFormat = \"MM/DD/YYYY\";\n\nexport const queueMaxCardsShown = 3;\nexport const maxRepeatedError = 3;\n","import { getEnvironment } from \"./get-environment\";\nimport { getEnvironmentSuffix } from \"./get-environment-suffix\";\n\nconst env = getEnvironment();\nconst suffix = getEnvironmentSuffix();\n\nconst QueueManagementAPIRoot = `https://checkin${env}.azure.${\n env === \"int\" ? \"development\" : \"production\"\n}.k8s.iqmetrix.net/v1`;\nconst IQAccountsAPIRoot = `https://accounts${suffix}.iqmetrix.net`;\n\nexport const getActionEndpoint = (companyId: number, locationId: number, customerId: string, userId: number) => {\n return `${QueueManagementAPIRoot}/companies/${companyId}/locations/${locationId}/customers/${customerId}?userId=${userId}`;\n};\n\nexport const getCustomerEndpoint = (companyId: number, locationId: number, userId: number, date?: string) => {\n const search = new URLSearchParams({ userId: userId.toString() });\n if (date) {\n search.set(\"date\", date);\n }\n const url = new URL(`${QueueManagementAPIRoot}/companies/${companyId}/locations/${locationId}/customers`);\n url.search = search.toString();\n return url.toString();\n};\n\nexport const getCustomerHistoryReport = (\n companyId: number,\n startDate: string,\n endDate: string,\n locationIds: string\n) => {\n return `${QueueManagementAPIRoot}/companies/${companyId}/customers/history/report?startDate=${startDate}&endDate=${endDate}&locationIds=${locationIds}`;\n};\n\nexport const getCompanyConfigEndpoint = (companyId: number) => {\n return `${QueueManagementAPIRoot}/companies/${companyId}/configuration`;\n};\n\nexport const getLocationConfigEndpoint = (companyId: number, locationId: number) => {\n return `${QueueManagementAPIRoot}/companies/${companyId}/locations/${locationId}/configuration`;\n};\n\nexport const getReasonCodesEndpoint = (companyId: number, locationId: number) => {\n return `${QueueManagementAPIRoot}/companies/${companyId}/locations/${locationId}/reason-codes`;\n};\n\nexport const getHistoryEndpoint = (companyId: number, locationId: number, date: string) => {\n return `${QueueManagementAPIRoot}/companies/${companyId}/locations/${locationId}/customers/history?date=${date}`;\n};\n\nexport const getUserLocationsEndpoint = (companyId: number, userId: number) => {\n return `${QueueManagementAPIRoot}/companies/${companyId}/users/${userId}/assigned-locations`;\n};\n\nexport const getPermissions = (code: string) => {\n return `${IQAccountsAPIRoot}/v1/permissions?code=${code}`;\n};\n\nexport const getLogoutEndpoint = () => {\n return `${IQAccountsAPIRoot}/logout`;\n};\n\nexport const getLoginEndpoint = () => {\n return `${IQAccountsAPIRoot}/v1/oauth2/auth`;\n};\n\nexport const getMeEndpoint = () => {\n return `${IQAccountsAPIRoot}/v1/me`;\n};\n\nexport const getAppVersionEndpoint = () => {\n if (process.env.NODE_ENV !== \"development\") {\n return \"/ping\";\n }\n return `/version.json`;\n};\n","import { Location } from \"models\";\n\nconst MINIMUM_SEARCH_LENGTH = 2;\n\nexport function filterLocations(filterValue: string, locations: Location[]) {\n if (filterValue.length > MINIMUM_SEARCH_LENGTH) {\n return locations.filter((location) => location.displayName.toLowerCase().includes(filterValue.toLowerCase()));\n } else {\n return locations;\n }\n}\n","export async function getResponseMessage(res: Response): Promise {\n try {\n const resJson = await res.json();\n let message = \"\";\n if (resJson.data) {\n message = resJson.data.message;\n } else if (resJson.errors) {\n message = resJson.errors[0].message || resJson.errors[0][0].message;\n }\n return message;\n } catch (error) {\n return \"Unexpected error. Please try again.\";\n }\n}\n","export class ResponseError extends Error {\n private _response: Response;\n\n public get response(): Response {\n return this._response;\n }\n\n private constructor(message: string, res: Response) {\n super(message);\n this.name = \"ResponseError\";\n this._response = res;\n }\n\n /**\n * Factory method to create a new ResponseError\n */\n public static async create(res: Response) {\n let message: string;\n try {\n const json = await res.json();\n message = json.errors.map((e: { message: string }) => e.message).join(\"\\n\");\n } catch (e) {\n // do nothing we're already failing!\n message = \"Unknown Error\";\n }\n return new ResponseError(message, res);\n }\n}\n","const messages = {\n appName: \"Queue Management\",\n \"Queue.category.Waiting\": \"Waiting\",\n \"Queue.category.Waiting.description\": \"Customers joined and waiting for an available sales representative.\",\n \"Queue.category.ReturnRequested\": \"Return requested\",\n \"Queue.category.ReturnRequested.description\": \"Customers asked to return to the store to be helped next.\",\n \"Queue.category.HelpNext\": \"Help next\",\n \"Queue.category.HelpNext.description\": \"Customers ready to be helped or with a scheduled return time.\",\n \"Button.remove\": \"Remove\",\n \"Button.mark.as.done\": \"Mark as done\",\n \"Button.request.return\": \"Request return\",\n \"Button.request.return.again\": \"Request return again\",\n \"Button.request.next.return\": \"Request the next customer return to store\",\n \"Button.more.actions\": \"More actions\",\n \"Timestamp.since\": \"since {queuedDate}\",\n \"Timestamp.at\": \"at {queuedDate}\",\n DatetimeFormat: \"MMM D [at] h:mma\",\n Joined: \"Joined {dateString}\",\n \"Scheduled.for\": \"Scheduled for {queuedDate}\",\n Arrived: \"Arrived at {arrivedDate}\",\n Requested: \"Requested {queuedDate}\",\n Returned: \"Returned {dateString}\",\n \"Customer.call\": \"Call\",\n \"Customer.cancel\": \"Cancel\",\n \"Button.select\": \"Select\",\n \"Customer.info.title\": \"Customer information\",\n \"Locations.page\": \"Please select your location\",\n \"Input.search\": \"Search locations\",\n \"Drawer.title\": \"Account\",\n \"Drawer.change.location\": \"Change location\",\n \"Drawer.log.out\": \"Sign out\",\n \"Landing.page\": \"Welcome to your Queue!\",\n \"Landing.page.button\": \"LOGIN\",\n \"Error.permission.header\": \"You do not have permission to view this page.\",\n \"Error.permission.subTitle\": \"Please contact your systems administrator to request permission.\",\n \"Error.no.locations.subTitle\": \"Please contact your systems administrator to assign you a location.\",\n \"Error.page.not.working.header\": \"This page is not working.\",\n \"Error.page.not.working.subTitle\": \"The browser sent a request that the server does not understand.\",\n \"Add.customer.modal.add.customer\": \"Add customer\",\n \"Add.customer.modal.reason.for.visit\": \"Reason for visit\",\n \"Add.customer.modal.how.to.add.customer\": \"How would you like to add the customer?\",\n \"Add.customer.modal.how.to.add.customer.text\": \"Text message\",\n \"Add.customer.modal.how.to.add.customer.schedule\": \"Schedule\",\n \"Add.customer.modal.how.to.add.customer.text.small.text\":\n \"The customer will interact with the queue using their device to send/receive messages via text.\",\n \"Add.customer.modal.how.to.add.customer.schedule.small.text\":\n \"Please suggest an approximate time for the customer to return. The customer is unable to interact with the queue using their device.\",\n \"Add.customer.modal.phone\": \"Phone\",\n \"Add.customer.modal.schedule.return.time\": \"Suggested return time\",\n \"Add.customer.modal.phone.number.must.be.length\": \"Phone number requires 10 digits\",\n \"Add.customer.modal.phone.number.not.valid\": \"Phone number is not valid\",\n \"Add.customer.modal.name\": \"Name\",\n \"Add.customer.required.field\": \"Required\",\n \"Add.customer.modal.date.future\": \"Please select a time that is later today\",\n \"History.card.title\": \"Today’s history\",\n \"History.card.subTitle\": \"Customers that have interacted with the queue today.\",\n \"App.menu.active.queue.title\": \"Active queue\",\n \"App.menu.history.title\": \"Today's history\",\n \"App.menu.report.title\": \"Report\",\n \"Create.report.modal.select.location\": \"Select locations\",\n \"Create.report.modal.by.location\": \"By location\",\n \"Create.report.modal.entire.company\": \"Entire company\",\n \"Create.report.modal.locations.selected\": \"{numberOf, plural, =1 {# location} other {# locations}}\",\n \"Request.report.date.range\": \"Date range\",\n \"Request.report.card.subtitle\": \"Customers that have interacted with the queue.\",\n \"Request.report.card.title\": \"Queue history\",\n \"Request.report.card.location.label\": \"Location(s)\",\n \"Request.report.card.input.placeholder\": \"Select a location\",\n \"Button.text.export\": \"Export\",\n \"Request.report.alert.title\": \"File exported successfully.\",\n \"Request.report.alert.description\":\n \"Please check your system’s “Downloads” folder if you cannot see the downloaded file within your browser.\",\n \"Request.report.start.date\": \"Start date\",\n \"Request.report.end.date\": \"End date\",\n \"Request.report.default.name\": \"QueueReport\",\n \"Button.show.more\": \"show more ({number})\",\n \"Button.show.less\": \"show less\",\n \"Error.no.network.title\": \"The application has encountered a timeout.\",\n \"Error.no.network.subTitle\": \"Attempting to reconnect... If the problem persists, report this error to\",\n \"Error.timeout.subTitle\": \"Please try again. If the problem persists, report this error to\",\n \"Error.queue.problem.title\": \"There was a problem updating the queue.\",\n \"Error.queue.problem.subTitle\":\n \"You will be unable to complete any actions until the system reconnects successfully. Please wait or refresh the page to try again.\",\n};\n\nexport default messages;\n","import en from \"./en\";\nimport fr from \"./fr\";\n\nexport type Messages = typeof en;\n\nexport const messages: Record = {\n en,\n fr,\n};\n","import { Messages } from \".\";\n\nconst messages: Messages = {\n appName: \"\",\n \"Queue.category.Waiting\": \"\",\n \"Queue.category.Waiting.description\": \"\",\n \"Queue.category.ReturnRequested\": \"\",\n \"Queue.category.ReturnRequested.description\": \"\",\n \"Queue.category.HelpNext\": \"\",\n \"Queue.category.HelpNext.description\": \"\",\n \"Button.remove\": \"\",\n \"Button.mark.as.done\": \"\",\n \"Button.request.return\": \"\",\n \"Button.request.return.again\": \"\",\n \"Button.more.actions\": \"\",\n \"Button.request.next.return\": \"\",\n \"Timestamp.since\": \"\",\n \"Timestamp.at\": \"\",\n DatetimeFormat: \"\",\n Joined: \"\",\n \"Scheduled.for\": \"\",\n Arrived: \"\",\n Requested: \"\",\n Returned: \"\",\n \"Customer.call\": \"\",\n \"Customer.cancel\": \"\",\n \"Button.select\": \"Select\",\n \"Customer.info.title\": \"\",\n \"Locations.page\": \"\",\n \"Input.search\": \"\",\n \"Drawer.title\": \"\",\n \"Drawer.change.location\": \"\",\n \"Drawer.log.out\": \"\",\n \"Landing.page\": \"\",\n \"Landing.page.button\": \"\",\n \"Error.permission.header\": \"\",\n \"Error.permission.subTitle\": \"\",\n \"Error.no.locations.subTitle\": \"\",\n \"Error.page.not.working.header\": \"\",\n \"Error.page.not.working.subTitle\": \"\",\n \"Add.customer.modal.add.customer\": \"\",\n \"Add.customer.modal.how.to.add.customer\": \"\",\n \"Add.customer.modal.reason.for.visit\": \"\",\n \"Add.customer.modal.how.to.add.customer.text\": \"\",\n \"Add.customer.modal.how.to.add.customer.schedule\": \"\",\n \"Add.customer.modal.how.to.add.customer.text.small.text\": \"\",\n \"Add.customer.modal.how.to.add.customer.schedule.small.text\": \"\",\n \"Add.customer.modal.phone\": \"\",\n \"Add.customer.modal.schedule.return.time\": \"\",\n \"Add.customer.modal.phone.number.must.be.length\": \"\",\n \"Add.customer.modal.phone.number.not.valid\": \"\",\n \"Add.customer.modal.name\": \"\",\n \"Add.customer.required.field\": \"\",\n \"Add.customer.modal.date.future\": \"\",\n \"History.card.title\": \"\",\n \"History.card.subTitle\": \"\",\n \"App.menu.active.queue.title\": \"\",\n \"App.menu.history.title\": \"\",\n \"App.menu.report.title\": \"\",\n \"Create.report.modal.select.location\": \"\",\n \"Create.report.modal.by.location\": \"\",\n \"Create.report.modal.entire.company\": \"\",\n \"Create.report.modal.locations.selected\": \"\",\n \"Request.report.date.range\": \"\",\n \"Request.report.card.subtitle\": \"\",\n \"Request.report.card.title\": \"\",\n \"Request.report.card.location.label\": \"\",\n \"Request.report.card.input.placeholder\": \"\",\n \"Button.text.export\": \"\",\n \"Request.report.alert.title\": \"\",\n \"Request.report.alert.description\": \"\",\n \"Request.report.start.date\": \"\",\n \"Request.report.end.date\": \"\",\n \"Request.report.default.name\": \"\",\n \"Button.show.more\": \"\",\n \"Button.show.less\": \"\",\n \"Error.no.network.title\": \"\",\n \"Error.timeout.subTitle\": \"\",\n \"Error.no.network.subTitle\": \"\",\n \"Error.queue.problem.title\": \"\",\n \"Error.queue.problem.subTitle\": \"\",\n};\n\nexport default messages;\n"],"sourceRoot":""}