@redneckz/wildless-cms-uni-blocks 0.14.820 → 0.14.821

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 (377) hide show
  1. package/bundle/bundle.umd.js +184 -222
  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 +50 -80
  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 +10 -7
  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 +50 -80
  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 +10 -7
  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/retail/api/checkCode.d.ts +0 -1
  102. package/lib/retail/api/checkCode.js +1 -1
  103. package/lib/retail/api/checkCode.js.map +1 -1
  104. package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  105. package/lib/retail/api/updateProfileEsia.js +3 -0
  106. package/lib/retail/api/updateProfileEsia.js.map +1 -0
  107. package/lib/retail/api/updateUserTask.d.ts +0 -1
  108. package/lib/retail/api/updateUserTask.js.map +1 -1
  109. package/lib/retail/api/uploadFile.d.ts +1 -1
  110. package/lib/retail/api/uploadFile.js +3 -2
  111. package/lib/retail/api/uploadFile.js.map +1 -1
  112. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  113. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  114. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  115. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
  116. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  117. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  118. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  119. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  120. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  121. package/lib/retail/components/Fields/BeginDateField.js +1 -2
  122. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  123. package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  124. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  125. package/lib/retail/components/Fields/DaDataInnField.js +1 -2
  126. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  127. package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  128. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  129. package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  130. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  131. package/lib/retail/components/Fields/JobsNumberField.js +1 -2
  132. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  133. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  134. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  135. package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  136. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  137. package/lib/retail/components/Fields/WagesField.js +1 -2
  138. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  139. package/lib/retail/content.js +5 -11
  140. package/lib/retail/content.js.map +1 -1
  141. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  142. package/lib/retail/utils/mainFormStateMap.js +0 -1
  143. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  144. package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  145. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  146. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  147. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  148. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  149. package/mobile/bundle/bundle.umd.js +184 -222
  150. package/mobile/bundle/bundle.umd.min.js +1 -1
  151. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  152. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  153. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  154. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  155. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  156. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  157. package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
  158. package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  159. package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
  160. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  161. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  162. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  163. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  164. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  165. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  166. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  167. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  168. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  169. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  170. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  171. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  172. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  173. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  174. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  175. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  176. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  177. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  178. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  179. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  180. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  181. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  182. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  183. package/mobile/dist/retail/api/checkCode.d.ts +0 -1
  184. package/mobile/dist/retail/api/checkCode.js +2 -3
  185. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  186. package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
  187. package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
  188. package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
  189. package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
  190. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  191. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  192. package/mobile/dist/retail/api/uploadFile.js +3 -2
  193. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  194. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  195. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  196. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  197. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  198. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  199. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  200. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  201. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  202. package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
  203. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  204. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  205. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  206. package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
  207. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  208. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  209. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  210. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  211. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  212. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
  213. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  214. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  215. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  216. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  217. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  218. package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
  219. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  220. package/mobile/dist/retail/content.js +5 -11
  221. package/mobile/dist/retail/content.js.map +1 -1
  222. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  223. package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
  224. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  225. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  226. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  227. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  228. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  229. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  230. package/mobile/lib/common.css +1 -1
  231. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  232. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  233. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  234. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  235. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  236. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  237. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  238. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  239. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  240. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  241. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  242. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  243. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  244. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  245. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  246. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  247. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  248. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  249. package/mobile/lib/retail/api/checkCode.d.ts +0 -1
  250. package/mobile/lib/retail/api/checkCode.js +1 -1
  251. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  252. package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
  253. package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
  254. package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
  255. package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
  256. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  257. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  258. package/mobile/lib/retail/api/uploadFile.js +3 -2
  259. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  260. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  261. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  262. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  263. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  264. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  265. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  266. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  267. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  268. package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
  269. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  270. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  271. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  272. package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
  273. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  274. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  275. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  276. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  277. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  278. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
  279. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  280. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  281. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  282. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  283. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  284. package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
  285. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  286. package/mobile/lib/retail/content.js +5 -11
  287. package/mobile/lib/retail/content.js.map +1 -1
  288. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  289. package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
  290. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  291. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  292. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  293. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  294. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  295. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  296. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  297. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  298. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  299. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  300. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  301. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  302. package/mobile/src/retail/api/checkCode.ts +1 -1
  303. package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  304. package/mobile/src/retail/api/updateUserTask.ts +0 -1
  305. package/mobile/src/retail/api/uploadFile.ts +3 -2
  306. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  307. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  308. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  309. package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
  310. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  311. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  312. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  313. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  314. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  315. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  316. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  317. package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
  318. package/mobile/src/retail/content.tsx +5 -11
  319. package/mobile/src/retail/model/NameFieldDef.ts +0 -1
  320. package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
  321. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  322. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  323. package/package.json +1 -1
  324. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  325. package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  326. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  327. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  328. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  329. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  330. package/src/retail/api/checkCode.ts +1 -1
  331. package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  332. package/src/retail/api/updateUserTask.ts +0 -1
  333. package/src/retail/api/uploadFile.ts +3 -2
  334. package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  335. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
  336. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  337. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  338. package/src/retail/components/Fields/BeginDateField.tsx +0 -2
  339. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  340. package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  341. package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  342. package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  343. package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  344. package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  345. package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  346. package/src/retail/components/Fields/WagesField.tsx +0 -2
  347. package/src/retail/content.tsx +5 -11
  348. package/src/retail/model/NameFieldDef.ts +0 -1
  349. package/src/retail/utils/mainFormStateMap.ts +0 -1
  350. package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  351. package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  352. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  353. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  354. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  355. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  356. package/dist/retail/api/esiaRequestProfile.js +0 -10
  357. package/dist/retail/api/esiaRequestProfile.js.map +0 -1
  358. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  359. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  360. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  361. package/lib/retail/api/esiaRequestProfile.js +0 -7
  362. package/lib/retail/api/esiaRequestProfile.js.map +0 -1
  363. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  364. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  365. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  366. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  367. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
  368. package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
  369. package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
  370. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  371. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  372. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  373. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
  374. package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
  375. package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
  376. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
  377. 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 = {
@@ -2645,11 +2645,11 @@
2645
2645
  {
2646
2646
  columns: 2,
2647
2647
  inputs: [
2648
- { name: 'surname', required: true, dadata: true, filledByEsia: true },
2649
- { name: 'name', required: true, dadata: true, filledByEsia: true },
2650
- { name: 'middleName', dadata: true, filledByEsia: true },
2651
- { name: 'limitedBirthday', required: true, filledByEsia: true },
2652
- { name: 'phone', required: true, filledByEsia: true },
2648
+ { name: 'surname', required: true, dadata: true },
2649
+ { name: 'name', required: true, dadata: true },
2650
+ { name: 'middleName', dadata: true },
2651
+ { name: 'limitedBirthday', required: true },
2652
+ { name: 'phone', required: true },
2653
2653
  { name: 'email', required: true, dadata: true },
2654
2654
  ],
2655
2655
  },
@@ -2659,57 +2659,6 @@
2659
2659
  ];
