{
  "version": 3,
  "sources": ["../../src/managers/UnlockPanelManager/helpers/getProviderList.ts"],
  "sourcesContent": ["import { providerLabels } from 'constants/providerFactory.constants';\nimport {\n  ICustomProvider,\n  IProviderBase,\n  ProviderType,\n  ProviderTypeEnum\n} from 'providers/types/providerFactory.types';\n\nexport function getProvidersList(\n  addedCustomProviders: ICustomProvider[] = [],\n  allowedProviders?: ProviderType[] | null\n): IProviderBase[] {\n  const defaultProviderTypes = (\n    Object.values(ProviderTypeEnum) as ProviderType[]\n  ).filter((type) => {\n    const excludedProviders: ProviderType[] = [\n      ProviderTypeEnum.none,\n      ProviderTypeEnum.webview\n    ];\n    return !excludedProviders.includes(type);\n  });\n\n  const allAvailableProviderTypes: ProviderType[] = [\n    ...defaultProviderTypes,\n    ...addedCustomProviders.map((p) => p.type as ProviderType)\n  ];\n\n  const customProviderLabels = addedCustomProviders.reduce(\n    (acc, provider) => {\n      acc[provider.type as ProviderType] = provider.name;\n      return acc;\n    },\n    {} as Record<ProviderType, string>\n  );\n\n  const allAvailableLabels = {\n    ...providerLabels,\n    ...customProviderLabels\n  };\n\n  const allowedProviderTypes: ProviderType[] = allowedProviders\n    ? allowedProviders.filter((type) =>\n        allAvailableProviderTypes.includes(type)\n      )\n    : allAvailableProviderTypes;\n\n  const providerList: IProviderBase[] = allowedProviderTypes.map((type) => {\n    const custom = addedCustomProviders.find(\n      (customProvider) => customProvider.type === type\n    );\n    if (custom) {\n      return custom;\n    }\n\n    return {\n      name: type in allAvailableLabels ? allAvailableLabels[type] : type,\n      type\n    };\n  });\n\n  return providerList;\n}\n"],
  "mappings": "kFAQO,SAASA,EACdC,EAA0C,CAAC,EAC3CC,EACiB,CAWjB,IAAMC,EAA4C,CAChD,GAVA,OAAO,OAAOC,CAAgB,EAC9B,OAAQC,GAKD,CAJmC,CACxCD,EAAiB,KACjBA,EAAiB,OACnB,EAC0B,SAASC,CAAI,CACxC,EAIC,GAAGJ,EAAqB,IAAKK,GAAMA,EAAE,IAAoB,CAC3D,EAEMC,EAAuBN,EAAqB,OAChD,CAACO,EAAKC,KACJD,EAAIC,EAAS,IAAoB,EAAIA,EAAS,KACvCD,GAET,CAAC,CACH,EAEME,EAAqB,CACzB,GAAGC,EACH,GAAGJ,CACL,EAsBA,OApB6CL,EACzCA,EAAiB,OAAQG,GACvBF,EAA0B,SAASE,CAAI,CACzC,EACAF,GAEuD,IAAKE,GAAS,CACvE,IAAMO,EAASX,EAAqB,KACjCY,GAAmBA,EAAe,OAASR,CAC9C,EACA,OAAIO,GAIG,CACL,KAAMP,KAAQK,EAAqBA,EAAmBL,CAAI,EAAIA,EAC9D,KAAAA,CACF,CACF,CAAC,CAGH",
  "names": ["getProvidersList", "addedCustomProviders", "allowedProviders", "allAvailableProviderTypes", "ProviderTypeEnum", "type", "p", "customProviderLabels", "acc", "provider", "allAvailableLabels", "providerLabels", "custom", "customProvider"]
}
