@redneckz/wildless-cms-uni-blocks 0.14.824 → 0.14.825

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 (378) hide show
  1. package/bundle/bundle.umd.js +198 -229
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  4. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  5. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  6. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  7. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  8. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  9. package/bundle/retail/api/checkCode.d.ts +0 -1
  10. package/{dist/retail/api/esiaRequestProfile.d.ts → bundle/retail/api/updateProfileEsia.d.ts} +4 -11
  11. package/bundle/retail/api/updateUserTask.d.ts +0 -1
  12. package/bundle/retail/api/uploadFile.d.ts +1 -1
  13. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  14. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  15. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  16. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  17. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  19. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  20. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  21. package/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  22. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  23. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  24. package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  25. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  26. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  27. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  29. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  30. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  32. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  33. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  35. package/dist/retail/api/checkCode.d.ts +0 -1
  36. package/dist/retail/api/checkCode.js +2 -3
  37. package/dist/retail/api/checkCode.js.map +1 -1
  38. package/{bundle/retail/api/esiaRequestProfile.d.ts → dist/retail/api/updateProfileEsia.d.ts} +4 -11
  39. package/dist/retail/api/updateProfileEsia.js +6 -0
  40. package/dist/retail/api/updateProfileEsia.js.map +1 -0
  41. package/dist/retail/api/updateUserTask.d.ts +0 -1
  42. package/dist/retail/api/updateUserTask.js.map +1 -1
  43. package/dist/retail/api/uploadFile.d.ts +1 -1
  44. package/dist/retail/api/uploadFile.js +3 -2
  45. package/dist/retail/api/uploadFile.js.map +1 -1
  46. package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  47. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  48. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  49. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  50. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  51. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  52. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  53. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  54. package/dist/retail/components/Fields/BeginDateField.js +1 -2
  55. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  56. package/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  57. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  58. package/dist/retail/components/Fields/DaDataInnField.js +1 -2
  59. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  60. package/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  61. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  62. package/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  63. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  64. package/dist/retail/components/Fields/JobsNumberField.js +1 -2
  65. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  66. package/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  67. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  68. package/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  69. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  70. package/dist/retail/components/Fields/WagesField.js +1 -2
  71. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  72. package/dist/retail/content.js +5 -11
  73. package/dist/retail/content.js.map +1 -1
  74. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  75. package/dist/retail/utils/mainFormStateMap.js +0 -1
  76. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  77. package/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  78. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  79. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  80. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  81. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  82. package/lib/common.css +1 -1
  83. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  84. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  85. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  86. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  87. package/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  88. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  89. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  90. package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  91. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  92. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  93. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  94. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  95. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  96. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  97. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  98. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  99. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  100. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  101. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  102. package/lib/retail/api/checkCode.d.ts +0 -1
  103. package/lib/retail/api/checkCode.js +1 -1
  104. package/lib/retail/api/checkCode.js.map +1 -1
  105. package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  106. package/lib/retail/api/updateProfileEsia.js +3 -0
  107. package/lib/retail/api/updateProfileEsia.js.map +1 -0
  108. package/lib/retail/api/updateUserTask.d.ts +0 -1
  109. package/lib/retail/api/updateUserTask.js.map +1 -1
  110. package/lib/retail/api/uploadFile.d.ts +1 -1
  111. package/lib/retail/api/uploadFile.js +3 -2
  112. package/lib/retail/api/uploadFile.js.map +1 -1
  113. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  114. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  115. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  116. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
  117. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  118. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  119. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  120. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  121. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  122. package/lib/retail/components/Fields/BeginDateField.js +1 -2
  123. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  124. package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  125. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  126. package/lib/retail/components/Fields/DaDataInnField.js +1 -2
  127. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  128. package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  129. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  130. package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  131. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  132. package/lib/retail/components/Fields/JobsNumberField.js +1 -2
  133. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  134. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  135. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  136. package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  137. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  138. package/lib/retail/components/Fields/WagesField.js +1 -2
  139. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  140. package/lib/retail/content.js +5 -11
  141. package/lib/retail/content.js.map +1 -1
  142. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  143. package/lib/retail/utils/mainFormStateMap.js +0 -1
  144. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  145. package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  146. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  147. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  148. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  149. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  150. package/mobile/bundle/bundle.umd.js +198 -229
  151. package/mobile/bundle/bundle.umd.min.js +1 -1
  152. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  153. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  154. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  155. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  156. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  157. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  158. package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
  159. package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  160. package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
  161. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  162. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  163. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  164. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  165. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  166. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  167. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  168. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  169. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  170. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  171. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  172. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  173. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  174. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  175. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  176. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  177. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  178. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  179. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  180. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  181. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  182. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  183. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  184. package/mobile/dist/retail/api/checkCode.d.ts +0 -1
  185. package/mobile/dist/retail/api/checkCode.js +2 -3
  186. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  187. package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
  188. package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
  189. package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
  190. package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
  191. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  192. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  193. package/mobile/dist/retail/api/uploadFile.js +3 -2
  194. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  195. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  196. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  197. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  198. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  199. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  200. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  201. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  202. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  203. package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
  204. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  205. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  206. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  207. package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
  208. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  209. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  210. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  211. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  212. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  213. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
  214. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  215. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  216. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  217. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  218. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  219. package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
  220. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  221. package/mobile/dist/retail/content.js +5 -11
  222. package/mobile/dist/retail/content.js.map +1 -1
  223. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  224. package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
  225. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  226. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  227. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  228. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  229. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  230. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  231. package/mobile/lib/common.css +1 -1
  232. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  233. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  234. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  235. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  236. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  237. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  238. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  239. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  240. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  241. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  242. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  243. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  244. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  245. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  246. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  247. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  248. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  249. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  250. package/mobile/lib/retail/api/checkCode.d.ts +0 -1
  251. package/mobile/lib/retail/api/checkCode.js +1 -1
  252. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  253. package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
  254. package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
  255. package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
  256. package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
  257. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  258. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  259. package/mobile/lib/retail/api/uploadFile.js +3 -2
  260. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  261. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  262. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  263. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  264. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  265. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  266. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  267. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  268. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  269. package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
  270. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  271. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  272. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  273. package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
  274. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  275. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  276. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  277. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  278. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  279. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
  280. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  281. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  282. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  283. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  284. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  285. package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
  286. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  287. package/mobile/lib/retail/content.js +5 -11
  288. package/mobile/lib/retail/content.js.map +1 -1
  289. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  290. package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
  291. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  292. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  293. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  294. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  295. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  296. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  297. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  298. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  299. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  300. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  301. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
  302. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  303. package/mobile/src/retail/api/checkCode.ts +1 -1
  304. package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  305. package/mobile/src/retail/api/updateUserTask.ts +0 -1
  306. package/mobile/src/retail/api/uploadFile.ts +3 -2
  307. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  308. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  309. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  310. package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
  311. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  312. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  313. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  314. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  315. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  316. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  317. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  318. package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
  319. package/mobile/src/retail/content.tsx +5 -11
  320. package/mobile/src/retail/model/NameFieldDef.ts +0 -1
  321. package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
  322. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  323. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  324. package/package.json +1 -1
  325. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  326. package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  327. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  328. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  329. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
  330. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  331. package/src/retail/api/checkCode.ts +1 -1
  332. package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  333. package/src/retail/api/updateUserTask.ts +0 -1
  334. package/src/retail/api/uploadFile.ts +3 -2
  335. package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  336. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
  337. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  338. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  339. package/src/retail/components/Fields/BeginDateField.tsx +0 -2
  340. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  341. package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  342. package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  343. package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  344. package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  345. package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  346. package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  347. package/src/retail/components/Fields/WagesField.tsx +0 -2
  348. package/src/retail/content.tsx +5 -11
  349. package/src/retail/model/NameFieldDef.ts +0 -1
  350. package/src/retail/utils/mainFormStateMap.ts +0 -1
  351. package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  352. package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  353. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  354. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  355. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  356. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  357. package/dist/retail/api/esiaRequestProfile.js +0 -10
  358. package/dist/retail/api/esiaRequestProfile.js.map +0 -1
  359. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  360. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  361. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  362. package/lib/retail/api/esiaRequestProfile.js +0 -7
  363. package/lib/retail/api/esiaRequestProfile.js.map +0 -1
  364. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  365. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  366. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  367. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  368. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
  369. package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
  370. package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
  371. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  372. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  373. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  374. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
  375. package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
  376. package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
  377. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
  378. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
