@sheerid/jslib 1.106.0 → 1.109.0

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.
Files changed (246) hide show
  1. package/README.md +104 -0
  2. package/__tests__/__helpers__/renderers.d.ts +7 -0
  3. package/es5/Tmetrix.bundle.js +5 -5
  4. package/es5/messages_ar.bundle.js +5 -5
  5. package/es5/messages_bg.bundle.js +5 -5
  6. package/es5/messages_cs.bundle.js +5 -5
  7. package/es5/messages_da.bundle.js +5 -5
  8. package/es5/messages_de.bundle.js +5 -5
  9. package/es5/messages_el.bundle.js +5 -5
  10. package/es5/messages_en-GB.bundle.js +5 -5
  11. package/es5/messages_es-ES.bundle.js +5 -5
  12. package/es5/messages_es.bundle.js +5 -5
  13. package/es5/messages_fi.bundle.js +5 -5
  14. package/es5/messages_fr-CA.bundle.js +5 -5
  15. package/es5/messages_fr.bundle.js +5 -5
  16. package/es5/messages_ga.bundle.js +5 -5
  17. package/es5/messages_hr.bundle.js +5 -5
  18. package/es5/messages_hu.bundle.js +5 -5
  19. package/es5/messages_id.bundle.js +5 -5
  20. package/es5/messages_it.bundle.js +5 -5
  21. package/es5/messages_iw.bundle.js +5 -5
  22. package/es5/messages_ja.bundle.js +5 -5
  23. package/es5/messages_ko.bundle.js +5 -5
  24. package/es5/messages_lo.bundle.js +5 -5
  25. package/es5/messages_lt.bundle.js +5 -5
  26. package/es5/messages_ms.bundle.js +5 -5
  27. package/es5/messages_nl.bundle.js +5 -5
  28. package/es5/messages_no.bundle.js +5 -5
  29. package/es5/messages_pl.bundle.js +5 -5
  30. package/es5/messages_pt-BR.bundle.js +5 -5
  31. package/es5/messages_pt.bundle.js +5 -5
  32. package/es5/messages_ru.bundle.js +5 -5
  33. package/es5/messages_sk.bundle.js +5 -5
  34. package/es5/messages_sl.bundle.js +5 -5
  35. package/es5/messages_sr.bundle.js +5 -5
  36. package/es5/messages_sv.bundle.js +5 -5
  37. package/es5/messages_th.bundle.js +5 -5
  38. package/es5/messages_tr.bundle.js +5 -5
  39. package/es5/messages_zh-HK.bundle.js +5 -5
  40. package/es5/messages_zh.bundle.js +5 -5
  41. package/es6/{ar-a1aa1b10.es.js → ar-4956061a.es.js} +12 -3
  42. package/es6/{cs-08b05f91.es.js.map → ar-4956061a.es.js.map} +1 -1
  43. package/es6/{bg-81a7792c.es.js → bg-d6354db2.es.js} +12 -3
  44. package/es6/{ar-a1aa1b10.es.js.map → bg-d6354db2.es.js.map} +1 -1
  45. package/es6/{cs-08b05f91.es.js → cs-1de96b4c.es.js} +12 -3
  46. package/es6/{da-3d94f9d8.es.js.map → cs-1de96b4c.es.js.map} +1 -1
  47. package/es6/{da-3d94f9d8.es.js → da-8f1dfa43.es.js} +12 -3
  48. package/es6/{bg-81a7792c.es.js.map → da-8f1dfa43.es.js.map} +1 -1
  49. package/es6/{de-37509c80.es.js → de-1aa4e429.es.js} +12 -3
  50. package/es6/de-1aa4e429.es.js.map +1 -0
  51. package/es6/{el-fe41c0c3.es.js → el-2d5e12dd.es.js} +12 -3
  52. package/es6/el-2d5e12dd.es.js.map +1 -0
  53. package/es6/{en-GB-52e5c64c.es.js → en-GB-20967dc5.es.js} +11 -2
  54. package/es6/{en-GB-52e5c64c.es.js.map → en-GB-20967dc5.es.js.map} +1 -1
  55. package/es6/{es-c9026cd4.es.js → es-8e86100a.es.js} +12 -3
  56. package/es6/es-8e86100a.es.js.map +1 -0
  57. package/es6/{es-ES-c3335e2a.es.js → es-ES-4bd1e82e.es.js} +12 -3
  58. package/es6/{es-ES-c3335e2a.es.js.map → es-ES-4bd1e82e.es.js.map} +1 -1
  59. package/es6/{fi-0c8f6bbc.es.js → fi-1d11aab4.es.js} +12 -3
  60. package/es6/fi-1d11aab4.es.js.map +1 -0
  61. package/es6/{fr-CA-bb35b777.es.js → fr-CA-5adbcd22.es.js} +12 -3
  62. package/es6/{fr-CA-bb35b777.es.js.map → fr-CA-5adbcd22.es.js.map} +1 -1
  63. package/es6/{fr-e5e92540.es.js → fr-d80e65df.es.js} +12 -3
  64. package/es6/fr-d80e65df.es.js.map +1 -0
  65. package/es6/{ga-2a2f70dc.es.js → ga-06830697.es.js} +12 -3
  66. package/es6/ga-06830697.es.js.map +1 -0
  67. package/es6/{hr-cde64c69.es.js → hr-4684ff5d.es.js} +12 -3
  68. package/es6/hr-4684ff5d.es.js.map +1 -0
  69. package/es6/{hu-cc086f07.es.js → hu-7a4f3a78.es.js} +12 -3
  70. package/es6/hu-7a4f3a78.es.js.map +1 -0
  71. package/es6/{id-b81308a9.es.js → id-b6fe2fcd.es.js} +12 -3
  72. package/es6/id-b6fe2fcd.es.js.map +1 -0
  73. package/es6/{it-38113b5f.es.js → it-18fd5526.es.js} +12 -3
  74. package/es6/it-18fd5526.es.js.map +1 -0
  75. package/es6/{iw-86b8d01f.es.js → iw-b1f73ffa.es.js} +12 -3
  76. package/es6/iw-b1f73ffa.es.js.map +1 -0
  77. package/es6/{ja-4b9af9de.es.js → ja-05eb217d.es.js} +12 -3
  78. package/es6/ja-05eb217d.es.js.map +1 -0
  79. package/es6/{ko-0ecf01b8.es.js → ko-6026fe32.es.js} +12 -3
  80. package/es6/ko-6026fe32.es.js.map +1 -0
  81. package/es6/{lo-bb99eab4.es.js → lo-30da01da.es.js} +12 -3
  82. package/es6/lo-30da01da.es.js.map +1 -0
  83. package/es6/{lt-8a75ecd4.es.js → lt-a08f94d6.es.js} +12 -3
  84. package/es6/lt-a08f94d6.es.js.map +1 -0
  85. package/es6/{ms-3e109888.es.js → ms-4b69e218.es.js} +12 -3
  86. package/es6/ms-4b69e218.es.js.map +1 -0
  87. package/es6/{nl-d27731f2.es.js → nl-9acf82f8.es.js} +12 -3
  88. package/es6/nl-9acf82f8.es.js.map +1 -0
  89. package/es6/{no-398365a0.es.js → no-443dff87.es.js} +12 -3
  90. package/es6/no-443dff87.es.js.map +1 -0
  91. package/es6/{pl-03b07ec0.es.js → pl-0b4902db.es.js} +12 -3
  92. package/es6/pl-0b4902db.es.js.map +1 -0
  93. package/es6/{pt-BR-908eb973.es.js → pt-BR-afd2234b.es.js} +12 -3
  94. package/es6/{pt-BR-908eb973.es.js.map → pt-BR-afd2234b.es.js.map} +1 -1
  95. package/es6/{pt-9c0c5121.es.js → pt-eefd6a76.es.js} +12 -3
  96. package/es6/pt-eefd6a76.es.js.map +1 -0
  97. package/es6/{ru-8a2909fe.es.js → ru-55b959b7.es.js} +12 -3
  98. package/es6/ru-55b959b7.es.js.map +1 -0
  99. package/es6/{sk-60396a9f.es.js → sk-1751ddd2.es.js} +12 -3
  100. package/es6/sk-1751ddd2.es.js.map +1 -0
  101. package/es6/{sl-a97ed325.es.js → sl-3d874685.es.js} +12 -3
  102. package/es6/sl-3d874685.es.js.map +1 -0
  103. package/es6/{sr-c53320d0.es.js → sr-9449946e.es.js} +12 -3
  104. package/es6/sr-9449946e.es.js.map +1 -0
  105. package/es6/{sv-9874cc44.es.js → sv-b3117f27.es.js} +12 -3
  106. package/es6/sv-b3117f27.es.js.map +1 -0
  107. package/es6/{th-42342bb0.es.js → th-1fb295d2.es.js} +12 -3
  108. package/es6/th-1fb295d2.es.js.map +1 -0
  109. package/es6/{tr-b5e66c00.es.js → tr-b7aed90b.es.js} +12 -3
  110. package/es6/tr-b7aed90b.es.js.map +1 -0
  111. package/es6/{zh-4ae25b08.es.js → zh-6c863e80.es.js} +12 -3
  112. package/es6/zh-6c863e80.es.js.map +1 -0
  113. package/es6/{zh-HK-56ab15f3.es.js → zh-HK-8bc1767d.es.js} +12 -3
  114. package/es6/zh-HK-8bc1767d.es.js.map +1 -0
  115. package/localized-messages/ar.json +12 -3
  116. package/localized-messages/bg.json +12 -3
  117. package/localized-messages/cs.json +12 -3
  118. package/localized-messages/da.json +12 -3
  119. package/localized-messages/de.json +12 -3
  120. package/localized-messages/el.json +12 -3
  121. package/localized-messages/en-GB.json +11 -2
  122. package/localized-messages/en-US.json +11 -2
  123. package/localized-messages/es-ES.json +12 -3
  124. package/localized-messages/es.json +12 -3
  125. package/localized-messages/fi.json +12 -3
  126. package/localized-messages/fr-CA.json +12 -3
  127. package/localized-messages/fr.json +12 -3
  128. package/localized-messages/ga.json +12 -3
  129. package/localized-messages/hr.json +12 -3
  130. package/localized-messages/hu.json +12 -3
  131. package/localized-messages/id.json +12 -3
  132. package/localized-messages/it.json +12 -3
  133. package/localized-messages/iw.json +12 -3
  134. package/localized-messages/ja.json +12 -3
  135. package/localized-messages/ko.json +12 -3
  136. package/localized-messages/lo.json +12 -3
  137. package/localized-messages/lt.json +12 -3
  138. package/localized-messages/ms.json +12 -3
  139. package/localized-messages/nl.json +12 -3
  140. package/localized-messages/no.json +12 -3
  141. package/localized-messages/pl.json +12 -3
  142. package/localized-messages/pt-BR.json +12 -3
  143. package/localized-messages/pt.json +12 -3
  144. package/localized-messages/ru.json +12 -3
  145. package/localized-messages/sk.json +12 -3
  146. package/localized-messages/sl.json +12 -3
  147. package/localized-messages/sr.json +12 -3
  148. package/localized-messages/sv.json +12 -3
  149. package/localized-messages/th.json +12 -3
  150. package/localized-messages/tr.json +12 -3
  151. package/localized-messages/zh-HK.json +12 -3
  152. package/localized-messages/zh.json +12 -3
  153. package/manifest.json +48 -48
  154. package/package.json +1 -1
  155. package/sheerid-requestOrg.css +5 -5
  156. package/sheerid-requestOrg.css.map +1 -1
  157. package/sheerid-requestOrg.js +15 -15
  158. package/sheerid-requestOrg.js.map +1 -1
  159. package/sheerid-utils.js +9 -9
  160. package/sheerid-utils.js.map +1 -1
  161. package/sheerid.css +5 -5
  162. package/sheerid.css.map +1 -1
  163. package/sheerid.js +18 -18
  164. package/sheerid.js.map +1 -1
  165. package/sheerides6.js +304 -161
  166. package/sheerides6.js.map +1 -1
  167. package/src/components/FieldLabel.d.ts +2 -2
  168. package/src/components/FormFields/Address/AddressComponent.d.ts +3 -7
  169. package/src/components/FormFields/BirthDate/BirthDateComponent.d.ts +1 -1
  170. package/src/components/FormFields/BranchOfService/BranchOfServiceComponent.d.ts +1 -1
  171. package/src/components/FormFields/ChangeLocale/ChangeLocaleComponent.d.ts +1 -1
  172. package/src/components/FormFields/City/City.d.ts +2 -2
  173. package/src/components/FormFields/CollegeName/CollegeNameComponent.d.ts +1 -1
  174. package/src/components/FormFields/Company/CompanyComponent.d.ts +1 -1
  175. package/src/components/FormFields/Country/CountryComponent.d.ts +1 -1
  176. package/src/components/FormFields/DischargeDate/DischargeDateComponent.d.ts +1 -1
  177. package/src/components/FormFields/DriverLicenseNumber/DriverLicenseNumberComponent.d.ts +1 -1
  178. package/src/components/FormFields/EBTCardNumber/EBTCardNumberComponent.d.ts +7 -0
  179. package/src/components/FormFields/EBTCardNumber/EBTCardNumberComponent.test.d.ts +1 -0
  180. package/src/components/FormFields/Email/EmailComponent.d.ts +1 -1
  181. package/src/components/FormFields/FirstName/FirstNameComponent.d.ts +1 -1
  182. package/src/components/FormFields/FirstResponderOrganization/FirstResponderOrganizationComponent.d.ts +1 -1
  183. package/src/components/FormFields/FirstResponderStatus/FirstResponderStatusComponent.d.ts +1 -1
  184. package/src/components/FormFields/FormFieldCustom/FormFieldCustom.d.ts +18 -0
  185. package/src/components/FormFields/FormFieldCustom/FormFieldCustom.test.d.ts +1 -0
  186. package/src/components/FormFields/FormFieldLayout/FormFieldLayout.d.ts +14 -0
  187. package/src/components/FormFields/FormFieldText/FormFieldText.d.ts +17 -0
  188. package/src/components/FormFields/FormFieldText/FormFieldText.test.d.ts +1 -0
  189. package/src/components/FormFields/LastName/LastNameComponent.d.ts +1 -1
  190. package/src/components/FormFields/LicensedProfessionalOrganization/LicensedProfessionalOrganizationComponent.d.ts +1 -1
  191. package/src/components/FormFields/LowIncomeOrganization/LowIncomeOrganizationComponent.d.ts +2 -2
  192. package/src/components/FormFields/MedicalProfessionalOrganization/MedicalProfessionalOrganizationComponent.d.ts +1 -1
  193. package/src/components/FormFields/MedicalStatus/MedicalStatusComponent.d.ts +1 -1
  194. package/src/components/FormFields/MemberId/MemberIdComponent.d.ts +1 -1
  195. package/src/components/FormFields/MembershipOrganization/MembershipOrganizationComponent.d.ts +1 -1
  196. package/src/components/FormFields/MilitaryStatus/MilitaryStatusComponent.d.ts +1 -1
  197. package/src/components/FormFields/PhoneNumber/PhoneNumberComponent.d.ts +1 -1
  198. package/src/components/FormFields/SMSCode/SMSCodeComponent.d.ts +1 -1
  199. package/src/components/FormFields/SSN/SSN.d.ts +3 -8
  200. package/src/components/FormFields/State/State.d.ts +1 -1
  201. package/src/components/FormFields/State/StateSelectComponent.d.ts +1 -1
  202. package/src/components/FormFields/Status/StatusComponent.d.ts +1 -1
  203. package/src/components/FormFields/TeacherSchool/TeacherSchoolComponent.d.ts +1 -1
  204. package/src/components/FormInputs/InputText/InputText.d.ts +3 -19
  205. package/src/components/StepMemberPersonalInfo/StepMemberPersonalInfoComponent.d.ts +0 -1
  206. package/src/components/StepMilitaryPersonalInfo/StepCollectMilitaryStatusComponent.d.ts +1 -1
  207. package/src/components/StepPending/ReviewPendingComponent.d.ts +1 -1
  208. package/src/components/TryAgainButtonComponent.d.ts +1 -1
  209. package/src/components/TryAgainButtonComponent.test.d.ts +1 -0
  210. package/src/es6.d.ts +3 -0
  211. package/src/lib/ServerApi/VerificationApiClient.d.ts +2 -1
  212. package/src/lib/installScript/modal.d.ts +3 -3
  213. package/src/lib/types/runtimeTypes.d.ts +5 -2
  214. package/src/lib/types/types.d.ts +30 -6
  215. package/src/lib/utils/strings.d.ts +1 -0
  216. package/src/lib/utils/strings.test.d.ts +1 -0
  217. package/types-reference.zip +0 -0
  218. package/es6/de-37509c80.es.js.map +0 -1
  219. package/es6/el-fe41c0c3.es.js.map +0 -1
  220. package/es6/es-c9026cd4.es.js.map +0 -1
  221. package/es6/fi-0c8f6bbc.es.js.map +0 -1
  222. package/es6/fr-e5e92540.es.js.map +0 -1
  223. package/es6/ga-2a2f70dc.es.js.map +0 -1
  224. package/es6/hr-cde64c69.es.js.map +0 -1
  225. package/es6/hu-cc086f07.es.js.map +0 -1
  226. package/es6/id-b81308a9.es.js.map +0 -1
  227. package/es6/it-38113b5f.es.js.map +0 -1
  228. package/es6/iw-86b8d01f.es.js.map +0 -1
  229. package/es6/ja-4b9af9de.es.js.map +0 -1
  230. package/es6/ko-0ecf01b8.es.js.map +0 -1
  231. package/es6/lo-bb99eab4.es.js.map +0 -1
  232. package/es6/lt-8a75ecd4.es.js.map +0 -1
  233. package/es6/ms-3e109888.es.js.map +0 -1
  234. package/es6/nl-d27731f2.es.js.map +0 -1
  235. package/es6/no-398365a0.es.js.map +0 -1
  236. package/es6/pl-03b07ec0.es.js.map +0 -1
  237. package/es6/pt-9c0c5121.es.js.map +0 -1
  238. package/es6/ru-8a2909fe.es.js.map +0 -1
  239. package/es6/sk-60396a9f.es.js.map +0 -1
  240. package/es6/sl-a97ed325.es.js.map +0 -1
  241. package/es6/sr-c53320d0.es.js.map +0 -1
  242. package/es6/sv-9874cc44.es.js.map +0 -1
  243. package/es6/th-42342bb0.es.js.map +0 -1
  244. package/es6/tr-b5e66c00.es.js.map +0 -1
  245. package/es6/zh-4ae25b08.es.js.map +0 -1
  246. package/es6/zh-HK-56ab15f3.es.js.map +0 -1
