@redneckz/wildless-cms-uni-blocks 0.14.819 → 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 (387) hide show
  1. package/bundle/bundle.umd.js +188 -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/AcquiringField.js +4 -0
  78. package/dist/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
  79. package/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  80. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  81. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  82. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  83. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  84. package/lib/common.css +1 -1
  85. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  86. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  87. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  88. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  89. package/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  90. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  91. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  92. package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  93. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  94. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  95. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  96. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  97. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  98. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  99. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  100. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  101. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  102. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  103. package/lib/retail/api/checkCode.d.ts +0 -1
  104. package/lib/retail/api/checkCode.js +1 -1
  105. package/lib/retail/api/checkCode.js.map +1 -1
  106. package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  107. package/lib/retail/api/updateProfileEsia.js +3 -0
  108. package/lib/retail/api/updateProfileEsia.js.map +1 -0
  109. package/lib/retail/api/updateUserTask.d.ts +0 -1
  110. package/lib/retail/api/updateUserTask.js.map +1 -1
  111. package/lib/retail/api/uploadFile.d.ts +1 -1
  112. package/lib/retail/api/uploadFile.js +3 -2
  113. package/lib/retail/api/uploadFile.js.map +1 -1
  114. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  115. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  116. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  117. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
  118. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  119. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  120. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  121. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  122. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  123. package/lib/retail/components/Fields/BeginDateField.js +1 -2
  124. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  125. package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  126. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  127. package/lib/retail/components/Fields/DaDataInnField.js +1 -2
  128. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  129. package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  130. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  131. package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  132. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  133. package/lib/retail/components/Fields/JobsNumberField.js +1 -2
  134. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  135. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  136. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  137. package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  138. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  139. package/lib/retail/components/Fields/WagesField.js +1 -2
  140. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  141. package/lib/retail/content.js +5 -11
  142. package/lib/retail/content.js.map +1 -1
  143. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  144. package/lib/retail/utils/mainFormStateMap.js +0 -1
  145. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  146. package/lib/ui-kit/FormField/Fields/AcquiringField.js +4 -0
  147. package/lib/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
  148. package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  149. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  150. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  151. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  152. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  153. package/mobile/bundle/bundle.umd.js +188 -222
  154. package/mobile/bundle/bundle.umd.min.js +1 -1
  155. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  156. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  157. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  158. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  159. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  160. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  161. package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
  162. package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  163. package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
  164. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  165. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  166. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  167. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  168. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  169. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  170. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  171. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  172. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  173. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  174. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  175. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  176. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  177. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  178. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  179. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  180. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  181. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  182. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  183. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  184. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  185. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  186. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  187. package/mobile/dist/retail/api/checkCode.d.ts +0 -1
  188. package/mobile/dist/retail/api/checkCode.js +2 -3
  189. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  190. package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
  191. package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
  192. package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
  193. package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
  194. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  195. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  196. package/mobile/dist/retail/api/uploadFile.js +3 -2
  197. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  198. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  199. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  200. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  201. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  202. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  203. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  204. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  205. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  206. package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
  207. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  208. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  209. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  210. package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
  211. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  212. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  213. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  214. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  215. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  216. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
  217. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  218. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  219. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  220. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  221. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  222. package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
  223. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  224. package/mobile/dist/retail/content.js +5 -11
  225. package/mobile/dist/retail/content.js.map +1 -1
  226. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  227. package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
  228. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  229. package/mobile/dist/ui-kit/FormField/Fields/AcquiringField.js +4 -0
  230. package/mobile/dist/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
  231. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  232. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  233. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  234. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  235. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  236. package/mobile/lib/common.css +1 -1
  237. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  238. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  239. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  240. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  241. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  242. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  243. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  244. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  245. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  246. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  247. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  248. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  249. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  250. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  251. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  252. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  253. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  254. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  255. package/mobile/lib/retail/api/checkCode.d.ts +0 -1
  256. package/mobile/lib/retail/api/checkCode.js +1 -1
  257. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  258. package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
  259. package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
  260. package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
  261. package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
  262. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  263. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  264. package/mobile/lib/retail/api/uploadFile.js +3 -2
  265. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  266. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  267. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  268. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  269. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  270. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  271. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  272. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  273. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  274. package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
  275. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  276. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  277. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  278. package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
  279. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  280. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  281. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  282. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  283. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  284. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
  285. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  286. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  287. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  288. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  289. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  290. package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
  291. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  292. package/mobile/lib/retail/content.js +5 -11
  293. package/mobile/lib/retail/content.js.map +1 -1
  294. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  295. package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
  296. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  297. package/mobile/lib/ui-kit/FormField/Fields/AcquiringField.js +4 -0
  298. package/mobile/lib/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
  299. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  300. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  301. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  302. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  303. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  304. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  305. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  306. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  307. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  308. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  309. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  310. package/mobile/src/retail/api/checkCode.ts +1 -1
  311. package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  312. package/mobile/src/retail/api/updateUserTask.ts +0 -1
  313. package/mobile/src/retail/api/uploadFile.ts +3 -2
  314. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  315. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  316. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  317. package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
  318. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  319. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  320. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  321. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  322. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  323. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  324. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  325. package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
  326. package/mobile/src/retail/content.tsx +5 -11
  327. package/mobile/src/retail/model/NameFieldDef.ts +0 -1
  328. package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
  329. package/mobile/src/ui-kit/FormField/Fields/AcquiringField.tsx +4 -0
  330. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  331. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  332. package/package.json +1 -1
  333. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  334. package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  335. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  336. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  337. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  338. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  339. package/src/retail/api/checkCode.ts +1 -1
  340. package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  341. package/src/retail/api/updateUserTask.ts +0 -1
  342. package/src/retail/api/uploadFile.ts +3 -2
  343. package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  344. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
  345. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  346. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  347. package/src/retail/components/Fields/BeginDateField.tsx +0 -2
  348. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  349. package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  350. package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  351. package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  352. package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  353. package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  354. package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  355. package/src/retail/components/Fields/WagesField.tsx +0 -2
  356. package/src/retail/content.tsx +5 -11
  357. package/src/retail/model/NameFieldDef.ts +0 -1
  358. package/src/retail/utils/mainFormStateMap.ts +0 -1
  359. package/src/ui-kit/FormField/Fields/AcquiringField.tsx +4 -0
  360. package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  361. package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  362. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  363. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  364. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  365. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  366. package/dist/retail/api/esiaRequestProfile.js +0 -10
  367. package/dist/retail/api/esiaRequestProfile.js.map +0 -1
  368. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  369. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  370. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  371. package/lib/retail/api/esiaRequestProfile.js +0 -7
  372. package/lib/retail/api/esiaRequestProfile.js.map +0 -1
  373. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  374. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  375. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  376. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  377. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
  378. package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
  379. package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
  380. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  381. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  382. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  383. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
  384. package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
  385. package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
  386. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
  387. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
