{"version":3,"file":"signUpFormFields.mjs","names":[],"sources":["../../../src/internal/clerk-js/signUpFormFields.ts"],"sourcesContent":["import type { Attribute, Attributes, SignUpResource, UserSettingsResource } from '../../types';\nimport { camelToSnake } from '../../underscore';\n\n/**\n * ActiveIdentifier denotes which one of the email address or phone number takes priority when enabled\n */\nexport type ActiveIdentifier = 'emailAddress' | 'phoneNumber' | null | undefined;\n\nconst FieldKeys = [\n  'emailAddress',\n  'phoneNumber',\n  'username',\n  'firstName',\n  'lastName',\n  'password',\n  'ticket',\n  'legalAccepted',\n] as const;\nexport type FieldKey = (typeof FieldKeys)[number];\n\nexport type Field = {\n  disabled?: boolean;\n  /**\n   * Denotes if the corresponding input is required to be filled\n   */\n  required: boolean;\n};\n\nexport type Fields = {\n  [key in FieldKey]: Field | undefined;\n};\n\ntype FieldDeterminationProps = {\n  attributes: Partial<Attributes>;\n  activeCommIdentifierType?: ActiveIdentifier;\n  hasTicket?: boolean;\n  hasEmail?: boolean;\n  signUp?: SignUpResource | undefined;\n  isProgressiveSignUp: boolean;\n  legalConsentRequired?: boolean;\n};\n\nexport function determineActiveFields(fieldProps: FieldDeterminationProps): Fields {\n  return FieldKeys.reduce((fields: Fields, fieldKey: FieldKey) => {\n    const field = getField(fieldKey, fieldProps);\n    if (field) {\n      fields[fieldKey] = field;\n    }\n    return fields;\n  }, {} as Fields);\n}\n\n// If continuing with an existing sign-up, show only fields absolutely necessary to minimize fiction\ntype VerificationStatusInput = { status: string | null } | null | undefined;\n\nexport type ExistingSignUpInput = Pick<\n  SignUpResource,\n  'emailAddress' | 'firstName' | 'lastName' | 'username' | 'legalAcceptedAt'\n> & {\n  verifications?: {\n    emailAddress?: VerificationStatusInput;\n    phoneNumber?: VerificationStatusInput;\n    externalAccount?: VerificationStatusInput;\n    web3Wallet?: VerificationStatusInput;\n  };\n};\n\nexport function minimizeFieldsForExistingSignup(fields: Fields, signUp: ExistingSignUpInput) {\n  if (signUp) {\n    const hasEmailFilled = !!signUp.emailAddress;\n    const hasVerifiedEmail = signUp.verifications?.emailAddress?.status === 'verified';\n    const hasVerifiedPhone = signUp.verifications?.phoneNumber?.status === 'verified';\n    const hasVerifiedExternalAccount = signUp.verifications?.externalAccount?.status === 'verified';\n    const hasVerifiedWeb3Wallet = signUp.verifications?.web3Wallet?.status === 'verified';\n    const hasLegalAccepted = signUp.legalAcceptedAt !== null;\n\n    if (hasEmailFilled && hasVerifiedEmail) {\n      delete fields.emailAddress;\n    }\n\n    if (hasVerifiedPhone) {\n      delete fields.phoneNumber;\n    }\n\n    if (hasVerifiedExternalAccount || hasVerifiedWeb3Wallet) {\n      delete fields.password;\n    }\n\n    if (signUp.firstName) {\n      delete fields.firstName;\n    }\n\n    if (signUp.lastName) {\n      delete fields.lastName;\n    }\n\n    if (signUp.username) {\n      delete fields.username;\n    }\n\n    if (hasLegalAccepted) {\n      delete fields.legalAccepted;\n    }\n\n    // Hide any non-required fields\n    Object.entries(fields).forEach(([k, v]) => {\n      if (v && !v.required) {\n        delete fields[k as FieldKey];\n      }\n    });\n  }\n}\n\nexport const getInitialActiveIdentifier = (\n  attributes: Partial<Attributes>,\n  isProgressiveSignUp: boolean,\n  initialValues?: { phoneNumber?: string | null; emailAddress?: string | null },\n): ActiveIdentifier => {\n  if (initialValues?.emailAddress) {\n    return 'emailAddress';\n  }\n  if (initialValues?.phoneNumber) {\n    return 'phoneNumber';\n  }\n\n  if (emailOrPhone(attributes, isProgressiveSignUp)) {\n    // If we are in the case of Email OR Phone, email takes priority\n    return 'emailAddress';\n  }\n\n  const { email_address, phone_number } = attributes;\n\n  if (email_address?.enabled && isProgressiveSignUp ? email_address.required : email_address?.used_for_first_factor) {\n    return 'emailAddress';\n  }\n\n  if (phone_number?.enabled && isProgressiveSignUp ? phone_number.required : phone_number?.used_for_first_factor) {\n    return 'phoneNumber';\n  }\n\n  return null;\n};\n\nexport function showFormFields(userSettings: UserSettingsResource): boolean {\n  const { authenticatableSocialStrategies, web3FirstFactors } = userSettings;\n\n  return userSettings.hasValidAuthFactor || (!authenticatableSocialStrategies.length && !web3FirstFactors.length);\n}\n\nexport function emailOrPhone(attributes: Partial<Attributes>, isProgressiveSignUp: boolean) {\n  const { email_address, phone_number } = attributes;\n\n  return Boolean(\n    isProgressiveSignUp\n      ? email_address?.enabled && phone_number?.enabled && !email_address.required && !phone_number.required\n      : email_address?.used_for_first_factor && phone_number?.used_for_first_factor,\n  );\n}\n\nfunction getField(fieldKey: FieldKey, fieldProps: FieldDeterminationProps): Field | undefined {\n  switch (fieldKey) {\n    case 'emailAddress':\n      return getEmailAddressField(fieldProps);\n    case 'phoneNumber':\n      return getPhoneNumberField(fieldProps);\n    case 'password':\n      return getPasswordField(fieldProps.attributes);\n    case 'ticket':\n      return getTicketField(fieldProps.hasTicket);\n    case 'legalAccepted':\n      return getLegalAcceptedField(fieldProps.legalConsentRequired);\n    case 'username':\n    case 'firstName':\n    case 'lastName':\n      return getGenericField(fieldKey, fieldProps.attributes);\n    default:\n      return;\n  }\n}\n\nfunction getEmailAddressField({\n  attributes,\n  hasTicket,\n  hasEmail,\n  activeCommIdentifierType,\n  isProgressiveSignUp,\n}: FieldDeterminationProps): Field | undefined {\n  if (isProgressiveSignUp) {\n    // If there is no ticket, or there is a ticket along with an email, and email address is enabled,\n    // we have to show it in the SignUp form\n    const show = (!hasTicket || (hasTicket && hasEmail)) && attributes.email_address?.enabled;\n\n    if (!show) {\n      return;\n    }\n\n    // If we are in the case of Email OR Phone, determine if the initial input has to be the email address\n    // based on the active identifier type.\n    if (emailOrPhone(attributes, isProgressiveSignUp) && activeCommIdentifierType !== 'emailAddress') {\n      return;\n    }\n\n    const { emailShouldBeRequired } = determineRequiredIdentifier(attributes);\n\n    return {\n      required: emailShouldBeRequired,\n      disabled: !!hasTicket && !!hasEmail,\n    };\n  }\n\n  const show =\n    (!hasTicket || (hasTicket && hasEmail)) &&\n    attributes.email_address?.enabled &&\n    attributes.email_address?.used_for_first_factor &&\n    activeCommIdentifierType === 'emailAddress';\n\n  if (!show) {\n    return;\n  }\n\n  return {\n    required: true, // as far as the FE is concerned the email address is required, if shown\n    disabled: !!hasTicket && !!hasEmail,\n  };\n}\n\nfunction getPhoneNumberField({\n  attributes,\n  hasTicket,\n  activeCommIdentifierType,\n  isProgressiveSignUp,\n}: FieldDeterminationProps): Field | undefined {\n  if (isProgressiveSignUp) {\n    // If there is no ticket and phone number is enabled, we have to show it in the SignUp form\n    const show = attributes.phone_number?.enabled;\n\n    if (!show) {\n      return;\n    }\n\n    // If we are in the case of Email OR Phone, determine if the initial input has to be the phone number\n    // based on the active identifier type.\n    if (emailOrPhone(attributes, isProgressiveSignUp) && activeCommIdentifierType !== 'phoneNumber') {\n      return;\n    }\n\n    const { phoneShouldBeRequired } = determineRequiredIdentifier(attributes);\n\n    return {\n      required: phoneShouldBeRequired,\n    };\n  }\n\n  const show =\n    !hasTicket &&\n    attributes.phone_number?.enabled &&\n    attributes.phone_number.used_for_first_factor &&\n    activeCommIdentifierType === 'phoneNumber';\n\n  if (!show) {\n    return;\n  }\n\n  return {\n    required: true, // as far as the FE is concerned the phone number is required, if shown\n  };\n}\n\n// Currently, password is always enabled so only show if required\nfunction getPasswordField(attributes: Partial<Attributes>): Field | undefined {\n  const show = attributes.password?.enabled && attributes.password.required;\n\n  if (!show) {\n    return;\n  }\n\n  return {\n    required: Boolean(attributes.password?.required),\n  };\n}\n\nfunction getTicketField(hasTicket?: boolean): Field | undefined {\n  if (!hasTicket) {\n    return;\n  }\n\n  return {\n    required: true,\n  };\n}\n\nfunction getLegalAcceptedField(legalConsentRequired?: boolean): Field | undefined {\n  if (!legalConsentRequired) {\n    return;\n  }\n\n  return {\n    required: true,\n  };\n}\n\nfunction getGenericField(fieldKey: FieldKey, attributes: Partial<Attributes>): Field | undefined {\n  const attribute = attributes[camelToSnake(fieldKey) as Attribute];\n\n  if (!attribute?.enabled) {\n    return;\n  }\n\n  return {\n    required: attribute.required,\n  };\n}\n\ntype Outcome = 'email' | 'phone' | 'username' | 'mirrorServer' | 'none';\n\ntype SignUpAttributeField = {\n  enabled: boolean;\n  required: boolean;\n  firstFactor: boolean;\n};\n\ntype Context = {\n  passwordRequired: boolean;\n  email: SignUpAttributeField;\n  phone: SignUpAttributeField;\n  username: SignUpAttributeField;\n};\n\nconst outcomePredicates: Record<Outcome, ((ctx: Context) => boolean)[]> = {\n  mirrorServer: [\n    // If password is not required, then field requirements are determined by the server.\n    ctx => !ctx.passwordRequired,\n    // If any of the identifiers are already required by the server, then we don't need to do anything.\n    ctx => ctx.email.required || ctx.phone.required || (ctx.username.required && ctx.username.firstFactor),\n  ],\n  none: [\n    // If none of the identifiers are enabled, then none can be required.\n    ctx => !ctx.email.enabled && !ctx.phone.enabled && !ctx.username.enabled,\n  ],\n  email: [\n    // If email is the only enabled identifier, it should be required.\n    ctx => ctx.email.enabled && !ctx.phone.enabled && !ctx.username.enabled,\n    // If email is enabled but not required, and phone is enabled and not required, then email should be required.\n    ctx => ctx.email.enabled && !ctx.email.required && ctx.phone.enabled && !ctx.phone.required,\n    // If username is a first factor but not required, email can be used as an alternative.\n    ctx => ctx.username.firstFactor && !ctx.username.required && ctx.email.enabled && !ctx.email.required,\n    // If username is required but not a first factor, and both email and phone are enabled, then email is a valid identifier.\n    ctx => ctx.username.required && !ctx.username.firstFactor && ctx.email.enabled && ctx.phone.enabled,\n  ],\n  phone: [\n    ctx => ctx.phone.enabled && !ctx.email.required && !ctx.phone.required,\n    // If username is a first factor but not required, phone can be used as an alternative.\n    ctx => ctx.username.firstFactor && !ctx.username.required && ctx.phone.enabled && !ctx.phone.required,\n    // If phone is the only first factor, it should be required.\n    ctx => ctx.phone.firstFactor && !ctx.email.firstFactor && !ctx.username.firstFactor,\n    // If username is required but not a first factor, and both email and phone are enabled, then phone is a valid identifier.\n    ctx => ctx.username.required && !ctx.username.firstFactor && ctx.phone.enabled && ctx.email.enabled,\n    // If email is not enabled, but phone and username are, phone should be available.\n    ctx => !ctx.email.enabled && ctx.phone.enabled && ctx.username.enabled,\n  ],\n  username: [\n    // If username is the only first factor, it should be required.\n    ctx => ctx.username.enabled && ctx.username.firstFactor && !ctx.email.enabled && !ctx.phone.enabled,\n    // If username is required but not a first factor, and both email and phone are enabled, it should be required.\n    ctx => ctx.username.required && !ctx.username.firstFactor && ctx.email.enabled && ctx.phone.enabled,\n  ],\n};\n\n/**\n * When password is required, we need to ensure at least one identifier\n * (email, phone, or username) is also required\n */\nexport function determineRequiredIdentifier(attributes: Partial<Attributes>): {\n  emailShouldBeRequired: boolean;\n  phoneShouldBeRequired: boolean;\n  usernameShouldBeRequired: boolean;\n} {\n  const ctx = {\n    passwordRequired: Boolean(attributes.password?.enabled && attributes.password.required),\n    email: {\n      enabled: Boolean(attributes.email_address?.enabled),\n      required: Boolean(attributes.email_address?.required),\n      firstFactor: Boolean(attributes.email_address?.used_for_first_factor),\n    },\n    phone: {\n      enabled: Boolean(attributes.phone_number?.enabled),\n      required: Boolean(attributes.phone_number?.required),\n      firstFactor: Boolean(attributes.phone_number?.used_for_first_factor),\n    },\n    username: {\n      enabled: Boolean(attributes.username?.enabled),\n      required: Boolean(attributes.username?.required),\n      firstFactor: Boolean(attributes.username?.used_for_first_factor),\n    },\n  };\n\n  const outcomeMet = (outcome: Outcome) => outcomePredicates[outcome].some(predicate => predicate(ctx));\n\n  if (outcomeMet('mirrorServer')) {\n    return {\n      emailShouldBeRequired: ctx.email.required,\n      phoneShouldBeRequired: ctx.phone.required,\n      usernameShouldBeRequired: ctx.username.required,\n    };\n  }\n\n  if (outcomeMet('none')) {\n    return {\n      emailShouldBeRequired: false,\n      phoneShouldBeRequired: false,\n      usernameShouldBeRequired: false,\n    };\n  }\n\n  const emailShouldBeRequired = outcomeMet('email');\n  const phoneShouldBeRequired = outcomeMet('phone');\n  const usernameShouldBeRequired = outcomeMet('username');\n\n  // If password is required and no identifier is enabled, then email is the default.\n  if (ctx.passwordRequired && !emailShouldBeRequired && !phoneShouldBeRequired && !usernameShouldBeRequired) {\n    return {\n      emailShouldBeRequired: true,\n      phoneShouldBeRequired: false,\n      usernameShouldBeRequired: false,\n    };\n  }\n\n  return {\n    emailShouldBeRequired,\n    phoneShouldBeRequired,\n    usernameShouldBeRequired,\n  };\n}\n"],"mappings":";;;AAQA,MAAM,YAAY;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAyBA,SAAgB,sBAAsB,YAA6C;CACjF,OAAO,UAAU,QAAQ,QAAgB,aAAuB;EAC9D,MAAM,QAAQ,SAAS,UAAU,UAAU;EAC3C,IAAI,OACF,OAAO,YAAY;EAErB,OAAO;CACT,GAAG,CAAC,CAAW;AACjB;AAiBA,SAAgB,gCAAgC,QAAgB,QAA6B;CAC3F,IAAI,QAAQ;EACV,MAAM,iBAAiB,CAAC,CAAC,OAAO;EAChC,MAAM,mBAAmB,OAAO,eAAe,cAAc,WAAW;EACxE,MAAM,mBAAmB,OAAO,eAAe,aAAa,WAAW;EACvE,MAAM,6BAA6B,OAAO,eAAe,iBAAiB,WAAW;EACrF,MAAM,wBAAwB,OAAO,eAAe,YAAY,WAAW;EAC3E,MAAM,mBAAmB,OAAO,oBAAoB;EAEpD,IAAI,kBAAkB,kBACpB,OAAO,OAAO;EAGhB,IAAI,kBACF,OAAO,OAAO;EAGhB,IAAI,8BAA8B,uBAChC,OAAO,OAAO;EAGhB,IAAI,OAAO,WACT,OAAO,OAAO;EAGhB,IAAI,OAAO,UACT,OAAO,OAAO;EAGhB,IAAI,OAAO,UACT,OAAO,OAAO;EAGhB,IAAI,kBACF,OAAO,OAAO;EAIhB,OAAO,QAAQ,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,OAAO;GACzC,IAAI,KAAK,CAAC,EAAE,UACV,OAAO,OAAO;EAElB,CAAC;CACH;AACF;AAEA,MAAa,8BACX,YACA,qBACA,kBACqB;CACrB,IAAI,eAAe,cACjB,OAAO;CAET,IAAI,eAAe,aACjB,OAAO;CAGT,IAAI,aAAa,YAAY,mBAAmB,GAE9C,OAAO;CAGT,MAAM,EAA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