@@ -2030,7 +2030,7 @@
2030
2030
 
2031
2031
  const PhoneField = JSX(({ field, input }) => {
2032
2032
  const fieldName = input?.name || 'phone';
2033
- return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
2033
+ return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
2034
2034
  });
2035
2035
 
2036
2036
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
@@ -2210,7 +2210,7 @@
2210
2210
  function shouldRenderField({ input, field, }) {
2211
2211
  const { condition } = input;
2212
2212
  const { value } = field(condition?.name || '');
2213
- return !condition || condition?.values?.includes(value?.key ?? value);
2213
+ return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
2214
2214
  }
2215
2215
 
2216
2216
  const PRODUCT_REF = {
@@ -2668,11 +2668,11 @@
2668
2668
  {
2669
2669
  columns: 2,
2670
2670
  inputs: [
2671
- { name: 'surname', required: true, dadata: true, filledByEsia: true },
2672
- { name: 'name', required: true, dadata: true, filledByEsia: true },
2673
- { name: 'middleName', dadata: true, filledByEsia: true },
2674
- { name: 'limitedBirthday', required: true, filledByEsia: true },
2675
- { name: 'phone', required: true, filledByEsia: true },
2671
+ { name: 'surname', required: true, dadata: true },
2672
+ { name: 'name', required: true, dadata: true },
2673
+ { name: 'middleName', dadata: true },
2674
+ { name: 'limitedBirthday', required: true },
2675
+ { name: 'phone', required: true },
2676
2676
  { name: 'email', required: true, dadata: true },
2677
2677
  ],
2678
2678
  },
@@ -2682,57 +2682,6 @@
2682
2682
  ];