@@ -1407,6 +1407,10 @@
1407
1407
  text: 'Интернет-эквайринг',
1408
1408
  key: 'internet',
1409
1409
  },
1410
+ {
1411
+ text: 'SoftPOS',
1412
+ key: 'softpos',
1413
+ },
1410
1414
  {
1411
1415
  text: 'Все виды эквайринга',
1412
1416
  key: 'all',
@@ -2018,7 +2022,7 @@
2018
2022
 
2019
2023
  const PhoneField = JSX(({ field, input }) => {
2020
2024
  const fieldName = input?.name || 'phone';
2021
- return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
2025
+ return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
2022
2026
  });
2023
2027
 
2024
2028
  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);
@@ -2198,7 +2202,7 @@
2198
2202
  function shouldRenderField({ input, field, }) {
2199
2203
  const { condition } = input;
2200
2204
  const { value } = field(condition?.name || '');
2201
- return !condition || condition?.values?.includes(value?.key ?? value);
2205
+ return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
2202
2206
  }
2203
2207
 
2204
2208
  const PRODUCT_REF = {
@@ -2633,11 +2637,11 @@
2633
2637
  {
2634
2638
  columns: 2,
2635
2639
  inputs: [
2636
- { name: 'surname', required: true, dadata: true, filledByEsia: true },
2637
- { name: 'name', required: true, dadata: true, filledByEsia: true },
2638
- { name: 'middleName', dadata: true, filledByEsia: true },
2639
- { name: 'limitedBirthday', required: true, filledByEsia: true },
2640
- { name: 'phone', required: true, filledByEsia: true },
2640
+ { name: 'surname', required: true, dadata: true },
2641
+ { name: 'name', required: true, dadata: true },
2642
+ { name: 'middleName', dadata: true },
2643
+ { name: 'limitedBirthday', required: true },
2644
+ { name: 'phone', required: true },
2641
2645
  { name: 'email', required: true, dadata: true },
2642
2646
  ],
2643
2647
  },
@@ -2647,57 +2651,6 @@
2647
2651
  ];
