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AC,KAAK,CAAC,EAAE,0CAA0C;KACnF;IACD,CAAC,6BAA6B,CAAC,OAAO,CAAC,EAAE;QACvC,CAAC,8BAA8B,CAAC,KAAK,CAAC,EAAE,wCAAwC;QAChF,CAAC,8BAA8B,CAAC,aAAa,CAAC,EAAE,+CAA+C;QAC/F,CAAC,8BAA8B,CAAC,KAAK,CAAC,EAAE,wCAAwC;KACjF;CACF,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAC5B,IAAmC,EACnC,KAAqC,EAClB,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AAEtD,eAAe,yBAAyB,CAAC","sourcesContent":["import React from 'react';\n\nimport {\n  AppleAuthenticationButtonProps,\n  AppleAuthenticationButtonStyle,\n  AppleAuthenticationButtonType,\n} from './AppleAuthentication.types';\nimport {\n  ExpoAppleAuthenticationButtonSignInWhite,\n  ExpoAppleAuthenticationButtonSignInWhiteOutline,\n  ExpoAppleAuthenticationButtonSignInBlack,\n  ExpoAppleAuthenticationButtonContinueWhite,\n  ExpoAppleAuthenticationButtonContinueWhiteOutline,\n  ExpoAppleAuthenticationButtonContinueBlack,\n  ExpoAppleAuthenticationButtonSignUpWhite,\n  ExpoAppleAuthenticationButtonSignUpWhiteOutline,\n  ExpoAppleAuthenticationButtonSignUpBlack,\n} from './ExpoAppleAuthenticationButton';\n\n// @needsAudit\n/**\n * This component displays the proprietary \"Sign In with Apple\" / \"Continue with Apple\" button on\n * your screen. The App Store Guidelines require you to use this component to start the\n * authentication process instead of a custom button. Limited customization of the button is\n * available via the provided properties.\n *\n * You should only attempt to render this if [`AppleAuthentication.isAvailableAsync()`](#isavailableasync)\n * resolves to `true`. This component will render nothing if it is not available, and you will get\n * a warning in development mode (`__DEV__ === true`).\n *\n * The properties of this component extend from `View`; however, you should not attempt to set\n * `backgroundColor` or `borderRadius` with the `style` property. This will not work and is against\n * the App Store Guidelines. Instead, you should use the `buttonStyle` property to choose one of the\n * predefined color styles and the `cornerRadius` property to change the border radius of the\n * button.\n *\n * Make sure to attach height and width via the style props as without these styles, the button will\n * not appear on the screen.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidbutton)\n * for more details.\n */\nconst AppleAuthenticationButton: React.FC<AppleAuthenticationButtonProps> = ({\n  onPress,\n  buttonStyle,\n  buttonType,\n  ...restProps\n}) => {\n  if (!ExpoAppleAuthenticationButtonSignInWhite) {\n    if (__DEV__) {\n      console.warn(\"'AppleAuthenticationButton' is not available.\");\n    }\n    return null;\n  }\n\n  const AppleAuthenticationButtonComponent = selectButtonComponent(buttonType, buttonStyle);\n\n  return <AppleAuthenticationButtonComponent onButtonPress={onPress} {...restProps} />;\n};\n\nconst ButtonComponents: { [type: number]: { [style: number]: React.ElementType } } = {\n  [AppleAuthenticationButtonType.SIGN_IN]: {\n    [AppleAuthenticationButtonStyle.WHITE]: ExpoAppleAuthenticationButtonSignInWhite,\n    [AppleAuthenticationButtonStyle.WHITE_OUTLINE]: ExpoAppleAuthenticationButtonSignInWhiteOutline,\n    [AppleAuthenticationButtonStyle.BLACK]: ExpoAppleAuthenticationButtonSignInBlack,\n  },\n  [AppleAuthenticationButtonType.CONTINUE]: {\n    [AppleAuthenticationButtonStyle.WHITE]: ExpoAppleAuthenticationButtonContinueWhite,\n    [AppleAuthenticationButtonStyle.WHITE_OUTLINE]:\n      ExpoAppleAuthenticationButtonContinueWhiteOutline,\n    [AppleAuthenticationButtonStyle.BLACK]: ExpoAppleAuthenticationButtonContinueBlack,\n  },\n  [AppleAuthenticationButtonType.SIGN_UP]: {\n    [AppleAuthenticationButtonStyle.WHITE]: ExpoAppleAuthenticationButtonSignUpWhite,\n    [AppleAuthenticationButtonStyle.WHITE_OUTLINE]: ExpoAppleAuthenticationButtonSignUpWhiteOutline,\n    [AppleAuthenticationButtonStyle.BLACK]: ExpoAppleAuthenticationButtonSignUpBlack,\n  },\n};\n\nconst selectButtonComponent = (\n  type: AppleAuthenticationButtonType,\n  style: AppleAuthenticationButtonStyle\n): React.ElementType => ButtonComponents[type][style];\n\nexport default AppleAuthenticationButton;\n"]}