package/sheerides6.js CHANGED
@@ -600,6 +600,7 @@ var SubSegmentEnum;
600
600
  SubSegmentEnum["LICENSED_REAL_ESTATE_AGENT"] = "licensedRealEstateAgent";
601
601
  SubSegmentEnum["VETERINARIAN"] = "Veterinarian";
602
602
  SubSegmentEnum["SNAP_BENEFITS"] = "snapBenefits";
603
+ SubSegmentEnum["OTHER_GOVERNMENT_ASSISTANCE"] = "otherGovernmentAssistance";
603
604
  SubSegmentEnum["CHILD_CARE_WORKER"] = "childCareWorker";
604
605
  })(SubSegmentEnum || (SubSegmentEnum = {}));
605
606
  Object.values(SubSegmentEnum); // For runtime checks
@@ -643,6 +644,7 @@ var RecentMoverStatusDefaultMessagesEnum;
643
644
  var LowIncomeStatusDefaultMessagesEnum;
644
645
  (function (LowIncomeStatusDefaultMessagesEnum) {
645
646
  LowIncomeStatusDefaultMessagesEnum["SNAP_BENEFITS"] = "Snap Benefits Recipient";
647
+ LowIncomeStatusDefaultMessagesEnum["OTHER_GOVERNMENT_ASSISTANCE"] = "Other Government Assistance Recipient";
646
648
  })(LowIncomeStatusDefaultMessagesEnum || (LowIncomeStatusDefaultMessagesEnum = {}));
647
649
  Object.values(MilitaryStatusDefaultMessagesEnum); // For runtime checks
648
650
  Object.values(FirstResponderStatusDefaultMessagesEnum); // For runtime checks
@@ -671,6 +673,7 @@ var FieldIdEnum;
671
673
  FieldIdEnum["socialSecurityNumber"] = "socialSecurityNumber";
672
674
  FieldIdEnum["carrierConsentValue"] = "carrierConsentValue";
673
675
  FieldIdEnum["driverLicenseNumber"] = "driverLicenseNumber";
676
+ FieldIdEnum["ebtCardNumber"] = "ebtCardNumber";
674
677
  })(FieldIdEnum || (FieldIdEnum = {}));
675
678
  const FieldIds = Object.values(FieldIdEnum); // For runtime checks
676
679
  var HookNameEnum;
@@ -1180,6 +1183,7 @@ const defaultOptions = {
1180
1183
  urlEmploymentFaq: "https://verify.sheerid.com/employment-faq/",
1181
1184
  urlIdentityFaq: "https://verify.sheerid.com/identity-faq/",
1182
1185
  urlLicensedProfessionalFaq: "https://verify.sheerid.com/professions-faq/",
1186
+ urlLowIncomeFaq: "https://verify.sheerid.com/low-income-faq/",
1183
1187
  urlAddSchoolFaq: "https://verify.sheerid.com/add-school-request-faq/",
1184
1188
  urlAddSchoolForm: "https://offers.sheerid.com/sheerid/add-school-request/",
1185
1189
  privacyPolicyUrl: undefined,
@@ -1190,6 +1194,7 @@ const defaultOptions = {
1190
1194
  httpRequestTimeout: HTTP_REQUEST_TIMEOUT,
1191
1195
  hideTestModeFlag: false,
1192
1196
  hideMilitaryFamilyAcceptableUploads: true,
1197
+ customFormFields: [],
1193
1198
  };
1194
1199
  let options$1 = { ...defaultOptions };
1195
1200
  const getOptions = () => options$1;
@@ -1358,6 +1363,10 @@ const setOptions = (newOptions) => {
1358
1363
  options$1.hideMilitaryFamilyAcceptableUploads = newOptions.hideMilitaryFamilyAcceptableUploads;
1359
1364
  logger.info('option "hideMilitaryFamilyAcceptableUploads" set to', options$1.hideMilitaryFamilyAcceptableUploads);
1360
1365
  }
1366
+ if (newOptions.hasOwnProperty("customFormFields")) {
1367
+ options$1.customFormFields = newOptions.customFormFields;
1368
+ logger.info('option "customFormFields" set to', options$1.customFormFields);
1369
+ }
1361
1370
  };
1362
1371
 
1363
1372
  class ResponseTimeLogger {
@@ -1809,6 +1818,7 @@ var enUSMessages = {
1809
1818
  "defaultMessages.MILITARY_FAMILY": "Military Family",
1810
1819
  "defaultMessages.MILITARY_RETIREE": "Military Retiree",
1811
1820
  "defaultMessages.NURSE": "Nurse",
1821
+ "defaultMessages.OTHER_GOVERNMENT_ASSISTANCE": "Other Government Assistance Recipient",
1812
1822
  "defaultMessages.OTHER_HEALTH_WORKER": "Other Health Worker",
1813
1823
  "defaultMessages.OTHER_MOVER": "Other Mover",
1814
1824
  "defaultMessages.PHARMACIST": "Pharmacist",
@@ -2097,6 +2107,7 @@ var enUSMessages = {
2097
2107
  "defaultMessages.driverLicenseNumber": "Driver license number",
2098
2108
  "defaultMessages.driverLicenseNumberPlaceholder": "Driver license number",
2099
2109
  "defaultMessages.driverLicenseState": "Driver license state",
2110
+ "defaultMessages.ebtCardNumber": "EBT Card Number",
2100
2111
  "defaultMessages.emailAddress": "Email address",
2101
2112
  "defaultMessages.emailAddressPlaceholder": "Email address",
2102
2113
  "defaultMessages.error": "Error",
@@ -2121,6 +2132,7 @@ var enUSMessages = {
2121
2132
  "defaultMessages.errorId.invalidDischargeDate": "Invalid discharge date",
2122
2133
  "defaultMessages.errorId.invalidDocUploadToken": "Provided document upload token is not valid",
2123
2134
  "defaultMessages.errorId.invalidDriverLicenseNumber": "Invalid driver license number",
2135
+ "defaultMessages.errorId.invalidEbtCardNumber": "Invalid EBT Card Number",
2124
2136
  "defaultMessages.errorId.invalidEmail": "Invalid email",
2125
2137
  "defaultMessages.errorId.invalidEmailLoopToken": "We are sorry, the page you requested cannot be found. The URL may be incorrect or the page you're looking for is no longer available.",
2126
2138
  "defaultMessages.errorId.invalidFileSizeEmpty": "One or more files is empty",
@@ -2155,6 +2167,7 @@ var enUSMessages = {
2155
2167
  "defaultMessages.errorId.outsideAgePerson": "Birthdate is not eligible for this offer.",
2156
2168
  "defaultMessages.errorId.requestTimeout": "Request timeout",
2157
2169
  "defaultMessages.errorId.simulatedError": "This is a simulated error",
2170
+ "defaultMessages.errorId.unauthorizedAccountStatus": "This offer has been temporarily discontinued. Please contact the brand’s customer support for more information.",
2158
2171
  "defaultMessages.errorId.unauthorizedDomain": "Unauthorized domain",
2159
2172
  "defaultMessages.errorId.underagePerson": "Persons under age 16 are not eligible for this offer.",
2160
2173
  "defaultMessages.errorId.unknownError": "Unknown Error",
@@ -2212,6 +2225,8 @@ var enUSMessages = {
2212
2225
  "defaultMessages.locales.tr": "Turkish",
2213
2226
  "defaultMessages.locales.zh": "Chinese (Traditional)",
2214
2227
  "defaultMessages.locales.zh-HK": "Chinese (Hong Kong)",
2228
+ "defaultMessages.lowIncomeOrganization": "Government Assistance Program",
2229
+ "defaultMessages.lowIncomeOrganizationPlaceholder": "Government Assistance Program",
2215
2230
  "defaultMessages.lowRewardPool": "<span class='sid-fire-emoji'>&#128293;</span> Only {offersRemaining} offers left!",
2216
2231
  "defaultMessages.memberId": "ID Number",
2217
2232
  "defaultMessages.memberIdPlaceholder": "ID Number",
@@ -2452,6 +2467,8 @@ var enUSMessages = {
2452
2467
  "defaultMessages.step.error.errorId.inactiveProgram.title": "Offer Sold Out!",
2453
2468
  "defaultMessages.step.error.errorId.noRemainingRewardCodes.buttonText": "See More Offers",
2454
2469
  "defaultMessages.step.error.errorId.noRemainingRewardCodes.title": "Offer Sold Out!",
2470
+ "defaultMessages.step.error.errorId.unauthorizedAccountStatus.buttonText": "Contact Support",
2471
+ "defaultMessages.step.error.errorId.unauthorizedAccountStatus.title": "Offer Is Paused!",
2455
2472
  "defaultMessages.step.error.errorId.verificationLimitExceeded.title": "Verification Limit Exceeded",
2456
2473
  "defaultMessages.step.pending.docDiffLang": "We identified your document is in a different language.",
2457
2474
  "defaultMessages.step.pending.subtitle": "SheerID is reviewing your documents, to confirm your status. This process may take up to {maxReviewTime}.",
@@ -2485,16 +2502,17 @@ var enUSMessages = {
2485
2502
  "defaultMessages.step.success.copyCouponCode": "Copy Coupon code",
2486
2503
  "defaultMessages.step.success.emailNotification": "We have emailed you a copy so you can use your new code now or later. Look for the email from verify@sheerid.com.",
2487
2504
  "defaultMessages.step.success.verificationOnly": "\n SheerID handles verification only.\n Now that you've been approved, please direct all questions about the\n promotion terms to {companyName} customer service.\n ",
2505
+ "defaultMessages.streetAddress": "Street Address",
2488
2506
  "defaultMessages.studentInfoShared": "Information entered here will be used for verification purposes and shared with {companyName}. ",
2489
2507
  "defaultMessages.tryAgain": "Try again",
2490
2508
  "defaultMessages.universityName": "University name",
2491
2509
  "defaultMessages.verificationPurposesOnly": "Used for verification purposes only",
2492
2510
  "defaultMessages.verifyAndContinue": "Verify and continue",
2493
- "defaultMessages.verifyLowIncomeStatus": "Verify my status",
2494
2511
  "defaultMessages.verifyMyEmploymentStatus": "Verify My Employee Status",
2495
2512
  "defaultMessages.verifyMyFirstResponderStatus": "Verify My First Responder Status",
2496
2513
  "defaultMessages.verifyMyIdentityStatus": "Verify My Identity",
2497
2514
  "defaultMessages.verifyMyLicensedProfessionalStatus": "Verify My Licensed Professional Status",
2515
+ "defaultMessages.verifyMyLowIncomeStatus": "Verify my status",
2498
2516
  "defaultMessages.verifyMyMedicalProfessionalStatus": "Verify My Medical Professional Status",
2499
2517
  "defaultMessages.verifyMyMembershipStatus": "Verify My Membership Status",
2500
2518
  "defaultMessages.verifyMyMilitaryStatus": "Verify My Military Status",
@@ -2750,154 +2768,154 @@ const getMessagesModuleByLocale = async (locale) => {
2750
2768
  switch (locale) {
2751
2769
  case "ar":
2752
2770
  localizedMessages = await import(
2753
- /* webpackChunkName: "messages_ar" */ './es6/ar-a1aa1b10.es.js').then((m) => m.default);
2771
+ /* webpackChunkName: "messages_ar" */ './es6/ar-4956061a.es.js').then((m) => m.default);
2754
2772
  break;
2755
2773
  case "bg":
2756
2774
  localizedMessages = await import(
2757
- /* webpackChunkName: "messages_bg" */ './es6/bg-81a7792c.es.js').then((m) => m.default);
2775
+ /* webpackChunkName: "messages_bg" */ './es6/bg-d6354db2.es.js').then((m) => m.default);
2758
2776
  break;
2759
2777
  case "cs":
2760
2778
  localizedMessages = await import(
2761
- /* webpackChunkName: "messages_cs" */ './es6/cs-08b05f91.es.js').then((m) => m.default);
2779
+ /* webpackChunkName: "messages_cs" */ './es6/cs-1de96b4c.es.js').then((m) => m.default);
2762
2780
  break;
2763
2781
  case "da":
2764
2782
  localizedMessages = await import(
2765
- /* webpackChunkName: "messages_da" */ './es6/da-3d94f9d8.es.js').then((m) => m.default);
2783
+ /* webpackChunkName: "messages_da" */ './es6/da-8f1dfa43.es.js').then((m) => m.default);
2766
2784
  break;
2767
2785
  case "de":
2768
2786
  localizedMessages = await import(
2769
- /* webpackChunkName: "messages_de" */ './es6/de-37509c80.es.js').then((m) => m.default);
2787
+ /* webpackChunkName: "messages_de" */ './es6/de-1aa4e429.es.js').then((m) => m.default);
2770
2788
  break;
2771
2789
  case "el":
2772
2790
  localizedMessages = await import(
2773
- /* webpackChunkName: "messages_el" */ './es6/el-fe41c0c3.es.js').then((m) => m.default);
2791
+ /* webpackChunkName: "messages_el" */ './es6/el-2d5e12dd.es.js').then((m) => m.default);
2774
2792
  break;
2775
2793
  case "en-GB":
2776
2794
  localizedMessages = await import(
2777
- /* webpackChunkName: "messages_en-GB" */ './es6/en-GB-52e5c64c.es.js').then((m) => m.default);
2795
+ /* webpackChunkName: "messages_en-GB" */ './es6/en-GB-20967dc5.es.js').then((m) => m.default);
2778
2796
  break;
2779
2797
  case "en-US":
2780
2798
  localizedMessages = enUSMessages;
2781
2799
  break;
2782
2800
  case "es-ES":
2783
2801
  localizedMessages = await import(
2784
- /* webpackChunkName: "messages_es-ES" */ './es6/es-ES-c3335e2a.es.js').then((m) => m.default);
2802
+ /* webpackChunkName: "messages_es-ES" */ './es6/es-ES-4bd1e82e.es.js').then((m) => m.default);
2785
2803
  break;
2786
2804
  case "es":
2787
2805
  localizedMessages = await import(
2788
- /* webpackChunkName: "messages_es" */ './es6/es-c9026cd4.es.js').then((m) => m.default);
2806
+ /* webpackChunkName: "messages_es" */ './es6/es-8e86100a.es.js').then((m) => m.default);
2789
2807
  break;
2790
2808
  case "fi":
2791
2809
  localizedMessages = await import(
2792
- /* webpackChunkName: "messages_fi" */ './es6/fi-0c8f6bbc.es.js').then((m) => m.default);
2810
+ /* webpackChunkName: "messages_fi" */ './es6/fi-1d11aab4.es.js').then((m) => m.default);
2793
2811
  break;