2660
2660
  };
2661
2661
 
2662
- const getTraceId = () => {
2663
- const result = new Uint8Array(8);
2664
- globalThis.crypto.getRandomValues(result);
2665
- return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
2666
- };
2667
-
2668
- const fetchRetailJSON = async (url, method, body) => {
2669
- try {
2670
- const response = await doRequest(url, method, body);
2671
- return response.json();
2672
- }
2673
- catch (err) {
2674
- console.error(err);
2675
- return null;
2676
- }
2677
- };
2678
- async function doRequest(url, method, body) {
2679
- const traceId = getTraceId();
2680
- return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
2681
- method,
2682
- headers: {
2683
- 'Content-Type': 'application/json',
2684
- 'X-B3-Sampled': '1',
2685
- 'X-B3-Spanid': traceId,
2686
- 'X-B3-Traceid': traceId,
2687
- ...getAuthorizationHeaders(),
2688
- },
2689
- credentials: 'include',
2690
- body: body ? JSON.stringify(body) : null,
2691
- });
2692
- }
2693
- const getAuthorizationHeaders = () => {
2694
- const token = sessionStorage.getItem('accessToken');
2695
- return token ? { Authorization: `Bearer ${token}` } : null;
2696
- };
2697
-
2698
- const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
2699
-
2700
- const EsiaLoginBanner = JSX(() => {
2701
- const navigator = locationNavigator();
2702
- const handleAuth = useCallback(async () => {
2703
- const resp = await getLink({
2704
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
2705
- });
2706
- if (resp?.link) {
2707
- navigator.assign(resp.link);
2708
- }
2709
- }, []);
2710
- 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" })] }));
2711
- });
2712
-
2713
2662
  const debounce = (fn, delay = 600) => {
2714
2663
  let timerId;
2715
2664
  const debouncedCallback = (...args) => {
@@ -3596,6 +3545,42 @@
3596
3545
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3597
3546
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3598
3547
 
3548
+ const getTraceId = () => {
3549
+ const result = new Uint8Array(8);
3550
+ globalThis.crypto.getRandomValues(result);
3551
+ return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
3552
+ };
3553
+
3554
+ const fetchRetailJSON = async (url, method, body) => {
3555
+ try {
3556
+ const response = await doRequest(url, method, body);
3557
+ return response.json();
3558
+ }
3559
+ catch (err) {
3560
+ console.error(err);
3561
+ return null;
3562
+ }
3563
+ };
3564
+ async function doRequest(url, method, body) {
3565
+ const traceId = getTraceId();
3566
+ return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
3567
+ method,
3568
+ headers: {
3569
+ 'Content-Type': 'application/json',
3570
+ 'X-B3-Sampled': '1',
3571
+ 'X-B3-Spanid': traceId,
3572
+ 'X-B3-Traceid': traceId,
3573
+ ...getAuthorizationHeaders(),
3574
+ },
3575
+ credentials: 'include',
3576
+ body: body ? JSON.stringify(body) : null,
3577
+ });
3578
+ }
3579
+ const getAuthorizationHeaders = () => {
3580
+ const token = sessionStorage.getItem('accessToken');
3581
+ return token ? { Authorization: `Bearer ${token}` } : null;
3582
+ };
3583
+
3599
3584
  const fetchRegionOffices = async (regionKey) => {
3600
3585
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3601
3586
  regionRfCd: {
@@ -3825,7 +3810,7 @@
3825
3810
 
3826
3811
  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 ?? '') })));