2648
2652
  };
2649
2653
 
2650
- const getTraceId = () => {
2651
- const result = new Uint8Array(8);
2652
- globalThis.crypto.getRandomValues(result);
2653
- return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
2654
- };
2655
-
2656
- const fetchRetailJSON = async (url, method, body) => {
2657
- try {
2658
- const response = await doRequest(url, method, body);
2659
- return response.json();
2660
- }
2661
- catch (err) {
2662
- console.error(err);
2663
- return null;
2664
- }
2665
- };
2666
- async function doRequest(url, method, body) {
2667
- const traceId = getTraceId();
2668
- return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
2669
- method,
2670
- headers: {
2671
- 'Content-Type': 'application/json',
2672
- 'X-B3-Sampled': '1',
2673
- 'X-B3-Spanid': traceId,
2674
- 'X-B3-Traceid': traceId,
2675
- ...getAuthorizationHeaders(),
2676
- },
2677
- credentials: 'include',
2678
- body: body ? JSON.stringify(body) : null,
2679
- });
2680
- }
2681
- const getAuthorizationHeaders = () => {
2682
- const token = sessionStorage.getItem('accessToken');
2683
- return token ? { Authorization: `Bearer ${token}` } : null;
2684
- };
2685
-
2686
- const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
2687
-
2688
- const EsiaLoginBanner = JSX(() => {
2689
- const navigator = locationNavigator();
2690
- const handleAuth = useCallback(async () => {
2691
- const resp = await getLink({
2692
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
2693
- });
2694
- if (resp?.link) {
2695
- navigator.assign(resp.link);
2696
- }
2697
- }, []);
2698
- 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" })] }));
2699
- });
2700
-
2701
2654
  const debounce = (fn, delay = 600) => {
2702
2655
  let timerId;
2703
2656
  const debouncedCallback = (...args) => {
@@ -3584,6 +3537,42 @@
3584
3537
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3585
3538
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3586
3539
 
3540
+ const getTraceId = () => {
3541
+ const result = new Uint8Array(8);
3542
+ globalThis.crypto.getRandomValues(result);
3543
+ return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
3544
+ };
3545
+
3546
+ const fetchRetailJSON = async (url, method, body) => {
3547
+ try {
3548
+ const response = await doRequest(url, method, body);
3549
+ return response.json();
3550
+ }
3551
+ catch (err) {
3552
+ console.error(err);
3553
+ return null;
3554
+ }
3555
+ };
3556
+ async function doRequest(url, method, body) {
3557
+ const traceId = getTraceId();
3558
+ return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
3559
+ method,
3560
+ headers: {
3561
+ 'Content-Type': 'application/json',
3562
+ 'X-B3-Sampled': '1',
3563
+ 'X-B3-Spanid': traceId,
3564
+ 'X-B3-Traceid': traceId,
3565
+ ...getAuthorizationHeaders(),
3566
+ },
3567
+ credentials: 'include',
3568
+ body: body ? JSON.stringify(body) : null,
3569
+ });
3570
+ }
3571
+ const getAuthorizationHeaders = () => {
3572
+ const token = sessionStorage.getItem('accessToken');
3573
+ return token ? { Authorization: `Bearer ${token}` } : null;
3574
+ };
3575
+
3587
3576
  const fetchRegionOffices = async (regionKey) => {
3588
3577
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3589
3578
  regionRfCd: {
@@ -3813,7 +3802,7 @@
3813
3802
 
3814
3803
  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 ?? '') })));
3815
3804
 
3816
- 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 ?? '') })));
3805
+ 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 })));
3817
3806
 
3818
3807
  const FIELD_NAME$2 = 'birthPlace';
3819
3808
  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) })));