2794
2812
  case "fr-CA":
2795
2813
  localizedMessages = await import(
2796
- /* webpackChunkName: "messages_fr-CA" */ './es6/fr-CA-bb35b777.es.js').then((m) => m.default);
2814
+ /* webpackChunkName: "messages_fr-CA" */ './es6/fr-CA-5adbcd22.es.js').then((m) => m.default);
2797
2815
  break;
2798
2816
  case "fr":
2799
2817
  localizedMessages = await import(
2800
- /* webpackChunkName: "messages_fr" */ './es6/fr-e5e92540.es.js').then((m) => m.default);
2818
+ /* webpackChunkName: "messages_fr" */ './es6/fr-d80e65df.es.js').then((m) => m.default);
2801
2819
  break;
2802
2820
  case "ga":
2803
2821
  localizedMessages = await import(
2804
- /* webpackChunkName: "messages_ga" */ './es6/ga-2a2f70dc.es.js').then((m) => m.default);
2822
+ /* webpackChunkName: "messages_ga" */ './es6/ga-06830697.es.js').then((m) => m.default);
2805
2823
  break;
2806
2824
  case "hr":
2807
2825
  localizedMessages = await import(
2808
- /* webpackChunkName: "messages_hr" */ './es6/hr-cde64c69.es.js').then((m) => m.default);
2826
+ /* webpackChunkName: "messages_hr" */ './es6/hr-4684ff5d.es.js').then((m) => m.default);
2809
2827
  break;
2810
2828
  case "hu":
2811
2829
  localizedMessages = await import(
2812
- /* webpackChunkName: "messages_hu" */ './es6/hu-cc086f07.es.js').then((m) => m.default);
2830
+ /* webpackChunkName: "messages_hu" */ './es6/hu-7a4f3a78.es.js').then((m) => m.default);
2813
2831
  break;
2814
2832
  case "id":
2815
2833
  localizedMessages = await import(
2816
- /* webpackChunkName: "messages_id" */ './es6/id-b81308a9.es.js').then((m) => m.default);
2834
+ /* webpackChunkName: "messages_id" */ './es6/id-b6fe2fcd.es.js').then((m) => m.default);
2817
2835
  break;
2818
2836
  case "it":
2819
2837
  localizedMessages = await import(
2820
- /* webpackChunkName: "messages_it" */ './es6/it-38113b5f.es.js').then((m) => m.default);
2838
+ /* webpackChunkName: "messages_it" */ './es6/it-18fd5526.es.js').then((m) => m.default);
2821
2839
  break;
2822
2840
  case "iw":
2823
2841
  localizedMessages = await import(
2824
- /* webpackChunkName: "messages_iw" */ './es6/iw-86b8d01f.es.js').then((m) => m.default);
2842
+ /* webpackChunkName: "messages_iw" */ './es6/iw-b1f73ffa.es.js').then((m) => m.default);
2825
2843
  break;
2826
2844
  case "ja":
2827
2845
  localizedMessages = await import(
2828
- /* webpackChunkName: "messages_ja" */ './es6/ja-4b9af9de.es.js').then((m) => m.default);
2846
+ /* webpackChunkName: "messages_ja" */ './es6/ja-05eb217d.es.js').then((m) => m.default);
2829
2847
  break;
2830
2848
  case "ko":
2831
2849
  localizedMessages = await import(
2832
- /* webpackChunkName: "messages_ko" */ './es6/ko-0ecf01b8.es.js').then((m) => m.default);
2850
+ /* webpackChunkName: "messages_ko" */ './es6/ko-6026fe32.es.js').then((m) => m.default);
2833
2851
  break;
2834
2852
  case "lo":
2835
2853
  localizedMessages = await import(
2836
- /* webpackChunkName: "messages_lo" */ './es6/lo-bb99eab4.es.js').then((m) => m.default);
2854
+ /* webpackChunkName: "messages_lo" */ './es6/lo-30da01da.es.js').then((m) => m.default);
2837
2855
  break;
2838
2856
  case "lt":
2839
2857
  localizedMessages = await import(
2840
- /* webpackChunkName: "messages_lt" */ './es6/lt-8a75ecd4.es.js').then((m) => m.default);
2858
+ /* webpackChunkName: "messages_lt" */ './es6/lt-a08f94d6.es.js').then((m) => m.default);
2841
2859
  break;
2842
2860
  case "ms":
2843
2861
  localizedMessages = await import(
2844
- /* webpackChunkName: "messages_ms" */ './es6/ms-3e109888.es.js').then((m) => m.default);
2862
+ /* webpackChunkName: "messages_ms" */ './es6/ms-4b69e218.es.js').then((m) => m.default);
2845
2863
  break;
2846
2864
  case "nl":
2847
2865
  localizedMessages = await import(
2848
- /* webpackChunkName: "messages_nl" */ './es6/nl-d27731f2.es.js').then((m) => m.default);
2866
+ /* webpackChunkName: "messages_nl" */ './es6/nl-9acf82f8.es.js').then((m) => m.default);
2849
2867
  break;
2850
2868
  case "no":
2851
2869
  localizedMessages = await import(
2852
- /* webpackChunkName: "messages_no" */ './es6/no-398365a0.es.js').then((m) => m.default);
2870
+ /* webpackChunkName: "messages_no" */ './es6/no-443dff87.es.js').then((m) => m.default);
2853
2871
  break;
2854
2872
  case "pl":
2855
2873
  localizedMessages = await import(
2856
- /* webpackChunkName: "messages_pl" */ './es6/pl-03b07ec0.es.js').then((m) => m.default);
2874
+ /* webpackChunkName: "messages_pl" */ './es6/pl-0b4902db.es.js').then((m) => m.default);
2857
2875
  break;
2858
2876
  case "pt-BR":
2859
2877
  localizedMessages = await import(
2860
- /* webpackChunkName: "messages_pt-BR" */ './es6/pt-BR-908eb973.es.js').then((m) => m.default);
2878
+ /* webpackChunkName: "messages_pt-BR" */ './es6/pt-BR-afd2234b.es.js').then((m) => m.default);
2861
2879
  break;
2862
2880
  case "pt":
2863
2881
  localizedMessages = await import(
2864
- /* webpackChunkName: "messages_pt" */ './es6/pt-9c0c5121.es.js').then((m) => m.default);
2882
+ /* webpackChunkName: "messages_pt" */ './es6/pt-eefd6a76.es.js').then((m) => m.default);
2865
2883
  break;
2866
2884
  case "ru":
2867
2885
  localizedMessages = await import(
2868
- /* webpackChunkName: "messages_ru" */ './es6/ru-8a2909fe.es.js').then((m) => m.default);
2886
+ /* webpackChunkName: "messages_ru" */ './es6/ru-55b959b7.es.js').then((m) => m.default);
2869
2887
  break;
2870
2888
  case "sk":
2871
2889
  localizedMessages = await import(
2872
- /* webpackChunkName: "messages_sk" */ './es6/sk-60396a9f.es.js').then((m) => m.default);
2890
+ /* webpackChunkName: "messages_sk" */ './es6/sk-1751ddd2.es.js').then((m) => m.default);
2873
2891
  break;
2874
2892
  case "sl":
2875
2893
  localizedMessages = await import(
2876
- /* webpackChunkName: "messages_sl" */ './es6/sl-a97ed325.es.js').then((m) => m.default);
2894
+ /* webpackChunkName: "messages_sl" */ './es6/sl-3d874685.es.js').then((m) => m.default);
2877
2895
  break;
2878
2896
  case "sr":
2879
2897
  localizedMessages = await import(
2880
- /* webpackChunkName: "messages_sr" */ './es6/sr-c53320d0.es.js').then((m) => m.default);
2898
+ /* webpackChunkName: "messages_sr" */ './es6/sr-9449946e.es.js').then((m) => m.default);
2881
2899
  break;
2882
2900
  case "sv":
2883
2901
  localizedMessages = await import(
2884
- /* webpackChunkName: "messages_sv" */ './es6/sv-9874cc44.es.js').then((m) => m.default);
2902
+ /* webpackChunkName: "messages_sv" */ './es6/sv-b3117f27.es.js').then((m) => m.default);
2885
2903
  break;
2886
2904
  case "th":
2887
2905
  localizedMessages = await import(
2888
- /* webpackChunkName: "messages_th" */ './es6/th-42342bb0.es.js').then((m) => m.default);
2906
+ /* webpackChunkName: "messages_th" */ './es6/th-1fb295d2.es.js').then((m) => m.default);
2889
2907
  break;
2890
2908
  case "tr":
2891
2909
  localizedMessages = await import(
2892
- /* webpackChunkName: "messages_tr" */ './es6/tr-b5e66c00.es.js').then((m) => m.default);
2910
+ /* webpackChunkName: "messages_tr" */ './es6/tr-b7aed90b.es.js').then((m) => m.default);
2893
2911
  break;
2894
2912
  case "zh-HK":
2895
2913
  localizedMessages = await import(
2896
- /* webpackChunkName: "messages_zh-HK" */ './es6/zh-HK-56ab15f3.es.js').then((m) => m.default);
2914
+ /* webpackChunkName: "messages_zh-HK" */ './es6/zh-HK-8bc1767d.es.js').then((m) => m.default);
2897
2915
  break;
2898
2916
  case "zh":
2899
2917
  localizedMessages = await import(
2900
- /* webpackChunkName: "messages_zh" */ './es6/zh-4ae25b08.es.js').then((m) => m.default);
2918
+ /* webpackChunkName: "messages_zh" */ './es6/zh-6c863e80.es.js').then((m) => m.default);
2901
2919
  break;
2902
2920
  default:
2903
2921
  logger.warn(`getMessagesModuleByLocale: Unable to load messages for ${locale}, falling back to en-US`);
@@ -3568,6 +3586,7 @@ const lowIncomePInfoReqEmpty = {
3568
3586
  name: "",
3569
3587
  },
3570
3588
  statuses: [],