3827
3812
 
3828
- 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 ?? '') })));
3813
+ 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 })));
3829
3814
 
3830
3815
  const FIELD_NAME$2 = 'birthPlace';
3831
3816
  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) })));
@@ -3889,8 +3874,7 @@
3889
3874
 
3890
3875
  const ConfirmationIncomeField = JSX(({ field, input }) => {
3891
3876
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
3892
- const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
3893
- 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 })] }));
3877
+ 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 }));
3894
3878
  });
3895
3879
 
3896
3880
  const ConscriptionField = JSX(({ field, input }) => {
@@ -4434,7 +4418,7 @@
4434
4418
  }
4435
4419
  })();
4436
4420
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
4437
- return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4421
+ return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4438
4422
  });
4439
4423
 
4440
4424
  const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? '') })));
@@ -4513,7 +4497,7 @@
4513
4497
  const MIN_YEARS = 0;
4514
4498
  const Experience5YearsField = JSX(({ field, input }) => {
4515
4499
  const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
4516
- 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 ?? '') }));
4500
+ 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 }));
4517
4501
  });
4518
4502
 
4519
4503
  const FamilyMembersField = JSX(({ field, input }) => {
@@ -4534,7 +4518,7 @@
4534
4518
  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 }));
4535
4519
  });
4536
4520
 
4537
- 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 ?? '') })));
4521
+ 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 })));
4538
4522
 