2683
2683
  };
2684
2684
 
2685
- const getTraceId = () => {
2686
- const result = new Uint8Array(8);
2687
- globalThis.crypto.getRandomValues(result);
2688
- return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
2689
- };
2690
-
2691
- const fetchRetailJSON = async (url, method, body) => {
2692
- try {
2693
- const response = await doRequest(url, method, body);
2694
- return response.json();
2695
- }
2696
- catch (err) {
2697
- console.error(err);
2698
- return null;
2699
- }
2700
- };
2701
- async function doRequest(url, method, body) {
2702
- const traceId = getTraceId();
2703
- return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
2704
- method,
2705
- headers: {
2706
- 'Content-Type': 'application/json',
2707
- 'X-B3-Sampled': '1',
2708
- 'X-B3-Spanid': traceId,
2709
- 'X-B3-Traceid': traceId,
2710
- ...getAuthorizationHeaders(),
2711
- },
2712
- credentials: 'include',
2713
- body: body ? JSON.stringify(body) : null,
2714
- });
2715
- }
2716
- const getAuthorizationHeaders = () => {
2717
- const token = sessionStorage.getItem('accessToken');
2718
- return token ? { Authorization: `Bearer ${token}` } : null;
2719
- };
2720
-
2721
- const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
2722
-
2723
- const EsiaLoginBanner = JSX(() => {
2724
- const navigator = locationNavigator();
2725
- const handleAuth = useCallback(async () => {
2726
- const resp = await getLink({
2727
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
2728
- });
2729
- if (resp?.link) {
2730
- navigator.assign(resp.link);
2731
- }
2732
- }, []);
2733
- return (jsxs("div", { className: "flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9", children: [jsxs("div", { className: "flex flex-col justify-around w-full", children: [jsx("p", { className: "mb-4 text-xl @md:text-2xl @md:mb-6", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsxs("ul", { className: "list-disc list-inside mb-9", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { className: "block mb-6 self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), jsx(Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), jsx(Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
2734
- });
2735
-
2736
2685
  const debounce = (fn, delay = 600) => {
2737
2686
  let timerId;
2738
2687
  const debouncedCallback = (...args) => {
@@ -3619,6 +3568,42 @@
3619
3568
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3620
3569
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3621
3570
 
3571
+ const getTraceId = () => {
3572
+ const result = new Uint8Array(8);
3573
+ globalThis.crypto.getRandomValues(result);
3574
+ return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
3575
+ };
3576
+
3577
+ const fetchRetailJSON = async (url, method, body) => {
3578
+ try {
3579
+ const response = await doRequest(url, method, body);
3580
+ return response.json();
3581
+ }
3582
+ catch (err) {
3583
+ console.error(err);
3584
+ return null;
3585
+ }
3586
+ };
3587
+ async function doRequest(url, method, body) {
3588
+ const traceId = getTraceId();
3589
+ return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
3590
+ method,
3591
+ headers: {
3592
+ 'Content-Type': 'application/json',
3593
+ 'X-B3-Sampled': '1',
3594
+ 'X-B3-Spanid': traceId,
3595
+ 'X-B3-Traceid': traceId,
3596
+ ...getAuthorizationHeaders(),
3597
+ },
3598
+ credentials: 'include',
3599
+ body: body ? JSON.stringify(body) : null,
3600
+ });
3601
+ }
3602
+ const getAuthorizationHeaders = () => {
3603
+ const token = sessionStorage.getItem('accessToken');
3604
+ return token ? { Authorization: `Bearer ${token}` } : null;
3605
+ };
3606
+
3622
3607
  const fetchRegionOffices = async (regionKey) => {
3623
3608
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3624
3609
  regionRfCd: {
@@ -3848,7 +3833,7 @@
3848
3833
 
3849
3834
  const BankruptcyFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0412 \u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0438 \u043C\u0435\u043D\u044F \u0432\u0435\u0434\u0451\u0442\u0441\u044F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u043E \u043F\u043E \u0434\u0435\u043B\u0443 \u043E \u0431\u0430\u043D\u043A\u0440\u043E\u0442\u0441\u0442\u0432\u0435", ...field(input?.name ?? '') })));
3850
3835
 
3851
- const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
3836
+ const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input })));
3852
3837
 
3853
3838
  const FIELD_NAME$2 = 'birthPlace';
3854
3839
  const BirthPlaceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$2) })));
@@ -3912,8 +3897,7 @@
3912
3897
 
3913
3898
  const ConfirmationIncomeField = JSX(({ field, input }) => {
3914
3899
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
3915
- const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
3916
- return (jsxs("div", { children: [filledByEsia ? (jsx("div", { className: "mb-6", children: jsx(InfoCard, { __html: "\u0414\u043B\u044F \u0432\u044B\u0431\u043E\u0440\u0430 \u0438\u043D\u043E\u0433\u043E \u0441\u043F\u043E\u0441\u043E\u0431\u0430 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430, \u043E\u0444\u043E\u0440\u043C\u0438\u0442\u0435 \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442 \u0431\u0435\u0437 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043D\u0430 \u043F\u043E\u0440\u0442\u0430\u043B\u0435 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }) })) : null, jsx(SelectField, { field: field, source: confirmationIncome, label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430", fieldName: "confirmationIncome", input: input, disabled: filledByEsia })] }));
3900
+ return (jsx(SelectField, { field: field, source: confirmationIncome, label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430", fieldName: "confirmationIncome", input: input }));
3917
3901
  });
3918
3902
 
3919
3903
  const ConscriptionField = JSX(({ field, input }) => {
@@ -4457,7 +4441,7 @@
4457
4441
  }
4458
4442
  })();
4459
4443
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
4460
- return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4444
+ return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4461
4445
  });
4462
4446
 
4463
4447
  const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: new Date() })));
@@ -4540,7 +4524,7 @@
4540
4524
  const MIN_YEARS = 0;
4541
4525
  const Experience5YearsField = JSX(({ field, input }) => {
4542
4526
  const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
4543
- return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4527
+ return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange }));
4544
4528
  });
4545
4529
 
4546
4530
  const FamilyMembersField = JSX(({ field, input }) => {
@@ -4561,7 +4545,7 @@
4561
4545
  return (jsx(SelectField, { field: field, source: familyStatus, label: "\u0421\u0435\u043C\u0435\u0439\u043D\u043E\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", fieldName: "familyStatus", input: input }));
4562
4546
  });
4563
4547
 
4564
- const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4548
+ const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input })));
4565
4549
 