@@ -3877,8 +3866,7 @@
3877
3866
 
3878
3867
  const ConfirmationIncomeField = JSX(({ field, input }) => {
3879
3868
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
3880
- const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
3881
- 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 })] }));
3869
+ 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 }));
3882
3870
  });
3883
3871
 
3884
3872
  const ConscriptionField = JSX(({ field, input }) => {
@@ -4422,7 +4410,7 @@
4422
4410
  }
4423
4411
  })();
4424
4412
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
4425
- return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4413
+ return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4426
4414
  });
4427
4415
 
4428
4416
  const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? '') })));
@@ -4501,7 +4489,7 @@
4501
4489
  const MIN_YEARS = 0;
4502
4490
  const Experience5YearsField = JSX(({ field, input }) => {
4503
4491
  const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
4504
- 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 ?? '') }));
4492
+ 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 }));
4505
4493
  });
4506
4494
 
4507
4495
  const FamilyMembersField = JSX(({ field, input }) => {
@@ -4522,7 +4510,7 @@
4522
4510
  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 }));
4523
4511
  });
4524
4512
 
4525
- 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 ?? '') })));
4513
+ 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 })));
4526
4514
 
4527
4515
  const HousingField = JSX(({ field, input }) => {
4528
4516
  const { data: housing } = useLeadFormData('HOUSE_TYPE');
@@ -4531,9 +4519,9 @@
4531
4519
 
4532
4520
  const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
4533
4521
 
4534
- 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 ?? '') })));
4522
+ 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 })));
4535
4523
 
4536
- 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 ?? '') })));
4524
+ 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 })));
4537
4525
 
4538
4526
  const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
4539
4527
  const isLatin = (_ = '') => latinPattern.test(_);
@@ -4685,7 +4673,7 @@
4685
4673
  field?.('inn')?.onChange?.(item.data?.inn);
4686
4674
  updateOrganizationFields(store, field, item);
4687
4675
  }, []);
4688
- 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 }));
4676
+ 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 }));
4689
4677
  });
4690
4678
 
4691
4679
  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 })));
@@ -4825,7 +4813,7 @@
4825
4813
 
4826
4814
  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 })));
4827
4815
 
4828
- 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 ?? '') })));
4816
+ 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 })));
4829
4817
 
4830
4818
  const DELIVERY_CITIES_REF = {
4831
4819
  $ref: '/wcms-resources/delivery-cities-data.json',
@@ -5455,7 +5443,7 @@
5455
5443
  const participant = task.participants[0];
5456
5444
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5457
5445
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
5458
- 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;
5446
+ 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;
5459
5447
  return {
5460
5448
  currency: currency?.key,
5461
5449
  paymentSystem: getSelectValue(paymentSystem),
@@ -5507,7 +5495,6 @@
5507
5495
  monthsValue,
5508
5496
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5509
5497
  },
5510
- esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5511
5498
  ...getParticipantIncomes(participantIncomes),
5512
5499
  ...getParticipantAddresses(participantAddresses),
5513
5500
  ...getParticipantContacts(participantContacts),
@@ -5562,6 +5549,39 @@
5562
5549
  };
5563
5550
  };
5564
5551
 
5552
+ const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
5553
+
5554
+ const EsiaLoginDialog = JSX(({ onClose }) => {
5555
+ const navigator = locationNavigator();
5556
+ const retailFormStore = useRetailFormStore();
5557
+ const handleAuth = useCallback(async () => {
5558
+ const resp = await getLink({
5559
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
5560
+ });
5561
+ if (resp?.link) {
5562
+ navigator.assign(resp.link);
5563
+ globalThis.location.href = resp.link;
5564
+ }
5565
+ }, []);
5566
+ const handleClose = useCallback(() => {
5567
+ if (retailFormStore.leadForm) {
5568
+ const leadForm = { ...retailFormStore.leadForm };
5569
+ delete leadForm.esiaAccountTypeCd;
5570
+ retailFormStore.leadForm = leadForm;
5571
+ }
5572
+ onClose?.();
5573
+ }, []);
5574
+ 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" })] })] }) }));
5575
+ });
5576
+
5577
+ const useEsiaLoginDialog = (nextStepLink) => {
5578
+ const { open } = useDialog(EsiaLoginDialog);
5579
+ const navigator = locationNavigator();
5580
+ return useCallback(() => {
5581
+ open({ onClose: () => navigator.assign(nextStepLink) });
5582
+ }, [open, nextStepLink]);
5583
+ };
5584
+
5565
5585
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5566
5586
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5567
5587
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5683,19 +5703,21 @@
5683
5703
 