4539
4523
  const HousingField = JSX(({ field, input }) => {
4540
4524
  const { data: housing } = useLeadFormData('HOUSE_TYPE');
@@ -4543,9 +4527,9 @@
4543
4527
 
4544
4528
  const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
4545
4529
 
4546
- 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 ?? '') })));
4530
+ 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 })));
4547
4531
 
4548
- 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 ?? '') })));
4532
+ 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 })));
4549
4533
 
4550
4534
  const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
4551
4535
  const isLatin = (_ = '') => latinPattern.test(_);
@@ -4697,7 +4681,7 @@
4697
4681
  field?.('inn')?.onChange?.(item.data?.inn);
4698
4682
  updateOrganizationFields(store, field, item);
4699
4683
  }, []);
4700
- 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 }));
4684
+ 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 }));
4701
4685
  });
4702
4686
 
4703
4687
  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 })));
@@ -4837,7 +4821,7 @@
4837
4821
 
4838
4822
  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 })));
4839
4823
 
4840
- 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 ?? '') })));
4824
+ 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 })));
4841
4825
 
4842
4826
  const DELIVERY_CITIES_REF = {
4843
4827
  $ref: '/wcms-resources/delivery-cities-data.json',
@@ -5467,7 +5451,7 @@
5467
5451
  const participant = task.participants[0];
5468
5452
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5469
5453
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
5470
- 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;
5454
+ 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;
5471
5455
  return {
5472
5456
  currency: currency?.key,
5473
5457
  paymentSystem: getSelectValue(paymentSystem),
@@ -5519,7 +5503,6 @@
5519
5503
  monthsValue,
5520
5504
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5521
5505
  },
5522
- esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5523
5506
  ...getParticipantIncomes(participantIncomes),
5524
5507
  ...getParticipantAddresses(participantAddresses),
5525
5508
  ...getParticipantContacts(participantContacts),
@@ -5574,6 +5557,39 @@
5574
5557
  };
5575
5558
  };
5576
5559
 
5560
+ const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
5561
+
5562
+ const EsiaLoginDialog = JSX(({ onClose }) => {
5563
+ const navigator = locationNavigator();
5564
+ const retailFormStore = useRetailFormStore();
5565
+ const handleAuth = useCallback(async () => {
5566
+ const resp = await getLink({
5567
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
5568
+ });
5569
+ if (resp?.link) {
5570
+ navigator.assign(resp.link);
5571
+ globalThis.location.href = resp.link;
5572
+ }
5573
+ }, []);
5574
+ const handleClose = useCallback(() => {
5575
+ if (retailFormStore.leadForm) {
5576
+ const leadForm = { ...retailFormStore.leadForm };
5577
+ delete leadForm.esiaAccountTypeCd;
5578
+ retailFormStore.leadForm = leadForm;
5579
+ }
5580
+ onClose?.();
5581
+ }, []);
5582
+ 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" })] })] }) }));
5583
+ });
5584
+
5585
+ const useEsiaLoginDialog = (nextStepLink) => {
5586
+ const { open } = useDialog(EsiaLoginDialog);
5587
+ const navigator = locationNavigator();
5588
+ return useCallback(() => {
5589
+ open({ onClose: () => navigator.assign(nextStepLink) });
5590
+ }, [open, nextStepLink]);
5591
+ };
5592
+
5577
5593
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5578
5594
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5579
5595
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5695,19 +5711,21 @@
5695
5711
 
5696
5712
  /* eslint-disable max-lines */
5697
5713
  // eslint-disable-next-line max-lines-per-function
5698
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5714
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5699
5715
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5700
5716
  const [ok, setOK] = useState();
5701
5717
  const saveUserData = useSaveUserData();
5702
5718
  const sendAspects = useSendLeadFormAspects({ data });
5703
5719
  const navigator = locationNavigator();
5704
- const goToNextStep = useCallback(() => {
5705
- navigator.assign(nextStepLink);
5706
- }, []);
5707
- const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5720
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5721
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5708
5722
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5709
5723
  const draftDialog = useDraftDialog();