3589
+ ebtCardNumber: "",
3571
3590
  metadata: {
3572
3591
  marketConsentValue: false,
3573
3592
  refererUrl: window.location.href,
@@ -3624,6 +3643,7 @@ const initialErrorStructure = {
3624
3643
  carrierConsentValue: undefined,
3625
3644
  smsCode: undefined,
3626
3645
  driverLicenseNumber: undefined,
3646
+ ebtCardNumber: undefined,
3627
3647
  };
3628
3648
  const getAllEmptyViewModels = () => ({
3629
3649
  collectStudentPersonalInfo: deepClone(stuPInfoReqEmpty),
@@ -4217,6 +4237,24 @@ const getFieldValidationErrors = (viewModel, formValidationOptions) => {
4217
4237
  fieldValidationErrors[fieldId] = validateFieldById(fieldId, fieldValue, formValidationOptions);
4218
4238
  }
4219
4239
  }
4240
+ const { customFormFields } = getOptions();
4241
+ if (customFormFields) {
4242
+ customFormFields.forEach((customField) => {
4243
+ let errorId;
4244
+ try {
4245
+ errorId = customField.validate(viewModel.metadata[customField.fieldId]);
4246
+ }
4247
+ catch (e) {
4248
+ logger.warn(`Error validating custom field ${customField.fieldId}`, e);
4249
+ }
4250
+ if (errorId) {
4251
+ fieldValidationErrors[customField.fieldId] = errorId;
4252
+ }
4253
+ else {
4254
+ delete fieldValidationErrors[customField.fieldId];
4255
+ }
4256
+ });
4257
+ }
4220
4258
  return fieldValidationErrors;
4221
4259
  };
4222
4260
  const isFormFilled = (viewModel, formValidationOptions) => {
@@ -4445,7 +4483,7 @@ const getDriverLicenseNumberValidationError = (value) => {
4445
4483
  };
4446
4484
  const getStatusesValidationError = (value) => {
4447
4485
  const invalidStatuses = "invalidStatuses";
4448
- if (!value || !isValidLicensedProfessionalStatus(value)) {
4486
+ if (!value || !isValidLicensedProfessionalStatus(value) || !isValidLowIncomeStatus(value)) {
4449
4487
  return invalidStatuses;
4450
4488
  }
4451
4489
  };
@@ -4493,6 +4531,7 @@ const getStatusValidationError = (value) => {
4493
4531
  }
4494
4532
  };
4495
4533
  const isValidLicensedProfessionalStatus = (value) => value.length > 0;
4534
+ const isValidLowIncomeStatus = (value) => value.length > 0;
4496
4535
  const isValidName = (value) => {
4497
4536
  const VALID_NAME_REGEXP =
4498
4537
  // eslint-disable-next-line
@@ -4656,6 +4695,9 @@ const validateFieldById = (fieldId, value, formValidationOptions) => {
4656
4695
  case FieldIdEnum.docUpload:
4657
4696
  defaultValidator = getFileValidationError;
4658
4697
  return getValidationError(fieldId, value, defaultValidator, overriddenValidator, formValidationOptions);
4698
+ case FieldIdEnum.ebtCardNumber:
4699
+ defaultValidator = getFileValidationError;
4700
+ return getValidationError(fieldId, value, defaultValidator, overriddenValidator, formValidationOptions);
4659
4701
  default:
4660
4702
  if (customValidatorExists(fieldId)) {
4661
4703
  return getCustomValidationError(fieldId, value, formValidationOptions);
@@ -4959,18 +5001,7 @@ const produceDraftViewModel = (previousModel, key, value) => fn(previousModel, (
4959
5001
  draft[key] = value;
4960
5002
  });
4961
5003
 
4962
- const FieldLabel = ({ text, htmlForLabel, id, displayClasses, isRequired, children, }) => (React.createElement("label", { htmlFor: htmlForLabel },
4963
- React.createElement("div", { id: id, className: `sid-field__label sid-l-space-btm-sm ${displayClasses}` },
4964
- React.createElement("span", { className: "sid-field__label-name", "aria-hidden": "true" },
4965
- text,
4966
- isRequired && (React.createElement("span", { "aria-hidden": "true", className: "sid-field__label--required" }, "*"))),
4967
- children && React.createElement("div", { className: "sid-field__label-explanation" }, children))));
4968
- FieldLabel.defaultProps = {
4969
- id: "",
4970
- displayClasses: "",
4971
- isRequired: true,
4972
- children: null,
4973
- };
5004
+ const dashed = (camel) => camel.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
4974
5005
 
4975
5006
  const InputText = ({ id, isErrored, className = undefined, hidePlaceholder = true, refId, required = false, type = "text", ariaDescribedBy, ariaLabel, ...props // forward any remaining props to the input
4976
5007
  }) => {
@@ -4987,25 +5018,53 @@ const InputText = ({ id, isErrored, className = undefined, hidePlaceholder = tru
4987
5018
  const finalRefId = refId || id;
4988
5019
  return (React.createElement("input", Object.assign({ className: internalClassName, id: `sid-${id}`, name: `sid-${id}`, type: type, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, "aria-required": required, "aria-invalid": isErrored, ref: (input) => setRef(finalRefId, input) }, props)));
4989
5020
  };
4990
- // TODO remove injectIntl, unused
4991
- const InputTextComponent = injectIntl(InputText);
5021
+ // DO NOT INJECT INTL. Localize your strings pass them down as props
5022
+ const InputTextComponent = InputText;
4992
5023
 
4993
- const FirstName = ({ value, isErrored, onChange, intl, placeholder = "", }) => (React.createElement("div", { className: "sid-field sid-first-name" },
4994
- React.createElement("div", { className: "sid-l-space-top-md" }),
4995
- React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "firstName", defaultMessage: "First name" }), htmlForLabel: "sid-first-name", id: "sid-first-name-label", displayClasses: placeholder && "sid-h-screen-reader-only" }),
4996
- React.createElement(InputTextComponent, { id: "first-name", isErrored: isErrored, onChange: (e) => onChange(e.target.value), placeholder: placeholder ||
4997
- intl.formatHTMLMessage({ id: "firstNamePlaceholder", defaultMessage: "First Name" }), refId: "firstName", value: value, required: true, "aria-labelledby": "sid-first-name-label" }),
4998
- isErrored ? (React.createElement("div", { className: "sid-field-error" },
4999
- React.createElement(FormattedHTMLMessage, { id: "errorId.invalidFirstName", defaultMessage: "Invalid first name" }))) : null));
5024
+ const FieldLabel = ({ text, htmlForLabel, id, displayClasses, isRequired, children, }) => (React.createElement("label", { htmlFor: htmlForLabel },
5025
+ React.createElement("div", { id: id, className: `sid-field__label sid-l-space-btm-sm ${displayClasses}` },
5026
+ React.createElement("span", { className: "sid-field__label-name", "aria-hidden": "true" },
5027
+ text,
5028
+ isRequired && (React.createElement("span", { "aria-hidden": "true", className: "sid-field__label--required" }, "*"))),
5029
+ children && React.createElement("div", { className: "sid-field__label-explanation" }, children))));
5030
+ FieldLabel.defaultProps = {
5031
+ id: "",
5032
+ displayClasses: "",
5033
+ isRequired: true,
5034
+ children: null,
5035
+ };
5036
+
5037
+ /**
5038
+ * In the JSLIB, a FormField has a label, inline error message, and children like a text input
5039
+ * This component provides consistent structure, classnames and some accessibility considerations for all FormFields
5040
+ */
5041
+ const FormFieldLayout = ({ fieldId, label, errorMessage, isRequired, showPlaceholderAndHideLabel = false, children, }) => {
5042
+ const labelIntlId = `${fieldId}Label`;
5043
+ const labelHtmlId = `sid-${dashed(labelIntlId)}`;
5044
+ return (React.createElement("div", { className: `sid-field sid-${dashed(fieldId)}` },
5045
+ React.createElement("div", { className: "sid-l-space-top-md" }),
5046
+ React.createElement(FieldLabel, { text: label, isRequired: isRequired, htmlForLabel: `sid-${dashed(fieldId)}`, id: labelHtmlId, displayClasses: showPlaceholderAndHideLabel ? "sid-h-screen-reader-only" : "" }),
5047
+ children,
5048
+ errorMessage && React.createElement("div", { className: "sid-field-error" }, errorMessage)));
5049
+ };
5050
+
5051
+ /**
5052
+ * Generic text field component.
5053
+ * In the JSLIB, a field has a label, inline error message, and an input of some kind.
5054
+ */
5055
+ const FormFieldText = ({ fieldId, value, onChange, placeholder, label, errorMessage, showPlaceholderAndHideLabel = false, required = true, ...inputTextProps }) => {
5056
+ const labelIntlId = `${fieldId}Label`;
5057
+ const labelHtmlId = `sid-${dashed(labelIntlId)}`;
5058
+ return (React.createElement(FormFieldLayout, { fieldId: fieldId, label: label, errorMessage: errorMessage, showPlaceholderAndHideLabel: showPlaceholderAndHideLabel, isRequired: required },
5059
+ React.createElement(InputTextComponent, Object.assign({ id: dashed(fieldId), value: value, onChange: (e) => onChange(e.target.value), placeholder: placeholder, hidePlaceholder: !showPlaceholderAndHideLabel, "aria-labelledby": labelHtmlId, refId: fieldId, isErrored: !!errorMessage, required: required }, inputTextProps))));
5060
+ };
5061
+
5062
+ const FirstName = ({ value, isErrored, onChange, intl, placeholder = "", }) => (React.createElement(FormFieldText, { fieldId: "firstName", value: value, onChange: onChange, placeholder: placeholder ||
5063
+ intl.formatHTMLMessage({ id: "firstNamePlaceholder", defaultMessage: "First Name" }), label: React.createElement(FormattedHTMLMessage, { id: "firstName", defaultMessage: "First name" }), errorMessage: isErrored && (React.createElement(FormattedHTMLMessage, { id: "errorId.invalidFirstName", defaultMessage: "Invalid first name" })), showPlaceholderAndHideLabel: !!placeholder }));
5000
5064
  const FirstNameComponent = injectIntl(FirstName);
5001
5065
 
5002
- const LastName = ({ value, isErrored, onChange, intl, placeholder = "", }) => (React.createElement("div", { className: "sid-field sid-last-name" },
5003
- React.createElement("div", { className: "sid-l-space-top-md" }),
5004
- React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "lastName", defaultMessage: "Last name" }), htmlForLabel: "sid-last-name", id: "sid-last-name-label", displayClasses: placeholder && "sid-h-screen-reader-only" }),
5005
- React.createElement(InputTextComponent, { id: "last-name", isErrored: isErrored, onChange: (event) => onChange(event.target.value), placeholder: placeholder ||
5006
- intl.formatHTMLMessage({ id: "lastNamePlaceholder", defaultMessage: "Last Name" }), refId: "lastName", value: value, required: true, "aria-labelledby": "sid-last-name-label" }),
5007
- isErrored ? (React.createElement("div", { className: "sid-field-error" },
5008
- React.createElement(FormattedHTMLMessage, { id: "errorId.invalidLastName", defaultMessage: "Invalid last name" }))) : null));
5066
+ const LastName = ({ value, isErrored, onChange, intl, placeholder = "", }) => (React.createElement(FormFieldText, { fieldId: "lastName", value: value, onChange: onChange, placeholder: placeholder ||
5067
+ intl.formatHTMLMessage({ id: "lastNamePlaceholder", defaultMessage: "Last Name" }), label: React.createElement(FormattedHTMLMessage, { id: "lastName", defaultMessage: "Last name" }), errorMessage: isErrored && (React.createElement(FormattedHTMLMessage, { id: "errorId.invalidLastName", defaultMessage: "Invalid last name" })), showPlaceholderAndHideLabel: !!placeholder }));
5009
5068
  const LastNameComponent = injectIntl(LastName);
5010
5069
 