5684
5704
  /* eslint-disable max-lines */
5685
5705
  // eslint-disable-next-line max-lines-per-function
5686
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5706
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5687
5707
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5688
5708
  const [ok, setOK] = useState();
5689
5709
  const saveUserData = useSaveUserData();
5690
5710
  const sendAspects = useSendLeadFormAspects({ data });
5691
5711
  const navigator = locationNavigator();
5692
- const goToNextStep = useCallback(() => {
5693
- navigator.assign(nextStepLink);
5694
- }, []);
5695
- const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5712
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5713
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5696
5714
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5697
5715
  const draftDialog = useDraftDialog();
5698
5716
  const handleSubmit = useCallback(async (formData) => {
5717
+ if (esiaError) {
5718
+ navigator.assign(nextStepLink);
5719
+ return;
5720
+ }
5699
5721
  try {
5700
5722
  startSending();
5701
5723
  const profileId = await createUserProfile({
@@ -5713,7 +5735,7 @@
5713
5735
  });
5714
5736
  verifyPhoneDialog.close();
5715
5737
  if (productType === 'debitCard') {
5716
- goToNextStep();
5738
+ openEsiaLoginDialog();
5717
5739
  }
5718
5740
  else {
5719
5741
  consentBkiDialog.open(formData.phone, profileId);
@@ -5752,7 +5774,7 @@
5752
5774
  catch {
5753
5775
  setOK(false);
5754
5776
  }
5755
- }, []);
5777
+ }, [esiaError]);
5756
5778
  return { isSending, ok, handleSubmit };
5757
5779
  };
5758
5780
  const getAcceptedConsents = (formData, productType) => {
@@ -5835,10 +5857,7 @@
5835
5857
  }
5836
5858
  }, [target, key]);
5837
5859
 
5838
- const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5839
- saveToken(res);
5840
- return res;
5841
- });
5860
+ const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5842
5861
 
5843
5862
  const initialFormState = {
5844
5863
  surname: '',
@@ -5856,24 +5875,19 @@
5856
5875
  consentPhotoFlg: false,
5857
5876
  consentFATCA: false,
5858
5877
  };
5859
- const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5878
+ const getInitialFormState$1 = (inputs, savedForm) => {
5860
5879
  if (savedForm) {
5861
- return {
5862
- ...savedForm,
5863
- limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5864
- ...(!esiaAuthSuccess && {
5865
- esiaAccountTypeCd: { key: '' },
5866
- }),
5867
- };
5880
+ return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5868
5881
  }
5869
5882
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5870
5883
  return { ...formState };
5871
5884
  };
5872
5885
 