5710
5724
  const handleSubmit = useCallback(async (formData) => {
5725
+ if (esiaError) {
5726
+ navigator.assign(nextStepLink);
5727
+ return;
5728
+ }
5711
5729
  try {
5712
5730
  startSending();
5713
5731
  const profileId = await createUserProfile({
@@ -5725,7 +5743,7 @@
5725
5743
  });
5726
5744
  verifyPhoneDialog.close();
5727
5745
  if (productType === 'debitCard') {
5728
- goToNextStep();
5746
+ openEsiaLoginDialog();
5729
5747
  }
5730
5748
  else {
5731
5749
  consentBkiDialog.open(formData.phone, profileId);
@@ -5764,7 +5782,7 @@
5764
5782
  catch {
5765
5783
  setOK(false);
5766
5784
  }
5767
- }, []);
5785
+ }, [esiaError]);
5768
5786
  return { isSending, ok, handleSubmit };
5769
5787
  };
5770
5788
  const getAcceptedConsents = (formData, productType) => {
@@ -5847,10 +5865,7 @@
5847
5865
  }
5848
5866
  }, [target, key]);
5849
5867
 
5850
- const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5851
- saveToken(res);
5852
- return res;
5853
- });
5868
+ const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5854
5869
 
5855
5870
  const initialFormState = {
5856
5871
  surname: '',
@@ -5868,24 +5883,19 @@
5868
5883
  consentPhotoFlg: false,
5869
5884
  consentFATCA: false,
5870
5885
  };
5871
- const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5886
+ const getInitialFormState$1 = (inputs, savedForm) => {
5872
5887
  if (savedForm) {
5873
- return {
5874
- ...savedForm,
5875
- limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5876
- ...(!esiaAuthSuccess && {
5877
- esiaAccountTypeCd: { key: '' },
5878
- }),
5879
- };
5888
+ return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5880
5889
  }
5881
5890
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5882
5891
  return { ...formState };
5883
5892
  };
5884
5893
 