4566
4550
  const HousingField = JSX(({ field, input }) => {
4567
4551
  const { data: housing } = useLeadFormData('HOUSE_TYPE');
@@ -4570,9 +4554,9 @@
4570
4554
 
4571
4555
  const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
4572
4556
 
4573
- const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4557
+ const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input })));
4574
4558
 
4575
- const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4559
+ const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input })));
4576
4560
 
4577
4561
  const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
4578
4562
  const isLatin = (_ = '') => latinPattern.test(_);
@@ -4738,7 +4722,7 @@
4738
4722
  field?.('inn')?.onChange?.(item.data?.inn);
4739
4723
  updateOrganizationFields(store, field, item);
4740
4724
  }, []);
4741
- return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? ''), onDaDataChange: onDaDataChange }));
4725
+ return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4742
4726
  });
4743
4727
 
4744
4728
  const OtherIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0418\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
@@ -4885,7 +4869,7 @@
4885
4869
 
4886
4870
  const TotalIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
4887
4871
 
4888
- const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4872
+ const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
4889
4873
 
4890
4874
  const DELIVERY_CITIES_REF = {
4891
4875
  $ref: '/wcms-resources/delivery-cities-data.json',
@@ -5515,7 +5499,7 @@
5515
5499
  const participant = task.participants[0];
5516
5500
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5517
5501
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
5518
- const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, profile, } = participant;
5502
+ const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, } = participant;
5519
5503
  return {
5520
5504
  currency: currency?.key,
5521
5505
  paymentSystem: getSelectValue(paymentSystem),
@@ -5567,7 +5551,6 @@
5567
5551
  monthsValue,
5568
5552
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5569
5553
  },
5570
- esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5571
5554
  ...getParticipantIncomes(participantIncomes),
5572
5555
  ...getParticipantAddresses(participantAddresses),
5573
5556
  ...getParticipantContacts(participantContacts),
@@ -5622,6 +5605,39 @@
5622
5605
  };
5623
5606
  };
5624
5607
 
