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AAK,EAAE;QACzB,SAAS,CACP,OAAO,gBAAgB,KAAK,QAAQ,IAAI,gBAAgB,CAAC,MAAM,EAC/D,6EAA6E,CAC9E,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QAEjF,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SAC9B;QACD,OAAO,MAAM,CAAC;KACf;SAAM;QACL,OAAO,MAAM,uBAAuB,CAAC,iBAAiB,EAAE,CAAC;KAC1D;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,EAAE;QAC/C,MAAM,IAAI,mBAAmB,CAAC,2BAA2B,EAAE,oBAAoB,CAAC,CAAC;KAClF;IACD,MAAM,uBAAuB,CAAC,kBAAkB,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-errors';\nimport invariant from 'invariant';\nimport { Platform } from 'react-native';\n\nimport ExpoLocalAuthentication from './ExpoLocalAuthentication';\n\nimport { AuthenticationType, LocalAuthenticationResult } from './LocalAuthentication.types';\n\nexport { AuthenticationType, LocalAuthenticationResult };\n\nexport async function hasHardwareAsync(): Promise<boolean> {\n  if (!ExpoLocalAuthentication.hasHardwareAsync) {\n    throw new UnavailabilityError('expo-local-authentication', 'hasHardwareAsync');\n  }\n  return await ExpoLocalAuthentication.hasHardwareAsync();\n}\n\nexport async function supportedAuthenticationTypesAsync(): Promise<AuthenticationType[]> {\n  if (!ExpoLocalAuthentication.supportedAuthenticationTypesAsync) {\n    throw new UnavailabilityError('expo-local-authentication', 'supportedAuthenticationTypesAsync');\n  }\n  return await ExpoLocalAuthentication.supportedAuthenticationTypesAsync();\n}\n\nexport async function isEnrolledAsync(): Promise<boolean> {\n  if (!ExpoLocalAuthentication.isEnrolledAsync) {\n    throw new UnavailabilityError('expo-local-authentication', 'isEnrolledAsync');\n  }\n  return await ExpoLocalAuthentication.isEnrolledAsync();\n}\n\nexport async function authenticateAsync(\n  promptMessageIOS: string = 'Authenticate'\n): Promise<LocalAuthenticationResult> {\n  if (!ExpoLocalAuthentication.authenticateAsync) {\n    throw new UnavailabilityError('expo-local-authentication', 'authenticateAsync');\n  }\n\n  if (Platform.OS === 'ios') {\n    invariant(\n      typeof promptMessageIOS === 'string' && promptMessageIOS.length,\n      'Fingerprint.authenticateAsync must be called with a non-empty string on iOS'\n    );\n\n    const result = await ExpoLocalAuthentication.authenticateAsync(promptMessageIOS);\n\n    if (result.warning) {\n      console.warn(result.warning);\n    }\n    return result;\n  } else {\n    return await ExpoLocalAuthentication.authenticateAsync();\n  }\n}\n\nexport async function cancelAuthenticate(): Promise<void> {\n  if (!ExpoLocalAuthentication.cancelAuthenticate) {\n    throw new UnavailabilityError('expo-local-authentication', 'cancelAuthenticate');\n  }\n  await ExpoLocalAuthentication.cancelAuthenticate();\n}\n"]}