smartcomply-web-sdk 1.0.94 → 1.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5837,7 +5837,7 @@ var SmartComplySDK = (() => {
5837
5837
  * CDN tag they installed with (e.g. @1, which floats to the latest
5838
5838
  * matching release) actually resolved to the version they expect.
5839
5839
  */
5840
- _SmartComply.VERSION = "1.0.94";
5840
+ _SmartComply.VERSION = "1.0.95";
5841
5841
  var SmartComply = _SmartComply;
5842
5842
 
5843
5843
  // src/flow/theme.ts
@@ -7365,6 +7365,10 @@ var SmartComplySDK = (() => {
7365
7365
  if (typeof idType === "string") return globalDocFlow;
7366
7366
  return (idType.fields || []).some((f2) => isUploadFieldType(f2.type));
7367
7367
  }
7368
+ function selectIdTypesForScreen(byCategory, globalDocFlow) {
7369
+ if (!byCategory) return [];
7370
+ return (globalDocFlow ? byCategory.document_verification : byCategory.data_verification) || [];
7371
+ }
7368
7372
  function isResumeLinkErrorMessage(message) {
7369
7373
  return /resume link|resubmit link/i.test(message);
7370
7374
  }
@@ -7892,7 +7896,7 @@ var SmartComplySDK = (() => {
7892
7896
  }
7893
7897
  if (info.failure_stage === "document" && info.country && info.identifier_type) {
7894
7898
  const channels = this.sdkConfig?.channels || {};
7895
- const idTypes = channels[info.country] || [];
7899
+ const idTypes = channels[info.country]?.document_verification || [];
7896
7900
  const match = idTypes.find((idType) => {
7897
7901
  const code = typeof idType === "string" ? idType : idType.code || idType.name;
7898
7902
  return code === info.identifier_type;
@@ -8194,9 +8198,10 @@ var SmartComplySDK = (() => {
8194
8198
  subtitle.textContent = "Choose the country that issued your ID";
8195
8199
  container.appendChild(subtitle);
8196
8200
  for (const country of countries) {
8201
+ const count = channels[country].data_verification.length + channels[country].document_verification.length;
8197
8202
  const card = this.createOptionCard(
8198
8203
  COUNTRY_LABELS[country] || country,
8199
- `${channels[country].length} ID type${channels[country].length > 1 ? "s" : ""} available`,
8204
+ `${count} ID type${count > 1 ? "s" : ""} available`,
8200
8205
  () => {
8201
8206
  this.selectedCountry = country;
8202
8207
  this.showStep("id_type");
@@ -8216,7 +8221,7 @@ var SmartComplySDK = (() => {
8216
8221
  subtitle.textContent = globalDocFlow ? "Choose the document you want to scan" : "Choose the ID you want to verify";
8217
8222
  container.appendChild(subtitle);
8218
8223
  const channels = this.sdkConfig?.channels || {};
8219
- const idTypes = channels[this.selectedCountry] || [];
8224
+ const idTypes = selectIdTypesForScreen(channels[this.selectedCountry], globalDocFlow);
8220
8225
  for (const idType of idTypes) {
8221
8226
  const typeName = typeof idType === "string" ? idType : idType.name;
8222
8227
  const typeCode = typeof idType === "string" ? idType : idType.code || idType.name;
@@ -9527,7 +9532,10 @@ var SmartComplySDK = (() => {
9527
9532
  if (types.includes("data_verification")) return false;
9528
9533
  }
9529
9534
  const channels = this.sdkConfig?.channels || {};
9530
- const allFields = Object.values(channels).flat().flatMap((ch) => ch.fields || []);
9535
+ const allFields = Object.values(channels).flatMap((byCategory) => [
9536
+ ...byCategory.data_verification || [],
9537
+ ...byCategory.document_verification || []
9538
+ ]).flatMap((ch) => ch.fields || []);
9531
9539
  return allFields.some((f2) => isUploadFieldType(f2.type));
9532
9540
  }
9533
9541
  /**