5873
- const uploadFile = async (file, documentCategory, isPDF = false) => {
5886
+ const uploadFile = async (file, taskId, documentCategory) => {
5874
5887
  const fd = new FormData();
5888
+ fd.append('taskId', taskId);
5875
5889
  fd.append('documentCategory', documentCategory);
5876
- fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5890
+ fd.append('file', file, 'file.pdf');
5877
5891
  const res = await globalThis
5878
5892
  ?.fetch?.(`/light-api-cash/v1/file`, {
5879
5893
  method: 'POST',
@@ -5887,13 +5901,23 @@
5887
5901
  return res;
5888
5902
  };
5889
5903
 
5890
- const parseEsiaProfile = async (esiaProfile, isDebit) => {
5891
- checkEsiaData(esiaProfile);
5892
- const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
5904
+ const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5905
+ isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5893
5906
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5894
- let files = [];
5895
- if (isFullEsiaData) {
5896
- files = await saveDocuments(esiaAdditionalDocument);
5907
+ const files = [];
5908
+ if (!isDebit) {
5909
+ await saveDocument({
5910
+ document: esiaAdditionalDocument.pdfFileWorkbook,
5911
+ taskId,
5912
+ category: 'CONFIRMING_INCOME_DOC',
5913
+ files,
5914
+ });
5915
+ await saveDocument({
5916
+ document: esiaAdditionalDocument.pdfFilePayout,
5917
+ taskId,
5918
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5919
+ files,
5920
+ });
5897
5921
  }
5898
5922
  const mainData = {
5899
5923
  name: profile.name,
@@ -5910,11 +5934,11 @@
5910
5934
  birthPlace: addInfo.birthPlace,
5911
5935
  addressRegistration: buildAddress(addressRegistration),
5912
5936
  addressFact: buildAddress(addressFact),
5913
- esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
5937
+ esiaAccountTypeCd: profile.esiaAccountType,
5914
5938
  };
5915
5939
  return {
5916
5940
  ...mainData,
5917
- ...(isFullEsiaData && {
5941
+ ...(!isDebit && {
5918
5942
  snils: addInfo.snils,
5919
5943
  inn: esiaAdditionalDocument.inn,
5920
5944
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -5923,9 +5947,6 @@
5923
5947
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
5924
5948
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
5925
5949
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
5926
- esiaAccountTypeCd: profile.esiaAccountType,
5927
- confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
5928
- employment: { key: 'WORK', text: 'Работаю' },
5929
5950
  files,
5930
5951
  }),
5931
5952
  };
@@ -5958,67 +5979,21 @@
5958
5979
  };
5959
5980
  };
5960
5981
  const getYearFromMonth = (month) => Math.floor(month / 12);
5961
- const saveDocuments = async (esiaAdditionalDocument) => {
5962
- const files = [];
5963
- const documents = [
5964
- {
5965
- file: esiaAdditionalDocument.pdfFileWorkbook,
5966
- category: 'CONFIRMING_INCOME_DOC',
5967
- isPDF: true,
5968
- },
5969
- {
5970
- file: esiaAdditionalDocument.pdfFilePayout,
5971
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5972
- isPDF: true,
5973
- },
5974
- {
5975
- file: esiaAdditionalDocument.pdfFileSigPayout,
5976
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5977
- isPDF: true,
5978
- },
5979
- {
5980
- file: esiaAdditionalDocument.xmlFilePayout,
5981
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5982
- isPDF: false,
5983
- },
5984
- {
5985
- file: esiaAdditionalDocument.xmlFileSigPayout,
5986
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5987
- isPDF: false,
5988
- },
5989
- {
5990
- file: esiaAdditionalDocument.xmlFileWorkbook,
5991
- category: 'CONFIRMING_INCOME_DOC',
5992
- isPDF: false,
5993
- },
5994
- {
5995
- file: esiaAdditionalDocument.pdfFileSigWorkbook,
5996
- category: 'CONFIRMING_INCOME_DOC',
5997
- isPDF: true,
5998
- },
5999
- {
6000
- file: esiaAdditionalDocument.xmlFileSigWorkbook,
6001
- category: 'CONFIRMING_INCOME_DOC',
6002
- isPDF: false,
6003
- },
6004
- ];
6005
- for (const doc of documents) {
6006
- const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
6007
- await fetch(`${contentType},${doc.file}`)
6008
- .then((res) => res.blob())
6009
- .then((value) => uploadFile(value, doc.category, doc.isPDF))
6010
- .then((file) => files.push(file));
6011
- }
6012
- return files;
6013
- };
6014
- const checkEsiaData = (esiaProfile) => {
6015
- const { profile, document, addressRegistration } = esiaProfile;
5982
+ const saveDocument = async ({ document, taskId, category, files, }) => {
5983
+ await fetch(`data:application/pdf;base64,${document}`)
5984
+ .then((res) => res.blob())
5985
+ .then((value) => uploadFile(value, taskId, category))
5986
+ .then((file) => files.push(file));
5987
+ };
5988
+ const checkEsiaDataForCredit = (esiaProfile) => {
5989
+ const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
6016
5990
  const data = [
6017
5991
  profile.name,
6018
5992
  profile.surname,
6019
5993
  profile.midname,
6020
5994
  profile.birthDate,
6021
5995
  profile.phone,
5996
+ profile.email,
6022
5997
  document.dulIssueDate,
6023
5998
  document.dulIssuedBy,
6024
5999
  document.dulNumber,
@@ -6026,14 +6001,6 @@
6026
6001
  document.dulSubdivisionCode,
6027
6002
  addressRegistration,
6028
6003
  profile.esiaAccountType,
6029
- ];
6030
- if (!data.every((_) => Boolean(_))) {
6031
- throw new Error();
6032
- }
6033
- };
6034
- const checkEsiaAdditionalDocument = (esiaProfile) => {
6035
- const { esiaAdditionalDocument } = esiaProfile;
6036
- const data = [
6037
6004
  esiaAdditionalDocument.inn,
6038
6005
  esiaAdditionalDocument.averageMonthlyIncome.toString(),
6039
6006
  esiaAdditionalDocument.startWorkDate,
@@ -6043,84 +6010,100 @@
6043
6010
  esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6044
6011
  esiaAdditionalDocument.pdfFilePayout,
6045
6012
  esiaAdditionalDocument.pdfFileWorkbook,
6046
- esiaAdditionalDocument.pdfFileSigPayout,
6047
- esiaAdditionalDocument.xmlFilePayout,
6048
- esiaAdditionalDocument.xmlFileSigPayout,
6049
- esiaAdditionalDocument.xmlFileWorkbook,
6050
- esiaAdditionalDocument.pdfFileSigWorkbook,
6051
- esiaAdditionalDocument.xmlFileSigWorkbook,
6052
6013
  ];
6053
- return data.every((_) => Boolean(_));
6014
+ if (!data.every((_) => Boolean(_))) {
6015
+ throw new Error();
6016
+ }
6017
+ };
6018
+ const checkEsiaDataForDebit = (esiaProfile) => {
6019
+ const { profile, document, addressRegistration } = esiaProfile;
6020
+ const data = [
6021
+ profile.name,
6022
+ profile.surname,
6023
+ profile.midname,
6024
+ profile.birthDate,
6025
+ profile.phone,
6026
+ profile.email,
6027
+ document.dulIssueDate,
6028
+ document.dulIssuedBy,
6029
+ document.dulNumber,
6030
+ document.dulSerie,
6031
+ document.dulSubdivisionCode,
6032
+ addressRegistration,
6033
+ profile.esiaAccountType,
6034
+ ];
6035
+ if (!data.every((_) => Boolean(_))) {
6036
+ throw new Error();
6037
+ }
6054
6038
  };
6055
6039
 
6056
- const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
6040
+ const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6041
+ const navigator = locationNavigator();
6042
+ const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6057
6043
  const leadFormStore = useLeadFormStore();
6058
6044
  const saveForm = useSetter(leadFormStore, 'leadForm');
6059
- const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6060
- const requestEsiaProfile = useCallback(async (code, state) => {
6061
- setEsiaStatus(EsiaStatuses.Pending);
6045
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
6046
+ const updateEsiaProfile = useCallback(async (profileId, code, state) => {
6047
+ startLoading();
6062
6048
  try {
6063
- const data = await esiaRequestProfile({
6049
+ const data = await updateProfileEsia({
6050
+ profileId,
6064
6051
  code,
6065
6052
  state,
6066
6053
  redirectUri: globalThis.location?.href,
6067
- authorize: true,
6068
6054
  });
6069
- if (data) {
6070
- const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6055
+ if (data && leadFormStore?.taskId) {
6056
+ const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6071
6057
  saveForm((_) => ({
6072
6058
  ..._,
6073
6059
  ...parsedData,
6074
6060
  }));
6075
- setEsiaStatus(EsiaStatuses.Success);
6076
6061
  }
6062
+ navigator.assign(nextStepLink);
6077
6063
  }
6078
6064
  catch {
6079
- setEsiaStatus(EsiaStatuses.Error);
6065
+ setEsiaError();
6080
6066
  }
6081
- }, []);
6067
+ finally {
6068
+ endLoading();
6069
+ }
6070
+ }, [nextStepLink]);
6082
6071
  useEffect(() => {
6083
6072
  leadFormStore.productType = productType;
6073
+ const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6084
6074
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6085
6075
  const code = params.get('code');
6086
6076
  const state = params.get('state');
6087
- if (code && state) {
6088
- requestEsiaProfile(code, state);
6077
+ if (profileId && code && state) {
6078
+ updateEsiaProfile(profileId, code, state);
6089
6079
  }
6090
6080
  else {
6091
6081
  sessionStorage.removeItem('accessToken');
6092
6082
  sessionStorage.removeItem('refreshToken');
6093
6083
  }
6094
6084
  }, []);
6095
- return initialFormState;
6085
+ return [initialFormState, { isLoading }];
6096
6086
  };
6097
6087
 
6098
- var EsiaStatuses;
6099
- (function (EsiaStatuses) {
6100
- EsiaStatuses["Success"] = "SUCCESS";
6101
- EsiaStatuses["Error"] = "ERROR";
6102
- EsiaStatuses["Pending"] = "PENDING";
6103
- })(EsiaStatuses || (EsiaStatuses = {}));
6104
6088
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6105
- const [esiaStatus, setEsiaStatus] = useState();
6106
- const leadForm = useRef(null);
6089
+ const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6107
6090
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6108
6091
  const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
6109
6092
  const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
6110
- const initialFormState = useInitApplicationLead({
6093
+ const [initialFormState, { isLoading }] = useInitApplicationLead({
6111
6094
  inputs,
6112
6095
  nextStepLink,
6113
6096
  productType,
6114
- setEsiaStatus,
6115
- esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
6097
+ setEsiaError,
6116
6098
  });
6117
6099
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6118
6100
  programId,
6119
6101
  nextStepLink,
6120
6102
  productType,
6103
+ esiaError,
6121
6104
  data,
6122
6105
  });
6123
- const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6106
+ const [, { field, onSubmit }] = useForm(initialFormState, {
6124
6107
  formValidator,
6125
6108
  onSubmit: handleSubmit,
6126
6109
  });
@@ -6130,17 +6113,7 @@
6130
6113
  responseTypeDialog.open({ ok });
6131
6114
  }
6132
6115
  }, [ok]);
6133
- useEffect(() => {
6134
- if (esiaStatus && leadForm?.current) {
6135
- leadForm.current.scrollIntoView({
6136
- block: 'start',
6137
- });
6138
- }
6139
- if (esiaStatus === EsiaStatuses.Success) {
6140
- reset();
6141
- }
6142
- }, [leadForm?.current, esiaStatus]);
6143
- 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] })] }));
6116
+ 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] }) }));
6144
6117
  });
