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5D,CAEO,SAASS,EACdrI,CAAyB,CACzBG,CAAsB,MACtBN,EAAAA,CAAAA,CAAAA,UAAAA,MAAAA,CAAAA,CAAAA,GAAAA,KAAAA,IAAAA,SAAAA,CAAAA,EAAAA,EAAAA,SAAAA,CAAAA,EAAAA,CACAF,EAAAA,UAAAA,MAAAA,CAAAA,GAAAA,KAAAA,IAAAA,SAAAA,CAAAA,EAAAA,CAAAA,SAAAA,CAAAA,EAAAA,CAAmCnM,KAAAA,EAGnC,OAAO4M,EAD4BJ,EAAOH,EAAYF,GACnCU,QAAQ,CAACF,EAC9B,wJC3GA,IAAMiD,EAAQ,QACR+E,EAAW,WAGXH,EAAO,OACPD,EAAO,sGCFb,SAASxX,IAAG,QAAA+X,EAAAC,UAAA1U,MAAA,CAAA2U,EAAA,MAAAF,GAAAG,EAAA,EAAAA,EAAAH,EAAAG,IAAGD,CAAAA,CAAHC,EAAA,CAAAF,SAAA,CAAAE,EAAqB,CAC/B,MAAOC,CAAAA,EAAAA,EAAAA,EAAAA,EAAQC,CAAAA,EAAAA,EAAAA,CAAAA,EAAKH,GACtB,qCCHO,SAASJ,EAA4BQ,CAAkB,EAC5D,IAAMC,EAAc,EAAE,CACtB,IAAK,IAAMnF,KAAQkF,EACZC,EAAYxI,QAAQ,CAACqD,IACxBmF,EAAYpO,IAAI,CAACiJ,GAGrB,OAAOmF,CACT","sources":["webpack://_N_E/?a29f","webpack://_N_E/./node_modules/.pnpm/next@14.2.25_@babel+core@7.25.2_@opentelemetry+api@1.9.0_@playwright+test@1.46.1_react-dom@18_uvezhz7xw2brasxc47ilynrdsu/node_modules/next/dist/api/navigation.js","webpack://_N_E/./src/components/business/scanners/hooks/useWebSocketScannerListener.ts","webpack://_N_E/./src/components/icons/ScannerIcon.tsx","webpack://_N_E/./src/app/scan-test/components/ScanTestHeader.tsx","webpack://_N_E/./src/components/icons/ErrorFilledIcon.tsx","webpack://_N_E/./src/app/scan-test/components/ScanReadout.tsx","webpack://_N_E/./src/app/scan-test/hooks/useScanTestBiometricsListener.ts","webpack://_N_E/./src/components/icons/CameraOffIcon.tsx","webpack://_N_E/./src/app/scan-test/components/ScanTestBiometrics.tsx","webpack://_N_E/./src/lib/utils/safe-json-parse.ts","webpack://_N_E/./src/app/scan-test/components/ScanTest.tsx","webpack://_N_E/./src/app/scan-test/components/ScanTestClient.tsx","webpack://_N_E/./src/components/LoadingSpinner.tsx","webpack://_N_E/./src/components/business/printer-assignment/hooks/useDepartureStation.tsx","webpack://_N_E/./src/components/business/printer-assignment/hooks/usePositionKey.tsx","webpack://_N_E/./src/components/business/scanners/biometric-scanner/types.ts","webpack://_N_E/./src/components/business/scanners/biometric-scanner/BiometricProvider.tsx","webpack://_N_E/./src/components/business/scanners/hooks/useBgrSessionName.ts","webpack://_N_E/./src/components/business/scanners/hooks/usePlayErrorNoise.ts","webpack://_N_E/./src/components/business/scanners/hooks/usePlaySuccessNoise.ts","webpack://_N_E/./src/components/icons/CameraOnIcon.tsx","webpack://_N_E/./src/components/icons/CheckmarkFilledIcon.tsx","webpack://_N_E/./src/components/icons/CloseIcon.tsx","webpack://_N_E/./src/components/layout/dashboard/hooks/usePermission.ts","webpack://_N_E/./src/components/ui/CloseButton.tsx","webpack://_N_E/./src/components/utils/AzureActiveDirectoryProfileProvider.tsx","webpack://_N_E/./src/components/utils/FeatureToggleContext.tsx","webpack://_N_E/./src/components/utils/LoggerProvider.tsx","webpack://_N_E/./src/components/utils/ServerEnvironmentContext.tsx","webpack://_N_E/./src/config/client.ts","webpack://_N_E/./src/hooks/browser/createLocalStorageHook.ts","webpack://_N_E/./src/hooks/browser/useWindowEvent.ts","webpack://_N_E/./src/hooks/business/utils.ts","webpack://_N_E/./src/lib/dayjs.ts","webpack://_N_E/./src/lib/errors/meta/meta-error.ts","webpack://_N_E/./src/lib/errors/meta/flight-not-found-error.ts","webpack://_N_E/./src/lib/errors/meta/meta-compound-error.ts","webpack://_N_E/./src/lib/errors/meta/service-error.ts","webpack://_N_E/./src/lib/errors/unauthenticated-error.ts","webpack://_N_E/./src/lib/errors/unauthorized-error.ts","webpack://_N_E/./src/lib/errors/index.ts","webpack://_N_E/./src/lib/logger/utils.ts","webpack://_N_E/./src/lib/logger/client.ts","webpack://_N_E/./src/lib/role.ts","webpack://_N_E/./src/lib/permissions.ts","webpack://_N_E/./src/lib/server-env.ts","webpack://_N_E/./src/lib/utils/cn.ts","webpack://_N_E/./src/lib/utils/unique.ts"],"sourcesContent":["import(/* webpackMode: \"eager\", webpackExports: [\"ScanTestClient\"] */ \"/app/src/app/scan-test/components/ScanTestClient.tsx\");\n","export * from \"../client/components/navigation\";\n\n//# sourceMappingURL=navigation.js.map","import { useEffect, useRef } from 'react'\nimport {\n ScannerMessage,\n useLastScanMessage,\n} from '@/components/business/scanners/websocket-scanner/WebSocketScannerProvider'\n\nexport function useWebSocketScannerListener(listener: (scan: ScannerMessage) => unknown) {\n const lastScannerMessage = useLastScanMessage()\n const listenerRef = useRef(listener)\n\n useEffect(() => {\n listenerRef.current = listener\n }, [listener])\n\n useEffect(() => {\n if (lastScannerMessage !== undefined) {\n listenerRef.current(lastScannerMessage)\n }\n }, [lastScannerMessage])\n}\n","import { SVGProps } from 'react'\n\nexport function ScannerIcon(props: SVGProps) {\n return (\n \n \n \n )\n}\n","import { ScannerIcon } from '@/components/icons/ScannerIcon'\nimport { CloseButton } from '@/components/ui/CloseButton'\nimport { cn } from '@/lib/utils'\n\nexport type ScanTestHeaderProps = {\n onCloseClick: () => void\n className?: string\n}\n\nexport function ScanTestHeader({ onCloseClick, className }: ScanTestHeaderProps) {\n return (\n \n \n

Scanner Test