5011
5070
  const Email = ({ value, isErrored, onChange, explanation, intl, onKeyDown = undefined, placeholder = "", }) => (React.createElement("div", { className: "sid-field sid-email" },
@@ -11566,7 +11625,6 @@ const inactiveMilitaryViewModelToRequest = (viewModel) => ({
11566
11625
  locale: viewModel.localeChoice.value,
11567
11626
  country: viewModel.countryChoice ? viewModel.countryChoice.value : undefined,
11568
11627
  metadata: viewModel.metadata,
11569
- socialSecurityNumber: viewModel.socialSecurityNumber,
11570
11628
  });
11571
11629
  const firstResponderViewModelToRequest = (viewModel) => {
11572
11630
  const request = {
@@ -11698,6 +11756,7 @@ const lowIncomeViewModelToRequest = (viewModel) => ({
11698
11756
  statuses: viewModel.statuses,
11699
11757
  organization: viewModel.organization,
11700
11758
  deviceFingerprintHash: viewModel.deviceFingerprintHash,
11759
+ ebtCardNumber: viewModel.ebtCardNumber,
11701
11760
  locale: viewModel.localeChoice.value,
11702
11761
  metadata: viewModel.metadata,
11703
11762
  });
@@ -18487,6 +18546,33 @@ const RewardsRemainingComponent = ({ verificationService, }) => {
18487
18546
  return null;
18488
18547
  };
18489
18548
 
18549
+ /**
18550
+ * Custom form field component.
18551
+ * Implementors can render a form field passing in config using setOptions, rather than
18552
+ * having to create an entire React project and override component(s).
18553
+ */
18554
+ const FormFieldCustom = injectIntl(({ config, verificationService, intl }) => {
18555
+ const currentValue = getSafe(() => verificationService.viewModel.metadata[config.fieldId]) || "";
18556
+ const errorId = getSafe(() => verificationService.fieldValidationErrors[config.fieldId]);
18557
+ const onChange = (value) => {
18558
+ verificationService.updateViewModel(fn(verificationService.viewModel, (draft) => {
18559
+ draft.metadata = draft.metadata || {};
18560
+ draft.metadata[config.fieldId] = value;
18561
+ }));
18562
+ verificationService.updateFieldValidationErrors(fn(verificationService.fieldValidationErrors, (draft) => {
18563
+ const errorId = config.validate(value);
18564
+ if (errorId === undefined) {
18565
+ delete draft[config.fieldId];
18566
+ }
18567
+ // Don't set error. Only do that when submit is clicked, same as jslib's built-in fields
18568
+ }));
18569
+ };
18570
+ return (React.createElement(FormFieldText, { fieldId: config.fieldId, value: `${currentValue}`, onChange: onChange, placeholder: intl.formatHTMLMessage({
18571
+ id: `${config.fieldId}Placeholder`,
18572
+ defaultMessage: config.fieldId,
18573
+ }), label: React.createElement(FormattedHTMLMessage, { id: `${config.fieldId}Label`, defaultMessage: config.fieldId }), errorMessage: errorId && (React.createElement(FormattedHTMLMessage, { id: `errorId.${errorId}`, defaultMessage: `Invalid ${config.fieldId}` })), showPlaceholderAndHideLabel: config.showPlaceholderAndHideLabel, required: config.required }));
18574
+ });
18575
+
18490
18576
  /**
18491
18577
  * TODO - preamble
18492
18578
  */
@@ -18557,6 +18643,7 @@ const StepStudentPersonalInfo = ({ intl, verificationService, }) => {
18557
18643
  updateStudentViewModel("phoneNumber", newValue);
18558
18644
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
18559
18645
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
18646
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
18560
18647
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
18561
18648
  updateStudentViewModel("metadata", {
18562
18649
  ...verificationService.viewModel.metadata,
@@ -18645,6 +18732,7 @@ const StepSeniorPersonalInfo = ({ verificationService }) => {
18645
18732
  updateSeniorViewModel("phoneNumber", newValue);
18646
18733
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
18647
18734
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
18735
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
18648
18736
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
18649
18737
  updateSeniorViewModel("metadata", {
18650
18738
  ...verificationService.viewModel.metadata,
@@ -18682,21 +18770,10 @@ const carrierConsentValueValidator = (countryChoiceValue) => (value, programThem
18682
18770
  }
18683
18771
  };
18684
18772
 
18685
- const City = ({ value, isErrored, onChange, intl, onKeyDown = undefined, placeholder = "", }) => (React.createElement("div", { className: "sid-field sid-city" },
18686
- React.createElement("div", { className: "sid-l-space-top-md" }),
18687
- React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "city", defaultMessage: "City" }), htmlForLabel: "sid-city", id: "sid-city-label", displayClasses: placeholder && "sid-h-screen-reader-only" }),
18688
- React.createElement(InputTextComponent, { id: "city", isErrored: isErrored, onChange: (e) => onChange(e.target.value), onKeyDown: typeof onKeyDown === "function" ? (e) => onKeyDown(e) : undefined, placeholder: placeholder || intl.formatHTMLMessage({ id: "cityPlaceholder", defaultMessage: "City" }), value: value, "aria-labelledby": "sid-city-label" }),
18689
- isErrored ? (React.createElement("div", { className: "sid-field-error" },
18690
- React.createElement(FormattedHTMLMessage, { id: "errorId.invalidCity", defaultMessage: "Invalid city" }))) : null));
18773
+ const City = ({ value, isErrored, onChange, intl, isRequired = false, onKeyDown = undefined, placeholder = "", }) => (React.createElement(FormFieldText, { fieldId: "city", value: value, onChange: onChange, placeholder: placeholder || intl.formatHTMLMessage({ id: "cityPlaceholder", defaultMessage: "City" }), label: React.createElement(FormattedHTMLMessage, { id: "city", defaultMessage: "City" }), errorMessage: isErrored && React.createElement(FormattedHTMLMessage, { id: "errorId.invalidCity", defaultMessage: "Invalid city" }), showPlaceholderAndHideLabel: !!placeholder, required: isRequired, onKeyDown: typeof onKeyDown === "function" ? (e) => onKeyDown(e) : undefined }));
18691
18774
  const CityComponent = injectIntl(City);
18692
18775
 
18693
- const Address = ({ value, isErrored, onChange, intl, onKeyDown = undefined, placeholder = "", }) => (React.createElement("div", { className: "sid-field sid-address" },
18694
- React.createElement("div", { className: "sid-l-space-top-md" }),
18695
- React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "address", defaultMessage: "Address" }), htmlForLabel: "sid-address", id: "sid-address-label", displayClasses: placeholder && "sid-h-screen-reader-only" }),
18696
- React.createElement(InputTextComponent, { id: "address", isErrored: isErrored, onChange: (e) => onChange(e.target.value), onKeyDown: typeof onKeyDown === "function" ? (e) => onKeyDown(e) : undefined, placeholder: placeholder ||
18697
- intl.formatHTMLMessage({ id: "addressPlaceholder", defaultMessage: "Address" }), value: value, "aria-labelledby": "sid-address-label" }),
18698
- isErrored ? (React.createElement("div", { className: "sid-field-error" },
18699
- React.createElement(FormattedHTMLMessage, { id: "errorId.invalidAddress", defaultMessage: "Invalid address" }))) : null));
18776
+ const Address = ({ value, isErrored, onChange, intl, isRequired = false, onKeyDown = undefined, placeholder = "", label, }) => (React.createElement(FormFieldText, { fieldId: "address", value: value, onChange: onChange, placeholder: placeholder || intl.formatHTMLMessage({ id: "addressPlaceholder", defaultMessage: "Address" }), label: label || React.createElement(FormattedHTMLMessage, { id: "address", defaultMessage: "Address" }), errorMessage: isErrored && (React.createElement(FormattedHTMLMessage, { id: "errorId.invalidAddress", defaultMessage: "Invalid address" })), showPlaceholderAndHideLabel: !!placeholder, required: isRequired, onKeyDown: typeof onKeyDown === "function" ? (e) => onKeyDown(e) : undefined }));
18700
18777
  const AddressComponent = injectIntl(Address);
18701
18778
 
18702
18779
  /**
@@ -18817,6 +18894,7 @@ const StepAgePersonalInfo = ({ verificationService, intl }) => {
18817
18894
  updateAgeViewModel("phoneNumber", value);
18818
18895
  updateFieldValidationErrorsByFieldId("phoneNumber", value, verificationService);
18819
18896
  }, errorId: fieldValidationErrors.phoneNumber, requireCarrierConsent: verificationService.programTheme.smsLoopEnabled || safeCountryValue !== "US", onCarrierConsentChange: onCarrierConsentChange, carrierConsent: Boolean(viewModel.metadata && viewModel.metadata.carrierConsentValue), selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })),
18897
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
18820
18898
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
18821
18899
  updateAgeViewModel("metadata", {
18822
18900
  ...verificationService.viewModel.metadata,
@@ -18943,6 +19021,7 @@ const StepTeacherPersonalInfo = ({ intl, verificationService, }) => {
18943
19021
  updateTeacherViewModel("postalCode", newValue);
18944
19022
  updateFieldValidationErrorsByFieldId("postalCode", newValue, verificationService);
18945
19023
  }, value: viewModel.postalCode })) : null,
19024
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
18946
19025
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
18947
19026
  updateTeacherViewModel("metadata", {
18948
19027
  ...verificationService.viewModel.metadata,
@@ -18989,7 +19068,6 @@ const MembershipOrganizationComponent = injectIntl(MembershipOrganization);
18989
19068
 
18990
19069
  /**
18991
19070
  * Step Member Personal Info Component
18992
- * TODO - We need to import more from es6
18993
19071
  */
18994
19072
  const StepMemberPersonalInfo = ({ intl, verificationService, }) => {
18995
19073
  const viewModel = verificationService.viewModel;
@@ -19062,6 +19140,7 @@ const StepMemberPersonalInfo = ({ intl, verificationService, }) => {
19062
19140
  updateMemberViewModel("phoneNumber", newValue);
19063
19141
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
19064
19142
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
19143
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
19065
19144
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
19066
19145
  updateMemberViewModel("metadata", {
19067
19146
  ...verificationService.viewModel.metadata,
@@ -19261,6 +19340,7 @@ const StepActiveMilitaryPersonalInfo = ({ intl, verificationService, }) => {
19261
19340
  updateActiveMilitaryViewModel("phoneNumber", newValue);
19262
19341
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
19263
19342
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
19343
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
19264
19344
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
19265
19345
  updateActiveMilitaryViewModel("metadata", {
19266
19346
  ...verificationService.viewModel.metadata,
@@ -19385,50 +19465,6 @@ DischargeDate.defaultProps = {
19385
19465
  };
19386
19466
  const DischargeDateComponent = injectIntl(DischargeDate);
19387
19467
 
19388
- /**
19389
- * Insert `newPart` into a string
19390
- * Use:
19391
- * "Hi !".insertAt(3, "world"); // "Hi world!"
19392
- */
19393
- String.prototype.insertAt = function (index, newPart) {
19394
- if (index > this.length) {
19395
- return this;
19396
- }
19397
- return `${this.slice(0, index)}${newPart}${this.slice(index)}`;
19398
- };
19399
-
19400
- const displaySSN = (value) => {
19401
- let stringValue;
19402
- try {
19403
- stringValue = value.toString();
19404
- if (!stringValue)
19405
- throw new Error();
19406
- }
19407
- catch (e) {
19408
- return "";
19409
- }
19410
- return stringValue
19411
- .replace(/[^\d]/g, "") // replce non-digit chars
19412
- .insertAt(3, "-") // for display
19413
- .insertAt(6, "-")
19414
- .replace("--", "") // just in case
19415
- .replace(/-$/, ""); // don't add trailing hyphen, breaks backspace
19416
- };
19417
- // The viewModel and API don't include hyphens. Also enforces max length, prior to setting viewModel, avoiding off-by-one error.
19418
- const unDisplaySSN = (value) => value.replace(/-/g, "").slice(0, SSN_STRING_LENGTH);
19419
-
19420
- const SocialSecurity = ({ value, isErrored, onChange, intl, explanation, placeholder = "", isRequired = false, label, }) => {
19421
- const getDefaultExplanation = () => (!isRequired ? explanation : "");
19422
- return (React.createElement("div", { className: "sid-field sid-ssn" },
19423
- React.createElement("div", { className: "sid-l-space-top-md" }),
19424
- React.createElement(FieldLabel, { text: label, htmlForLabel: "sid-ssn", id: "sid-ssn-label", displayClasses: "sid-field__label-with-explanation", isRequired: isRequired }, getDefaultExplanation()),
19425
- React.createElement(InputTextComponent, { id: "ssn", refId: FieldIdEnum.socialSecurityNumber, className: "sid-ssn__input", isErrored: isErrored, required: true, placeholder: placeholder ||
19426
- intl.formatHTMLMessage({ id: "ssnPlaceholder", defaultMessage: "000-00-0000" }), value: displaySSN(value), hidePlaceholder: false, onChange: (e) => onChange(unDisplaySSN(e.target.value)), "aria-labelledby": "sid-ssn-label" }),
19427
- isErrored ? (React.createElement("div", { className: "sid-field-error" },
19428
- React.createElement(FormattedHTMLMessage, { id: "errorId.invalidSocialSecurityNumber", defaultMessage: "Invalid SSN" }))) : null));
19429
- };
19430
- const SocialSecurityNumber = injectIntl(SocialSecurity);
19431
-
19432
19468
  /**
19433
19469
  * TODO - preamble
19434
19470
  */
@@ -19515,10 +19551,7 @@ const StepInactiveMilitaryPersonalInfo = ({ intl, verificationService, }) => {
19515
19551
  updateInactiveMilitaryViewModel("phoneNumber", newValue);
19516
19552
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
19517
19553
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
19518
- React.createElement(SocialSecurity, { value: viewModel.socialSecurityNumber, onChange: (value) => {
19519
- updateInactiveMilitaryViewModel("socialSecurityNumber", value);
19520
- updateFieldValidationErrorsByFieldId("socialSecurityNumber", value, verificationService);
19521
- }, isRequired: false, isErrored: !!fieldValidationErrors[FieldIdEnum.socialSecurityNumber], placeholder: "000-00-0000", label: React.createElement(FormattedHTMLMessage, { id: "ssn", defaultMessage: "Social Security Number" }), explanation: React.createElement(FormattedHTMLMessage, { id: "optional", defaultMessage: "Optional" }) }),
19554
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
19522
19555
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
19523
19556
  updateInactiveMilitaryViewModel("metadata", {
19524
19557
  ...verificationService.viewModel.metadata,
@@ -19651,6 +19684,7 @@ const StepFirstResponderPersonalInfo = ({ intl, verificationService, }) => {
19651
19684
  updateFirstResponderViewModel("postalCode", newValue);
19652
19685
  updateFieldValidationErrorsByFieldId("postalCode", newValue, verificationService);
19653
19686
  }, value: viewModel.postalCode })) : null,
19687
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
19654
19688
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
19655
19689
  updateFirstResponderViewModel("metadata", {
19656
19690
  ...verificationService.viewModel.metadata,
@@ -19808,6 +19842,7 @@ const StepMedicalProfessionalPersonalInfo = ({ intl, verificationService, }) =>
19808
19842
  updateMedicalProfessionalViewModel("memberId", newValue);
19809
19843
  updateFieldValidationErrorsByFieldId("memberId", newValue, verificationService);
19810
19844
  }, explanation: memberIdMessageKeys && (React.createElement(FormattedHTMLMessage, { id: memberIdMessageKeys.explanationKey, defaultMessage: "Your Professional Membership Registration Number" })), label: memberIdMessageKeys && (React.createElement(FormattedHTMLMessage, { id: memberIdMessageKeys.labelKey, defaultMessage: "Registration Number" })) })),
19845
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
19811
19846
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
19812
19847
  updateMedicalProfessionalViewModel("metadata", {
19813
19848
  ...verificationService.viewModel.metadata,
@@ -19898,12 +19933,12 @@ const StepEmploymentPersonalInfo = ({ verificationService, }) => {
19898
19933
  shouldCollectAddressFields(viewModel.countryChoice, verificationService.programTheme.config.countries) ? (React.createElement(AddressComponent, { isErrored: !!fieldValidationErrors.address1, errorId: fieldValidationErrors.address1, onChange: (newValue) => {
19899
19934
  updateEmploymentViewModel("address1", newValue);
19900
19935
  updateFieldValidationErrorsByFieldId("address1", newValue, verificationService);
19901
- }, value: viewModel.address1 })) : null,
19936
+ }, isRequired: true, value: viewModel.address1 })) : null,
19902
19937
  shouldCollectAddressFields(viewModel.countryChoice, verificationService.programTheme.config.countries) ? (React.createElement("div", { className: "sid-thirds" },
19903
19938
  React.createElement(CityComponent, { isErrored: !!fieldValidationErrors.city, errorId: fieldValidationErrors.city, onChange: (newValue) => {
19904
19939
  updateEmploymentViewModel("city", newValue);
19905
19940
  updateFieldValidationErrorsByFieldId("city", newValue, verificationService);
19906
- }, value: viewModel.city }),
19941
+ }, value: viewModel.city, isRequired: true }),
19907
19942
  React.createElement(StateComponent, { isErrored: !!fieldValidationErrors.state, errorId: fieldValidationErrors.state, onChange: (newValue) => {
19908
19943
  updateEmploymentViewModel("state", newValue);
19909
19944
  updateFieldValidationErrorsByFieldId("state", newValue, verificationService);
@@ -19921,6 +19956,7 @@ const StepEmploymentPersonalInfo = ({ verificationService, }) => {
19921
19956
  updateEmploymentViewModel("phoneNumber", newValue);
19922
19957
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
19923
19958
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
19959
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
19924
19960
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
19925
19961
  updateEmploymentViewModel("metadata", {
19926
19962
  ...verificationService.viewModel.metadata,
@@ -20038,6 +20074,7 @@ const StepDriverLicensePersonalInfo = ({ intl, verificationService, }) => {
20038
20074
  updateIdentityViewModel("driverLicenseNumber", newValue);
20039
20075
  updateFieldValidationErrorsByFieldId("driverLicenseNumber", newValue, verificationService);
20040
20076
  } }),
20077
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
20041
20078
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
20042
20079
  updateIdentityViewModel("metadata", {
20043
20080
  ...verificationService.viewModel.metadata,
@@ -20113,12 +20150,12 @@ const StepGeneralIdentityPersonalInfo = ({ intl, verificationService, }) => {
20113
20150
  React.createElement(AddressComponent, { isErrored: !!fieldValidationErrors.address1, errorId: fieldValidationErrors.address1, onChange: (newValue) => {
20114
20151
  updateIdentityViewModel("address1", newValue);
20115
20152
  updateFieldValidationErrorsByFieldId("address1", newValue, verificationService);
20116
- }, value: viewModel.address1 }),
20153
+ }, value: viewModel.address1, isRequired: true }),
20117
20154
  React.createElement("div", { className: "sid-thirds" },
20118
20155
  React.createElement(CityComponent, { isErrored: !!fieldValidationErrors.city, errorId: fieldValidationErrors.city, onChange: (newValue) => {
20119
20156
  updateIdentityViewModel("city", newValue);
20120
20157
  updateFieldValidationErrorsByFieldId("city", newValue, verificationService);
20121
- }, value: viewModel.city }),
20158
+ }, value: viewModel.city, isRequired: true }),
20122
20159
  React.createElement(StateSelectComponent, { isRequired: true, options: getAvailableStateChoices(verificationService.programTheme, intl), value: viewModel.state || undefined, isErrored: Boolean(fieldValidationErrors.state), onChange: async (stateChoice) => {
20123
20160
  const stateValue = stateChoice ? stateChoice.value : undefined;
20124
20161
  updateIdentityViewModel("state", stateValue);
@@ -20127,7 +20164,8 @@ const StepGeneralIdentityPersonalInfo = ({ intl, verificationService, }) => {
20127
20164
  React.createElement(PostalCodeComponent, { isErrored: !!fieldValidationErrors.postalCode, onChange: (newValue) => {
20128
20165
  updateIdentityViewModel("postalCode", newValue);
20129
20166
  updateFieldValidationErrorsByFieldId("postalCode", newValue, verificationService);
20130
- }, value: viewModel.postalCode })),
20167
+ }, value: viewModel.postalCode, isRequired: true })),
20168
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
20131
20169
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
20132
20170
  updateIdentityViewModel("metadata", {
20133
20171
  ...verificationService.viewModel.metadata,
@@ -20203,12 +20241,12 @@ const StepHybridIdentityPersonalInfo = ({ intl, verificationService, }) => {
20203
20241
  React.createElement(AddressComponent, { isErrored: !!fieldValidationErrors.address1, errorId: fieldValidationErrors.address1, onChange: (newValue) => {
20204
20242
  updateIdentityViewModel("address1", newValue);
20205
20243
  updateFieldValidationErrorsByFieldId("address1", newValue, verificationService);
20206
- }, value: viewModel.address1 }),
20244
+ }, value: viewModel.address1, isRequired: true }),
20207
20245
  React.createElement("div", { className: "sid-thirds" },
20208
20246
  React.createElement(CityComponent, { isErrored: !!fieldValidationErrors.city, errorId: fieldValidationErrors.city, onChange: (newValue) => {
20209
20247
  updateIdentityViewModel("city", newValue);
20210
20248
  updateFieldValidationErrorsByFieldId("city", newValue, verificationService);
20211
- }, value: viewModel.city }),
20249
+ }, value: viewModel.city, isRequired: true }),
20212
20250
  React.createElement(StateSelectComponent, { isRequired: true, options: getAvailableStateChoices(verificationService.programTheme, intl), value: viewModel.state || undefined, isErrored: Boolean(fieldValidationErrors.state), onChange: async (stateChoice) => {
20213
20251
  const stateValue = stateChoice ? stateChoice.value : undefined;
20214
20252
  updateIdentityViewModel("state", stateValue);
@@ -20222,6 +20260,7 @@ const StepHybridIdentityPersonalInfo = ({ intl, verificationService, }) => {
20222
20260
  updateIdentityViewModel("driverLicenseNumber", newValue);
20223
20261
  updateFieldValidationErrorsByFieldId("driverLicenseNumber", newValue, verificationService);
20224
20262
  } }),
20263
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
20225
20264
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
20226
20265
  updateIdentityViewModel("metadata", {
20227
20266
  ...verificationService.viewModel.metadata,
@@ -20266,8 +20305,8 @@ const LicensedProfessionalOrganization = ({ value, isErrored, onChange, verifica
20266
20305
  };
20267
20306
  const LicensedProfessionalOrganizationComponent = injectIntl(LicensedProfessionalOrganization);
20268
20307
 
20269
- const SEGMENT_ID = "licensed-professional";
20270
- const defaultStatusMessages = {
20308
+ const SEGMENT_ID$1 = "licensed-professional";
20309
+ const defaultStatusMessages$1 = {
20271
20310
  LICENSED_COSMETOLOGIST: "Licensed Cosmetologist",
20272
20311
  LICENSED_REAL_ESTATE_AGENT: "Licensed Real Estate Agent",
20273
20312
  VETERINARIAN: "Veterinarian",
@@ -20288,7 +20327,7 @@ const StepLicensedProfessionalPersonalInfo = ({ intl, verificationService, }) =>
20288
20327
  if (!status) {
20289
20328
  return "";
20290
20329
  }
20291
- return intl.formatHTMLMessage({ id: status, defaultMessage: defaultStatusMessages[status] });
20330
+ return intl.formatHTMLMessage({ id: status, defaultMessage: defaultStatusMessages$1[status] });
20292
20331
  };
20293
20332
  const getAvailableLicensedProfessionalStatuses = () => {
20294
20333
  const availableStatusesResponse = verificationResponse.availableStatuses;
@@ -20314,7 +20353,7 @@ const StepLicensedProfessionalPersonalInfo = ({ intl, verificationService, }) =>
20314
20353
  React.createElement("div", { className: "sid-header__how-verifying-works sid-l-horz-center" },
20315
20354
  React.createElement(HowDoesVerifyingWorkComponent, { verificationService: verificationService }),
20316
20355
  React.createElement(RewardsRemainingComponent, { verificationService: verificationService })))),
20317
- React.createElement(StatusComponent, { segmentId: SEGMENT_ID, value: {
20356
+ React.createElement(StatusComponent, { segmentId: SEGMENT_ID$1, value: {
20318
20357
  value: viewModel.statuses ? viewModel.statuses[0] : "",
20319
20358
  label: viewModel.statuses ? getStatusLabel(viewModel.statuses[0]) : "",
20320
20359
  }, isErrored: !!fieldValidationErrors.statuses, options: getAvailableLicensedProfessionalStatuses(), onChange: (status) => {
@@ -20352,6 +20391,7 @@ const StepLicensedProfessionalPersonalInfo = ({ intl, verificationService, }) =>
20352
20391
  updateLicensedProfessionalViewModel("phoneNumber", newValue);
20353
20392
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
20354
20393
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
20394
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
20355
20395
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
20356
20396
  updateLicensedProfessionalViewModel("metadata", {
20357
20397
  ...verificationService.viewModel.metadata,
@@ -20413,7 +20453,7 @@ const StepMoverPersonalInfo = ({ verificationService }) => {
20413
20453
  React.createElement(AddressComponent, { value: viewModel.address1, isErrored: !!fieldValidationErrors.address1, errorId: fieldValidationErrors.address1, onChange: (newValue) => {
20414
20454
  updateMoverViewModel("address1", newValue);
20415
20455
  updateFieldValidationErrorsByFieldId("address1", newValue, verificationService);
20416
- } }),
20456
+ }, label: React.createElement(FormattedHTMLMessage, { id: "streetAddress", defaultMessage: "Street Address" }), isRequired: true }),
20417
20457
  React.createElement(PostalCodeComponent, { value: viewModel.postalCode, isErrored: !!fieldValidationErrors.postalCode, onChange: (newValue) => {
20418
20458
  updateMoverViewModel("postalCode", newValue);
20419
20459
  updateFieldValidationErrorsByFieldId("postalCode", newValue, verificationService);
@@ -20427,6 +20467,7 @@ const StepMoverPersonalInfo = ({ verificationService }) => {
20427
20467
  updateMoverViewModel("phoneNumber", newValue);
20428
20468
  updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
20429
20469
  }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
20470
+ getOptions().customFormFields.map((config) => (React.createElement(FormFieldCustom, { config: config, verificationService: verificationService }))),
20430
20471
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
20431
20472
  updateMoverViewModel("metadata", {
20432
20473
  ...verificationService.viewModel.metadata,
@@ -20444,14 +20485,14 @@ const StepMoverPersonalInfo = ({ verificationService }) => {
20444
20485
  };
20445
20486
  const StepMoverPersonalInfoComponent = injectIntl(StepMoverPersonalInfo);
20446
20487
 
20447
- const LowIncomeOrganization = ({ value, isErrored, onChange, verificationService, intl, placeholder = "", }) => {
20488
+ const LowIncomeOrganization = ({ value, isErrored, onChange, verificationService, intl, placeholder = "", isRequired = false, }) => {
20448
20489
  const { programId } = verificationService;
20449
20490
  return (React.createElement("div", { className: "sid-field sid-low-income-id" },
20450
20491
  React.createElement("div", { className: "sid-l-space-top-md" }),
20451
- React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "organization", defaultMessage: "Government Assistance Program" }), htmlForLabel: "sid-low-income", id: "sid-low-income-label", displayClasses: placeholder && "sid-h-screen-reader-only" }),
20492
+ React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "lowIncomeOrganization", defaultMessage: "Government Assistance Program" }), htmlForLabel: "sid-low-income", id: "sid-low-income-label", displayClasses: placeholder && "sid-h-screen-reader-only", isRequired: isRequired }),
20452
20493
  React.createElement(TypeaheadComponent, { className: isErrored ? "sid-text-input--error" : "", countryCode: getSafe(() => verificationService.viewModel.countryChoice.value), onChange: (choice) => onChange(choice), minimumSearchValueLength: getOptions().minimumOrganizationSearchLength, placeholder: placeholder ||
20453
20494
  intl.formatHTMLMessage({
20454
- id: "organizationNamePlaceholder",
20495
+ id: "lowIncomeOrganizationPlaceholder",
20455
20496
  defaultMessage: "Government Assistance Program",
20456
20497
  }), programId: programId, value: value, inputHtmlId: "sid-low-income", openOrgSearchEnabled: verificationService.programTheme.openOrgSearchEnabled, orgSearchUrl: verificationService.programTheme.config.orgSearchUrl }),
20457
20498
  isErrored ? (React.createElement("div", { className: "sid-field-error" },
@@ -20459,6 +20500,15 @@ const LowIncomeOrganization = ({ value, isErrored, onChange, verificationService
20459
20500
  };
20460
20501
  const LowIncomeOrganizationComponent = injectIntl(LowIncomeOrganization);
20461
20502
 
20503
+ const EBTCardNumber = ({ value, isErrored, onChange, intl, placeholder = "", }) => (React.createElement(FormFieldText, { fieldId: "ebtCardNumber", value: value, onChange: onChange, placeholder: placeholder ||
20504
+ intl.formatHTMLMessage({ id: "ebtCardNumberPlaceholder", defaultMessage: "EBT card Number" }), label: React.createElement(FormattedHTMLMessage, { id: "ebtCardNumber", defaultMessage: "EBT card Number" }), errorMessage: isErrored && (React.createElement(FormattedHTMLMessage, { id: "errorId.invalidEBTCardNumber", defaultMessage: "Invalid EBT Card Number" })), showPlaceholderAndHideLabel: !!placeholder }));
20505
+ const EBTCardNumberComponent = injectIntl(EBTCardNumber);
20506
+
20507
+ const SEGMENT_ID = "low-income";
20508
+ const defaultStatusMessages = {
20509
+ SNAP_BENEFITS: "Snap Benefits Recipient",
20510
+ OTHER_GOVERNMENT_ASSISTANCE: "Other Government Assistance Recipient",
20511
+ };
20462
20512
  const StepLowIncomePersonalInfo = ({ intl, verificationService, }) => {
20463
20513
  const viewModel = verificationService.viewModel;
20464
20514
  const { fieldValidationErrors } = verificationService;
@@ -20469,18 +20519,45 @@ const StepLowIncomePersonalInfo = ({ intl, verificationService, }) => {
20469
20519
  value: "en-US",
20470
20520
  label: "English",
20471
20521
  };
20522
+ const selectedStatus = viewModel.statuses[0] ? viewModel.statuses[0] : undefined;
20523
+ const isSelectedStatusSnapBenefits = selectedStatus === "SNAP_BENEFITS";
20472
20524
  const updateLowIncomeViewModel = (key, value) => {
20473
20525
  const nextState = fn(viewModel, (draft) => {
20474
20526
  draft[key] = value;
20475
20527
  });
20476
20528
  verificationService.updateViewModel(nextState);
20477
20529
  };
20530
+ const getStatusLabel = (status) => {
20531
+ if (!status) {
20532
+ return "";
20533
+ }
20534
+ return intl.formatHTMLMessage({ id: status, defaultMessage: defaultStatusMessages[status] });
20535
+ };
20536
+ const getAvailableLowIncomeStatuses = () => {
20537
+ const availableStatusesResponse = verificationResponse.availableStatuses;
20538
+ const availableStatuses = [];
20539
+ if (availableStatusesResponse) {
20540
+ for (const status of availableStatusesResponse) {
20541
+ availableStatuses.push({
20542
+ value: status,
20543
+ label: getStatusLabel(status),
20544
+ });
20545
+ }
20546
+ }
20547
+ return availableStatuses;
20548
+ };
20478
20549
  const updateLocale = (localeChoice) => {
20479
20550
  const nextState = fn(viewModel, (draft) => {
20480
20551
  draft.localeChoice = localeChoice;
20481
20552
  });
20482
20553
  verificationService.updateLocale(nextState, verificationService.programTheme, verificationService.verificationResponse.segment);
20483
20554
  };
20555
+ React.useEffect(() => {
20556
+ if (isSelectedStatusSnapBenefits) {
20557
+ const updatedViewModel = { fieldsToSkipValidation: ["organization"] };
20558
+ setViewModel(updatedViewModel, { partial: true });
20559
+ }
20560
+ }, [isSelectedStatusSnapBenefits]);
20484
20561
  return (React.createElement("div", { id: "sid-step-low-income-personal-info", className: "sid-l-container" },
20485
20562
  failedInstantMatch ? (React.createElement("div", { className: "sid-header" },
20486
20563
  React.createElement("div", { className: "sid-l-horz-center" },
@@ -20500,10 +20577,22 @@ const StepLowIncomePersonalInfo = ({ intl, verificationService, }) => {
20500
20577
  React.createElement(RewardsRemainingComponent, { verificationService: verificationService })))),
20501
20578
  localeChoices.length > 1 ? (React.createElement(ChangeLocaleComponent, { options: localeChoices, value: viewModel.localeChoice || defaultLocaleChoice, isErrored: false, onChange: (localeChoice) => updateLocale(localeChoice) })) : null,
20502
20579
  React.createElement(CountryComponentWrapper, { verificationService: verificationService, viewModel: viewModel }),
20503
- React.createElement(LowIncomeOrganizationComponent, { isErrored: !!fieldValidationErrors.organization, onChange: (choice) => {
20580
+ React.createElement(StatusComponent, { segmentId: SEGMENT_ID, value: {
20581
+ value: viewModel.statuses ? viewModel.statuses[0] : "",
20582
+ label: viewModel.statuses ? getStatusLabel(viewModel.statuses[0]) : "",
20583
+ }, isErrored: !!fieldValidationErrors.statuses, options: getAvailableLowIncomeStatuses(), onChange: (status) => {
20584
+ const updatedStatuses = status ? [status.value] : [];
20585
+ updateLowIncomeViewModel("statuses", updatedStatuses);
20586
+ updateFieldValidationErrorsByFieldId("statuses", status ? status.value : "", verificationService);
20587
+ } }),
20588
+ selectedStatus === "SNAP_BENEFITS" && (React.createElement(EBTCardNumberComponent, { value: viewModel.ebtCardNumber, isErrored: !!fieldValidationErrors.ebtCardNumber, onChange: (newValue) => {
20589
+ updateLowIncomeViewModel("ebtCardNumber", newValue);
20590
+ updateFieldValidationErrorsByFieldId("ebtCardNumber", newValue, verificationService);
20591
+ } })),
20592
+ selectedStatus === "OTHER_GOVERNMENT_ASSISTANCE" && (React.createElement(LowIncomeOrganizationComponent, { isErrored: !!fieldValidationErrors.organization, onChange: (choice) => {
20504
20593
  updateViewModelOrganization(choice, verificationService);
20505
20594
  updateFieldValidationErrorsByFieldId("organization", choice, verificationService);
20506
- }, value: verificationService.viewModel.organization, verificationService: verificationService }),
20595
+ }, value: verificationService.viewModel.organization, verificationService: verificationService, isRequired: true })),
20507
20596
  React.createElement("div", { className: "sid-names" },
20508
20597
  React.createElement(FirstNameComponent, { value: viewModel.firstName, isErrored: !!fieldValidationErrors.firstName, onChange: (newValue) => {
20509
20598
  updateLowIncomeViewModel("firstName", newValue);
@@ -20525,6 +20614,11 @@ const StepLowIncomePersonalInfo = ({ intl, verificationService, }) => {
20525
20614
  updateLowIncomeViewModel("email", newValue);
20526
20615
  updateFieldValidationErrorsByFieldId("email", newValue, verificationService);
20527
20616
  }, onKeyDown: (event) => handleEmailOnKeyDown(event) }),
20617
+ verificationService.programTheme.isSmsNotifierConfigured ||
20618
+ verificationService.programTheme.smsLoopEnabled ? (React.createElement(PhoneNumberComponent, { isRequired: !!verificationService.programTheme.smsLoopEnabled, value: viewModel.phoneNumber, isErrored: !!fieldValidationErrors.phoneNumber, onChange: (newValue) => {
20619
+ updateLowIncomeViewModel("phoneNumber", newValue);
20620
+ updateFieldValidationErrorsByFieldId("phoneNumber", newValue, verificationService);
20621
+ }, selectedCountryCode: viewModel.countryChoice && viewModel.countryChoice.value })) : null,
20528
20622
  React.createElement(MarketConsentWrapperComponent, { verificationService: verificationService, isErrored: !!fieldValidationErrors.marketConsentValue, onChange: (newValue) => {
20529
20623
  updateLowIncomeViewModel("metadata", {
20530
20624
  ...verificationService.viewModel.metadata,
@@ -20537,7 +20631,7 @@ const StepLowIncomePersonalInfo = ({ intl, verificationService, }) => {
20537
20631
  React.createElement("button", { id: "sid-submit-btn-collect-info", onClick: () => submitForm(viewModel, verificationService, VerificationStepsEnum.collectLowIncomePersonalInfo), type: "submit", className: `sid-btn sid-btn--dark sid-l-full-width ${!isFormFilled(viewModel, verificationService.formValidationOptions)
20538
20632
  ? "sid-btn--disabled-like"
20539
20633
  : ""}`, "aria-labelledby": "verify-status-text", ref: (button) => setRef("submitButton", button) },
20540
- React.createElement("span", { id: "verify-status-text" }, failedInstantMatch ? (React.createElement(FormattedHTMLMessage, { id: "tryAgain", defaultMessage: "Try Again" })) : (React.createElement(FormattedHTMLMessage, { id: "verifyMyLowIncomeStatus", defaultMessage: "Verify My Status" })))))),
20634
+ React.createElement("span", { id: "verify-status-text" }, failedInstantMatch ? (React.createElement(FormattedHTMLMessage, { id: "tryAgain", defaultMessage: "Try Again" })) : (React.createElement(FormattedHTMLMessage, { id: "verifyMyLowIncomeStatus", defaultMessage: "Verify Status" })))))),
20541
20635
  React.createElement(FormFooterComponent, { verificationService: verificationService })));
20542
20636
  };
20543
20637
  const StepLowIncomePersonalInfoComponent = injectIntl(StepLowIncomePersonalInfo);
@@ -20545,6 +20639,52 @@ const StepLowIncomePersonalInfoComponent = injectIntl(StepLowIncomePersonalInfo)
20545
20639
  // Collect status is identical to Active at this time.
20546
20640
  const StepCollectMilitaryStatusComponent = ({ verificationService, }) => (React.createElement(StepActiveMilitaryPersonalInfoComponent, { verificationService: verificationService }));
20547
20641
 
20642
+ /**
20643
+ * Insert `newPart` into a string
20644
+ * Use:
20645
+ * "Hi !".insertAt(3, "world"); // "Hi world!"
20646
+ */
20647
+ String.prototype.insertAt = function (index, newPart) {
20648
+ if (index > this.length) {
20649
+ return this;
20650
+ }
20651
+ return `${this.slice(0, index)}${newPart}${this.slice(index)}`;
20652
+ };
20653
+
20654
+ const displaySSN = (value) => {
20655
+ let stringValue;
20656
+ try {
20657
+ stringValue = value.toString();
20658
+ if (!stringValue)
20659
+ throw new Error();
20660
+ }
20661
+ catch (e) {
20662
+ return "";
20663
+ }
20664
+ return stringValue
20665
+ .replace(/[^\d]/g, "") // replce non-digit chars
20666
+ .insertAt(3, "-") // for display
20667
+ .insertAt(6, "-")
20668
+ .replace("--", "") // just in case
20669
+ .replace(/-$/, ""); // don't add trailing hyphen, breaks backspace
20670
+ };
20671
+ // The viewModel and API don't include hyphens. Also enforces max length, prior to setting viewModel, avoiding off-by-one error.
20672
+ const unDisplaySSN = (value) => value.replace(/-/g, "").slice(0, SSN_STRING_LENGTH);
20673
+
20674
+ const SocialSecurity = ({ value, isErrored, onChange, intl, placeholder = "", }) => {
20675
+ const changeSsn = (value) => {
20676
+ onChange(value);
20677
+ };
20678
+ return (React.createElement("div", { className: "sid-field sid-ssn" },
20679
+ React.createElement("div", { className: "sid-l-space-top-md" }),
20680
+ React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "ssn", defaultMessage: "Social Security Number" }), htmlForLabel: "sid-ssn", id: "sid-ssn-label", displayClasses: placeholder && "sid-h-screen-reader-only" }),
20681
+ React.createElement(InputTextComponent, { id: "ssn", refId: FieldIdEnum.socialSecurityNumber, className: "sid-ssn__input", isErrored: isErrored, required: true, placeholder: placeholder ||
20682
+ intl.formatHTMLMessage({ id: "ssnPlaceholder", defaultMessage: "000-00-0000" }), value: displaySSN(value), hidePlaceholder: false, onChange: (e) => changeSsn(unDisplaySSN(e.target.value)), "aria-labelledby": "sid-ssn-label" }),
20683
+ isErrored ? (React.createElement("div", { className: "sid-field-error" },
20684
+ React.createElement(FormattedHTMLMessage, { id: "errorId.invalidSocialSecurityNumber", defaultMessage: "Invalid SSN" }))) : null));
20685
+ };
20686
+ const SocialSecurityNumber = injectIntl(SocialSecurity);
20687
+
20548
20688
  const Step$1 = ({ useSsn, useDocUpload, verificationService }) => (React.createElement("div", { id: "sid-ssn-choice", className: "sid-l-container sid-l-horz-center" },
20549
20689
  React.createElement("div", { className: "sid-header" },
20550
20690
  React.createElement("div", { className: "sid-l-horz-center" },
@@ -20614,8 +20754,9 @@ const TryAgainButtonComponent = ({ verificationService }) => {
20614
20754
  (async () => {
20615
20755
  const trackingId = undefined;
20616
20756
  const forceNewVerificationRequest = true;
20757
+ const { programId } = verificationService;
20617
20758
  await verificationService.resetState();
20618
- verificationService.fetchNewVerificationRequest(verificationService.programId, currentSegment, undefined, trackingId, forceNewVerificationRequest);
20759
+ verificationService.fetchNewVerificationRequest(programId, currentSegment, undefined, trackingId, forceNewVerificationRequest);
20619
20760
  })();
20620
20761
  }, [verificationService.programId, currentSegment]);
20621
20762
  return (React.createElement("button", { type: "button", className: "sid-btn sid-btn-light", "aria-label": "submit", onClick: fetchNewVerificationRequest, onKeyPress: fetchNewVerificationRequest, tabIndex: 0 },
@@ -20637,11 +20778,6 @@ const StepError = ({ verificationService, errorId }) => {
20637
20778
  let logoContainerClass = "sid-l-horz-center";
20638
20779
  let button = (React.createElement(BtnContainer, null,
20639
20780
  React.createElement(TryAgainButtonComponent, { verificationService: verificationService })));
20640
- // special case
20641
- if (errorIds.includes("verificationLimitExceeded")) {
20642
- button = null;
20643
- logoContainerClass += " sid-l-space-top-xl";
20644
- }
20645
20781
  // If there's an overriding title message, use it (UX-160):
20646
20782
  if (getSafe(() => verificationService.messages[`step.error.errorId.${firstErrorId}.title`])) {
20647
20783
  errorTitle = {
@@ -20656,6 +20792,17 @@ const StepError = ({ verificationService, errorId }) => {
20656
20792
  React.createElement(LinkExternal, { href: verificationResponse.redirectUrl, onClick: () => recordEvent(VerificationStepsEnum.error, verificationResponse.redirectUrl), className: "sid-btn sid-btn-light" },
20657
20793
  React.createElement(FormattedHTMLMessage, { id: `step.error.errorId.${firstErrorId}.buttonText`, defaultMessage: verificationService.messages[`step.error.errorId.${firstErrorId}.buttonText`] }))));
20658
20794
  }
20795
+ // special cases
20796
+ if (errorIds.includes("verificationLimitExceeded")) {
20797
+ button = null;
20798
+ logoContainerClass += " sid-l-space-top-xl";
20799
+ }
20800
+ if (errorIds.includes("unauthorizedAccountStatus")) {
20801
+ const faqUrl = getSafe(() => verificationService.programTheme.config.brandInfo.faqUrl);
20802
+ button = faqUrl ? (React.createElement(BtnContainer, null,
20803
+ React.createElement(LinkExternal, { href: faqUrl, onClick: () => recordEvent(VerificationStepsEnum.error, faqUrl), className: "sid-btn sid-btn-light" },
20804
+ React.createElement(FormattedHTMLMessage, { id: "step.error.errorId.unauthorizedAccountStatus.buttonText", defaultMessage: verificationService.messages["step.error.errorId.unauthorizedAccountStatus.buttonText"] })))) : null;
20805
+ }
20659
20806
  return (React.createElement("div", { id: "sid-step-error", className: "sid-l-container" },
20660
20807
  React.createElement("div", { className: "sid-header sid-l-horz-center" },
20661
20808
  React.createElement("div", { className: logoContainerClass }, hasLogo ? (React.createElement(LogoComponent, { verificationService: verificationService })) : (React.createElement("img", { className: "sid-l-lead-image", alt: "design element", src: "https://assets-resources.sheerid.com/common/images/2018/icons/circle-exclamation.svg" }))),
@@ -23407,7 +23554,7 @@ class Iframe {
23407
23554
 
23408
23555
  class Modal {
23409
23556
  constructor(url, userConfig) {
23410
- this.popStateEventHandler = () => this.closeModal(true);
23557
+ this.popStateEventHandler = () => this.closeModal();
23411
23558
  const thresholdConfig = userConfig.mobileThreshold
23412
23559
  ? userConfig.mobileThreshold
23413
23560
  : iframeConstants.DEFAULT_MOBILE_THRESHOLD_WIDTH;
@@ -23444,14 +23591,11 @@ class Modal {
23444
23591
  });
23445
23592
  return this.closeButton;
23446
23593
  }
23447
- closeModal(historyEventTrigger = false) {
23594
+ closeModal() {
23448
23595
  window.removeEventListener("popstate", this.popStateEventHandler);
23449
23596
  const transitionTimeout = iframeConstants.MODAL_OPACITY_TRANSITION_PERIOD;
23450
23597
  removeElement(this.overlay, transitionTimeout);
23451
23598
  removeElement(this.wrapper, transitionTimeout);
23452
- if (!historyEventTrigger) {
23453
- window.history.back();
23454
- }
23455
23599
  }
23456
23600
  static createOverlay() {
23457
23601
  const overlay = document.createElement("div");
@@ -23504,7 +23648,6 @@ class Modal {
23504
23648
  });
23505
23649
  document.body.appendChild(this.overlay);
23506
23650
  document.body.appendChild(this.wrapper);
23507
- window.history.pushState({}, document.title);
23508
23651
  this.addPopStateListener();
23509
23652
  }
23510
23653
  init() {
@@ -23563,5 +23706,5 @@ const collectDeviceProfile = async (verificationId, programId) => {
23563
23706
  includeIPQSDeviceFingerprintScript(programTheme, verificationId);
23564
23707
  };
23565
23708
 
23566
- export { ACCEPTED_DOC_MIME_TYPES, AcceptableUploadsComponent, AddressComponent, BirthDateComponent, BranchOfServiceComponent, ChangeLocaleComponent, CityComponent, CollegeNameComponent, CompanyComponent, CopyToClipboard, CountDownComponent, CountryComponent, CountryComponentWrapper, DEFAULT_LOCALE, DEFAULT_MINIMUM_ORG_SEARCH_VALUE_LENGTH, DEFAULT_PRIVACY_POLICY_URL, DeleteJson, DischargeDateComponent, DriverLicenseNumberComponent, EmailComponent, FaqLinkComponent, FetchOrganizationsComponent, FieldIdEnum, FieldIds, FieldLabel, FirstNameComponent, FirstResponderOrganizationComponent, FirstResponderStatusComponent, FirstResponderStatusDefaultMessagesEnum, FormFooterComponent, GetEmptyTheme, GetJson, GetResponse, HTTP_REQUEST_TIMEOUT, HookNameEnum, HookNames, HowDoesVerifyingWorkComponent, InputSelectButtonComponent, InputSelectComponent, InputSelectListComponent, InputTextComponent, LastNameComponent, LinkExternal, LoadingSpinnerComponent, Locales, LogoComponent, LowIncomeOrganizationComponent, LowIncomeStatusDefaultMessagesEnum, MAX_DOC_UPLOAD_DOCS_ALLOWED, MarketConsentWrapperComponent as MarketConsentWrapper, MedicalProfessionalOrganizationComponent, MedicalProfessionalStatusDefaultMessagesEnum, MedicalStatusComponent, MemberIdComponent, MembershipOrganizationComponent, MilitaryStatusComponent, MilitaryStatusDefaultMessagesEnum, MockSteps, MockStepsEnum, OptInComponent, OptInInputComponent, OrganizationListComponent, OrganizationResultComponent, PhoneNumberComponent, PostFiles, PostJson, PostalCodeComponent, PostalCodeInputComponent, PoweredByComponent, PrivacyPolicyLinkComponent, QUERY_STRING_ERRORID_OVERRIDE, QUERY_STRING_INSTALL_PAGE_URL, QUERY_STRING_REDIRECT_URL_OVERRIDE, QUERY_STRING_REWARD_CODE_OVERRIDE, QUERY_STRING_SEGMENT_OVERRIDE, QUERY_STRING_STEP_OVERRIDE, QUERY_STRING_SUBSEGMENT_OVERRIDE, RequestOrganizationContext, RequestOrganizationErrorComponent, RequestOrganizationForm, RequestOrganizationFormFooterComponent, RequestOrganizationSearchComponent, RequestOrganizationSearchResultComponent, RequestOrganizationSuccessComponent, ReviewPendingComponent, RewardsRemainingComponent, SHEERID, SMSCodeComponent, SSN_STRING_LENGTH, SSOPendingComponent, SearchFieldComponent, SegmentEnum, Segments, SelectButtonComponent, SelectComponent, SelectListComponent, SocialSecurityNumber, SortByLabel, SsnChoice, StateComponent, StateEnum, StateSelectComponent, StatusComponent, StepActiveMilitaryPersonalInfoComponent, StepDriverLicensePersonalInfoComponent, StepGeneralIdentityPersonalInfoComponent, StepHybridIdentityPersonalInfoComponent, StepLowIncomePersonalInfoComponent, SubSegmentEnum, TeacherSchoolComponent, TryAgainButtonComponent, TryAgainSteps, TypeaheadComponent, UPLOAD_FILE_PREFIX, UploadInfoComponent, VerificationApiClient, VerificationForm, VerificationSteps, VerificationStepsEnum, addFiles, addHook, allMockedResponses, arrayUnique, assertValidConversionRequest, assertValidDatabaseId, assertValidFieldId, assertValidFunction, assertValidHook, assertValidHookName, assertValidHtmlElement, assertValidLocale, assertValidMockStepName, assertValidProgramId, assertValidSegmentName, assertValidTrackingId, assertValidTryAgainStep, assertValidVerificationStepName, carrierConsentValueValidator, closeTabRef, collectDeviceProfile, conversion, convertByTrackingId, convertByVerificationId, customValidatorExists$1 as customValidatorExists, deepClone, deepMerge, displaySSN, employmentPInfoReqEmpty, ensureMaxMetadataKeyValueLengths, ensureTrailingSlash, fetchExistingVerificationRequest, fetchProgramOrganizations, fetchRequestOrganizations, formatTwoDigitValues, getAddSchoolRequestUrl, getAllEmptyViewModels, getAvailableCountryChoices, getAvailableLocaleChoices, getAvailableLocales, getAvailableMilitaryStatuses, getAvailableStateChoices, getCompanyName, getConfiguredCountries, getConfiguredStates, getCustomValidator, getCustomValidatorFields, getDefaultCountryChoice, getDomainFromUrl, getEmptyViewModel, getEstAndMaxReviewTimes, getEstimatedReviewTime, getExtendedFieldValidationErrorsEmpty, getFaqLink, getFieldDisplayOrderFromRefs, getFieldValidationErrors, getFieldValidationErrorsEmpty, getFingerprint, getFirstErroredFieldId, getHook, getLocaleSafely, getLogoUrl, getMarketConsent, getMaxReviewTime, getMessages, getMetadata, getNewEmailCodeResendUrl, getNewSmsCodeResendUrl, getNewVerificationRequestUrl, getOptions, getOrgSearchCountryTags, getOverriddenMock, getOverridenValidator, getPhoneNumberValidationError, getPrivacyPolicyCompanyName, getPrivacyPolicyUrl, getProgramThemeUrl, getQueryParamsFromUrl, getRefByFieldId, getRefs, getRouteOverride, getSafe, getSheerIdScriptBasePath, getStatusLabel, getTabRef, getTrackingIdFromQueryString, getVerificationIdFromQueryString, getVerificationStatusUrl, handleCountryOnKeyDown, handleEmailOnKeyDown, handleStateChange, hasFailedInstantMatch, howDoesVerifyingWorkMessages, isFormErrored, isFormFilled, isTestEmailDomains, isValidLocale, isValidUsPostalCode, listenToSheerIdFrame, loadInModal, loadInlineIframe, logger, orgToOption, orgsInStatus, overrideComponent, overrideValidator, phoneNumberValidator, populateViewModelFromQueryParams, postVerificationSizeUpdates, postalCodeMatchers, postalCodeValidator, produceDraftViewModel, produceDraftViewModelWithRequiredFields, recordEvent, recordVerificationResponse, recordViewModelChange, refreshStore, registerAdditionalLocales, removeAllFiles, removeCustomValidator, removeFile, requestOrganizationConstants, resetCustomValidators, resetHooks, resetMetadata, resetOptions, resetOverriddenComponents, resetOverriddenValidators, resetRefs, resetStore, resetTabRef, resetViewModel, resolveTrackingId, setCustomValidator, setDimension, setFocus, setGaDimensionIsTest, setMetadata, setOptions, setRef, setTabRef, setViewModel, shouldCollectAddressFields, shouldCollectPostalCode, socialSecurityEmpty, speakToOuterFrame, submitAddSchoolRequest, submitForm, unDisplaySSN, updateFieldValidationErrors, updateFieldValidationErrorsByFieldId, updateMilitaryViewModel, updateViewModelOrganization, usePollingInterval, validateFieldById, validateMetadata };
23709
+ export { ACCEPTED_DOC_MIME_TYPES, AcceptableUploadsComponent, AddressComponent, BirthDateComponent, BranchOfServiceComponent, ChangeLocaleComponent, CityComponent, CollegeNameComponent, CompanyComponent, CopyToClipboard, CountDownComponent, CountryComponent, CountryComponentWrapper, DEFAULT_LOCALE, DEFAULT_MINIMUM_ORG_SEARCH_VALUE_LENGTH, DEFAULT_PRIVACY_POLICY_URL, DeleteJson, DischargeDateComponent, DriverLicenseNumberComponent, EmailComponent, FaqLinkComponent, FetchOrganizationsComponent, FieldIdEnum, FieldIds, FieldLabel, FirstNameComponent, FirstResponderOrganizationComponent, FirstResponderStatusComponent, FirstResponderStatusDefaultMessagesEnum, FormFieldCustom, FormFieldLayout, FormFieldText, FormFooterComponent, GetEmptyTheme, GetJson, GetResponse, HTTP_REQUEST_TIMEOUT, HookNameEnum, HookNames, HowDoesVerifyingWorkComponent, InputSelectButtonComponent, InputSelectComponent, InputSelectListComponent, InputTextComponent, LastNameComponent, LinkExternal, LoadingSpinnerComponent, Locales, LogoComponent, LowIncomeOrganizationComponent, LowIncomeStatusDefaultMessagesEnum, MAX_DOC_UPLOAD_DOCS_ALLOWED, MarketConsentWrapperComponent as MarketConsentWrapper, MedicalProfessionalOrganizationComponent, MedicalProfessionalStatusDefaultMessagesEnum, MedicalStatusComponent, MemberIdComponent, MembershipOrganizationComponent, MilitaryStatusComponent, MilitaryStatusDefaultMessagesEnum, MockSteps, MockStepsEnum, OptInComponent, OptInInputComponent, OrganizationListComponent, OrganizationResultComponent, PhoneNumberComponent, PostFiles, PostJson, PostalCodeComponent, PostalCodeInputComponent, PoweredByComponent, PrivacyPolicyLinkComponent, QUERY_STRING_ERRORID_OVERRIDE, QUERY_STRING_INSTALL_PAGE_URL, QUERY_STRING_REDIRECT_URL_OVERRIDE, QUERY_STRING_REWARD_CODE_OVERRIDE, QUERY_STRING_SEGMENT_OVERRIDE, QUERY_STRING_STEP_OVERRIDE, QUERY_STRING_SUBSEGMENT_OVERRIDE, RequestOrganizationContext, RequestOrganizationErrorComponent, RequestOrganizationForm, RequestOrganizationFormFooterComponent, RequestOrganizationSearchComponent, RequestOrganizationSearchResultComponent, RequestOrganizationSuccessComponent, ReviewPendingComponent, RewardsRemainingComponent, SHEERID, SMSCodeComponent, SSN_STRING_LENGTH, SSOPendingComponent, SearchFieldComponent, SegmentEnum, Segments, SelectButtonComponent, SelectComponent, SelectListComponent, SocialSecurityNumber, SortByLabel, SsnChoice, StateComponent, StateEnum, StateSelectComponent, StatusComponent, StepActiveMilitaryPersonalInfoComponent, StepDriverLicensePersonalInfoComponent, StepGeneralIdentityPersonalInfoComponent, StepHybridIdentityPersonalInfoComponent, StepLowIncomePersonalInfoComponent, SubSegmentEnum, TeacherSchoolComponent, TryAgainButtonComponent, TryAgainSteps, TypeaheadComponent, UPLOAD_FILE_PREFIX, UploadInfoComponent, VerificationApiClient, VerificationForm, VerificationSteps, VerificationStepsEnum, addFiles, addHook, allMockedResponses, arrayUnique, assertValidConversionRequest, assertValidDatabaseId, assertValidFieldId, assertValidFunction, assertValidHook, assertValidHookName, assertValidHtmlElement, assertValidLocale, assertValidMockStepName, assertValidProgramId, assertValidSegmentName, assertValidTrackingId, assertValidTryAgainStep, assertValidVerificationStepName, carrierConsentValueValidator, closeTabRef, collectDeviceProfile, conversion, convertByTrackingId, convertByVerificationId, customValidatorExists$1 as customValidatorExists, deepClone, deepMerge, displaySSN, employmentPInfoReqEmpty, ensureMaxMetadataKeyValueLengths, ensureTrailingSlash, fetchExistingVerificationRequest, fetchProgramOrganizations, fetchRequestOrganizations, formatTwoDigitValues, getAddSchoolRequestUrl, getAllEmptyViewModels, getAvailableCountryChoices, getAvailableLocaleChoices, getAvailableLocales, getAvailableMilitaryStatuses, getAvailableStateChoices, getCompanyName, getConfiguredCountries, getConfiguredStates, getCustomValidator, getCustomValidatorFields, getDefaultCountryChoice, getDomainFromUrl, getEmptyViewModel, getEstAndMaxReviewTimes, getEstimatedReviewTime, getExtendedFieldValidationErrorsEmpty, getFaqLink, getFieldDisplayOrderFromRefs, getFieldValidationErrors, getFieldValidationErrorsEmpty, getFingerprint, getFirstErroredFieldId, getHook, getLocaleSafely, getLogoUrl, getMarketConsent, getMaxReviewTime, getMessages, getMetadata, getNewEmailCodeResendUrl, getNewSmsCodeResendUrl, getNewVerificationRequestUrl, getOptions, getOrgSearchCountryTags, getOverriddenMock, getOverridenValidator, getPhoneNumberValidationError, getPrivacyPolicyCompanyName, getPrivacyPolicyUrl, getProgramThemeUrl, getQueryParamsFromUrl, getRefByFieldId, getRefs, getRouteOverride, getSafe, getSheerIdScriptBasePath, getStatusLabel, getTabRef, getTrackingIdFromQueryString, getVerificationIdFromQueryString, getVerificationStatusUrl, handleCountryOnKeyDown, handleEmailOnKeyDown, handleStateChange, hasFailedInstantMatch, howDoesVerifyingWorkMessages, isFormErrored, isFormFilled, isTestEmailDomains, isValidLocale, isValidUsPostalCode, listenToSheerIdFrame, loadInModal, loadInlineIframe, logger, orgToOption, orgsInStatus, overrideComponent, overrideValidator, phoneNumberValidator, populateViewModelFromQueryParams, postVerificationSizeUpdates, postalCodeMatchers, postalCodeValidator, produceDraftViewModel, produceDraftViewModelWithRequiredFields, recordEvent, recordVerificationResponse, recordViewModelChange, refreshStore, registerAdditionalLocales, removeAllFiles, removeCustomValidator, removeFile, requestOrganizationConstants, resetCustomValidators, resetHooks, resetMetadata, resetOptions, resetOverriddenComponents, resetOverriddenValidators, resetRefs, resetStore, resetTabRef, resetViewModel, resolveTrackingId, setCustomValidator, setDimension, setFocus, setGaDimensionIsTest, setMetadata, setOptions, setRef, setTabRef, setViewModel, shouldCollectAddressFields, shouldCollectPostalCode, socialSecurityEmpty, speakToOuterFrame, submitAddSchoolRequest, submitForm, unDisplaySSN, updateFieldValidationErrors, updateFieldValidationErrorsByFieldId, updateMilitaryViewModel, updateViewModelOrganization, usePollingInterval, validateFieldById, validateMetadata };
23567
23710
  //# sourceMappingURL=sheerides6.js.map