6145
6118
 
6146
6119
  const NotFound = JSX(({ title, description }) => {
@@ -7849,7 +7822,6 @@
7849
7822
  mandatoryPayments: undefined,
7850
7823
  snils: '',
7851
7824
  armyIdFlg: false,
7852
- esiaAccountTypeCd: { key: '', text: '' },
7853
7825
  },
7854
7826
  {
7855
7827
  bankruptcyFlg: false,
@@ -8240,7 +8212,7 @@
8240
8212
  label: 'Телефон работодателя',
8241
8213
  required: true,
8242
8214
  },
8243
- { name: 'beginDate', required: true, filledByEsia: true },
8215
+ { name: 'beginDate', required: true },
8244
8216
  ],
8245
8217
  },
8246
8218
  {
@@ -8281,16 +8253,6 @@
8281
8253
  {
8282
8254
  title: 'Совокупный доход',
8283
8255
  },
8284
- {
8285
- columns: 1,
8286
- inputs: [
8287
- {
8288
- name: 'confirmationIncome',
8289
- required: true,
8290
- filledByEsia: true,
8291
- },
8292
- ],
8293
- },
8294
8256
  {
8295
8257
  inputs: [
8296
8258
  {
@@ -8299,6 +8261,10 @@
8299
8261
  },
8300
8262
  ],
8301
8263
  },
8264
+ {
8265
+ columns: 1,
8266
+ inputs: [{ name: 'confirmationIncome', required: true }],
8267
+ },
8302
8268
  {
8303
8269
  columns: 1,
8304
8270
  inputs: [{ name: 'wages', required: true, filledByEsia: true }],
@@ -11588,7 +11554,7 @@
11588
11554
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11589
11555
  });
11590
11556
 
11591
- const packageVersion = "0.14.818";
11557
+ const packageVersion = "0.14.820";
11592
11558
 
11593
11559
  exports.Blocks = Blocks;
11594
11560
  exports.ContentPage = ContentPage;