\n \n \n )\n}\n","import { SVGProps } from 'react'\n\nexport function ErrorFilledIcon(props: SVGProps) {\n return (\n \n \n \n \n \n \n \n \n \n \n )\n}\n","import { LoadingSpinner } from '@/components/LoadingSpinner'\nimport { CheckmarkFilledIcon } from '@/components/icons/CheckmarkFilledIcon'\nimport { ErrorFilledIcon } from '@/components/icons/ErrorFilledIcon'\nimport { cn } from '@/lib/utils'\n\nconst readoutStyling: Record = {\n success: {\n color: '#418B44',\n icon: ,\n },\n error: {\n color: '#ff0000',\n icon: ,\n },\n loading: {\n color: '',\n icon: ,\n },\n} as const\n\nexport type ScanReadoutProps = {\n type: 'success' | 'error' | 'loading'\n source: 'BGR Scanner' | 'Biometric Scanner'\n readout: string | undefined\n deviceId: string | undefined\n timestamp: string | undefined\n className?: string\n}\n\nexport function ScanReadout({\n type,\n source,\n readout,\n deviceId,\n timestamp,\n className,\n}: ScanReadoutProps) {\n return (\n
\n {readoutStyling[type].icon}\n
\n

{source}

\n
\n

{readout}

\n

{deviceId ?? '--'}

\n
\n

{timestamp}

\n
\n
\n )\n}\n","'use client'\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { ScanReadoutProps } from '@/app/scan-test/components/ScanReadout'\nimport { dayjs } from '@/lib/dayjs'\nimport axios from 'axios'\nimport { usePositionKey } from '@/components/business/printer-assignment/hooks/usePositionKey'\nimport { FlightDescriptor } from '@/business/flight-descriptor'\nimport { WebPubSubClient } from '@azure/web-pubsub-client'\nimport { useBgrSessionName } from '@/components/business/scanners/hooks/useBgrSessionName'\n\nexport type ScanTestBiometricsProps = {\n originDate: string\n departureStation: string\n flightNumber: string\n carrier: string\n arrivalAirport: string\n workstationId: string\n}\n\nexport function useScanTestBiometricsListener(\n listener: (scanReadOut: ScanReadoutProps, loadingTimesamp?: string) => unknown,\n biometricsProps?: ScanTestBiometricsProps\n) {\n const [biometricClient, setBiometricClient] = useState(undefined)\n const listenerRef = useRef(listener)\n const [positionKey] = usePositionKey()\n const [bgrSessionName] = useBgrSessionName()\n const workstationId = bgrSessionName || positionKey\n\n useEffect(() => {\n if (biometricClient && workstationId) {\n const intervalId = setInterval(() => {\n biometricClient.sendEvent('heartbeat', { workstationId }, 'json')\n }, 10_000)\n return () => {\n clearInterval(intervalId)\n }\n }\n return () => {}\n }, [biometricClient, workstationId])\n\n useEffect(() => {\n listenerRef.current = listener\n }, [listener])\n\n const getManualFlightDescriptor = useCallback(\n (gateInput: string): FlightDescriptor => ({\n departureAirport: biometricsProps?.departureStation,\n flightDate: biometricsProps?.originDate,\n carrier: biometricsProps?.carrier,\n arrivalAirport: biometricsProps?.arrivalAirport,\n flightNumber: biometricsProps?.flightNumber,\n gate: gateInput,\n }),\n [biometricsProps]\n )\n\n const resetBiometrics = biometricsProps\n ? async (gateInput: string): Promise => {\n const loadingTimesamp = dayjs().format('YYYY-MM-DD HH:mm:ss.SSS')\n listenerRef.current({\n type: 'loading',\n source: 'Biometric Scanner',\n readout: 'Resetting Biometric Connection...',\n deviceId: undefined,\n timestamp: loadingTimesamp,\n })\n await axios\n .post('/api/rpc/biometrics/scan-test/close-flight', {\n departureStation: biometricsProps.departureStation,\n workstationId,\n })\n .then(() => {\n axios\n .post('/api/rpc/biometrics/scan-test/register', {\n departureStation: biometricsProps.departureStation,\n workstationId: biometricsProps.workstationId,\n flightDescriptor: getManualFlightDescriptor(gateInput),\n })\n .then((res) => {\n if (res !== undefined) {\n listenerRef.current(\n {\n type: 'success',\n source: 'Biometric Scanner',\n readout: 'Biometric Connection Reset',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n } else {\n listenerRef.current(\n {\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Failed to Reset Biometric Connection',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n }\n })\n })\n .catch(() => {\n listenerRef.current(\n {\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Failed to Reset Biometric Connection',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n })\n }\n : undefined\n\n const registerBiometrics = biometricsProps\n ? async (gateInput: string) => {\n const loadingTimesamp = dayjs().format('YYYY-MM-DD HH:mm:ss.SSS')\n listenerRef.current({\n type: 'loading',\n source: 'Biometric Scanner',\n readout: 'Registering Biometric Device...',\n deviceId: undefined,\n timestamp: loadingTimesamp,\n })\n axios\n .post('/api/rpc/biometrics/scan-test/register', {\n departureStation: biometricsProps.departureStation,\n workstationId: biometricsProps.workstationId,\n flightDescriptor: getManualFlightDescriptor(gateInput),\n })\n .then(async (resp) => {\n if (!resp.data.registrationUrl) {\n setBiometricClient(undefined)\n listenerRef.current(\n {\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Failed to Register Biometric Device',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n return undefined\n }\n const client = new WebPubSubClient(resp.data.registrationUrl)\n await client.start()\n setBiometricClient(client)\n listenerRef.current(\n {\n type: 'success',\n source: 'Biometric Scanner',\n readout: 'Registered Biometric Device',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n return client\n })\n .catch(() => {\n listenerRef.current(\n {\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Failed to Register Biometric Device',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n })\n }\n : undefined\n\n const changeCameraState = biometricsProps\n ? async (newCameraState: 'on' | 'off'): Promise<{ cameraOn: boolean }> => {\n if (newCameraState === 'on') {\n const loadingTimesamp = dayjs().toISOString()\n listenerRef.current({\n type: 'loading',\n source: 'Biometric Scanner',\n readout: 'Turning Camera On...',\n deviceId: undefined,\n timestamp: loadingTimesamp,\n })\n return axios\n .post('/api/rpc/biometrics/scan-test/toggle-camera', {\n departureStation: 'DFW',\n workstationId,\n action: 'on',\n })\n .then(async () => {\n listenerRef.current(\n {\n type: 'success',\n source: 'Biometric Scanner',\n readout: 'Camera On',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n return { cameraOn: true }\n })\n .catch(() => {\n listenerRef.current(\n {\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Unable to Activate Camera',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n return { cameraOn: false }\n })\n }\n const loadingTimesamp = dayjs().toISOString()\n listenerRef.current({\n type: 'loading',\n source: 'Biometric Scanner',\n readout: 'Turning Camera Off...',\n deviceId: undefined,\n timestamp: loadingTimesamp,\n })\n return axios\n .post('/api/rpc/biometrics/scan-test/toggle-camera', {\n departureStation: 'DFW',\n workstationId,\n action: 'off',\n })\n .then(async () => {\n listenerRef.current(\n {\n type: 'success',\n source: 'Biometric Scanner',\n readout: 'Camera Off',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n return { cameraOn: false }\n })\n .catch(() => {\n listenerRef.current(\n {\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Unable to Turn Off Camera',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n },\n loadingTimesamp\n )\n return { cameraOn: true }\n })\n }\n : undefined\n\n useEffect(() => {\n biometricClient?.on('disconnected', () => {\n listenerRef.current({\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Device Disconnected',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n })\n })\n\n biometricClient?.on('stopped', () => {\n listenerRef.current({\n type: 'error',\n source: 'Biometric Scanner',\n readout: 'Client has stopped',\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n })\n })\n\n biometricClient?.on('group-message', (e) => {\n listenerRef.current({\n type: 'success',\n source: 'Biometric Scanner',\n readout: `Group message received: ${JSON.stringify(e.message.data)}`,\n deviceId: undefined,\n timestamp: dayjs().toISOString(),\n })\n })\n }, [biometricClient])\n\n return { changeCameraState, registerBiometrics, resetBiometrics, biometricClient }\n}\n","import { SVGProps } from 'react'\n\nexport function CameraOffIcon(props: SVGProps) {\n return (\n \n \n \n )\n}\n","import { useBiometrics } from '@/components/business/scanners/biometric-scanner/BiometricProvider'\nimport { useState } from 'react'\nimport { ScanReadout, ScanReadoutProps } from '@/app/scan-test/components/ScanReadout'\nimport { useLogger } from '@/components/utils/LoggerProvider'\nimport {\n ScanTestBiometricsProps,\n useScanTestBiometricsListener,\n} from '@/app/scan-test/hooks/useScanTestBiometricsListener'\nimport { CameraOnIcon } from '@/components/icons/CameraOnIcon'\nimport { CameraOffIcon } from '@/components/icons/CameraOffIcon'\nimport { cn } from '@/lib/utils'\nimport { dayjs } from '@/lib/dayjs'\n\ntype ScanTestBiometricsComponentProps = {\n biometricsProps?: ScanTestBiometricsProps\n}\n\nexport function ScanTestBiometrics({ biometricsProps }: ScanTestBiometricsComponentProps) {\n const biometrics = useBiometrics()\n const { logger } = useLogger()\n const [cameraButtonDisabled, setCameraButtonDisabled] = useState(false)\n const [registerButtonDisabled, setRegisterButtonDisabled] = useState(false)\n const [biometricScanReadouts, setBiometricScanReadouts] = useState([])\n const [gateInput, setGateInput] = useState('')\n const [cameraOn, setCameraOn] = useState(false)\n\n const handleScan = (scanData: ScanReadoutProps, loadingTimestamp?: string) => {\n setBiometricScanReadouts((previous) => {\n if (loadingTimestamp !== undefined) {\n return previous.map((scan) => (scan.timestamp === loadingTimestamp ? scanData : scan))\n }\n const scans = [...previous, scanData]\n if (scans.length > 3) {\n scans.shift()\n }\n return scans\n })\n if (scanData.type === 'success') {\n logger.info({\n scope: 'src/app/scan-test/components/ScanTest.tsx::ScanTest',\n detail: 'scan-test-success',\n metadata: { ...scanData },\n })\n } else {\n logger.error({\n scope: 'src/app/scan-test/components/ScanTest.tsx::ScanTest',\n detail: 'scan-test-error',\n metadata: { ...scanData },\n })\n }\n }\n\n const { changeCameraState, registerBiometrics, resetBiometrics, biometricClient } =\n useScanTestBiometricsListener((scanReadout, loadingTimestamp) => {\n handleScan(scanReadout, loadingTimestamp)\n }, biometricsProps)\n\n const biometricsActive =\n biometrics !== undefined &&\n changeCameraState !== undefined &&\n registerBiometrics !== undefined &&\n resetBiometrics !== undefined\n\n if (biometricsActive) {\n return (\n
\n

or

\n
\n \n
\n {\n setGateInput(event.target.value.toUpperCase())\n }}\n className={cn(\n 'col-span-1 w-full rounded border px-4 py-3',\n 'border-[#0860C4] outline-none dark:border-[#1A94FF] dark:bg-[#2B2B2B]',\n 'disabled:border-[#B4C1CF] disabled:bg-[#F3F5F7] disabled:text-[#50657C]'\n )}\n />\n {biometricClient === undefined ? (\n {\n setRegisterButtonDisabled(true)\n await registerBiometrics(gateInput)\n setRegisterButtonDisabled(false)\n }}\n className={cn(\n 'text-md col-span-1 rounded border px-2 py-1 font-medium text-white',\n 'border-[#0860C4] bg-[#085ABD] dark:border-[#1A94FF] dark:bg-[#1A94FF]',\n 'disabled:border-slate-400 disabled:bg-slate-400'\n )}\n >\n Register\n \n ) : (\n {\n setRegisterButtonDisabled(true)\n setCameraButtonDisabled(true)\n await resetBiometrics(gateInput)\n setCameraOn(false)\n setCameraButtonDisabled(false)\n setRegisterButtonDisabled(false)\n }}\n className={cn(\n 'text-md col-span-1 rounded border px-2 py-1 font-medium text-white',\n 'border-[#0860C4] bg-[#085ABD] dark:border-[#1A94FF] dark:bg-[#1A94FF]',\n 'disabled:border-slate-400 disabled:bg-slate-400'\n )}\n >\n Reset\n \n )}\n {cameraOn ? (\n {\n setCameraButtonDisabled(true)\n const newCameraState = await changeCameraState(cameraOn ? 'off' : 'on')\n setCameraOn(newCameraState.cameraOn)\n setCameraButtonDisabled(false)\n }}\n className={cn(\n 'text-md flex flex-row items-center justify-center gap-2 rounded border px-4 py-3 font-medium text-white',\n 'border-[#0860C4] bg-[#085ABD] dark:border-[#1A94FF] dark:bg-[#1A94FF]',\n 'col-span-2 disabled:border-slate-400 disabled:bg-slate-400 md:col-span-1'\n )}\n >\n \n Turn off camera\n \n ) : (\n {\n setCameraButtonDisabled(true)\n const newCameraState = await changeCameraState(cameraOn ? 'off' : 'on')\n setCameraOn(newCameraState.cameraOn)\n setCameraButtonDisabled(false)\n }}\n className={cn(\n 'text-md flex flex-row items-center justify-center gap-2 rounded border px-4 py-3 font-medium text-white',\n 'border-[#0860C4] bg-[#085ABD] dark:border-[#1A94FF] dark:bg-[#1A94FF]',\n 'col-span-2 disabled:border-slate-400 disabled:bg-slate-400 md:col-span-1'\n )}\n >\n \n Turn on camera\n \n )}\n
\n
\n {biometricScanReadouts.length > 0 && (\n
\n {biometricScanReadouts.map((scanReadout) => (\n \n ))}\n
\n )}\n
\n )\n }\n return null\n}\n","export function safeJsonParse(stringToParse: string): {\n success: boolean\n data?: T\n error?: unknown\n} {\n try {\n return { success: true, data: JSON.parse(stringToParse) }\n } catch (e) {\n return { success: false, error: e }\n }\n}\n","'use client'\n\nimport { useWebSocketScannerListener } from '@/components/business/scanners/hooks/useWebSocketScannerListener'\nimport { useCallback, useState } from 'react'\nimport { useRouter } from 'next/navigation'\nimport { ScanTestHeader } from '@/app/scan-test/components/ScanTestHeader'\nimport { ScanReadout, ScanReadoutProps } from '@/app/scan-test/components/ScanReadout'\nimport { useLogger } from '@/components/utils/LoggerProvider'\nimport { ScanTestBiometricsProps } from '@/app/scan-test/hooks/useScanTestBiometricsListener'\nimport { ScanTestBiometrics } from '@/app/scan-test/components/ScanTestBiometrics'\nimport { dayjs } from '@/lib/dayjs'\nimport { usePlayErrorNoise } from '@/components/business/scanners/hooks/usePlayErrorNoise'\nimport { usePlaySuccessNoise } from '@/components/business/scanners/hooks/usePlaySuccessNoise'\nimport { safeJsonParse } from '@/lib/utils/safe-json-parse'\nimport {\n DeviceStatusSchema,\n OldWebSocketScannerExceptionSchema,\n SystemInfoSchema,\n} from '@/components/business/scanners/websocket-scanner/WebSocketScannerProvider'\n\ntype ScanTestProps = {\n biometricsProps?: ScanTestBiometricsProps\n}\n\nconst webSocketNoise = [\n /^Found - BGR$/,\n /^Found - LSR$/,\n /^IER.*/,\n /^AEA.*/,\n /^CC$/,\n /^Autograbbed \\d+ Device\\(s\\)$/,\n /^DISCONNECTED$/,\n]\n\nfunction isWebSocketNoise(barcode: string): boolean {\n // TODO: Remove the LSR exception noise check once updates to WS/Concentrator has been pushed out\n const parseResult = safeJsonParse(barcode)\n if (parseResult.success) {\n const systemInfoParseResult = SystemInfoSchema.safeParse(parseResult.data)\n if (systemInfoParseResult.success) {\n return true\n }\n\n const deviceStatusParseResult = DeviceStatusSchema.safeParse(parseResult.data)\n if (deviceStatusParseResult.success) {\n return true\n }\n\n const oldWebSocketScannerExceptionParseResult = OldWebSocketScannerExceptionSchema.safeParse(\n parseResult.data\n )\n if (\n oldWebSocketScannerExceptionParseResult.success &&\n oldWebSocketScannerExceptionParseResult.data.Message ===\n 'Object reference not set to an instance of an object.'\n ) {\n return true\n }\n }\n\n return webSocketNoise.some((regex) => regex.test(barcode))\n}\n\nfunction parseOldWebSocketError(barcode: string): string | undefined {\n const parseResult = safeJsonParse(barcode)\n if (parseResult.success) {\n const schemaParseResult = OldWebSocketScannerExceptionSchema.safeParse(parseResult.data)\n if (schemaParseResult.success) {\n return schemaParseResult.data.Message\n }\n }\n\n return undefined\n}\n\nexport function ScanTest({ biometricsProps }: ScanTestProps) {\n const router = useRouter()\n const [scanReadouts, setScanReadouts] = useState([])\n const { logger } = useLogger()\n const playSuccessNoise = usePlaySuccessNoise()\n const playErrorNoise = usePlayErrorNoise()\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const handleScan = useCallback(\n (scanData: ScanReadoutProps) => {\n setScanReadouts((previous) => {\n const scans = [...previous, scanData]\n if (scans.length > 3) {\n scans.shift()\n }\n return scans\n })\n if (scanData.type === 'success') {\n playSuccessNoise({\n status: 'ok',\n line1: 'Successful Scan',\n line2: `Successful Scan`,\n })\n logger.info({\n scope: 'src/app/scan-test/components/ScanTest.tsx::ScanTest',\n detail: 'scan-test-success',\n metadata: { ...scanData },\n })\n } else {\n playErrorNoise({\n status: 'error',\n line1: 'Error Scan',\n line2: 'Error Scan',\n })\n logger.error({\n scope: 'src/app/scan-test/components/ScanTest.tsx::ScanTest',\n detail: 'scan-test-error',\n metadata: { ...scanData },\n })\n }\n },\n [logger, playSuccessNoise, playErrorNoise]\n )\n\n useWebSocketScannerListener(\n useCallback(\n (scannerMessage) => {\n if (isWebSocketNoise(scannerMessage.barcode)) return\n\n const result = parseOldWebSocketError(scannerMessage.barcode)\n if (result !== undefined) {\n handleScan({\n type: 'error',\n source: 'BGR Scanner',\n readout: result || 'Exception occured. No Message',\n deviceId: '--',\n timestamp: dayjs().toISOString(),\n })\n return\n }\n\n handleScan({\n type: scannerMessage.barcode === 'Failed parse' ? 'error' : 'success',\n source: 'BGR Scanner',\n readout: scannerMessage.barcode,\n deviceId: scannerMessage.deviceId,\n timestamp: dayjs().toISOString(),\n })\n },\n [handleScan]\n )\n )\n\n return (\n
\n
\n router.push('/home')} />\n
\n {scanReadouts.length === 0 ? (\n

Scan to begin test

\n ) : (\n <>\n {scanReadouts.map((scanReadout) => (\n \n ))}\n \n )}\n
\n \n
\n
\n )\n}\n","'use client'\n\nimport { ScanTest } from '@/app/scan-test/components/ScanTest'\nimport { useDepartureStation } from '@/components/business/printer-assignment/hooks/useDepartureStation'\nimport { usePositionKey } from '@/components/business/printer-assignment/hooks/usePositionKey'\nimport { useBgrSessionName } from '@/components/business/scanners/hooks/useBgrSessionName'\nimport { WebSocketScannerProvider } from '@/components/business/scanners/websocket-scanner/WebSocketScannerProvider'\nimport { useFeatureToggle } from '@/components/utils/FeatureToggleContext'\nimport { dayjs } from '@/lib/dayjs'\n\nexport function ScanTestClient() {\n const [departureStation] = useDepartureStation()\n const [bgrSessionName] = useBgrSessionName()\n const [workstationId] = usePositionKey()\n const biometricsToggle = useFeatureToggle('FT_BIOMETRICS_SCAN_TEST')\n\n return (\n
\n {!biometricsToggle || departureStation === undefined || workstationId === undefined ? (\n \n \n \n ) : (\n \n \n \n )}\n
\n )\n}\n","import { OverrideProps, cn } from '@/lib/utils'\n\nexport type LoadingSpinnerProps = OverrideProps<\n 'svg',\n {\n classNames?: {\n svg?: string\n circle?: string\n path?: string\n }\n }\n>\n\nexport function LoadingSpinner({ classNames, className, ...props }: LoadingSpinnerProps) {\n return (\n \n \n \n \n )\n}\n","import { createLocalStorageHook } from '@/hooks/browser/createLocalStorageHook'\nimport { z } from 'zod'\n\nexport const useDepartureStation = createLocalStorageHook(\n 'departure-station',\n z.string().optional()\n)\n","import { createLocalStorageHook } from '@/hooks/browser/createLocalStorageHook'\nimport { z } from 'zod'\n\nexport const usePositionKey = createLocalStorageHook('position-key', z.string().optional())\n","import { z } from 'zod'\n\ntype BiometricVerificationData = {\n upid: string\n workstationId: string\n transactionId: string\n}\n\nconst BiometricVerificationDataSchema = z.object({\n upid: z.string(),\n workstationId: z.string(),\n transactionId: z.string(),\n})\n\nexport function isBiometricVerificationData(obj: unknown): obj is BiometricVerificationData {\n return BiometricVerificationDataSchema.safeParse(obj).success\n}\n","/* eslint-disable react/jsx-no-constructed-context-values */\n\n'use client'\n\nimport { ReactNode, createContext, useCallback, useContext, useEffect, useState } from 'react'\nimport { WebPubSubClient, OnGroupDataMessageArgs } from '@azure/web-pubsub-client'\nimport axios from 'axios'\nimport useSWR from 'swr'\nimport { useFeatureToggle } from '@/components/utils/FeatureToggleContext'\nimport { createDurationSwrMiddleware } from '@/hooks/business/utils'\nimport { useLogger } from '@/components/utils/LoggerProvider'\nimport { usePositionKey } from '@/components/business/printer-assignment/hooks/usePositionKey'\nimport { isBiometricVerificationData } from '@/components/business/scanners/biometric-scanner/types'\nimport { useBgrSessionName } from '@/components/business/scanners/hooks/useBgrSessionName'\n\ntype BiometricContextType = {\n registrationUrl: string | undefined\n workstationId: string | undefined\n biometricClient: WebPubSubClient | undefined\n isBiometricFlight: boolean\n setBiometricClient: (client: WebPubSubClient | undefined) => void\n refetch: () => void\n}\n\nexport const BiometricContext = createContext({\n registrationUrl: undefined,\n workstationId: undefined,\n biometricClient: undefined,\n isBiometricFlight: false,\n setBiometricClient: () => {},\n refetch: () => {},\n})\n\ntype BiometricPassengerContextType = {\n passengerUpid: string | undefined\n setPassengerUpid: (upid: string | undefined) => void\n transactionId: string | undefined\n setTransactionId: (transactionId: string | undefined) => void\n}\n\nexport const BiometricPassengerContext = createContext({\n passengerUpid: undefined,\n setPassengerUpid: () => {},\n transactionId: undefined,\n setTransactionId: () => {},\n})\n\ntype BiometricProviderProps = {\n originDate: string\n departureStation: string\n flightNumber: string | number\n children: ReactNode\n}\n\nexport function BiometricProvider({\n originDate,\n departureStation,\n flightNumber,\n children,\n}: BiometricProviderProps) {\n const [biometricClient, setBiometricClient] = useState(undefined)\n const { logger } = useLogger()\n const [isBiometricFlight, setIsBiometricFlight] = useState(false)\n const [passengerUpid, setPassengerUpid] = useState(undefined)\n const [transactionId, setTransactionId] = useState(undefined)\n const BIOMETRIC_REGISTRATION = useFeatureToggle('FT_BIOMETRIC_REGISTRATION')\n const [positionKey] = usePositionKey()\n const [bgrSessionName] = useBgrSessionName()\n const workstationId = bgrSessionName || positionKey // Dev workstationId PHX141456\n const shouldRegister = BIOMETRIC_REGISTRATION && workstationId !== undefined\n\n const register = useCallback(\n async (): Promise =>\n axios\n .post('/api/rpc/biometrics/register', {\n originDate,\n departureStation,\n flightNumber,\n workstationId,\n })\n .then(async (resp) => {\n if (!resp.data.registrationUrl) {\n setBiometricClient(undefined)\n setIsBiometricFlight(false)\n return undefined\n }\n const client = new WebPubSubClient(resp.data.registrationUrl)\n await client.start()\n setBiometricClient(client)\n setIsBiometricFlight(true)\n return resp.data.registrationUrl\n })\n .catch(() => {\n setBiometricClient(undefined)\n return undefined\n }),\n [originDate, departureStation, flightNumber, workstationId]\n )\n\n const { data } = useSWR(\n shouldRegister ? '/api/rpc/biometrics/register' : null,\n // SWR sends url as first arugment to fetcher function, ignore it\n () => register(),\n {\n refreshInterval: 3_300_000, // 55 minutes\n revalidateOnFocus: false,\n refreshWhenHidden: true,\n use: [\n createDurationSwrMiddleware(logger, '/api/rpc/biometrics/register', {\n originDate,\n departureStation,\n flightNumber,\n workstationId,\n }),\n ],\n }\n )\n\n useEffect(() => {\n if (biometricClient && workstationId) {\n const intervalId = setInterval(() => {\n biometricClient.sendEvent('heartbeat', { workstationId }, 'json')\n }, 10_000)\n return () => clearInterval(intervalId)\n }\n return () => {}\n }, [biometricClient, workstationId])\n\n // ignoring dependencies because we only want this to run when the client changes, not the workstationId (although it shouldn't change)\n useEffect(() => {\n const handler = (e: OnGroupDataMessageArgs) => {\n if (isBiometricVerificationData(e.message.data)) {\n const { upid, transactionId, workstationId: receivedWorkstationId } = e.message.data\n if (receivedWorkstationId === workstationId) {\n logger.info({\n scope: 'src/components/business/scanners/biometric-scanner/BiometricProvider.ts',\n detail: 'biometric-upid-received',\n metadata: {\n originDate,\n departureStation,\n flightNumber,\n upid,\n transactionId,\n workstationId,\n },\n })\n setPassengerUpid(upid)\n setTransactionId(transactionId)\n }\n }\n }\n biometricClient?.on('group-message', handler)\n return () => biometricClient?.off('group-message', handler)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [biometricClient])\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport function useBiometrics() {\n return useContext(BiometricContext)\n}\n\nexport function useBiometricPassenger() {\n return useContext(BiometricPassengerContext)\n}\n","import { createLocalStorageHook } from '@/hooks/browser/createLocalStorageHook'\nimport { z } from 'zod'\n\nexport const useBgrSessionName = createLocalStorageHook('bgr-session-name', z.string())\n","import { useScannerType } from '@/components/business/scanners/ScannerTypeProvider'\nimport {\n WebSocketScannerCommand,\n WebsocketScannerPlayErrorNoiseContext,\n WebsocketScannerPlayExitRowNoiseContext,\n WebsocketScannerPlayBoardingAlertContext,\n} from '@/components/business/scanners/websocket-scanner/WebSocketScannerProvider'\nimport { useContext } from 'react'\nimport {\n playFailureAudio,\n playExitRowAudio,\n playBoardingAlertAudio,\n} from '@/components/business/scanners/sounds'\n\nexport function usePlayErrorNoise(): (command: WebSocketScannerCommand) => unknown {\n const scannerType = useScannerType()\n const playWebsocketScannerErrorNoise = useContext(WebsocketScannerPlayErrorNoiseContext)\n if (scannerType === 'camera' || scannerType === 'keyboard-wedge') {\n return playFailureAudio\n }\n return playWebsocketScannerErrorNoise\n}\n\nexport function usePlayExitRowNoise(): (command: WebSocketScannerCommand) => unknown {\n const scannerType = useScannerType()\n const playWebsocketScannerExitRowNoise = useContext(WebsocketScannerPlayExitRowNoiseContext)\n if (scannerType === 'camera' || scannerType === 'keyboard-wedge') {\n return playExitRowAudio\n }\n return playWebsocketScannerExitRowNoise\n}\n\nexport function usePlayBoardingAlertNoise(): (command: WebSocketScannerCommand) => unknown {\n const scannerType = useScannerType()\n const playWebsocketScannerBoardingAlertNoise = useContext(\n WebsocketScannerPlayBoardingAlertContext\n )\n if (scannerType === 'camera' || scannerType === 'keyboard-wedge') {\n return playBoardingAlertAudio\n }\n return playWebsocketScannerBoardingAlertNoise\n}\n","import { useScannerType } from '@/components/business/scanners/ScannerTypeProvider'\nimport {\n WebSocketScannerCommand,\n WebsocketScannerPlaySuccessNoiseContext,\n} from '@/components/business/scanners/websocket-scanner/WebSocketScannerProvider'\nimport { useContext } from 'react'\nimport { playSuccessAudio } from '@/components/business/scanners/sounds'\n\nexport function usePlaySuccessNoise(): (command: WebSocketScannerCommand) => unknown {\n const scannerType = useScannerType()\n const playWebsocketScannerSuccessNoise = useContext(WebsocketScannerPlaySuccessNoiseContext)\n if (scannerType === 'camera' || scannerType === 'keyboard-wedge') {\n return playSuccessAudio\n }\n return playWebsocketScannerSuccessNoise\n}\n","import { SVGProps } from 'react'\n\nexport function CameraOnIcon(props: SVGProps) {\n return (\n \n \n \n )\n}\n","import { SVGProps } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nexport function CheckmarkFilledIcon(props: SVGProps) {\n const id = uuid()\n return (\n \n \n \n \n \n \n \n \n \n )\n}\n","import { SVGProps } from 'react'\n\nexport function CloseIcon(props: SVGProps) {\n return (\n \n \n \n )\n}\n","'use client'\n\nimport { useUserProfile } from '@/components/utils/AzureActiveDirectoryProfileProvider'\nimport { useFeatureToggle } from '@/components/utils/FeatureToggleContext'\nimport { useServerEnvInfo } from '@/components/utils/ServerEnvironmentContext'\nimport { getPermissions, Permission } from '@/lib/permissions'\nimport { useParams } from 'next/navigation'\n\nexport function usePermissions(): Permission[] {\n const profile = useUserProfile()\n const departureStation = useParams()\n const override = useFeatureToggle('FT_PERMISSIONS_OVERRIDE')\n const { serverEnv } = useServerEnvInfo()\n\n if (!profile || !departureStation.departureStation) {\n return []\n }\n\n const atHomeCity = profile.city === departureStation.departureStation\n const allRoles = profile.roles\n return getPermissions(allRoles, atHomeCity, serverEnv, override)\n}\n\nexport function usePermissionValidation(permission: Permission): boolean {\n const permissions = usePermissions()\n const hasPermission = permissions.includes(permission)\n\n return hasPermission\n}\n","import { CloseIcon } from '@/components/icons/CloseIcon'\nimport { cn } from '@/lib/utils'\nimport { FocusEventHandler, ForwardedRef, MouseEventHandler, forwardRef } from 'react'\n\nexport type CloseButtonProps = {\n onClick?: MouseEventHandler\n onFocus?: FocusEventHandler\n onBlur?: FocusEventHandler\n autoFocus?: boolean\n className?: string\n}\n\nexport const CloseButton = forwardRef(\n (\n { onClick, onFocus, onBlur, autoFocus, className }: CloseButtonProps,\n ref: ForwardedRef\n ) => (\n \n \n \n )\n)\n","'use client'\n\nimport { AzureActiveDirectoryProfile } from '@/lib/auth'\nimport { Role } from '@/lib/role'\nimport { createContext, ReactNode, useContext, useMemo } from 'react'\n\nexport type UserProfile = {\n email: string\n firstName: string\n lastName: string\n id: string\n roles: Role[]\n city?: string\n}\n\nconst AzureActiveDirectoryProfileAgentContext = createContext(undefined)\n\nexport type AzureActiveDirectoryProfileProviderProps = {\n profile: AzureActiveDirectoryProfile | undefined\n children?: ReactNode\n}\n\nexport function AzureActiveDirectoryProfileProvider({\n profile,\n children,\n}: AzureActiveDirectoryProfileProviderProps) {\n return (\n \n profile !== undefined\n ? {\n email: profile.email,\n firstName: profile.firstName,\n lastName: profile.lastName,\n id: profile.upn.split('@')[0],\n roles: profile.groupIds,\n city: profile.city,\n }\n : undefined,\n [profile]\n )}\n >\n {children}\n \n )\n}\n\nexport function useUserProfile() {\n return useContext(AzureActiveDirectoryProfileAgentContext)\n}\n","'use client'\n\nimport axios from 'axios'\n/* eslint-disable react/jsx-no-useless-fragment */\nimport { ReactNode, createContext, useContext, useMemo } from 'react'\nimport useSWR from 'swr'\n\nconst FeatureToggleMapContext = createContext>(new Map())\n\nexport type FeatureToggleProviderProps = {\n children: ReactNode\n [key: string]: boolean | ReactNode\n}\n\nexport function FeatureToggleProvider({ children, ...fallbackData }: FeatureToggleProviderProps) {\n const fallbackFeatureToggles = Object.entries(fallbackData)\n .filter((pair): pair is [string, boolean] => typeof pair[1] === 'boolean')\n .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {} as Record)\n\n const featureToggles = useSWR(\n `/api/feature-toggles` as string,\n (url) => axios.get>(url).then((response) => response.data),\n {\n fallbackData: fallbackFeatureToggles,\n refreshInterval: 60 * 1_000,\n }\n )\n return (\n new Map(Object.entries(featureToggles.data)), [featureToggles.data])}\n >\n {children}\n \n )\n}\n\nexport function useFeatureToggle(key: string): boolean {\n const featureToggleMap = useContext(FeatureToggleMapContext)\n return featureToggleMap.get(key) ?? false\n}\n\nexport type FeatureToggleProps = {\n feature: string\n on?: ReactNode\n off?: ReactNode\n}\n\nexport function FeatureToggle({ on, off, feature }: FeatureToggleProps) {\n const isEnabled = useFeatureToggle(feature)\n return <>{isEnabled ? on : off}\n}\n","'use client'\n\nimport { env } from '@/config/client'\nimport { createStructuredLoggerFromConsole } from '@/lib/logger/client'\nimport { StructuredLogger } from '@/lib/logger/types'\nimport { Dispatch, ReactNode, SetStateAction, createContext, useContext, useState } from 'react'\nimport { useReportWebVitals } from 'next/web-vitals'\n\nconst defaultLogger = createStructuredLoggerFromConsole(console, {\n version: env.NEXT_PUBLIC_APP_VERSION,\n})\n\nexport type LoggerProviderProps = {\n children?: ReactNode\n}\nconst LoggerContext = createContext(undefined)\n\nconst SetLoggerContext = createContext>>(\n () => {}\n)\n\nexport function LoggerProvider({ children }: LoggerProviderProps) {\n const [logger, setLogger] = useState(undefined)\n useReportWebVitals((metric) =>\n logger?.info({\n detail: 'web-vital',\n scope: 'src/components/utils/LoggerProvider::LoggerProvider',\n metadata: metric,\n })\n )\n return (\n \n {children}\n \n )\n}\n\nexport const useSetLogger = () => useContext(SetLoggerContext)\n\nexport type Logger = {\n logger: StructuredLogger\n type: 'app-insights' | 'console'\n}\n\n/**\n * FIXME: long-term, we should implement a logger-buffer\n * to store logs when app insights isn't loaded in, so we\n * can still capture and export telemetry without changing business\n * logic in the application.\n */\nexport const useLogger = (): Logger => {\n const logger = useContext(LoggerContext)\n if (logger !== undefined) {\n return { logger, type: 'app-insights' }\n }\n return { logger: defaultLogger, type: 'console' }\n}\n","'use client'\n\nimport { createContext, useContext, ReactNode, useMemo } from 'react'\nimport { LOCAL, ServerEnv } from '@/lib/server-env'\n\nexport type ServerEnvInfo = {\n serverEnv: ServerEnv\n envSwitchUrl: string\n}\n\nconst ServerEnvironmentContext = createContext({\n serverEnv: LOCAL,\n envSwitchUrl: '',\n})\n\nexport function useServerEnvInfo() {\n return useContext(ServerEnvironmentContext)\n}\n\nexport type ServerEnvironmentProviderProps = {\n serverEnv: ServerEnv\n envSwitchUrl: string\n children?: ReactNode\n}\n\nexport function ServerEnvironmentProvider({\n serverEnv,\n envSwitchUrl,\n children,\n}: ServerEnvironmentProviderProps) {\n return (\n ({ serverEnv, envSwitchUrl }), [serverEnv, envSwitchUrl])}\n >\n {children}\n \n )\n}\n","import { z } from 'zod'\n\nconst env = {\n NEXT_PUBLIC_APP_VERSION: z.string().parse(process.env.NEXT_PUBLIC_APP_VERSION),\n}\n\nexport { env }\n","import { useLogger } from '@/components/utils/LoggerProvider'\nimport { useWindowEvent } from '@/hooks/browser/useWindowEvent'\nimport { Dispatch, SetStateAction, useCallback, useEffect, useState } from 'react'\nimport { z } from 'zod'\n\nexport function readLocalStorage(key: string, schema: z.ZodType): T | undefined {\n const item = window.localStorage.getItem(key)\n if (item === null) {\n return undefined\n }\n try {\n const result = schema.safeParse(JSON.parse(item))\n return result.success ? result.data : undefined\n } catch {\n return undefined\n }\n}\n\nfunction updateLocalStorage(key: string, value: T | undefined) {\n if (value === undefined) {\n window.localStorage.removeItem(key)\n } else {\n window.localStorage.setItem(key, JSON.stringify(value))\n }\n}\n\nexport type LocalStorageHook = (\n initialState?: T | (() => T)\n) => [T | undefined, Dispatch>]\n\nexport function createLocalStorageHook(\n key: string,\n schema: z.ZodType\n): LocalStorageHook {\n return (initialState?: T | (() => T)) => {\n const { logger } = useLogger()\n const [state, setState] = useState(initialState)\n useEffect(() => {\n const value = readLocalStorage(key, schema)\n if (value !== undefined) {\n setState(value)\n }\n }, [])\n useWindowEvent('storage', (event) => {\n if (event.key === key) {\n setState(readLocalStorage(key, schema))\n }\n })\n return [\n state,\n useCallback(\n (value) => {\n const newValue = typeof value === 'function' ? value(state) : value\n const newState = schema.safeParse(newValue)\n if (newState.success) {\n updateLocalStorage(key, newState.data)\n setState(newState.data)\n window.dispatchEvent(new StorageEvent('storage', { key }))\n } else {\n logger.error({\n scope: '/app/hooks/browser/createLocalStorageHook.ts',\n detail: 'Failed to update local storage - bad data',\n metadata: { error: newState.error, key, newValue },\n })\n }\n },\n [logger, state]\n ),\n ]\n }\n}\n","'use client'\n\nimport { useEffect } from 'react'\n\ntype WindowEvent = T extends keyof WindowEventMap ? WindowEventMap[T] : Event\n\nexport function useWindowEvent(\n event: WindowEventKey,\n listener: (event: WindowEvent) => unknown,\n options?: { once?: boolean; passive?: boolean }\n) {\n useEffect(() => {\n const once = options?.once ?? false\n const passive = options?.passive ?? false\n window.addEventListener(\n event as keyof WindowEventMap,\n listener as (event: WindowEventMap[keyof WindowEventMap]) => unknown,\n { once, passive }\n )\n return () =>\n window.removeEventListener(\n event as keyof WindowEventMap,\n listener as (event: WindowEventMap[keyof WindowEventMap]) => unknown\n )\n }, [event, listener, options])\n}\n","import { StructuredLogger } from '@/lib/logger/types'\nimport { Key, Middleware, SWRHook } from 'swr'\nimport { FetcherResponse } from 'swr/dist/_internal'\n\nexport async function logRequest(\n logger: StructuredLogger,\n promise: Promise | FetcherResponse,\n metadata: { url: string } & Record,\n logResponse: boolean = false\n): Promise {\n const start = performance.now()\n try {\n const response = await promise\n logger.info({\n scope: 'src/hooks/business/utils',\n detail: 'request-success',\n metadata: {\n duration: performance.now() - start,\n response: logResponse ? response : undefined,\n ...metadata,\n },\n })\n return response\n } catch (error) {\n logger.error({\n scope: 'src/hooks/business/utils',\n detail: 'request-error',\n metadata: {\n duration: performance.now() - start,\n error: logResponse ? error : undefined,\n ...metadata,\n },\n })\n throw error\n }\n}\n\nexport function createDurationSwrMiddleware(\n logger: StructuredLogger,\n url: string,\n metadata: Record\n): Middleware {\n return (useSWRNext: SWRHook) => (key, fetcher, config) => {\n const nextFetcher =\n fetcher === null\n ? fetcher\n : async (key: Key) => logRequest(logger, fetcher(key), { url, ...metadata })\n\n return useSWRNext(key, nextFetcher, config)\n }\n}\n","import dayjs from 'dayjs'\nimport duration from 'dayjs/plugin/duration'\nimport minMax from 'dayjs/plugin/minMax'\nimport timezone from 'dayjs/plugin/timezone'\nimport utc from 'dayjs/plugin/utc'\nimport dayOfYear from 'dayjs/plugin/dayOfYear'\nimport relativeTime from 'dayjs/plugin/relativeTime'\n\ndayjs.extend(duration)\ndayjs.extend(minMax)\ndayjs.extend(timezone)\ndayjs.extend(utc)\ndayjs.extend(dayOfYear)\ndayjs.extend(relativeTime)\n\nexport { dayjs }\n","export class MetaError extends Error {\n error: unknown\n\n metadata: Record\n\n constructor(error: unknown, metadata?: Record, message?: string) {\n super(message)\n this.error = error\n this.metadata = metadata ?? {}\n }\n}\n","import { MetaError } from '@/lib/errors/meta/meta-error'\n\nexport class FlightNotFoundError extends MetaError {\n constructor(metadata?: Record, message?: string) {\n super(null, metadata, message ?? 'Flight not found')\n }\n}\n","import { FlightNotFoundError } from '@/lib/errors/meta/flight-not-found-error'\nimport { MetaError } from '@/lib/errors/meta/meta-error'\n\nexport class MetaCompoundError extends MetaError {\n static from(\n errors: Record,\n metadata?: Record,\n message?: string\n ) {\n if (Object.values(errors).every((error) => error instanceof FlightNotFoundError)) {\n return new FlightNotFoundError(metadata, message)\n }\n return new MetaCompoundError(errors, metadata, message)\n }\n\n errors: Record\n\n constructor(\n errors: Record,\n metadata?: Record,\n message?: string\n ) {\n super(null, metadata, message)\n this.errors = errors\n }\n}\n","import { FlightNotFoundError } from '@/lib/errors/meta/flight-not-found-error'\nimport { MetaError } from '@/lib/errors/meta/meta-error'\nimport { v4 as uuid } from 'uuid'\n\nexport class ServiceError extends MetaError {\n static from(\n error: unknown,\n metadata?: Record,\n message?: string\n ): ServiceError | FlightNotFoundError {\n if (error instanceof FlightNotFoundError) {\n return new FlightNotFoundError(\n metadata,\n message ?? (error instanceof Error ? error.message : undefined)\n )\n }\n return new ServiceError(\n error,\n metadata,\n message ?? (error instanceof Error ? error.message : undefined)\n )\n }\n\n id: string\n\n constructor(error: unknown, metadata?: Record, message?: string) {\n super(error, metadata, message)\n this.id = uuid()\n }\n}\n","export class UnauthenticatedError extends Error {\n constructor() {\n super('You are unauthorized to use ACE')\n }\n}\n","export class UnauthorizedError extends Error {\n constructor() {\n super('Unauthorized')\n }\n}\n","export * from '@/lib/errors/meta/flight-not-found-error'\nexport * from '@/lib/errors/meta/meta-compound-error'\nexport * from '@/lib/errors/meta/meta-error'\nexport * from '@/lib/errors/meta/service-error'\nexport * from '@/lib/errors/unauthenticated-error'\nexport * from '@/lib/errors/unauthorized-error'\n","import { Span } from '@opentelemetry/api'\nimport axios from 'axios'\nimport { z } from 'zod'\nimport { ServiceError, FlightNotFoundError, MetaCompoundError, MetaError } from '@/lib/errors'\nimport { StructuredLoggerOptions, StructuredLogger } from '@/lib/logger/types'\n\nexport function factoryWithDefaultOptions(\n defaultOptions: StructuredLoggerOptions,\n factory: (logger: T, options: StructuredLoggerOptions) => StructuredLogger\n): (logger: T, options?: Partial) => StructuredLogger {\n return (logger, options) => factory(logger, { ...defaultOptions, ...options })\n}\n\nexport function getErrorMetadata(\n error: unknown,\n iteration: number = 0\n): Record | undefined {\n if (iteration > 50) {\n return undefined\n }\n if (error instanceof ServiceError) {\n return {\n id: error.id,\n type: 'service-error',\n ...error.metadata,\n error: getErrorMetadata(error.error, iteration + 1),\n }\n }\n if (error instanceof FlightNotFoundError) {\n return {\n type: 'flight-not-found-error',\n ...error.metadata,\n }\n }\n if (error instanceof MetaCompoundError) {\n return {\n type: 'meta-compound-error',\n ...error.metadata,\n errors: Object.fromEntries(\n Object.entries(error.errors).map(([key, value]) => [\n key,\n getErrorMetadata(value, iteration + 1),\n ])\n ),\n }\n }\n if (error instanceof MetaError) {\n return {\n type: 'meta-error',\n ...error.metadata,\n error: getErrorMetadata(error.error, iteration + 1),\n }\n }\n if (axios.isAxiosError(error)) {\n return {\n type: 'axios-error',\n code: error.code,\n message: error.message,\n response: error.response\n ? {\n status: error.response.status,\n data: error.response.data,\n }\n : undefined,\n }\n }\n if (error instanceof z.ZodError) {\n return {\n type: 'zod-error',\n issues: error.issues,\n fields: error.issues.map((issue) => `${issue.path.join('.')} : ${issue.message}`),\n message: error.message,\n cause: error.cause,\n stack: error.stack,\n }\n }\n if (error instanceof AggregateError) {\n return {\n type: 'aggregate-error',\n errors: error.errors.map(getErrorMetadata),\n }\n }\n if (error instanceof Error) {\n return { type: 'error', message: error.message, name: error.name, stack: error.stack }\n }\n if (error === undefined) {\n return undefined\n }\n try {\n const raw = JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error)))\n return { type: 'unknown', raw }\n } catch (e) {\n return { type: 'unknown', raw: error, message: 'This should never happen' }\n }\n}\n\nexport function flattenObject(\n obj: any,\n path: string[] = []\n): Record {\n let flattened: Record = {}\n for (const [key, value] of Object.entries(obj)) {\n if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {\n flattened[`${path.join('.')}.${key}`] = value\n } else if (typeof value === 'object' && value !== null) {\n flattened = { ...flattenObject(value, [...path, key]), ...flattened }\n }\n }\n return flattened\n}\n\nexport function addAttributesToSpan(span: Span, obj: any) {\n for (const [key, value] of Object.entries(flattenObject(obj))) {\n span.setAttribute(key, value)\n }\n span.setAttribute('instrumentationlibrary.name', 'structured-logger')\n}\n","import { factoryWithDefaultOptions } from '@/lib/logger/utils'\nimport { ApplicationInsights } from '@microsoft/applicationinsights-web'\n\nexport const createStructuredLoggerFromConsole = factoryWithDefaultOptions(\n { version: undefined, region: undefined },\n (logger, options) => ({\n trace: (log, message) => {\n logger.log({ ...log, message, version: options.version, region: options.region })\n },\n debug: (log, message) => {\n logger.log({ ...log, message, version: options.version, region: options.region })\n },\n info: (log, message) => {\n logger.log({ ...log, message, version: options.version, region: options.region })\n },\n warn: (log, message) => {\n logger.log({ ...log, message, version: options.version, region: options.region })\n },\n error: (log, message) => {\n logger.log({ ...log, message, version: options.version, region: options.region })\n },\n fatal: (log, message) => {\n logger.log({ ...log, message, version: options.version, region: options.region })\n },\n logAxiosError: () => undefined,\n logUnexpectedError: () => undefined,\n warnUnexpectedError: () => undefined,\n traceFunction: (fn) => fn,\n traceAsyncFunction: (fn) => fn,\n initAxiosTrace: (fn) => fn,\n })\n)\n\nexport const createStructuredLoggerFromAppInsights = factoryWithDefaultOptions(\n { version: undefined, region: undefined },\n (logger, options) => ({\n trace: (log, message) => {\n logger.trackEvent(\n { name: 'client-trace' },\n { ...log, message, version: options.version, region: options.region }\n )\n },\n debug: (log, message) => {\n logger.trackEvent(\n { name: 'client-debug' },\n { ...log, message, version: options.version, region: options.region }\n )\n },\n info: (log, message) => {\n logger.trackEvent(\n { name: 'client-info' },\n { ...log, message, version: options.version, region: options.region }\n )\n },\n warn: (log, message) => {\n logger.trackEvent(\n { name: 'client-warn' },\n { ...log, message, version: options.version, region: options.region }\n )\n },\n error: (log, message) => {\n logger.trackEvent(\n { name: 'client-error' },\n { ...log, message, version: options.version, region: options.region }\n )\n },\n fatal: (log, message) => {\n logger.trackEvent(\n { name: 'client-fatal' },\n { ...log, message, version: options.version, region: options.region }\n )\n },\n logAxiosError: () => undefined,\n logUnexpectedError: () => undefined,\n warnUnexpectedError: () => undefined,\n traceFunction: (fn) => fn,\n traceAsyncFunction: (fn) => fn,\n initAxiosTrace: (fn) => fn,\n })\n)\n","export enum Role {\n PROD_USER = '5ca832f7-715a-4382-aa07-9db043ce02f4',\n BETA_USER = '8f2ad0e9-e1b7-4409-9508-2ef1d91d57fc',\n NONPROD_USER = '8a38e87f-7c01-46c3-9a47-2a1bda323b46',\n TRAINING_USER = '0554b476-3e1c-4f00-9dc1-be0aa90cfc58',\n\n TEMPORARY_DUTY_AGENT = 'ebd1f9df-a38a-466f-a0a6-4dffd3c556e9',\n STATION_AGENT = '3a3548c0-4178-4b89-9ee7-494e8b246689', // current ace ad group\n DEVELOPER = 'b72f127e-1189-4c21-b9ad-372a4c72b0e3',\n}\n\nexport function getRoles(groupIds: string[]): Role[] {\n const roles: Role[] = []\n\n for (const key of Object.values(Role)) {\n const role = key as Role\n\n if (groupIds.includes(role)) {\n roles.push(role)\n }\n }\n return roles\n}\n","import { Role } from '@/lib/role'\nimport { unique } from '@/lib/utils/unique'\nimport { BETA, PROD, ServerEnv, TRAINING } from '@/lib/server-env'\n\nexport enum Permission {\n // environment access\n ACCESS_PROD = 'access_prod',\n ACCESS_BETA = 'access_beta',\n ACCESS_DEV = 'access_dev',\n ACCESS_NONPROD = 'access_nonprod',\n ACCESS_TRAINING = 'access_training',\n\n // api permissions\n READ_ALL = 'read_all',\n READ_LIMITED = 'read_limited', // sets obfuscate = true\n UPDATE = 'update',\n DELETE = 'delete',\n\n // ui view permissions\n FULL_VIEW = 'full_view',\n VIEW_LIMITED = 'view_limited',\n VIEW_RESTRICTED = 'view_restricted',\n}\n\nexport const viewRestrictedPermissions = [Permission.READ_LIMITED, Permission.VIEW_RESTRICTED]\n\nexport const fullAccessPermissions = [\n Permission.READ_ALL,\n Permission.DELETE,\n Permission.UPDATE,\n Permission.FULL_VIEW,\n]\n\nexport const viewOnlyPermissions = [Permission.READ_ALL, Permission.VIEW_LIMITED]\n\nexport function mapRoleToEnvAccess(role: Role): Permission[] {\n switch (role) {\n case Role.PROD_USER:\n return [Permission.ACCESS_PROD]\n case Role.BETA_USER:\n return [Permission.ACCESS_BETA]\n case Role.NONPROD_USER:\n return [Permission.ACCESS_NONPROD]\n case Role.TRAINING_USER:\n return [Permission.ACCESS_TRAINING]\n case Role.DEVELOPER:\n return [Permission.ACCESS_DEV]\n default:\n return []\n }\n}\n\nexport function mapRoleToPermissions(\n role: Role,\n atHomeCity: boolean | undefined = undefined,\n currentEnv: ServerEnv | undefined = undefined,\n override: boolean = true\n): Permission[] {\n switch (role) {\n case Role.DEVELOPER:\n return currentEnv === PROD || currentEnv === BETA || !currentEnv\n ? [Permission.READ_ALL, Permission.FULL_VIEW]\n : fullAccessPermissions\n case Role.TEMPORARY_DUTY_AGENT:\n return fullAccessPermissions\n case Role.STATION_AGENT:\n if (override) {\n return fullAccessPermissions\n }\n return atHomeCity ? fullAccessPermissions : viewOnlyPermissions\n case Role.TRAINING_USER:\n return currentEnv === TRAINING ? fullAccessPermissions : []\n default:\n return []\n }\n}\n\nexport function getPermissions(\n roles: Role[] | undefined,\n atHomeCity: boolean = true,\n serverEnv: ServerEnv | undefined = undefined,\n override: boolean = true\n): Permission[] {\n if (!roles || roles.length === 0) {\n return [...viewRestrictedPermissions]\n }\n\n const envAccessPermissions = roles.flatMap((role) => mapRoleToEnvAccess(role))\n let appPermissions = roles.flatMap((role) =>\n mapRoleToPermissions(role, atHomeCity, serverEnv, override)\n )\n\n if (appPermissions.length === 0) {\n appPermissions = viewRestrictedPermissions\n }\n\n return unique([...envAccessPermissions, ...appPermissions])\n}\n\nexport function hasPermission(\n roles: Role[] | undefined,\n permission: Permission,\n atHomeCity: boolean = true,\n serverEnv: ServerEnv | undefined = undefined\n): boolean {\n const permissions = getPermissions(roles, atHomeCity, serverEnv)\n return permissions.includes(permission)\n}\n","const LOCAL = 'local' as const\nconst TRAINING = 'training' as const\nconst SANDBOX = 'sandbox' as const\nconst NONPROD = 'nonprod' as const\nconst BETA = 'beta' as const\nconst PROD = 'prod' as const\n\ntype ServerEnv =\n | typeof LOCAL\n | typeof BETA\n | typeof TRAINING\n | typeof SANDBOX\n | typeof NONPROD\n | typeof PROD\n\n// Never use in React. Even though React does a SSR first pass\n// the variables won't be set once the components make it to the front end\nfunction getServerEnv(): ServerEnv {\n if (process.env.SERVER_ENV === 'training') {\n return TRAINING\n }\n if (process.env.SERVER_ENV === 'sandbox') {\n return SANDBOX\n }\n if (process.env.SERVER_ENV === 'nonprod') {\n return NONPROD\n }\n if (process.env.SERVER_ENV === 'beta') {\n return BETA\n }\n if (process.env.SERVER_ENV === 'prod') {\n return PROD\n }\n return LOCAL\n}\n\nexport type { ServerEnv }\nexport { LOCAL, TRAINING, SANDBOX, NONPROD, BETA, PROD, getServerEnv }\n","import { twMerge } from 'tailwind-merge'\nimport { clsx, ClassValue } from 'clsx'\n\nfunction cn(...args: ClassValue[]): string {\n return twMerge(clsx(args))\n}\n\nexport { cn }\n","import { Primitive } from 'zod'\n\nexport function unique(items: Iterable): T[] {\n const uniqueItems = [] as T[]\n for (const item of items) {\n if (!uniqueItems.includes(item)) {\n uniqueItems.push(item)\n }\n }\n return uniqueItems\n}\n\nexport function uniqueByProperty(\n property: keyof T\n): (value: T, index: number, self: T[]) => boolean {\n return (value, index, self) =>\n self.findIndex((item) => item[property] === value[property]) === index\n}\n"],"names":["Promise","resolve","then","__webpack_require__","bind","ScannerIcon","props","jsx_runtime","jsx","svg","width","height","viewBox","fill","path","d","ScanTestHeader","param","onCloseClick","className","jsxs","div","cn","p","CloseButton","autoFocus","onClick","readoutStyling","success","color","icon","CheckmarkFilledIcon","error","g","clipPath","defs","id","rect","ErrorFilledIcon","loading","LoadingSpinner","ScanReadout","type","source","readout","deviceId","timestamp","style","borderColor","CameraOffIcon","xmlns","ScanTestBiometrics","biometricsProps","biometrics","useBiometrics","logger","useLogger","cameraButtonDisabled","setCameraButtonDisabled","useState","registerButtonDisabled","setRegisterButtonDisabled","biometricScanReadouts","setBiometricScanReadouts","gateInput","setGateInput","cameraOn","setCameraOn","handleScan","scanData","loadingTimestamp","undefined","previous","map","scan","scans","length","shift","info","scope","detail","metadata","changeCameraState","registerBiometrics","resetBiometrics","biometricClient","useScanTestBiometricsListener","listener","setBiometricClient","listenerRef","useRef","positionKey","usePositionKey","bgrSessionName","useBgrSessionName","workstationId","useEffect","intervalId","setInterval","sendEvent","clearInterval","current","getManualFlightDescriptor","useCallback","departureAirport","departureStation","flightDate","originDate","carrier","arrivalAirport","flightNumber","gate","loadingTimesamp","dayjs","format","axios","post","flightDescriptor","res","toISOString","catch","resp","data","registrationUrl","client","WebPubSubClient","start","newCameraState","action","on","concat","JSON","stringify","e","message","scanReadout","label","htmlFor","input","disabled","value","onChange","event","target","toUpperCase","button","CameraOnIcon","safeJsonParse","stringToParse","parse","webSocketNoise","ScanTest","router","useRouter","scanReadouts","setScanReadouts","playSuccessNoise","usePlaySuccessNoise","playErrorNoise","usePlayErrorNoise","status","line1","line2","useWebSocketScannerListener","lastScannerMessage","useLastScanMessage","isWebSocketNoise","barcode","parseResult","systemInfoParseResult","SystemInfoSchema","safeParse","deviceStatusParseResult","DeviceStatusSchema","oldWebSocketScannerExceptionParseResult","OldWebSocketScannerExceptionSchema","Message","some","regex","test","scannerMessage","result","parseOldWebSocketError","schemaParseResult","push","Fragment","ScanTestClient","useDepartureStation","biometricsToggle","useFeatureToggle","main","WebSocketScannerProvider","url","allowInvalidSchema","isFromScanTest","classNames","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","circle","stroke","cx","cy","r","strokeWidth","createLocalStorageHook","z","string","optional","BiometricVerificationDataSchema","object","upid","transactionId","BiometricContext","createContext","isBiometricFlight","refetch","BiometricPassengerContext","passengerUpid","setPassengerUpid","setTransactionId","BiometricProvider","children","setIsBiometricFlight","BIOMETRIC_REGISTRATION","shouldRegister","register","useSWR","refreshInterval","revalidateOnFocus","refreshWhenHidden","use","createDurationSwrMiddleware","handler","obj","receivedWorkstationId","off","Provider","useContext","useBiometricPassenger","scannerType","useScannerType","playWebsocketScannerErrorNoise","WebsocketScannerPlayErrorNoiseContext","playFailureAudio","usePlayExitRowNoise","playWebsocketScannerExitRowNoise","WebsocketScannerPlayExitRowNoiseContext","playExitRowAudio","usePlayBoardingAlertNoise","playWebsocketScannerBoardingAlertNoise","WebsocketScannerPlayBoardingAlertContext","playBoardingAlertAudio","playWebsocketScannerSuccessNoise","WebsocketScannerPlaySuccessNoiseContext","playSuccessAudio","uuid","fillOpacity","mask","maskUnits","x","y","CloseIcon","usePermissions","profile","useUserProfile","useParams","override","serverEnv","useServerEnvInfo","atHomeCity","city","allRoles","roles","getPermissions","usePermissionValidation","permission","permissions","includes","forwardRef","ref","onFocus","onBlur","AzureActiveDirectoryProfileAgentContext","AzureActiveDirectoryProfileProvider","useMemo","email","firstName","lastName","upn","split","groupIds","FeatureToggleMapContext","Map","FeatureToggleProvider","fallbackData","fallbackFeatureToggles","Object","entries","filter","pair","reduce","acc","key","featureToggles","get","response","featureToggleMap","FeatureToggle","feature","isEnabled","defaultLogger","createStructuredLoggerFromConsole","console","version","env","NEXT_PUBLIC_APP_VERSION","LoggerContext","SetLoggerContext","LoggerProvider","setLogger","useReportWebVitals","metric","useSetLogger","ServerEnvironmentContext","LOCAL","envSwitchUrl","ServerEnvironmentProvider","process","readLocalStorage","schema","item","window","localStorage","getItem","state","setState","initialState","useWindowEvent","newValue","newState","removeItem","setItem","dispatchEvent","StorageEvent","options","once","passive","addEventListener","removeEventListener","logRequest","promise","logResponse","performance","now","duration","fetcher","config","useSWRNext","minMax","timezone","utc","dayOfYear","relativeTime","factoryWithDefaultOptions","defaultOptions","factory","region","trace","log","debug","warn","fatal","logAxiosError","logUnexpectedError","warnUnexpectedError","traceFunction","fn","traceAsyncFunction","initAxiosTrace","createStructuredLoggerFromAppInsights","trackEvent","name","Role","Permission","viewRestrictedPermissions","fullAccessPermissions","viewOnlyPermissions","envAccessPermissions","flatMap","mapRoleToEnvAccess","role","PROD_USER","BETA_USER","NONPROD_USER","TRAINING_USER","DEVELOPER","appPermissions","mapRoleToPermissions","currentEnv","PROD","BETA","TEMPORARY_DUTY_AGENT","STATION_AGENT","TRAINING","unique","hasPermission","_len","arguments","args","_key","twMerge","clsx","items","uniqueItems"],"sourceRoot":""}