5608
+ const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
5609
+
5610
+ const EsiaLoginDialog = JSX(({ onClose }) => {
5611
+ const navigator = locationNavigator();
5612
+ const retailFormStore = useRetailFormStore();
5613
+ const handleAuth = useCallback(async () => {
5614
+ const resp = await getLink({
5615
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
5616
+ });
5617
+ if (resp?.link) {
5618
+ navigator.assign(resp.link);
5619
+ globalThis.location.href = resp.link;
5620
+ }
5621
+ }, []);
5622
+ const handleClose = useCallback(() => {
5623
+ if (retailFormStore.leadForm) {
5624
+ const leadForm = { ...retailFormStore.leadForm };
5625
+ delete leadForm.esiaAccountTypeCd;
5626
+ retailFormStore.leadForm = leadForm;
5627
+ }
5628
+ onClose?.();
5629
+ }, []);
5630
+ return (jsx(Dialog, { className: "my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg", onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [jsxs("div", { className: "flex items-center justify-around w-full px-m", children: [jsxs("ul", { className: "list-disc", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "70" })] }), jsxs("div", { className: "@container flex flex-wrap gap-lg w-full", children: [jsx(Button, { type: "button", onClick: handleAuth, className: "w-full md:w-auto", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsx(Button, { type: "button", version: "secondary", onClick: handleClose, className: "w-full md:w-auto", children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
5631
+ });
5632
+
5633
+ const useEsiaLoginDialog = (nextStepLink) => {
5634
+ const { open } = useDialog(EsiaLoginDialog);
5635
+ const navigator = locationNavigator();
5636
+ return useCallback(() => {
5637
+ open({ onClose: () => navigator.assign(nextStepLink) });
5638
+ }, [open, nextStepLink]);
5639
+ };
5640
+
5625
5641
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5626
5642
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5627
5643
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5743,40 +5759,43 @@
5743
5759
 
5744
5760
  /* eslint-disable max-lines */
5745
5761
  // eslint-disable-next-line max-lines-per-function
5746
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5762
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5747
5763
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5748
5764
  const [ok, setOK] = useState();
5749
5765
  const saveUserData = useSaveUserData();
5750
5766
  const sendAspects = useSendLeadFormAspects({ data });
5751
5767
  const navigator = locationNavigator();
5752
- const goToNextStep = useCallback(() => {
5753
- navigator.assign(nextStepLink);
5754
- }, []);
5755
- const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5768
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5769
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5756
5770
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5757
5771
  const draftDialog = useDraftDialog();
5758
5772
  const handleSubmit = useCallback(async (formData) => {
5773
+ if (esiaError) {
5774
+ navigator.assign(nextStepLink);
5775
+ return;
5776
+ }
5759
5777
  try {
5760
5778
  startSending();
5779
+ const transformedFormData = transformFormData(formData);
5761
5780
  const profileId = await createUserProfile({
5762
- profile: { phone: formatPhone(formData.phone) },
5781
+ profile: { phone: formatPhone(transformedFormData.phone) },
5763
5782
  });
5764
- if (profileId && formData?.phone) {
5783
+ if (profileId && transformedFormData?.phone) {
5765
5784
  const sendCurrentTask = async () => {
5766
5785
  await updateUserData({
5767
5786
  programId,
5768
5787
  profileId,
5769
- formData,
5788
+ formData: transformedFormData,
5770
5789
  productType,
5771
5790
  saveUserData,
5772
5791
  sendAspects,
5773
5792
  });
5774
5793
  verifyPhoneDialog.close();
5775
5794
  if (productType === 'debitCard') {
5776
- goToNextStep();
5795
+ openEsiaLoginDialog();
5777
5796
  }
5778
5797
  else {
5779
- consentBkiDialog.open(formData.phone, profileId);
5798
+ consentBkiDialog.open(transformedFormData.phone, profileId);
5780
5799
  }
5781
5800
  };
5782
5801
  const handleSuccessVerify = async () => {
@@ -5802,7 +5821,7 @@
5802
5821
  };
5803
5822
  const acceptedConsents = getAcceptedConsents(formData, productType);
5804
5823
  verifyPhoneDialog.open({
5805
- phone: formData?.phone,
5824
+ phone: transformedFormData?.phone,
5806
5825
  consents: acceptedConsents,
5807
5826
  onSuccess: handleSuccessVerify,
5808
5827
  });
@@ -5812,7 +5831,7 @@
5812
5831
  catch {
5813
5832
  setOK(false);
5814
5833
  }
5815
- }, []);
5834
+ }, [esiaError]);
5816
5835
  return { isSending, ok, handleSubmit };
5817
5836
  };
5818
5837
  const getAcceptedConsents = (formData, productType) => {
@@ -5884,6 +5903,12 @@
5884
5903
  consentAssignmentClaimsFlg: consentOthersFlg,
5885
5904
  };
5886
5905
  };
5906
+ const transformFormData = (formData) => ({
5907
+ ...formData,
5908
+ surname: formData.surname?.trim(),
5909
+ name: formData.name?.trim(),
5910
+ middleName: formData.middleName?.trim(),
5911
+ });
5887
5912
 
5888
5913
  const useSetter = (target, key) => useCallback((value) => {
5889
5914
  const newValue = value instanceof Function ? value(target[key]) : value;
@@ -5895,10 +5920,7 @@
5895
5920
  }
5896
5921
  }, [target, key]);
5897
5922
 
5898
- const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5899
- saveToken(res);
5900
- return res;
5901
- });
5923
+ const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5902
5924
 
5903
5925
  const initialFormState = {
5904
5926
  surname: '',
@@ -5916,24 +5938,19 @@
5916
5938
  consentPhotoFlg: false,
5917
5939
  consentFATCA: false,
5918
5940
  };
5919
- const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5941
+ const getInitialFormState$1 = (inputs, savedForm) => {
5920
5942
  if (savedForm) {
5921
- return {
5922
- ...savedForm,
5923
- limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5924
- ...(!esiaAuthSuccess && {
5925
- esiaAccountTypeCd: { key: '' },
5926
- }),
5927
- };
5943
+ return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5928
5944
  }
5929
5945
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5930
5946
  return { ...formState };
5931
5947
  };
5932
5948
 
5933
- const uploadFile = async (file, documentCategory, isPDF = false) => {
5949
+ const uploadFile = async (file, taskId, documentCategory) => {
5934
5950
  const fd = new FormData();
5951
+ fd.append('taskId', taskId);
5935
5952
  fd.append('documentCategory', documentCategory);
5936
- fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5953
+ fd.append('file', file, 'file.pdf');
5937
5954
  const res = await globalThis
5938
5955
  ?.fetch?.(`/light-api-cash/v1/file`, {
5939
5956
  method: 'POST',
@@ -5947,13 +5964,23 @@
5947
5964
  return res;
5948
5965
  };
5949
5966
 
5950
- const parseEsiaProfile = async (esiaProfile, isDebit) => {
5951
- checkEsiaData(esiaProfile);
5952
- const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
5967
+ const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5968
+ isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5953
5969
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5954
- let files = [];
5955
- if (isFullEsiaData) {
5956
- files = await saveDocuments(esiaAdditionalDocument);
5970
+ const files = [];
5971
+ if (!isDebit) {
5972
+ await saveDocument({
5973
+ document: esiaAdditionalDocument.pdfFileWorkbook,
5974
+ taskId,
5975
+ category: 'CONFIRMING_INCOME_DOC',
5976
+ files,
5977
+ });
5978
+ await saveDocument({
5979
+ document: esiaAdditionalDocument.pdfFilePayout,
5980
+ taskId,
5981
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5982
+ files,
5983
+ });
5957
5984
  }
5958
5985
  const mainData = {
5959
5986
  name: profile.name,
@@ -5970,11 +5997,11 @@
5970
5997
  birthPlace: addInfo.birthPlace,
5971
5998
  addressRegistration: buildAddress(addressRegistration),
5972
5999
  addressFact: buildAddress(addressFact),
5973
- esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
6000
+ esiaAccountTypeCd: profile.esiaAccountType,
5974
6001
  };
5975
6002
  return {
5976
6003
  ...mainData,
5977
- ...(isFullEsiaData && {
6004
+ ...(!isDebit && {
5978
6005
  snils: addInfo.snils,
5979
6006
  inn: esiaAdditionalDocument.inn,
5980
6007
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -5983,9 +6010,6 @@
5983
6010
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
5984
6011
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
5985
6012
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
5986
- esiaAccountTypeCd: profile.esiaAccountType,
5987
- confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
5988
- employment: { key: 'WORK', text: 'Работаю' },
5989
6013
  files,
5990
6014
  }),
5991
6015
  };
@@ -6018,60 +6042,43 @@
6018
6042
  };
6019
6043
  };
6020
6044
  const getYearFromMonth = (month) => Math.floor(month / 12);
6021
- const saveDocuments = async (esiaAdditionalDocument) => {
6022
- const files = [];
6023
- const documents = [
6024
- {
6025
- file: esiaAdditionalDocument.pdfFileWorkbook,
6026
- category: 'CONFIRMING_INCOME_DOC',
6027
- isPDF: true,
6028
- },
6029
- {
6030
- file: esiaAdditionalDocument.pdfFilePayout,
6031
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6032
- isPDF: true,
6033
- },
6034
- {
6035
- file: esiaAdditionalDocument.pdfFileSigPayout,
6036
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6037
- isPDF: true,
6038
- },
6039
- {
6040
- file: esiaAdditionalDocument.xmlFilePayout,
6041
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6042
- isPDF: false,
6043
- },
6044
- {
6045
- file: esiaAdditionalDocument.xmlFileSigPayout,
6046
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6047
- isPDF: false,
6048
- },
6049
- {
6050
- file: esiaAdditionalDocument.xmlFileWorkbook,
6051
- category: 'CONFIRMING_INCOME_DOC',
6052
- isPDF: false,
6053
- },
6054
- {
6055
- file: esiaAdditionalDocument.pdfFileSigWorkbook,
6056
- category: 'CONFIRMING_INCOME_DOC',
6057
- isPDF: true,
6058
- },
6059
- {
6060
- file: esiaAdditionalDocument.xmlFileSigWorkbook,
6061
- category: 'CONFIRMING_INCOME_DOC',
6062
- isPDF: false,
6063
- },
6045
+ const saveDocument = async ({ document, taskId, category, files, }) => {
6046
+ await fetch(`data:application/pdf;base64,${document}`)
6047
+ .then((res) => res.blob())
6048
+ .then((value) => uploadFile(value, taskId, category))
6049
+ .then((file) => files.push(file));
6050
+ };
6051
+ const checkEsiaDataForCredit = (esiaProfile) => {
6052
+ const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
6053
+ const data = [
6054
+ profile.name,
6055
+ profile.surname,
6056
+ profile.midname,
6057
+ profile.birthDate,
6058
+ profile.phone,
6059
+ profile.email,
6060
+ document.dulIssueDate,
6061
+ document.dulIssuedBy,
6062
+ document.dulNumber,
6063
+ document.dulSerie,
6064
+ document.dulSubdivisionCode,
6065
+ addressRegistration,
6066
+ profile.esiaAccountType,
6067
+ esiaAdditionalDocument.inn,
6068
+ esiaAdditionalDocument.averageMonthlyIncome.toString(),
6069
+ esiaAdditionalDocument.startWorkDate,
6070
+ esiaAdditionalDocument.workLengthInFiveYears.toString(),
6071
+ esiaAdditionalDocument.workLength.toString(),
6072
+ esiaAdditionalDocument.workLengthLastJob.toString(),
6073
+ esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6074
+ esiaAdditionalDocument.pdfFilePayout,
6075
+ esiaAdditionalDocument.pdfFileWorkbook,
6064
6076
  ];
6065
- for (const doc of documents) {
6066
- const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
6067
- await fetch(`${contentType},${doc.file}`)
6068
- .then((res) => res.blob())
6069
- .then((value) => uploadFile(value, doc.category, doc.isPDF))
6070
- .then((file) => files.push(file));
6077
+ if (!data.every((_) => Boolean(_))) {
6078
+ throw new Error();
6071
6079
  }
6072
- return files;
6073
6080
  };
6074
- const checkEsiaData = (esiaProfile) => {
6081
+ const checkEsiaDataForDebit = (esiaProfile) => {
6075
6082
  const { profile, document, addressRegistration } = esiaProfile;
6076
6083
  const data = [
6077
6084
  profile.name,
@@ -6079,6 +6086,7 @@
6079
6086
  profile.midname,
6080
6087
  profile.birthDate,
6081
6088
  profile.phone,
6089
+ profile.email,
6082
6090
  document.dulIssueDate,
6083
6091
  document.dulIssuedBy,
6084
6092
  document.dulNumber,
@@ -6091,97 +6099,75 @@
6091
6099
  throw new Error();
6092
6100
  }
6093
6101
  };
6094
- const checkEsiaAdditionalDocument = (esiaProfile) => {
6095
- const { esiaAdditionalDocument } = esiaProfile;
6096
- const data = [
6097
- esiaAdditionalDocument?.inn,
6098
- esiaAdditionalDocument?.averageMonthlyIncome?.toString(),
6099
- esiaAdditionalDocument?.startWorkDate,
6100
- esiaAdditionalDocument?.workLengthInFiveYears?.toString(),
6101
- esiaAdditionalDocument?.workLength?.toString(),
6102
- esiaAdditionalDocument?.workLengthLastJob?.toString(),
6103
- esiaAdditionalDocument?.jobsNumberInFiveYears?.toString(),
6104
- esiaAdditionalDocument?.pdfFilePayout,
6105
- esiaAdditionalDocument?.pdfFileWorkbook,
6106
- esiaAdditionalDocument?.pdfFileSigPayout,
6107
- esiaAdditionalDocument?.xmlFilePayout,
6108
- esiaAdditionalDocument?.xmlFileSigPayout,
6109
- esiaAdditionalDocument?.xmlFileWorkbook,
6110
- esiaAdditionalDocument?.pdfFileSigWorkbook,
6111
- esiaAdditionalDocument?.xmlFileSigWorkbook,
6112
- ];
6113
- return data.every((_) => Boolean(_));
6114
- };
6115
6102
 
6116
- const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
6103
+ const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6104
+ const navigator = locationNavigator();
6105
+ const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6117
6106
  const leadFormStore = useLeadFormStore();
6118
6107
  const saveForm = useSetter(leadFormStore, 'leadForm');
6119
- const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6120
- const requestEsiaProfile = useCallback(async (code, state) => {
6121
- setEsiaStatus(EsiaStatuses.Pending);
6108
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
6109
+ const updateEsiaProfile = useCallback(async (profileId, code, state) => {
6110
+ startLoading();
6122
6111
  try {
6123
- const data = await esiaRequestProfile({
6112
+ const data = await updateProfileEsia({
6113
+ profileId,
6124
6114
  code,
6125
6115
  state,
6126
6116
  redirectUri: globalThis.location?.href,
6127
- authorize: true,
6128
6117
  });
6129
- if (data) {
6130
- const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6118
+ if (data && leadFormStore?.taskId) {
6119
+ const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6131
6120
  saveForm((_) => ({
6132
6121
  ..._,
6133
6122
  ...parsedData,
6134
6123
  }));
6135
- setEsiaStatus(EsiaStatuses.Success);
6136
6124
  }
6125
+ navigator.assign(nextStepLink);
6137
6126
  }
6138
6127
  catch {
6139
- setEsiaStatus(EsiaStatuses.Error);
6128
+ setEsiaError();
6140
6129
  }
6141
- }, []);
6130
+ finally {
6131
+ endLoading();
6132
+ }
6133
+ }, [nextStepLink]);
6142
6134
  useEffect(() => {
6143
6135
  leadFormStore.productType = productType;
6136
+ const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6144
6137
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6145
6138
  const code = params.get('code');
6146
6139
  const state = params.get('state');
6147
- if (code && state) {
6148
- requestEsiaProfile(code, state);
6140
+ if (profileId && code && state) {
6141
+ updateEsiaProfile(profileId, code, state);
6149
6142
  }
6150
6143
  else {
6151
6144
  sessionStorage.removeItem('accessToken');
6152
6145
  sessionStorage.removeItem('refreshToken');
6153
6146
  }
6154
6147
  }, []);
6155
- return initialFormState;
6148
+ return [initialFormState, { isLoading }];
6156
6149
  };
6157
6150
 
6158
- var EsiaStatuses;
6159
- (function (EsiaStatuses) {
6160
- EsiaStatuses["Success"] = "SUCCESS";
6161
- EsiaStatuses["Error"] = "ERROR";
6162
- EsiaStatuses["Pending"] = "PENDING";
6163
- })(EsiaStatuses || (EsiaStatuses = {}));
6164
6151
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6165
- const [esiaStatus, setEsiaStatus] = useState();
6166
- const leadForm = useRef(null);
6152
+ const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6167
6153
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6168
6154
  const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
6169
6155
  const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
6170
6156
  const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
6171
- const initialFormState = useInitApplicationLead({
6157
+ const [initialFormState, { isLoading }] = useInitApplicationLead({
6172
6158
  inputs,
6173
6159
  nextStepLink,
6174
6160
  productType,
6175
- setEsiaStatus,
6176
- esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
6161
+ setEsiaError,
6177
6162
  });
6178
6163
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6179
6164
  programId,
6180
6165
  nextStepLink,
6181
6166
  productType,
6167
+ esiaError,
6182
6168
  data,
6183
6169
  });
6184
- const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6170
+ const [, { field, onSubmit }] = useForm(initialFormState, {
6185
6171
  formValidator,
6186
6172
  onSubmit: handleSubmit,
6187
6173
  });
@@ -6191,17 +6177,7 @@
6191
6177
  responseTypeDialog.open({ ok });
6192
6178
  }
6193
6179
  }, [ok]);
6194
- useEffect(() => {
6195
- if (esiaStatus && leadForm?.current) {
6196
- leadForm.current.scrollIntoView({
6197
- block: 'start',
6198
- });
6199
- }
6200
- if (esiaStatus === EsiaStatuses.Success) {
6201
- reset();
6202
- }
6203
- }, [leadForm?.current, esiaStatus]);
6204
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, {}) : null, jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", ref: leadForm, children: [esiaStatus === EsiaStatuses.Pending ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaStatus === EsiaStatuses.Error ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] })] }));
6180
+ return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaError ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] }) }));
6205
6181
  });
6206
6182
  const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
6207
6183
  const getExtendedValidatorObj = (productType) => ({
@@ -7899,7 +7875,6 @@
7899
7875
  mandatoryPayments: undefined,
7900
7876
  snils: '',
7901
7877
  armyIdFlg: false,
7902
- esiaAccountTypeCd: { key: '', text: '' },
7903
7878
  },
7904
7879
  {
7905
7880
  bankruptcyFlg: false,
@@ -8295,7 +8270,7 @@
8295
8270
  label: 'Телефон работодателя',
8296
8271
  required: true,
8297
8272
  },
8298
- { name: 'beginDate', required: true, filledByEsia: true },
8273
+ { name: 'beginDate', required: true },
8299
8274
  ],
8300
8275
  },
8301
8276
  {
@@ -8336,16 +8311,6 @@
8336
8311
  {
8337
8312
  title: 'Совокупный доход',
8338
8313
  },
8339
- {
8340
- columns: 1,
8341
- inputs: [
8342
- {
8343
- name: 'confirmationIncome',
8344
- required: true,
8345
- filledByEsia: true,
8346
- },
8347
- ],
8348
- },
8349
8314
  {
8350
8315
  inputs: [
8351
8316
  {
@@ -8354,6 +8319,10 @@
8354
8319
  },
8355
8320
  ],
8356
8321
  },
8322
+ {
8323
+ columns: 1,
8324
+ inputs: [{ name: 'confirmationIncome', required: true }],
8325
+ },
8357
8326
  {
8358
8327
  columns: 1,
8359
8328
  inputs: [{ name: 'wages', required: true, filledByEsia: true }],
@@ -10949,7 +10918,7 @@
10949
10918
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10950
10919
  });
10951
10920
 
10952
- const packageVersion = "0.14.823";
10921
+ const packageVersion = "0.14.824";
10953
10922
 
10954
10923
  exports.Blocks = Blocks;
10955
10924
  exports.ContentPage = ContentPage;