5885
- const uploadFile = async (file, documentCategory, isPDF = false) => {
5894
+ const uploadFile = async (file, taskId, documentCategory) => {
5886
5895
  const fd = new FormData();
5896
+ fd.append('taskId', taskId);
5887
5897
  fd.append('documentCategory', documentCategory);
5888
- fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5898
+ fd.append('file', file, 'file.pdf');
5889
5899
  const res = await globalThis
5890
5900
  ?.fetch?.(`/light-api-cash/v1/file`, {
5891
5901
  method: 'POST',
@@ -5899,13 +5909,23 @@
5899
5909
  return res;
5900
5910
  };
5901
5911
 
5902
- const parseEsiaProfile = async (esiaProfile, isDebit) => {
5903
- checkEsiaData(esiaProfile);
5904
- const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
5912
+ const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5913
+ isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5905
5914
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5906
- let files = [];
5907
- if (isFullEsiaData) {
5908
- files = await saveDocuments(esiaAdditionalDocument);
5915
+ const files = [];
5916
+ if (!isDebit) {
5917
+ await saveDocument({
5918
+ document: esiaAdditionalDocument.pdfFileWorkbook,
5919
+ taskId,
5920
+ category: 'CONFIRMING_INCOME_DOC',
5921
+ files,
5922
+ });
5923
+ await saveDocument({
5924
+ document: esiaAdditionalDocument.pdfFilePayout,
5925
+ taskId,
5926
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5927
+ files,
5928
+ });
5909
5929
  }
5910
5930
  const mainData = {
5911
5931
  name: profile.name,
@@ -5922,11 +5942,11 @@
5922
5942
  birthPlace: addInfo.birthPlace,
5923
5943
  addressRegistration: buildAddress(addressRegistration),
5924
5944
  addressFact: buildAddress(addressFact),
5925
- esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
5945
+ esiaAccountTypeCd: profile.esiaAccountType,
5926
5946
  };
5927
5947
  return {
5928
5948
  ...mainData,
5929
- ...(isFullEsiaData && {
5949
+ ...(!isDebit && {
5930
5950
  snils: addInfo.snils,
5931
5951
  inn: esiaAdditionalDocument.inn,
5932
5952
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -5935,9 +5955,6 @@
5935
5955
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
5936
5956
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
5937
5957
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
5938
- esiaAccountTypeCd: profile.esiaAccountType,
5939
- confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
5940
- employment: { key: 'WORK', text: 'Работаю' },
5941
5958
  files,
5942
5959
  }),
5943
5960
  };
@@ -5970,67 +5987,21 @@
5970
5987
  };
5971
5988
  };
5972
5989
  const getYearFromMonth = (month) => Math.floor(month / 12);
5973
- const saveDocuments = async (esiaAdditionalDocument) => {
5974
- const files = [];
5975
- const documents = [
5976
- {
5977
- file: esiaAdditionalDocument.pdfFileWorkbook,
5978
- category: 'CONFIRMING_INCOME_DOC',
5979
- isPDF: true,
5980
- },
5981
- {
5982
- file: esiaAdditionalDocument.pdfFilePayout,
5983
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5984
- isPDF: true,
5985
- },
5986
- {
5987
- file: esiaAdditionalDocument.pdfFileSigPayout,
5988
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5989
- isPDF: true,
5990
- },
5991
- {
5992
- file: esiaAdditionalDocument.xmlFilePayout,
5993
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5994
- isPDF: false,
5995
- },
5996
- {
5997
- file: esiaAdditionalDocument.xmlFileSigPayout,
5998
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5999
- isPDF: false,
6000
- },
6001
- {
6002
- file: esiaAdditionalDocument.xmlFileWorkbook,
6003
- category: 'CONFIRMING_INCOME_DOC',
6004
- isPDF: false,
6005
- },
6006
- {
6007
- file: esiaAdditionalDocument.pdfFileSigWorkbook,
6008
- category: 'CONFIRMING_INCOME_DOC',
6009
- isPDF: true,
6010
- },
6011
- {
6012
- file: esiaAdditionalDocument.xmlFileSigWorkbook,
6013
- category: 'CONFIRMING_INCOME_DOC',
6014
- isPDF: false,
6015
- },
6016
- ];
6017
- for (const doc of documents) {
6018
- const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
6019
- await fetch(`${contentType},${doc.file}`)
6020
- .then((res) => res.blob())
6021
- .then((value) => uploadFile(value, doc.category, doc.isPDF))
6022
- .then((file) => files.push(file));
6023
- }
6024
- return files;
6025
- };
6026
- const checkEsiaData = (esiaProfile) => {
6027
- const { profile, document, addressRegistration } = esiaProfile;
5990
+ const saveDocument = async ({ document, taskId, category, files, }) => {
5991
+ await fetch(`data:application/pdf;base64,${document}`)
5992
+ .then((res) => res.blob())
5993
+ .then((value) => uploadFile(value, taskId, category))
5994
+ .then((file) => files.push(file));
5995
+ };
5996
+ const checkEsiaDataForCredit = (esiaProfile) => {
5997
+ const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
6028
5998
  const data = [
6029
5999
  profile.name,
6030
6000
  profile.surname,
6031
6001
  profile.midname,
6032
6002
  profile.birthDate,
6033
6003
  profile.phone,
6004
+ profile.email,
6034
6005
  document.dulIssueDate,
6035
6006
  document.dulIssuedBy,
6036
6007
  document.dulNumber,
@@ -6038,14 +6009,6 @@
6038
6009
  document.dulSubdivisionCode,
6039
6010
  addressRegistration,
6040
6011
  profile.esiaAccountType,
6041
- ];
6042
- if (!data.every((_) => Boolean(_))) {
6043
- throw new Error();
6044
- }
6045
- };
6046
- const checkEsiaAdditionalDocument = (esiaProfile) => {
6047
- const { esiaAdditionalDocument } = esiaProfile;
6048
- const data = [
6049
6012
  esiaAdditionalDocument.inn,
6050
6013
  esiaAdditionalDocument.averageMonthlyIncome.toString(),
6051
6014
  esiaAdditionalDocument.startWorkDate,
@@ -6055,84 +6018,100 @@
6055
6018
  esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6056
6019
  esiaAdditionalDocument.pdfFilePayout,
6057
6020
  esiaAdditionalDocument.pdfFileWorkbook,
6058
- esiaAdditionalDocument.pdfFileSigPayout,
6059
- esiaAdditionalDocument.xmlFilePayout,
6060
- esiaAdditionalDocument.xmlFileSigPayout,
6061
- esiaAdditionalDocument.xmlFileWorkbook,
6062
- esiaAdditionalDocument.pdfFileSigWorkbook,
6063
- esiaAdditionalDocument.xmlFileSigWorkbook,
6064
6021
  ];
6065
- return data.every((_) => Boolean(_));
6022
+ if (!data.every((_) => Boolean(_))) {
6023
+ throw new Error();
6024
+ }
6025
+ };
6026
+ const checkEsiaDataForDebit = (esiaProfile) => {
6027
+ const { profile, document, addressRegistration } = esiaProfile;
6028
+ const data = [
6029
+ profile.name,
6030
+ profile.surname,
6031
+ profile.midname,
6032
+ profile.birthDate,
6033
+ profile.phone,
6034
+ profile.email,
6035
+ document.dulIssueDate,
6036
+ document.dulIssuedBy,
6037
+ document.dulNumber,
6038
+ document.dulSerie,
6039
+ document.dulSubdivisionCode,
6040
+ addressRegistration,
6041
+ profile.esiaAccountType,
6042
+ ];
6043
+ if (!data.every((_) => Boolean(_))) {
6044
+ throw new Error();
6045
+ }
6066
6046
  };
6067
6047
 
6068
- const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
6048
+ const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6049
+ const navigator = locationNavigator();
6050
+ const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6069
6051
  const leadFormStore = useLeadFormStore();
6070
6052
  const saveForm = useSetter(leadFormStore, 'leadForm');
6071
- const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6072
- const requestEsiaProfile = useCallback(async (code, state) => {
6073
- setEsiaStatus(EsiaStatuses.Pending);
6053
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
6054
+ const updateEsiaProfile = useCallback(async (profileId, code, state) => {
6055
+ startLoading();
6074
6056
  try {
6075
- const data = await esiaRequestProfile({
6057
+ const data = await updateProfileEsia({
6058
+ profileId,
6076
6059
  code,
6077
6060
  state,
6078
6061
  redirectUri: globalThis.location?.href,
6079
- authorize: true,
6080
6062
  });
6081
- if (data) {
6082
- const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6063
+ if (data && leadFormStore?.taskId) {
6064
+ const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6083
6065
  saveForm((_) => ({
6084
6066
  ..._,
6085
6067
  ...parsedData,
6086
6068
  }));
6087
- setEsiaStatus(EsiaStatuses.Success);
6088
6069
  }
6070
+ navigator.assign(nextStepLink);
6089
6071
  }
6090
6072
  catch {
6091
- setEsiaStatus(EsiaStatuses.Error);
6073
+ setEsiaError();
6092
6074
  }
6093
- }, []);
6075
+ finally {
6076
+ endLoading();
6077
+ }
6078
+ }, [nextStepLink]);
6094
6079
  useEffect(() => {
6095
6080
  leadFormStore.productType = productType;
6081
+ const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6096
6082
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6097
6083
  const code = params.get('code');
6098
6084
  const state = params.get('state');
6099
- if (code && state) {
6100
- requestEsiaProfile(code, state);
6085
+ if (profileId && code && state) {
6086
+ updateEsiaProfile(profileId, code, state);
6101
6087
  }
6102
6088
  else {
6103
6089
  sessionStorage.removeItem('accessToken');
6104
6090
  sessionStorage.removeItem('refreshToken');
6105
6091
  }
6106
6092
  }, []);
6107
- return initialFormState;
6093
+ return [initialFormState, { isLoading }];
6108
6094
  };
6109
6095
 
6110
- var EsiaStatuses;
6111
- (function (EsiaStatuses) {
6112
- EsiaStatuses["Success"] = "SUCCESS";
6113
- EsiaStatuses["Error"] = "ERROR";
6114
- EsiaStatuses["Pending"] = "PENDING";
6115
- })(EsiaStatuses || (EsiaStatuses = {}));
6116
6096
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6117
- const [esiaStatus, setEsiaStatus] = useState();
6118
- const leadForm = useRef(null);
6097
+ const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6119
6098
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6120
6099
  const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
6121
6100
  const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
6122
- const initialFormState = useInitApplicationLead({
6101
+ const [initialFormState, { isLoading }] = useInitApplicationLead({
6123
6102
  inputs,
6124
6103
  nextStepLink,
6125
6104
  productType,
6126
- setEsiaStatus,
6127
- esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
6105
+ setEsiaError,
6128
6106
  });
6129
6107
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6130
6108
  programId,
6131
6109
  nextStepLink,
6132
6110
  productType,
6111
+ esiaError,
6133
6112
  data,
6134
6113
  });
6135
- const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6114
+ const [, { field, onSubmit }] = useForm(initialFormState, {
6136
6115
  formValidator,
6137
6116
  onSubmit: handleSubmit,
6138
6117
  });
@@ -6142,17 +6121,7 @@
6142
6121
  responseTypeDialog.open({ ok });
6143
6122
  }
6144
6123
  }, [ok]);
6145
- useEffect(() => {
6146
- if (esiaStatus && leadForm?.current) {
6147
- leadForm.current.scrollIntoView({
6148
- block: 'start',
6149
- });
6150
- }
6151
- if (esiaStatus === EsiaStatuses.Success) {
6152
- reset();
6153
- }
6154
- }, [leadForm?.current, esiaStatus]);
6155
- 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] })] }));
6124
+ 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] }) }));
6156
6125
  });
6157
6126
 
6158
6127
  const NotFound = JSX(({ title, description }) => {
@@ -7845,7 +7814,6 @@
7845
7814
  mandatoryPayments: undefined,
7846
7815
  snils: '',
7847
7816
  armyIdFlg: false,
7848
- esiaAccountTypeCd: { key: '', text: '' },
7849
7817
  },
7850
7818
  {
7851
7819
  bankruptcyFlg: false,
@@ -8236,7 +8204,7 @@
8236
8204
  label: 'Телефон работодателя',
8237
8205
  required: true,
8238
8206
  },
8239
- { name: 'beginDate', required: true, filledByEsia: true },
8207
+ { name: 'beginDate', required: true },
8240
8208
  ],
8241
8209
  },
8242
8210
  {
@@ -8277,16 +8245,6 @@
8277
8245
  {
8278
8246
  title: 'Совокупный доход',
8279
8247
  },
8280
- {
8281
- columns: 1,
8282
- inputs: [
8283
- {
8284
- name: 'confirmationIncome',
8285
- required: true,
8286
- filledByEsia: true,
8287
- },
8288
- ],
8289
- },
8290
8248
  {
8291
8249
  inputs: [
8292
8250
  {
@@ -8295,6 +8253,10 @@
8295
8253
  },
8296
8254
  ],
8297
8255
  },
8256
+ {
8257
+ columns: 1,
8258
+ inputs: [{ name: 'confirmationIncome', required: true }],
8259
+ },
8298
8260
  {
8299
8261
  columns: 1,
8300
8262
  inputs: [{ name: 'wages', required: true, filledByEsia: true }],
@@ -10885,7 +10847,7 @@
10885
10847
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10886
10848
  });
10887
10849
 
10888
- const packageVersion = "0.14.819";
10850
+ const packageVersion = "0.14.820";
10889
10851
 
10890
10852
  exports.Blocks = Blocks;
10891
10853
  exports.ContentPage = ContentPage;