@redneckz/wildless-cms-uni-blocks 0.14.683 → 0.14.685

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 (593) hide show
  1. package/bundle/api/RetailAPI/getCardTypes.d.ts +1 -1
  2. package/bundle/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  3. package/bundle/api/RetailAPI/updateUserProfile.d.ts +1 -2
  4. package/bundle/api/RetailAPI/updateUserTask.d.ts +5 -4
  5. package/bundle/blocks.schema.json +1 -1
  6. package/bundle/bundle.umd.js +740 -681
  7. package/bundle/bundle.umd.min.js +1 -1
  8. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
  9. package/bundle/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
  10. package/bundle/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
  11. package/bundle/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
  12. package/bundle/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
  13. package/bundle/components/CreditCardForm/renderInputs.d.ts +2 -1
  14. package/bundle/components/CreditCardForm/renderStep.d.ts +2 -2
  15. package/bundle/components/CreditForm/CreditForm.d.ts +5 -2
  16. package/bundle/components/CreditForm/CreditFormContent.d.ts +4 -5
  17. package/bundle/components/CreditForm/CreditFormStep.d.ts +2 -3
  18. package/bundle/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
  19. package/bundle/components/CreditForm/getCalcData.d.ts +3 -0
  20. package/bundle/components/CreditForm/getZeroStepData.d.ts +1 -1
  21. package/bundle/components/CreditForm/renderInputs.d.ts +2 -1
  22. package/bundle/components/CreditForm/renderStep.d.ts +2 -2
  23. package/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
  24. package/bundle/components/OfficesAtmsMap/filterItems.d.ts +2 -0
  25. package/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
  26. package/bundle/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
  27. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  28. package/bundle/ui-kit/FormField/getField.d.ts +1 -1
  29. package/dist/api/RetailAPI/getCardTypes.d.ts +1 -1
  30. package/dist/api/RetailAPI/getCardTypes.js +4 -5
  31. package/dist/api/RetailAPI/getCardTypes.js.map +1 -1
  32. package/dist/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  33. package/dist/api/RetailAPI/getPaymentSystems.js +3 -4
  34. package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  35. package/dist/api/RetailAPI/updateUserProfile.d.ts +1 -2
  36. package/dist/api/RetailAPI/updateUserProfile.js +1 -1
  37. package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  38. package/dist/api/RetailAPI/updateUserTask.d.ts +5 -4
  39. package/dist/api/RetailAPI/updateUserTask.js +1 -1
  40. package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  41. package/dist/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
  42. package/dist/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  43. package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  44. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  45. package/dist/components/ApplicationForm/renderInputs.js +1 -1
  46. package/dist/components/ApplicationForm/renderInputs.js.map +1 -1
  47. package/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  48. package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  49. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
  50. package/dist/components/ApplicationLeadForm/getInitialFormState.js +0 -1
  51. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  52. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +15 -8
  53. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  54. package/dist/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
  55. package/dist/components/CalculatorCredit/CalculatorCredit.js +5 -3
  56. package/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  57. package/dist/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
  58. package/dist/components/CalculatorCredit/defaultValueAdapter.js +18 -0
  59. package/dist/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
  60. package/dist/components/CreditCardForm/CreditCardForm.js +4 -4
  61. package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  62. package/dist/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
  63. package/dist/components/CreditCardForm/CreditCardFormStatus.js +3 -1
  64. package/dist/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
  65. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
  66. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  67. package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -14
  68. package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  69. package/dist/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
  70. package/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
  71. package/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
  72. package/dist/components/CreditCardForm/renderInputs.d.ts +2 -1
  73. package/dist/components/CreditCardForm/renderInputs.js +1 -1
  74. package/dist/components/CreditCardForm/renderInputs.js.map +1 -1
  75. package/dist/components/CreditCardForm/renderStep.d.ts +2 -2
  76. package/dist/components/CreditCardForm/renderStep.js +2 -2
  77. package/dist/components/CreditCardForm/renderStep.js.map +1 -1
  78. package/dist/components/CreditForm/CreditForm.d.ts +5 -2
  79. package/dist/components/CreditForm/CreditForm.js +6 -20
  80. package/dist/components/CreditForm/CreditForm.js.map +1 -1
  81. package/dist/components/CreditForm/CreditFormContent.d.ts +4 -5
  82. package/dist/components/CreditForm/CreditFormStatusTracker.js +10 -10
  83. package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  84. package/dist/components/CreditForm/CreditFormStep.d.ts +2 -3
  85. package/dist/components/CreditForm/CreditFormStep.js +5 -10
  86. package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  87. package/dist/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
  88. package/dist/components/CreditForm/ProgramsSourceProps.js +2 -0
  89. package/dist/components/CreditForm/ProgramsSourceProps.js.map +1 -0
  90. package/dist/components/CreditForm/creditFormStepsData.js +9 -1
  91. package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  92. package/dist/components/CreditForm/formStateMap.js +9 -7
  93. package/dist/components/CreditForm/formStateMap.js.map +1 -1
  94. package/dist/components/CreditForm/getCalcData.d.ts +3 -0
  95. package/dist/components/CreditForm/getCalcData.js +16 -0
  96. package/dist/components/CreditForm/getCalcData.js.map +1 -0
  97. package/dist/components/CreditForm/getCreditFormTaskData.js +3 -2
  98. package/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  99. package/dist/components/CreditForm/getSecondStepData.js +0 -1
  100. package/dist/components/CreditForm/getSecondStepData.js.map +1 -1
  101. package/dist/components/CreditForm/getZeroStepData.d.ts +1 -1
  102. package/dist/components/CreditForm/getZeroStepData.js +3 -8
  103. package/dist/components/CreditForm/getZeroStepData.js.map +1 -1
  104. package/dist/components/CreditForm/renderInputs.d.ts +2 -1
  105. package/dist/components/CreditForm/renderInputs.js +1 -1
  106. package/dist/components/CreditForm/renderInputs.js.map +1 -1
  107. package/dist/components/CreditForm/renderStep.d.ts +2 -2
  108. package/dist/components/CreditForm/renderStep.js +2 -2
  109. package/dist/components/CreditForm/renderStep.js.map +1 -1
  110. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
  111. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -6
  112. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  113. package/dist/components/OfficesAtmsMap/filterItems.d.ts +2 -0
  114. package/dist/components/OfficesAtmsMap/filterItems.js +9 -0
  115. package/dist/components/OfficesAtmsMap/filterItems.js.map +1 -0
  116. package/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js +3 -3
  117. package/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
  118. package/dist/hooks/useJSONRef/useJSONRef.js +13 -3
  119. package/dist/hooks/useJSONRef/useJSONRef.js.map +1 -1
  120. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
  121. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  122. package/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
  123. package/dist/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
  124. package/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  125. package/dist/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
  126. package/dist/ui-kit/FormField/Fields/CreditCalcField.js +15 -0
  127. package/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
  128. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
  129. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  130. package/dist/ui-kit/FormField/Fields/RegionField.js +3 -1
  131. package/dist/ui-kit/FormField/Fields/RegionField.js.map +1 -1
  132. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  133. package/dist/ui-kit/FormField/SelectField.js +4 -6
  134. package/dist/ui-kit/FormField/SelectField.js.map +1 -1
  135. package/dist/ui-kit/FormField/getField.d.ts +1 -1
  136. package/dist/ui-kit/FormField/getField.js +5 -4
  137. package/dist/ui-kit/FormField/getField.js.map +1 -1
  138. package/dist/ui-kit/FormField/getObjectValidator.js +2 -0
  139. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  140. package/lib/api/RetailAPI/getCardTypes.d.ts +1 -1
  141. package/lib/api/RetailAPI/getCardTypes.js +5 -6
  142. package/lib/api/RetailAPI/getCardTypes.js.map +1 -1
  143. package/lib/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  144. package/lib/api/RetailAPI/getPaymentSystems.js +4 -5
  145. package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  146. package/lib/api/RetailAPI/updateUserProfile.d.ts +1 -2
  147. package/lib/api/RetailAPI/updateUserProfile.js +2 -2
  148. package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  149. package/lib/api/RetailAPI/updateUserTask.d.ts +5 -4
  150. package/lib/api/RetailAPI/updateUserTask.js +2 -2
  151. package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  152. package/lib/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
  153. package/lib/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  154. package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  155. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  156. package/lib/components/ApplicationForm/renderInputs.js +1 -1
  157. package/lib/components/ApplicationForm/renderInputs.js.map +1 -1
  158. package/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  159. package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  160. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
  161. package/lib/components/ApplicationLeadForm/getInitialFormState.js +0 -1
  162. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  163. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +15 -8
  164. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  165. package/lib/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
  166. package/lib/components/CalculatorCredit/CalculatorCredit.js +5 -3
  167. package/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  168. package/lib/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
  169. package/lib/components/CalculatorCredit/defaultValueAdapter.js +15 -0
  170. package/lib/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
  171. package/lib/components/CreditCardForm/CreditCardForm.js +4 -4
  172. package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  173. package/lib/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
  174. package/lib/components/CreditCardForm/CreditCardFormStatus.js +3 -1
  175. package/lib/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
  176. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
  177. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  178. package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -14
  179. package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  180. package/lib/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
  181. package/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
  182. package/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
  183. package/lib/components/CreditCardForm/renderInputs.d.ts +2 -1
  184. package/lib/components/CreditCardForm/renderInputs.js +1 -1
  185. package/lib/components/CreditCardForm/renderInputs.js.map +1 -1
  186. package/lib/components/CreditCardForm/renderStep.d.ts +2 -2
  187. package/lib/components/CreditCardForm/renderStep.js +2 -2
  188. package/lib/components/CreditCardForm/renderStep.js.map +1 -1
  189. package/lib/components/CreditForm/CreditForm.d.ts +5 -2
  190. package/lib/components/CreditForm/CreditForm.js +6 -20
  191. package/lib/components/CreditForm/CreditForm.js.map +1 -1
  192. package/lib/components/CreditForm/CreditFormContent.d.ts +4 -5
  193. package/lib/components/CreditForm/CreditFormStatusTracker.js +11 -11
  194. package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  195. package/lib/components/CreditForm/CreditFormStep.d.ts +2 -3
  196. package/lib/components/CreditForm/CreditFormStep.js +6 -11
  197. package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  198. package/lib/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
  199. package/lib/components/CreditForm/ProgramsSourceProps.js +2 -0
  200. package/lib/components/CreditForm/ProgramsSourceProps.js.map +1 -0
  201. package/lib/components/CreditForm/creditFormStepsData.js +9 -1
  202. package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  203. package/lib/components/CreditForm/formStateMap.js +9 -7
  204. package/lib/components/CreditForm/formStateMap.js.map +1 -1
  205. package/lib/components/CreditForm/getCalcData.d.ts +3 -0
  206. package/lib/components/CreditForm/getCalcData.js +13 -0
  207. package/lib/components/CreditForm/getCalcData.js.map +1 -0
  208. package/lib/components/CreditForm/getCreditFormTaskData.js +3 -2
  209. package/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  210. package/lib/components/CreditForm/getSecondStepData.js +0 -1
  211. package/lib/components/CreditForm/getSecondStepData.js.map +1 -1
  212. package/lib/components/CreditForm/getZeroStepData.d.ts +1 -1
  213. package/lib/components/CreditForm/getZeroStepData.js +3 -8
  214. package/lib/components/CreditForm/getZeroStepData.js.map +1 -1
  215. package/lib/components/CreditForm/renderInputs.d.ts +2 -1
  216. package/lib/components/CreditForm/renderInputs.js +1 -1
  217. package/lib/components/CreditForm/renderInputs.js.map +1 -1
  218. package/lib/components/CreditForm/renderStep.d.ts +2 -2
  219. package/lib/components/CreditForm/renderStep.js +2 -2
  220. package/lib/components/CreditForm/renderStep.js.map +1 -1
  221. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
  222. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +0 -4
  223. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  224. package/lib/components/OfficesAtmsMap/filterItems.d.ts +2 -0
  225. package/lib/components/OfficesAtmsMap/filterItems.js +6 -0
  226. package/lib/components/OfficesAtmsMap/filterItems.js.map +1 -0
  227. package/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js +1 -1
  228. package/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
  229. package/lib/hooks/useJSONRef/useJSONRef.js +13 -3
  230. package/lib/hooks/useJSONRef/useJSONRef.js.map +1 -1
  231. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
  232. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  233. package/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
  234. package/lib/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
  235. package/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  236. package/lib/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
  237. package/lib/ui-kit/FormField/Fields/CreditCalcField.js +13 -0
  238. package/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
  239. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
  240. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  241. package/lib/ui-kit/FormField/Fields/RegionField.js +3 -1
  242. package/lib/ui-kit/FormField/Fields/RegionField.js.map +1 -1
  243. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  244. package/lib/ui-kit/FormField/SelectField.js +4 -6
  245. package/lib/ui-kit/FormField/SelectField.js.map +1 -1
  246. package/lib/ui-kit/FormField/getField.d.ts +1 -1
  247. package/lib/ui-kit/FormField/getField.js +5 -4
  248. package/lib/ui-kit/FormField/getField.js.map +1 -1
  249. package/lib/ui-kit/FormField/getObjectValidator.js +2 -0
  250. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  251. package/mobile/bundle/api/RetailAPI/getCardTypes.d.ts +1 -1
  252. package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  253. package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +1 -2
  254. package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +5 -4
  255. package/mobile/bundle/bundle.umd.js +742 -683
  256. package/mobile/bundle/bundle.umd.min.js +1 -1
  257. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
  258. package/mobile/bundle/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
  259. package/mobile/bundle/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
  260. package/mobile/bundle/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
  261. package/mobile/bundle/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
  262. package/mobile/bundle/components/CreditCardForm/renderInputs.d.ts +2 -1
  263. package/mobile/bundle/components/CreditCardForm/renderStep.d.ts +2 -2
  264. package/mobile/bundle/components/CreditForm/CreditForm.d.ts +5 -2
  265. package/mobile/bundle/components/CreditForm/CreditFormContent.d.ts +4 -5
  266. package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +2 -3
  267. package/mobile/bundle/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
  268. package/mobile/bundle/components/CreditForm/getCalcData.d.ts +3 -0
  269. package/mobile/bundle/components/CreditForm/getZeroStepData.d.ts +1 -1
  270. package/mobile/bundle/components/CreditForm/renderInputs.d.ts +2 -1
  271. package/mobile/bundle/components/CreditForm/renderStep.d.ts +2 -2
  272. package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
  273. package/mobile/bundle/components/OfficesAtmsMap/filterItems.d.ts +2 -0
  274. package/mobile/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
  275. package/mobile/bundle/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
  276. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  277. package/mobile/bundle/ui-kit/FormField/getField.d.ts +1 -1
  278. package/mobile/dist/api/RetailAPI/getCardTypes.d.ts +1 -1
  279. package/mobile/dist/api/RetailAPI/getCardTypes.js +4 -5
  280. package/mobile/dist/api/RetailAPI/getCardTypes.js.map +1 -1
  281. package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  282. package/mobile/dist/api/RetailAPI/getPaymentSystems.js +3 -4
  283. package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  284. package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +1 -2
  285. package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
  286. package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  287. package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +5 -4
  288. package/mobile/dist/api/RetailAPI/updateUserTask.js +1 -1
  289. package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  290. package/mobile/dist/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
  291. package/mobile/dist/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  292. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  293. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  294. package/mobile/dist/components/ApplicationForm/renderInputs.js +1 -1
  295. package/mobile/dist/components/ApplicationForm/renderInputs.js.map +1 -1
  296. package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  297. package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  298. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
  299. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +0 -1
  300. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  301. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +15 -8
  302. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  303. package/mobile/dist/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
  304. package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js +5 -3
  305. package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  306. package/mobile/dist/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
  307. package/mobile/dist/components/CalculatorCredit/defaultValueAdapter.js +18 -0
  308. package/mobile/dist/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
  309. package/mobile/dist/components/CreditCardForm/CreditCardForm.js +4 -4
  310. package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  311. package/mobile/dist/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
  312. package/mobile/dist/components/CreditCardForm/CreditCardFormStatus.js +3 -1
  313. package/mobile/dist/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
  314. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
  315. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  316. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -14
  317. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  318. package/mobile/dist/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
  319. package/mobile/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
  320. package/mobile/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
  321. package/mobile/dist/components/CreditCardForm/renderInputs.d.ts +2 -1
  322. package/mobile/dist/components/CreditCardForm/renderInputs.js +1 -1
  323. package/mobile/dist/components/CreditCardForm/renderInputs.js.map +1 -1
  324. package/mobile/dist/components/CreditCardForm/renderStep.d.ts +2 -2
  325. package/mobile/dist/components/CreditCardForm/renderStep.js +2 -2
  326. package/mobile/dist/components/CreditCardForm/renderStep.js.map +1 -1
  327. package/mobile/dist/components/CreditForm/CreditForm.d.ts +5 -2
  328. package/mobile/dist/components/CreditForm/CreditForm.js +6 -20
  329. package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
  330. package/mobile/dist/components/CreditForm/CreditFormContent.d.ts +4 -5
  331. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +10 -10
  332. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  333. package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +2 -3
  334. package/mobile/dist/components/CreditForm/CreditFormStep.js +5 -10
  335. package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  336. package/mobile/dist/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
  337. package/mobile/dist/components/CreditForm/ProgramsSourceProps.js +2 -0
  338. package/mobile/dist/components/CreditForm/ProgramsSourceProps.js.map +1 -0
  339. package/mobile/dist/components/CreditForm/creditFormStepsData.js +9 -1
  340. package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  341. package/mobile/dist/components/CreditForm/formStateMap.js +9 -7
  342. package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
  343. package/mobile/dist/components/CreditForm/getCalcData.d.ts +3 -0
  344. package/mobile/dist/components/CreditForm/getCalcData.js +16 -0
  345. package/mobile/dist/components/CreditForm/getCalcData.js.map +1 -0
  346. package/mobile/dist/components/CreditForm/getCreditFormTaskData.js +3 -2
  347. package/mobile/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  348. package/mobile/dist/components/CreditForm/getSecondStepData.js +0 -1
  349. package/mobile/dist/components/CreditForm/getSecondStepData.js.map +1 -1
  350. package/mobile/dist/components/CreditForm/getZeroStepData.d.ts +1 -1
  351. package/mobile/dist/components/CreditForm/getZeroStepData.js +3 -8
  352. package/mobile/dist/components/CreditForm/getZeroStepData.js.map +1 -1
  353. package/mobile/dist/components/CreditForm/renderInputs.d.ts +2 -1
  354. package/mobile/dist/components/CreditForm/renderInputs.js +1 -1
  355. package/mobile/dist/components/CreditForm/renderInputs.js.map +1 -1
  356. package/mobile/dist/components/CreditForm/renderStep.d.ts +2 -2
  357. package/mobile/dist/components/CreditForm/renderStep.js +2 -2
  358. package/mobile/dist/components/CreditForm/renderStep.js.map +1 -1
  359. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
  360. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -6
  361. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  362. package/mobile/dist/components/OfficesAtmsMap/filterItems.d.ts +2 -0
  363. package/mobile/dist/components/OfficesAtmsMap/filterItems.js +9 -0
  364. package/mobile/dist/components/OfficesAtmsMap/filterItems.js.map +1 -0
  365. package/mobile/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js +3 -3
  366. package/mobile/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
  367. package/mobile/dist/hooks/useJSONRef/useJSONRef.js +13 -3
  368. package/mobile/dist/hooks/useJSONRef/useJSONRef.js.map +1 -1
  369. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
  370. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  371. package/mobile/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
  372. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
  373. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  374. package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
  375. package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js +15 -0
  376. package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
  377. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
  378. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  379. package/mobile/dist/ui-kit/FormField/Fields/RegionField.js +3 -1
  380. package/mobile/dist/ui-kit/FormField/Fields/RegionField.js.map +1 -1
  381. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  382. package/mobile/dist/ui-kit/FormField/SelectField.js +4 -6
  383. package/mobile/dist/ui-kit/FormField/SelectField.js.map +1 -1
  384. package/mobile/dist/ui-kit/FormField/getField.d.ts +1 -1
  385. package/mobile/dist/ui-kit/FormField/getField.js +5 -4
  386. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  387. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +2 -0
  388. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  389. package/mobile/lib/api/RetailAPI/getCardTypes.d.ts +1 -1
  390. package/mobile/lib/api/RetailAPI/getCardTypes.js +5 -6
  391. package/mobile/lib/api/RetailAPI/getCardTypes.js.map +1 -1
  392. package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  393. package/mobile/lib/api/RetailAPI/getPaymentSystems.js +4 -5
  394. package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  395. package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +1 -2
  396. package/mobile/lib/api/RetailAPI/updateUserProfile.js +2 -2
  397. package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  398. package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +5 -4
  399. package/mobile/lib/api/RetailAPI/updateUserTask.js +2 -2
  400. package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  401. package/mobile/lib/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
  402. package/mobile/lib/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  403. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  404. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  405. package/mobile/lib/components/ApplicationForm/renderInputs.js +1 -1
  406. package/mobile/lib/components/ApplicationForm/renderInputs.js.map +1 -1
  407. package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  408. package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  409. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
  410. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +0 -1
  411. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  412. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +15 -8
  413. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  414. package/mobile/lib/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
  415. package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js +5 -3
  416. package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  417. package/mobile/lib/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
  418. package/mobile/lib/components/CalculatorCredit/defaultValueAdapter.js +15 -0
  419. package/mobile/lib/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
  420. package/mobile/lib/components/CreditCardForm/CreditCardForm.js +4 -4
  421. package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  422. package/mobile/lib/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
  423. package/mobile/lib/components/CreditCardForm/CreditCardFormStatus.js +3 -1
  424. package/mobile/lib/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
  425. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
  426. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  427. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -14
  428. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  429. package/mobile/lib/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
  430. package/mobile/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
  431. package/mobile/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
  432. package/mobile/lib/components/CreditCardForm/renderInputs.d.ts +2 -1
  433. package/mobile/lib/components/CreditCardForm/renderInputs.js +1 -1
  434. package/mobile/lib/components/CreditCardForm/renderInputs.js.map +1 -1
  435. package/mobile/lib/components/CreditCardForm/renderStep.d.ts +2 -2
  436. package/mobile/lib/components/CreditCardForm/renderStep.js +2 -2
  437. package/mobile/lib/components/CreditCardForm/renderStep.js.map +1 -1
  438. package/mobile/lib/components/CreditForm/CreditForm.d.ts +5 -2
  439. package/mobile/lib/components/CreditForm/CreditForm.js +6 -20
  440. package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
  441. package/mobile/lib/components/CreditForm/CreditFormContent.d.ts +4 -5
  442. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +11 -11
  443. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  444. package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +2 -3
  445. package/mobile/lib/components/CreditForm/CreditFormStep.js +6 -11
  446. package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  447. package/mobile/lib/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
  448. package/mobile/lib/components/CreditForm/ProgramsSourceProps.js +2 -0
  449. package/mobile/lib/components/CreditForm/ProgramsSourceProps.js.map +1 -0
  450. package/mobile/lib/components/CreditForm/creditFormStepsData.js +9 -1
  451. package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  452. package/mobile/lib/components/CreditForm/formStateMap.js +9 -7
  453. package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
  454. package/mobile/lib/components/CreditForm/getCalcData.d.ts +3 -0
  455. package/mobile/lib/components/CreditForm/getCalcData.js +13 -0
  456. package/mobile/lib/components/CreditForm/getCalcData.js.map +1 -0
  457. package/mobile/lib/components/CreditForm/getCreditFormTaskData.js +3 -2
  458. package/mobile/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  459. package/mobile/lib/components/CreditForm/getSecondStepData.js +0 -1
  460. package/mobile/lib/components/CreditForm/getSecondStepData.js.map +1 -1
  461. package/mobile/lib/components/CreditForm/getZeroStepData.d.ts +1 -1
  462. package/mobile/lib/components/CreditForm/getZeroStepData.js +3 -8
  463. package/mobile/lib/components/CreditForm/getZeroStepData.js.map +1 -1
  464. package/mobile/lib/components/CreditForm/renderInputs.d.ts +2 -1
  465. package/mobile/lib/components/CreditForm/renderInputs.js +1 -1
  466. package/mobile/lib/components/CreditForm/renderInputs.js.map +1 -1
  467. package/mobile/lib/components/CreditForm/renderStep.d.ts +2 -2
  468. package/mobile/lib/components/CreditForm/renderStep.js +2 -2
  469. package/mobile/lib/components/CreditForm/renderStep.js.map +1 -1
  470. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
  471. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +0 -4
  472. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  473. package/mobile/lib/components/OfficesAtmsMap/filterItems.d.ts +2 -0
  474. package/mobile/lib/components/OfficesAtmsMap/filterItems.js +6 -0
  475. package/mobile/lib/components/OfficesAtmsMap/filterItems.js.map +1 -0
  476. package/mobile/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js +1 -1
  477. package/mobile/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
  478. package/mobile/lib/hooks/useJSONRef/useJSONRef.js +13 -3
  479. package/mobile/lib/hooks/useJSONRef/useJSONRef.js.map +1 -1
  480. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
  481. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  482. package/mobile/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
  483. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
  484. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  485. package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
  486. package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js +13 -0
  487. package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
  488. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
  489. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  490. package/mobile/lib/ui-kit/FormField/Fields/RegionField.js +3 -1
  491. package/mobile/lib/ui-kit/FormField/Fields/RegionField.js.map +1 -1
  492. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  493. package/mobile/lib/ui-kit/FormField/SelectField.js +4 -6
  494. package/mobile/lib/ui-kit/FormField/SelectField.js.map +1 -1
  495. package/mobile/lib/ui-kit/FormField/getField.d.ts +1 -1
  496. package/mobile/lib/ui-kit/FormField/getField.js +5 -4
  497. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  498. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +2 -0
  499. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  500. package/mobile/src/api/RetailAPI/getCardTypes.ts +5 -7
  501. package/mobile/src/api/RetailAPI/getPaymentSystems.ts +9 -7
  502. package/mobile/src/api/RetailAPI/updateUserProfile.ts +2 -3
  503. package/mobile/src/api/RetailAPI/updateUserTask.ts +6 -5
  504. package/mobile/src/api/RetailAPI/utils/getUpdateUserProfile.ts +2 -2
  505. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
  506. package/mobile/src/components/ApplicationForm/renderInputs.tsx +2 -2
  507. package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
  508. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +13 -7
  509. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +32 -16
  510. package/mobile/src/components/CalculatorCredit/CalculatorCredit.tsx +7 -5
  511. package/mobile/src/components/CalculatorCredit/defaultValueAdapter.ts +26 -0
  512. package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +4 -8
  513. package/mobile/src/components/CreditCardForm/CreditCardFormStatus.tsx +7 -1
  514. package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +14 -8
  515. package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -18
  516. package/mobile/src/components/CreditCardForm/PendingStatusContent.tsx +24 -21
  517. package/mobile/src/components/CreditCardForm/renderInputs.tsx +3 -2
  518. package/mobile/src/components/CreditCardForm/renderStep.tsx +3 -4
  519. package/mobile/src/components/CreditForm/CreditForm.tsx +12 -30
  520. package/mobile/src/components/CreditForm/CreditFormContent.ts +5 -8
  521. package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +14 -13
  522. package/mobile/src/components/CreditForm/CreditFormStep.tsx +10 -24
  523. package/mobile/src/components/CreditForm/ProgramsSourceProps.tsx +20 -0
  524. package/mobile/src/components/CreditForm/creditFormStepsData.tsx +9 -1
  525. package/mobile/src/components/CreditForm/formStateMap.tsx +9 -7
  526. package/mobile/src/components/CreditForm/getCalcData.ts +19 -0
  527. package/mobile/src/components/CreditForm/getCreditFormTaskData.ts +3 -2
  528. package/mobile/src/components/CreditForm/getSecondStepData.tsx +0 -1
  529. package/mobile/src/components/CreditForm/getZeroStepData.ts +7 -11
  530. package/mobile/src/components/CreditForm/renderInputs.tsx +3 -2
  531. package/mobile/src/components/CreditForm/renderStep.tsx +3 -3
  532. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +0 -9
  533. package/mobile/src/components/OfficesAtmsMap/filterItems.tsx +11 -0
  534. package/mobile/src/components/OfficesAtmsMap/useOfficesAtmsMapData.tsx +1 -1
  535. package/mobile/src/hooks/useJSONRef/useJSONRef.ts +21 -4
  536. package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +14 -10
  537. package/mobile/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
  538. package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +17 -4
  539. package/mobile/src/ui-kit/FormField/Fields/CreditCalcField.tsx +24 -0
  540. package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +8 -4
  541. package/mobile/src/ui-kit/FormField/Fields/RegionField.tsx +4 -1
  542. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +1 -0
  543. package/mobile/src/ui-kit/FormField/SelectField.tsx +4 -6
  544. package/mobile/src/ui-kit/FormField/getField.tsx +5 -4
  545. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
  546. package/package.json +3 -2
  547. package/src/api/RetailAPI/getCardTypes.ts +5 -7
  548. package/src/api/RetailAPI/getPaymentSystems.ts +9 -7
  549. package/src/api/RetailAPI/updateUserProfile.ts +2 -3
  550. package/src/api/RetailAPI/updateUserTask.ts +6 -5
  551. package/src/api/RetailAPI/utils/getUpdateUserProfile.ts +2 -2
  552. package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
  553. package/src/components/ApplicationForm/renderInputs.tsx +2 -2
  554. package/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
  555. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +13 -7
  556. package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +32 -16
  557. package/src/components/CalculatorCredit/CalculatorCredit.tsx +7 -5
  558. package/src/components/CalculatorCredit/defaultValueAdapter.ts +26 -0
  559. package/src/components/CreditCardForm/CreditCardForm.tsx +4 -8
  560. package/src/components/CreditCardForm/CreditCardFormStatus.tsx +7 -1
  561. package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +14 -8
  562. package/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -18
  563. package/src/components/CreditCardForm/PendingStatusContent.tsx +24 -21
  564. package/src/components/CreditCardForm/renderInputs.tsx +3 -2
  565. package/src/components/CreditCardForm/renderStep.tsx +3 -4
  566. package/src/components/CreditForm/CreditForm.fixture.tsx +6 -1
  567. package/src/components/CreditForm/CreditForm.tsx +12 -30
  568. package/src/components/CreditForm/CreditFormContent.ts +5 -8
  569. package/src/components/CreditForm/CreditFormStatusTracker.tsx +14 -13
  570. package/src/components/CreditForm/CreditFormStep.tsx +10 -24
  571. package/src/components/CreditForm/ProgramsSourceProps.tsx +20 -0
  572. package/src/components/CreditForm/creditFormStepsData.tsx +9 -1
  573. package/src/components/CreditForm/formStateMap.tsx +9 -7
  574. package/src/components/CreditForm/getCalcData.ts +19 -0
  575. package/src/components/CreditForm/getCreditFormTaskData.ts +3 -2
  576. package/src/components/CreditForm/getSecondStepData.tsx +0 -1
  577. package/src/components/CreditForm/getZeroStepData.ts +7 -11
  578. package/src/components/CreditForm/renderInputs.tsx +3 -2
  579. package/src/components/CreditForm/renderStep.tsx +3 -3
  580. package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +0 -9
  581. package/src/components/OfficesAtmsMap/filterItems.tsx +11 -0
  582. package/src/components/OfficesAtmsMap/useOfficesAtmsMapData.tsx +1 -1
  583. package/src/hooks/useJSONRef/useJSONRef.ts +21 -4
  584. package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +14 -10
  585. package/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
  586. package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +17 -4
  587. package/src/ui-kit/FormField/Fields/CreditCalcField.tsx +24 -0
  588. package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +8 -4
  589. package/src/ui-kit/FormField/Fields/RegionField.tsx +4 -1
  590. package/src/ui-kit/FormField/NameFieldDef.ts +1 -0
  591. package/src/ui-kit/FormField/SelectField.tsx +4 -6
  592. package/src/ui-kit/FormField/getField.tsx +5 -4
  593. package/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
@@ -958,12 +958,22 @@
958
958
  const refs = collectRef(content);
959
959
  const [refsMap, setRefsMap] = useState({});
960
960
  useEffect(() => {
961
- if (refs.length) {
962
- fetchRefs(refs).then(setRefsMap);
963
- }
961
+ resolveRefs(refs).then(setRefsMap);
964
962
  }, [refs.join()]);
965
963
  return refs.length ? resolveBlockProps(content, { ...fallback, ...refsMap }) : content;
966
964
  };
965
+ const resolveRefs = async (refs, parentRefsMap = {}) => {
966
+ if (refs.length) {
967
+ const refsMap = await fetchRefs(refs);
968
+ const unionRefsMap = { ...parentRefsMap, ...refsMap };
969
+ const additRefs = Object.entries(refsMap).flatMap(([, v]) => collectRef(v));
970
+ if (additRefs.length) {
971
+ return resolveRefs(additRefs, unionRefsMap);
972
+ }
973
+ return unionRefsMap;
974
+ }
975
+ return parentRefsMap;
976
+ };
967
977
 
968
978
  const extractContent = ({ block, options, className, defaultPadding, padding, isTheme, version, children, ...content }) => content;
969
979
 
@@ -1193,9 +1203,6 @@
1193
1203
 
1194
1204
  const getConsentDataProcessing = (inputs) => inputs?.find((_) => _?.name === 'consentDataProcessing');
1195
1205
 
1196
- const OUT_SERVICE_URL = `${API_BASE_URI}/outservice/outserviceregions`;
1197
- const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
1198
-
1199
1206
  function useBool(defaultValue = false) {
1200
1207
  const [value, setValue] = useState(defaultValue);
1201
1208
  const setTrue = useCallback(() => setValue(true), []);
@@ -1668,6 +1675,8 @@
1668
1675
  confirmationIncome: defaultValidator(),
1669
1676
  deliveryDate: defaultValidator('Укажите дату доставки'),
1670
1677
  addressCourier: addressDaDataValidator(),
1678
+ cardCategory: defaultValidator('Укажите категорию карты'),
1679
+ paymentSystem: defaultValidator('Укажите тип платежной системы'),
1671
1680
  };
1672
1681
  const getObjectValidator = (inputs) => {
1673
1682
  const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
@@ -2420,11 +2429,6 @@
2420
2429
  return { header, body };
2421
2430
  };
2422
2431
 
2423
- const isSSR = () => Boolean(typeof globalThis.process === 'object' && globalThis.process && globalThis.process.version);
2424
-
2425
- const isClient = !isSSR();
2426
- const ClientOnly = JSX(({ children }) => (isClient ? children : null));
2427
-
2428
2432
  const INITIAL_FILTRATION_STATE$1 = {
2429
2433
  workingSaturday: false,
2430
2434
  premiumService: false,
@@ -2469,103 +2473,13 @@
2469
2473
  transferringDataToBiometricSystem: (item) => Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
2470
2474
  };
2471
2475
 
2472
- function useButton() {
2473
- return (props) => ({
2474
- ...props,
2475
- onClick: handlerDecorator(handleClick(props)),
2476
- });
2477
- }
2478
- function handleClick({ disabled, onClick }) {
2479
- return (ev) => {
2480
- !disabled && onClick && onClick(ev);
2481
- };
2482
- }
2483
-
2484
- const buttonStyleMap = {
2485
- primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
2486
- secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
2487
- };
2488
- const secondaryButtonStyleMap = {
2489
- primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
2490
- secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
2491
- };
2492
- const Button = JSX(({ children, ...props }) => {
2493
- const button = useButton();
2494
- const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
2495
- return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', {
2496
- 'text-white bg-primary-active': active,
2497
- 'bg-main-gray text-main-disabled cursor-not-allowed': disabled,
2498
- 'rounded-md': rounded,
2499
- }, !active && !disabled
2500
- ? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
2501
- : '', className), type: type, role: role, onClick: onClick, children: children }));
2502
- });
2503
-
2504
- const getVersion = (isPrimary, type) => isPrimary && type !== 'underlined' ? 'primary' : 'secondary';
2505
-
2506
- const renderButtonsGroup = (data, activeButton, onButtonClick) => {
2507
- const allButtonVersion = getVersion(activeButton === 'all');
2508
- const businessButtonVersion = getVersion(activeButton === 'business');
2509
- const handleClick = (e, key, branches) => {
2510
- const filteredBranches = e.currentTarget === e.target && key === 'business' ? filterBranches(branches) : branches;
2511
- onButtonClick(key);
2512
- return filteredBranches;
2513
- };
2514
- const filterBranches = (branches) => branches.filter((branch) => branch.workSchedule &&
2515
- branch.workSchedule.businessScheduleVisibleTag &&
2516
- !branch.workSchedule.businessScheduleDescription);
2517
- return (jsxs("div", { className: "flex gap-lg flex-col sm:flex-row pb-lg", children: [jsx(Button, { "data-id": "all", onClick: (e) => handleClick(e, 'all', data), version: allButtonVersion, children: "\u0414\u043B\u044F \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" }), jsx(Button, { "data-id": "business", onClick: (e) => handleClick(e, 'business', data), version: businessButtonVersion, children: "\u0414\u043B\u044F \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" })] }));
2518
- };
2519
-
2520
- const renderDescriptionBlock$1 = ({ __html, list, richVersion }) => __html || list?.length ? (jsxs("div", { className: "mb-2xl border-b sm:border border-main-divider sm:rounded-md", children: [__html ? (jsx("div", { className: "mb-2xl", children: jsx(RichText, { __html: __html, richVersion: richVersion }) })) : null, list?.length ? (jsx("div", { className: "flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
2521
-
2522
- const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
2523
- const renderFiltrationForm = ({ filters, field: { field, reset }, onlyOffice, labels, }) => {
2524
- const visibleFiltersNum = onlyOffice ? 5 : 6;
2525
- const filtersCheckbox = (filters || []).map((key) => (jsx(Checkbox, { text: labels[key], ...field(key) }, key)));
2526
- const [visibleFilters, hiddenFilters] = visibleFiltersNum > 0
2527
- ? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
2528
- : [filtersCheckbox, []];
2529
- return (jsx("div", { children: filters?.length ? (jsx("div", { children: jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }), jsx(FoldableSection, { className: COMMON_FILTERS_STYLES, isUnfolded: isUnfolded, children: hiddenFilters })] })), renderFoldButton: renderFoldButton$2(reset, onlyOffice) }) })) : null }));
2530
- };
2531
- const renderFoldButton$2 = (reset, onlyOffice = false) => ({ isUnfolded, onToggle }) => {
2532
- const labels = ['Больше фильтров', 'Меньше фильтров'];
2533
- const icons = ['ArrowDownIcon', 'ArrowUpIcon'];
2534
- return (jsxs("div", { className: "flex space-x-lg", children: [onlyOffice ? (jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", appendRight: jsx(Icon, { name: icons[Number(isUnfolded)], width: "16", height: "16" }), text: labels[Number(isUnfolded)], onClick: onToggle })) : null, jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, children: renderBtnInner() })] }));
2535
- };
2536
- const renderBtnInner = () => (jsxs("div", { className: "flex items-center", children: ["\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", jsx(Icon, { name: "CloseIcon", width: "16", height: "16", className: "ml-2xs" })] }));
2537
-
2538
- const renderHeading = (title, lengthItems) => (jsx("div", { className: "flex flex-col sm:flex-row gap-xs mb-2xl", children: jsxs(Heading, { headingType: "h3", children: [jsx("span", { suppressHydrationWarning: true, children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: jsx("span", { suppressHydrationWarning: true, children: ` (${lengthItems})` }) })) : null] }) }));
2539
-
2540
- const defaultEmptyFunction$1 = () => void 0;
2541
- const filtersVisibleStyles = (activeButton) => activeButton === 'all' ? 'block' : 'hidden';
2542
- const OfficesAtmsMapLayout = JSX(({ className, data = [], isLoad, remoteWorkplaces = [], renderCard = defaultEmptyFunction$1, renderRemoteWorkplaceCard = defaultEmptyFunction$1, getBalloon = defaultEmptyFunction$1, getBalloonRemoteWorkplaces = defaultEmptyFunction$1, descriptionData, title, }) => {
2543
- const onlyOffice = title?.includes('Офис');
2544
- const [filtrationState, { field, reset }] = useForm(INITIAL_FILTRATION_STATE$1);
2545
- const { filteredItems, points, filteredRemoteWorkplaces, lengthItems } = useOfficesAtmsMapData({
2546
- data,
2547
- remoteWorkplaces,
2548
- filtrationState,
2549
- getBalloon,
2550
- getBalloonRemoteWorkplaces,
2551
- });
2552
- const [activeButton, setActiveButton] = useState('all');
2553
- const filterOptions = {
2554
- filters: getFiltersWithNonEmptyData([...data, ...remoteWorkplaces]),
2555
- field: { field, reset },
2556
- onlyOffice,
2557
- labels: FILTRATION_LABELS,
2558
- };
2559
- return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [renderHeading(title, lengthItems), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton), jsx("div", { className: style('pb-3xl', filtersVisibleStyles(activeButton)), children: renderFiltrationForm(filterOptions) })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: isLoad, className: "h-full" }) }) })] }), jsxs(ClientOnly, { children: [filteredItems.map(renderCard), filteredRemoteWorkplaces.map(renderRemoteWorkplaceCard)] })] }));
2560
- });
2561
2476
  const filterItems$1 = (data, filtrationState) => {
2562
2477
  const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
2563
2478
  return data.filter((item) => truthyFilters.every((_) => FILTRATION_PREDICATES$1[_](item)));
2564
2479
  };
2565
- const getFiltersWithNonEmptyData = (data) => Object.keys(INITIAL_FILTRATION_STATE$1).filter((_) => data.filter((item) => FILTRATION_PREDICATES$1[_](item)).length);
2566
2480
 
2567
- const defaultEmptyFunction = () => void 0;
2568
- const useOfficesAtmsMapData = ({ data, remoteWorkplaces = [], filtrationState = {}, getBalloon = defaultEmptyFunction, getBalloonRemoteWorkplaces = defaultEmptyFunction, }) => {
2481
+ const defaultEmptyFunction$1 = () => void 0;
2482
+ const useOfficesAtmsMapData = ({ data, remoteWorkplaces = [], filtrationState = {}, getBalloon = defaultEmptyFunction$1, getBalloonRemoteWorkplaces = defaultEmptyFunction$1, }) => {
2569
2483
  const [filteredItems, points, filteredRemoteWorkplaces, lengthItems] = useMemo(() => {
2570
2484
  const _filteredItems = filterItems$1(data, filtrationState);
2571
2485
  const _filteredRemoteWorkplaces = filterItems$1(remoteWorkplaces, filtrationState);
@@ -2602,6 +2516,11 @@
2602
2516
  return result || [];
2603
2517
  };
2604
2518
 
2519
+ const isSSR = () => Boolean(typeof globalThis.process === 'object' && globalThis.process && globalThis.process.version);
2520
+
2521
+ const isClient = !isSSR();
2522
+ const ClientOnly = JSX(({ children }) => (isClient ? children : null));
2523
+
2605
2524
  const AddressRetailField = JSX(({ field, input }) => {
2606
2525
  const [offices, setOffices] = useState([]);
2607
2526
  const { data } = useLeadFormData('REGION_RF');
@@ -2693,12 +2612,10 @@
2693
2612
  const AmountField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0443\u043C\u043C\u0430, \u20BD", items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })));
2694
2613
 
2695
2614
  const SelectField = UniBlock(({ field, source, label, fieldName, input, placeholder = 'Выберите из списка', isSearch = false, }) => {
2696
- const leadOptions = (source &&
2697
- source?.map((_) => ({
2698
- key: _.key || '',
2699
- text: _.value,
2700
- }))) ||
2701
- [];
2615
+ const leadOptions = source?.map((_) => ({
2616
+ key: _.key || '',
2617
+ text: _.value,
2618
+ })) || [];
2702
2619
  return (jsx(SelectControl, { placeholder: placeholder, label: label, options: leadOptions, isSearch: isSearch, ...getValidation(field(fieldName), validatorObj[fieldName], input?.required) }));
2703
2620
  });
2704
2621
 
@@ -2998,29 +2915,45 @@
2998
2915
 
2999
2916
  const BirthdayField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, input?.required) })));
3000
2917
 
3001
- const FIELD_NAME$9 = 'birthPlace';
3002
- const BirthPlaceField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthPlace'), validatorObj.birthPlace, input?.required), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$9) })));
2918
+ const FIELD_NAME$a = 'birthPlace';
2919
+ const BirthPlaceField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthPlace'), validatorObj.birthPlace, input?.required), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$a) })));
3003
2920
 
3004
- const getCardTypes = async (paymentSystemType) => {
3005
- const response = await doRequest('/dictionaryFiltered', 'POST', {
2921
+ const getCardTypes = async (paymentSystemTypeCd, creditProgramId) => {
2922
+ const data = await fetchRetailJSON('/dictionaryFiltered', 'POST', {
3006
2923
  type: 'CARD_TYPE',
3007
- presets: { paymentSystemType, creditProgramId: 13 },
2924
+ presets: { paymentSystemTypeCd, creditProgramId },
3008
2925
  });
3009
- const data = await response?.json();
3010
- return data;
2926
+ return Array.isArray(data) ? data : [];
3011
2927
  };
3012
2928
 
2929
+ function useLocalStorage(key) {
2930
+ const [storedValue, setStoredValue] = useState(JSON.parse(globalThis.localStorage?.getItem(key) || 'null'));
2931
+ const setValue = useCallback((value) => {
2932
+ globalThis.localStorage?.setItem(key, JSON.stringify(value));
2933
+ setStoredValue(value);
2934
+ }, [key, globalThis.localStorage]);
2935
+ return [storedValue, setValue];
2936
+ }
2937
+
3013
2938
  const CardCategoryField = JSX(({ field, input }) => {
3014
2939
  const [cardTypes, setCardTypes] = useState([]);
2940
+ const [programId] = useLocalStorage('programId');
2941
+ const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
3015
2942
  const selectedPaymentSystem = field('paymentSystem').value;
3016
2943
  useEffect(() => {
3017
- (async () => {
3018
- const fetchedCardTypes = await getCardTypes(selectedPaymentSystem);
3019
- setCardTypes(fetchedCardTypes);
3020
- })();
2944
+ if (selectedPaymentSystem && programId) {
2945
+ (async () => {
2946
+ const fetchedCardTypes = await getCardTypes(selectedPaymentSystem, programId);
2947
+ setCardTypes(fetchedCardTypes);
2948
+ if (!isValidCardCategory(fetchedCardTypes, selectedCardCategory)) {
2949
+ cardCategoryChange && cardCategoryChange(null);
2950
+ }
2951
+ })();
2952
+ }
3021
2953
  }, [selectedPaymentSystem]);
3022
2954
  return (jsx(SelectField, { field: field, source: cardTypes, label: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u043A\u0430\u0440\u0442\u044B", fieldName: "cardCategory", input: input }));
3023
2955
  });
2956
+ const isValidCardCategory = (cardTypes, selectedCardCategory) => cardTypes.some((cardType) => cardType.key === selectedCardCategory?.key);
3024
2957
 
3025
2958
  const ChildrenField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('children'), validatorObj.children, input?.required), ...input })));
3026
2959
 
@@ -3066,6 +2999,38 @@
3066
2999
  },
3067
3000
  };
3068
3001
 
3002
+ function useButton() {
3003
+ return (props) => ({
3004
+ ...props,
3005
+ onClick: handlerDecorator(handleClick(props)),
3006
+ });
3007
+ }
3008
+ function handleClick({ disabled, onClick }) {
3009
+ return (ev) => {
3010
+ !disabled && onClick && onClick(ev);
3011
+ };
3012
+ }
3013
+
3014
+ const buttonStyleMap = {
3015
+ primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
3016
+ secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
3017
+ };
3018
+ const secondaryButtonStyleMap = {
3019
+ primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
3020
+ secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
3021
+ };
3022
+ const Button = JSX(({ children, ...props }) => {
3023
+ const button = useButton();
3024
+ const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
3025
+ return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', {
3026
+ 'text-white bg-primary-active': active,
3027
+ 'bg-main-gray text-main-disabled cursor-not-allowed': disabled,
3028
+ 'rounded-md': rounded,
3029
+ }, !active && !disabled
3030
+ ? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
3031
+ : '', className), type: type, role: role, onClick: onClick, children: children }));
3032
+ });
3033
+
3069
3034
  const feedbackById = async (id, convertToPng = false) => {
3070
3035
  const response = await doRequest(`/feedback/file?id=${encodeURIComponent(id)}&convertToPngFlg=${convertToPng}`, 'GET');
3071
3036
  return response ? await response.blob() : new Blob();
@@ -3101,60 +3066,366 @@
3101
3066
 
3102
3067
  const ConsentField = JSX(({ field, input }) => input && input.name ? (jsx(CheckboxWithDoc, { text: CONSENTS[input.name]?.text, docId: CONSENTS[input.name]?.docId, ...getValidation(field(input.name), validatorObj[input.name], input?.required) })) : null);
3103
3068
 
3104
- const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
3105
- вкладчиком с долей участия более 20% уставного капитала руководителем,
3106
- которого Вы являетесь, кредит в АО «Россельхозбанк»`;
3107
- const CreditInRshbCdField = JSX(({ field, input }) => {
3108
- const { data: creditInRshbCd } = useLeadFormData('CREDIT_IN_RSHB');
3109
- return (jsx(SelectField, { field: field, source: creditInRshbCd, label: LABEL_TEXT, fieldName: "creditInRshbCd", input: input }));
3110
- });
3111
-
3112
- const orientationStyleMap = {
3113
- horizontal: '@lg:flex-row',
3114
- vertical: '',
3115
- };
3116
- const RadioButtonGroup = JSX(({ label, items, value, className, onChange: onChangeCheckedItem, disabled = false, orientation = 'horizontal', }) => (jsxs("div", { className: "grid gap-xs whitespace-nowrap", children: [label ? (jsx("div", { role: "radiogroup", "aria-label": label, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: label }) })) : null, jsx("div", { className: style('flex flex-col gap-s', orientationStyleMap[orientation], className), role: "radiogroup", "aria-label": "\u0413\u0440\u0443\u043F\u043F\u0430 \u043A\u043D\u043E\u043F\u043E\u043A", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: value === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id), disabled: disabled }, String(id)))) })] })));
3069
+ const MONTHS_IN_YEAR$1 = 12;
3070
+ const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR$1 * 100;
3071
+ const DEFAULT_MIN_MONTHS = 1;
3072
+ const DEFAULT_MAX_MONTHS = 60;
3073
+ const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
3117
3074
 
3118
- const RadioButtonGroupControl = JSX(({ className, label, onChange, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), onChange: (_) => onChange && onChange(_), ...rest }), renderErrorText(error)] })));
3075
+ const CalculatorLayout = JSX(({ className, title, children, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-xl', className), defaultPadding: "p-4xl", ...rest, children: [title ? jsx(Heading, { className: "text-center", title: title }) : null, children] })));
3119
3076
 
3120
- const CURRENCY_TYPES = [{ id: 'rub', text: 'Рубль' }];
3121
- const CurrencyField = JSX(({ field, input }) => {
3122
- const { value, onChange } = field('currency');
3123
- return (jsx(RadioButtonGroupControl, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", orientation: "horizontal", items: CURRENCY_TYPES, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('currency'), validatorObj.currency, input?.required) }));
3124
- });
3077
+ const CalculatorStyle = {
3078
+ wrapper: 'flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl',
3079
+ input: 'flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl',
3080
+ result: 'flex flex-col gap-y-xl min-w-52',
3081
+ };
3125
3082
 
3126
- const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...getValidation(field('deliveryDate'), validatorObj.deliveryDate, input?.required) })));
3083
+ const FormatValue = JSX(({ value, fractionDigits, fixed, prefix, postfix }) => (jsx(Text, { size: "text-h3", children: typeof value === 'number'
3084
+ ? [prefix, toLocalNumberFormat(fractionDigits, { fixed })(value), postfix]
3085
+ .filter(Boolean)
3086
+ .join(' ')
3087
+ : value })));
3127
3088
 
3128
- const DependentsField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", isInteger: true, maxLength: 2, ...getValidation(field('dependents'), validatorObj.dependents, input?.required), ...input })));
3089
+ const CalculatorValueStyle = 'flex justify-between @xl:flex-col';
3090
+ const CalculatorValue = JSX(({ className, title, value, color = 'text-secondary-text', ...rest }) => (jsxs("div", { className: style(CalculatorValueStyle, className), children: [title ? (jsx(Text, { size: "text-l", font: "font-light", color: color, children: title })) : null, value ? jsx(FormatValue, { value: value, ...rest }) : jsx(Text, { size: "text-h3", children: "-" })] })));
3129
3091
 
3130
- const DesiredMeetingDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0438", ...getValidation(field('desiredMeetingDate'), validatorObj.meetingDay, input?.required) })));
3092
+ const getDefaultParamsMin = (rateRows) => getDefaultParams([(i, acc) => i < acc, (i, prev) => i?.maxSum > prev?.maxSum], rateRows);
3093
+ const getDefaultParamsMax = (rateRows = [], isNewClient = false) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)));
3094
+ const getDefaultParams = (comparators, rateRows) => {
3095
+ if (!rateRows?.length) {
3096
+ return undefined;
3097
+ }
3098
+ const rates = rateRows?.reduce((acc, i) => {
3099
+ if (comparators[0](i.rate, acc[0].rate)) {
3100
+ return [i];
3101
+ }
3102
+ else if (i.rate === acc[0].rate) {
3103
+ return [...acc, i];
3104
+ }
3105
+ return acc;
3106
+ }, [rateRows[0]]);
3107
+ if (rates.length > 1) {
3108
+ return rates.reduce((prev, i) => (comparators[1](i, prev) ? i : prev), rates[0]);
3109
+ }
3110
+ return rates[0];
3111
+ };
3131
3112
 
3132
- const DisablePeopleFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u0438\u043D\u0432\u0430\u043B\u0438\u0434\u043E\u043C", ...getValidation(field('disablePeopleFlg'), validatorObj.disablePeopleFlg, input?.required) })));
3113
+ const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
3114
+ const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
3115
+ defaultParams.period >= DEFAULT_MIN_MONTHS &&
3116
+ defaultParams.period <= DEFAULT_MAX_MONTHS
3117
+ ? defaultParams.period
3118
+ : defaultMonth;
3133
3119
 
3134
- const FIELD_NAME$8 = 'dulIssueDateField';
3135
- const DulIssueDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0432\u044B\u0434\u0430\u0447\u0438", ...getValidation(field(FIELD_NAME$8), validatorObj.dulIssueDateField, input?.required), disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$8) })));
3120
+ const renderFootnote = (text, key) => text ? (jsx(Paragraph, { size: "text-xs", font: "font-light", color: "text-secondary-text", children: text }, String(key))) : null;
3136
3121
 
3137
- const FIELD_NAME$7 = 'dulIssuedBy';
3138
- const DulIssuedByField = JSX(({ field, input }) => {
3139
- const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } = field('dulSubdivisionCode');
3140
- const onDaDataChange = useCallback((item) => {
3141
- changeDulSubdivisionCode?.(item?.data?.code?.replace('-', ''));
3142
- }, []);
3143
- return (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$7), label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field(FIELD_NAME$7), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
3144
- });
3122
+ const STEP_MONTHS = 1;
3123
+ const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
3124
+ const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
3145
3125
 
3146
- const FIELD_NAME$6 = 'dulNumber';
3147
- const DulNumberField = JSX(({ field, input }) => (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$6), label: "\u041D\u043E\u043C\u0435\u0440 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", isInteger: true, maxLength: 6, ...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required) })));
3126
+ const orientationStyleMap = {
3127
+ horizontal: '@lg:flex-row',
3128
+ vertical: '',
3129
+ };
3130
+ const RadioButtonGroup = JSX(({ label, items, value, className, onChange: onChangeCheckedItem, disabled = false, orientation = 'horizontal', }) => (jsxs("div", { className: "grid gap-xs whitespace-nowrap", children: [label ? (jsx("div", { role: "radiogroup", "aria-label": label, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: label }) })) : null, jsx("div", { className: style('flex flex-col gap-s', orientationStyleMap[orientation], className), role: "radiogroup", "aria-label": "\u0413\u0440\u0443\u043F\u043F\u0430 \u043A\u043D\u043E\u043F\u043E\u043A", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: value === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id), disabled: disabled }, String(id)))) })] })));
3148
3131
 
3149
- const FIELD_NAME$5 = 'dulSerie';
3150
- const DulSerieField = JSX(({ field, input }) => (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$5), label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", isInteger: true, maxLength: 4, ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
3132
+ const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, value: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id), ...rest })] }));
3151
3133
 
3152
- const FIELD_NAME$4 = 'dulSubdivisionCode';
3153
- const DulSubdivisionCodeField = JSX(({ field, input }) => {
3154
- const onDaDataChange = useCallback((item) => {
3155
- field?.('dulIssuedBy')?.onChange?.(item?.data?.name);
3156
- }, []);
3157
- return (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$4), label: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F", isInteger: true, maxLength: 6, ...input, ...getValidation(field(FIELD_NAME$4), validatorObj.dulSubdivisionCode, input?.required), onDaDataChange: onDaDataChange }));
3134
+ const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
3135
+ ...props,
3136
+ className: 'sm:flex-col',
3137
+ items: [
3138
+ { id: 'annuity', text: 'Аннуитетный' },
3139
+ { id: 'differential', text: 'Дифференцированный' },
3140
+ ],
3141
+ });
3142
+
3143
+ const DEFAULT_MONEY_STEP = 1000;
3144
+ const renderWantedSumInput = ({ isShowItems = true, step = DEFAULT_MONEY_STEP, postfix = '₽', ...rest }) => (jsx(InputRange, { items: isShowItems
3145
+ ? [
3146
+ `От ${toLocalNumberFormat(1)(rest.min || 0)} ${postfix}`,
3147
+ `До ${toLocalNumberFormat(1)(rest.max || 0)} ${postfix}`,
3148
+ ]
3149
+ : [], step: step, ...rest }));
3150
+
3151
+ const setDefaultParamsCalc = ({ field, defParams, calcParams, map, monthsValue = 'maxMonths', }) => {
3152
+ Object.entries(map).forEach(([key, value]) => {
3153
+ field?.(key)?.onChange?.(defParams?.[value]);
3154
+ });
3155
+ field?.('monthsValue')?.onChange?.(clamp(defParams?.[monthsValue], calcParams.minMonths, calcParams.maxMonths));
3156
+ };
3157
+
3158
+ /**
3159
+ * Формулы расчёта аннуитетных и дифференцированных платежей:
3160
+ * https://finuslugi.ru/potrebitelskie_kredity/stat_annuitetnye_i_differentsirovannye_platezhi
3161
+ */
3162
+ const getMonthlyPayment = (rate, params) => {
3163
+ const { isAnnuity, moneyValue, monthsValue, moneyExtra } = params;
3164
+ if (rate === 0) {
3165
+ return 0;
3166
+ }
3167
+ else if (isAnnuity) {
3168
+ const i = rate / MONTHLY_INTEREST_RATE; // Используется значение ставки в процентах
3169
+ if (moneyExtra) {
3170
+ return (moneyValue + moneyExtra) * (i + i / (Math.pow(1 + i, monthsValue) - 1));
3171
+ }
3172
+ else {
3173
+ return moneyValue * (i + i / (Math.pow(1 + i, monthsValue) - 1));
3174
+ }
3175
+ }
3176
+ else {
3177
+ return Math.round(moneyValue / monthsValue) + moneyValue * (rate / (MONTHS_IN_YEAR$1 * 100)); // Используется значение ставки (rate) в процентах, делённое на сто.
3178
+ }
3179
+ };
3180
+
3181
+ const defaultDiscriminator = (_) => _;
3182
+ const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
3183
+ const max = maxBy();
3184
+
3185
+ const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
3186
+ const min = minBy();
3187
+
3188
+ const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
3189
+ ? {
3190
+ [minKey]: limitParams[minKey],
3191
+ [maxKey]: limitParams[maxKey],
3192
+ }
3193
+ : getRangeByKeys([minKey, maxKey], rateRows);
3194
+ const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
3195
+ [minKey]: rows.length
3196
+ ? min(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[minKey]))
3197
+ : 0,
3198
+ [maxKey]: rows.length
3199
+ ? max(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[maxKey]))
3200
+ : 0,
3201
+ });
3202
+ const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
3203
+
3204
+ const DEFAULT_MIN_SUM$2 = 10000;
3205
+ const DEFAULT_MAX_SUM$1 = 5000000;
3206
+ const DEFAULT_CREDIT_CALCULATOR_PARAMS = {
3207
+ minSum: DEFAULT_MIN_SUM$2,
3208
+ maxSum: DEFAULT_MAX_SUM$1,
3209
+ minMonths: DEFAULT_MIN_MONTHS,
3210
+ maxMonths: DEFAULT_MAX_MONTHS,
3211
+ rate: 0,
3212
+ isSalaryClient: false,
3213
+ isPensionClient: false,
3214
+ isStateEmployee: false,
3215
+ isInsurance: true,
3216
+ };
3217
+
3218
+ const checkCreditSourceBookRowCommonParams = (props) => checkRowParam$1({
3219
+ ...props,
3220
+ fieldKey: 'isSalaryClient',
3221
+ viewSettingFieldKey: 'isShowSalaryClient',
3222
+ }) &&
3223
+ checkRowParam$1({
3224
+ ...props,
3225
+ fieldKey: 'isStateEmployee',
3226
+ viewSettingFieldKey: 'isShowStateEmployee',
3227
+ }) &&
3228
+ checkRowParam$1({
3229
+ ...props,
3230
+ fieldKey: 'isPensionClient',
3231
+ viewSettingFieldKey: 'isShowPensionClient',
3232
+ }) &&
3233
+ checkRowParam$1({
3234
+ ...props,
3235
+ fieldKey: 'isInsurance',
3236
+ viewSettingFieldKey: 'isShowInsurance',
3237
+ });
3238
+ const checkRowParam$1 = ({ row, userInputParams, paramsViewSettings, fieldKey, viewSettingFieldKey, }) => {
3239
+ const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
3240
+ return isExclude || userInputParams[fieldKey] === row[fieldKey];
3241
+ };
3242
+
3243
+ const getCreditCalculatorLimitParams = ({ limitRows, userInputParams, paramsViewSettings, }) => limitRows?.find((row) => checkCreditSourceBookRowCommonParams({
3244
+ row,
3245
+ userInputParams,
3246
+ paramsViewSettings,
3247
+ }));
3248
+
3249
+ const getCreditCalculatorRateParams = ({ rateRows = [], userInputParams, paramsViewSettings, moneyValue, monthsValue, }) => rateRows?.find((row) => checkCreditSourceBookRowCommonParams({
3250
+ row,
3251
+ userInputParams,
3252
+ paramsViewSettings,
3253
+ }) &&
3254
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
3255
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
3256
+
3257
+ const getCreditCalculatorParams = (userInputParams, calcSource, paramsViewSettings) => {
3258
+ const { moneyValue, monthsValue } = userInputParams;
3259
+ const rateRows = calcSource?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
3260
+ const limitRows = calcSource?.limitRows || [];
3261
+ const creditCalculatorSourceBookLimitParams = getCreditCalculatorLimitParams({
3262
+ limitRows,
3263
+ userInputParams,
3264
+ paramsViewSettings,
3265
+ });
3266
+ const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], creditCalculatorSourceBookLimitParams, rateRows);
3267
+ const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], creditCalculatorSourceBookLimitParams, rateRows);
3268
+ const creditCalculatorRateParams = getCreditCalculatorRateParams({
3269
+ rateRows,
3270
+ userInputParams,
3271
+ paramsViewSettings,
3272
+ moneyValue,
3273
+ monthsValue,
3274
+ });
3275
+ const { rate } = creditCalculatorRateParams;
3276
+ const monthlyPayment = getMonthlyPayment(rate, userInputParams);
3277
+ return {
3278
+ ...creditCalculatorRateParams,
3279
+ ...userInputParams,
3280
+ minSum,
3281
+ maxSum,
3282
+ minMonths,
3283
+ maxMonths,
3284
+ moneyValue,
3285
+ monthsValue,
3286
+ monthlyPayment,
3287
+ };
3288
+ };
3289
+
3290
+ const isDefaultParams = (defaultParams = {}) => Boolean(Object.values(defaultParams).filter((_) => _).length);
3291
+
3292
+ const CREDIT_DEFAULT_SUM = 200000;
3293
+ const MAP$1 = {
3294
+ isSalaryClient: 'isSalaryClient',
3295
+ isStateEmployee: 'isStateEmployee',
3296
+ isPensionClient: 'isPensionClient',
3297
+ isInsurance: 'isInsurance',
3298
+ moneyValue: 'maxSum',
3299
+ };
3300
+ const CalculatorCredit = UniBlock(({ className, title, calcSource, buttons, footnote, paramsViewSettings, defaultParams, onChange, ...rest }) => {
3301
+ const defaultParamsCals = getDefaultParamsMin(calcSource?.rateRows);
3302
+ const [userInputParams, { field, isDirty }] = useForm({
3303
+ moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
3304
+ monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
3305
+ isAnnuity: Boolean(defaultParams?.isAnnuity),
3306
+ isInsurance: Boolean(defaultParams?.isEnableInsurance),
3307
+ isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
3308
+ isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
3309
+ isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
3310
+ });
3311
+ useEffect(() => {
3312
+ isDirty && onChange?.(userInputParams);
3313
+ }, [userInputParams, isDirty]);
3314
+ const calcParams = getCreditCalculatorParams(userInputParams, calcSource, paramsViewSettings);
3315
+ const paymentTypeElement = renderPaymentType({
3316
+ title: 'Тип платежа',
3317
+ orientation: 'vertical',
3318
+ ...field('isAnnuity'),
3319
+ });
3320
+ const { onChange: setMoneyValue } = field('moneyValue');
3321
+ const { onChange: setMonthsValue } = field('monthsValue');
3322
+ useEffect(() => {
3323
+ setMoneyValue &&
3324
+ setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
3325
+ }, [calcParams.minSum, calcParams.maxSum]);
3326
+ useEffect(() => {
3327
+ setMonthsValue &&
3328
+ setMonthsValue(clamp(userInputParams.monthsValue, calcParams.minMonths, calcParams.maxMonths));
3329
+ }, [calcParams.minMonths, calcParams.maxMonths]);
3330
+ useEffect(() => {
3331
+ if (!isDefaultParams(defaultParams) && defaultParamsCals) {
3332
+ setDefaultParamsCalc({
3333
+ field,
3334
+ defParams: defaultParamsCals,
3335
+ calcParams,
3336
+ map: MAP$1,
3337
+ monthsValue: 'minMonths',
3338
+ });
3339
+ }
3340
+ }, [calcSource, defaultParams]);
3341
+ return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
3342
+ title: 'Сумма кредита, ₽',
3343
+ step: 500,
3344
+ min: calcParams.minSum,
3345
+ max: calcParams.maxSum,
3346
+ ...field('moneyValue'),
3347
+ value: calcParams.moneyValue,
3348
+ }), renderMonthsInput({
3349
+ title: 'Срок кредита, месяцев',
3350
+ min: calcParams.minMonths,
3351
+ max: calcParams.maxMonths,
3352
+ ...field('monthsValue'),
3353
+ value: calcParams.monthsValue,
3354
+ }), renderCreditParamsForm$1({ ...calcParams, ...paramsViewSettings }, field), jsx("div", { className: "sm:hidden", children: paymentTypeElement })] }), jsxs("div", { className: style(CalculatorStyle.result, '@4xl:w-1/2'), children: [jsx(CalculatorValue, { title: "\u041F\u043E\u043B\u043D\u0430\u044F \u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: calcSource?.totalLoanCost }), jsx(CalculatorValue, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: calcParams?.rate, fractionDigits: 2, postfix: "%" }), jsx(CalculatorValue, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calcParams.monthlyPayment, postfix: "\u20BD" }), jsx("div", { className: "hidden sm:block mb-lg", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
3355
+ });
3356
+ const renderCreditParamsForm$1 = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
3357
+
3358
+ const PARAMS_MAP = {
3359
+ moneyValue: 'sum',
3360
+ monthsValue: 'period',
3361
+ isInsurance: 'isEnableInsurance',
3362
+ isPensionClient: 'isEnablePensionClient',
3363
+ isStateEmployee: 'isEnableStateEmployee',
3364
+ isSalaryClient: 'isEnableSalaryClient',
3365
+ isAnnuity: 'isAnnuity',
3366
+ };
3367
+ const defaultValueAdapter = (value, isInverse = false) => {
3368
+ const keysMap = isInverse ? swap(PARAMS_MAP) : PARAMS_MAP;
3369
+ return Object.fromEntries(Object.entries(value ?? {}).map(([k, v]) => [keysMap[k], v]));
3370
+ };
3371
+ const swap = (_) => Object.fromEntries(Object.entries(_).map(([k, v]) => [v, k]));
3372
+
3373
+ const FIELD_NAME$9 = 'calculator';
3374
+ const CreditCalcField = JSX(({ field, params }) => {
3375
+ const handleChange = useCallback((_) => {
3376
+ field(FIELD_NAME$9).onChange?.(_);
3377
+ }, []);
3378
+ return (jsx(CalculatorCredit, { ...params?.calcData, defaultParams: defaultValueAdapter(field(FIELD_NAME$9).value), onChange: handleChange }));
3379
+ });
3380
+
3381
+ const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
3382
+ вкладчиком с долей участия более 20% уставного капитала руководителем,
3383
+ которого Вы являетесь, кредит в АО «Россельхозбанк»`;
3384
+ const CreditInRshbCdField = JSX(({ field, input }) => {
3385
+ const { data: creditInRshbCd } = useLeadFormData('CREDIT_IN_RSHB');
3386
+ return (jsx(SelectField, { field: field, source: creditInRshbCd, label: LABEL_TEXT, fieldName: "creditInRshbCd", input: input }));
3387
+ });
3388
+
3389
+ const RadioButtonGroupControl = JSX(({ className, label, onChange, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), onChange: (_) => onChange && onChange(_), ...rest }), renderErrorText(error)] })));
3390
+
3391
+ const CURRENCY_TYPES = [{ id: 'rub', text: 'Рубль' }];
3392
+ const CurrencyField = JSX(({ field, input }) => {
3393
+ const { value, onChange } = field('currency');
3394
+ return (jsx(RadioButtonGroupControl, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", orientation: "horizontal", items: CURRENCY_TYPES, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('currency'), validatorObj.currency, input?.required) }));
3395
+ });
3396
+
3397
+ const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...getValidation(field('deliveryDate'), validatorObj.deliveryDate, input?.required) })));
3398
+
3399
+ const DependentsField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", isInteger: true, maxLength: 2, ...getValidation(field('dependents'), validatorObj.dependents, input?.required), ...input })));
3400
+
3401
+ const DesiredMeetingDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0438", ...getValidation(field('desiredMeetingDate'), validatorObj.meetingDay, input?.required) })));
3402
+
3403
+ const DisablePeopleFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u0438\u043D\u0432\u0430\u043B\u0438\u0434\u043E\u043C", ...getValidation(field('disablePeopleFlg'), validatorObj.disablePeopleFlg, input?.required) })));
3404
+
3405
+ const FIELD_NAME$8 = 'dulIssueDateField';
3406
+ const DulIssueDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0432\u044B\u0434\u0430\u0447\u0438", ...getValidation(field(FIELD_NAME$8), validatorObj.dulIssueDateField, input?.required), disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$8) })));
3407
+
3408
+ const FIELD_NAME$7 = 'dulIssuedBy';
3409
+ const DulIssuedByField = JSX(({ field, input }) => {
3410
+ const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } = field('dulSubdivisionCode');
3411
+ const onDaDataChange = useCallback((item) => {
3412
+ changeDulSubdivisionCode?.(item?.data?.code?.replace('-', ''));
3413
+ }, []);
3414
+ return (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$7), label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field(FIELD_NAME$7), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
3415
+ });
3416
+
3417
+ const FIELD_NAME$6 = 'dulNumber';
3418
+ const DulNumberField = JSX(({ field, input }) => (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$6), label: "\u041D\u043E\u043C\u0435\u0440 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", isInteger: true, maxLength: 6, ...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required) })));
3419
+
3420
+ const FIELD_NAME$5 = 'dulSerie';
3421
+ const DulSerieField = JSX(({ field, input }) => (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$5), label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", isInteger: true, maxLength: 4, ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
3422
+
3423
+ const FIELD_NAME$4 = 'dulSubdivisionCode';
3424
+ const DulSubdivisionCodeField = JSX(({ field, input }) => {
3425
+ const onDaDataChange = useCallback((item) => {
3426
+ field?.('dulIssuedBy')?.onChange?.(item?.data?.name);
3427
+ }, []);
3428
+ return (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$4), label: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F", isInteger: true, maxLength: 6, ...input, ...getValidation(field(FIELD_NAME$4), validatorObj.dulSubdivisionCode, input?.required), onDaDataChange: onDaDataChange }));
3158
3429
  });
3159
3430
 
3160
3431
  const EducationField = JSX(({ field, input }) => {
@@ -3329,11 +3600,10 @@
3329
3600
  return (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest }));
3330
3601
  });
3331
3602
 
3332
- const getPaymentSystems = async () => {
3333
- const response = await doRequest('/public-data/creditProgramConditions', 'POST', {
3334
- creditProgramId: 13,
3603
+ const getPaymentSystems = async (creditProgramId) => {
3604
+ const data = await fetchRetailJSON('/public-data/creditProgramConditions', 'POST', {
3605
+ creditProgramId,
3335
3606
  });
3336
- const data = await response?.json();
3337
3607
  return (data?.paymentSystems?.map((paymentSystem) => ({
3338
3608
  id: paymentSystem.type,
3339
3609
  text: paymentSystem.name,
@@ -3342,12 +3612,15 @@
3342
3612
 
3343
3613
  const PaymentSystemField = JSX(({ field, input }) => {
3344
3614
  const { value, onChange } = field('paymentSystem');
3615
+ const [programId] = useLocalStorage('programId');
3345
3616
  const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
3346
3617
  useEffect(() => {
3347
- (async () => {
3348
- const fetchedPaymentSystems = await getPaymentSystems();
3349
- setPaymentSystemOptions(fetchedPaymentSystems || []);
3350
- })();
3618
+ if (programId) {
3619
+ (async () => {
3620
+ const fetchedPaymentSystems = await getPaymentSystems(programId);
3621
+ setPaymentSystemOptions(fetchedPaymentSystems || []);
3622
+ })();
3623
+ }
3351
3624
  }, []);
3352
3625
  return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: paymentSystemOptions, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required) }));
3353
3626
  });
@@ -3393,6 +3666,9 @@
3393
3666
  const ProductField = JSX(({ field, source }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: arrayToOptions(source?.productList), ...withValidator(field('product'), validatorObj.product) })));
3394
3667
  const arrayToOptions = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
3395
3668
 
3669
+ const OUT_SERVICE_URL = `${API_BASE_URI}/outservice/outserviceregions`;
3670
+ const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
3671
+
3396
3672
  const REGIONS_URL = `${API_BASE_URI}/regions`;
3397
3673
  const EMPTY_REGIONS = [];
3398
3674
  // TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
@@ -3401,7 +3677,8 @@
3401
3677
  return Array.isArray(data) ? data : EMPTY_REGIONS;
3402
3678
  }
3403
3679
 
3404
- const RegionField = JSX(({ field, input, url }) => {
3680
+ const RegionField = JSX(({ field, input, params }) => {
3681
+ const url = getRegionUrl(params?.typeForm);
3405
3682
  const regions = useRegions(url);
3406
3683
  return (jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...getValidation(field('region'), validatorObj.region, input?.required) }));
3407
3684
  });
@@ -3513,8 +3790,8 @@
3513
3790
  const PRODUCT_REF = {
3514
3791
  $ref: '/wcms-resources/outservice-productlist.json',
3515
3792
  };
3516
- const getField = (field, typeForm = '') => (input, i) => {
3517
- const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
3793
+ const getField = (field, params) => (input, i) => {
3794
+ const isPremium = params?.typeForm === 'ULTRASERVICE' || params?.typeForm === 'PREMIUMSERVICE';
3518
3795
  const InputsMap = {
3519
3796
  surname: jsx(SurnameField, { field: field, input: input }),
3520
3797
  name: jsx(NameField, { field: field, input: input }),
@@ -3564,7 +3841,7 @@
3564
3841
  consentInformFlg: jsx(ConsentField, { field: field, input: input }),
3565
3842
  consentPfrFlg: jsx(ConsentField, { field: field, input: input }),
3566
3843
  applicationDate: (jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })),
3567
- region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input, url: getRegionUrl(typeForm) })),
3844
+ region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input, params: params })),
3568
3845
  education: jsx(EducationField, { field: field, input: input }),
3569
3846
  housing: jsx(HousingField, { field: field, input: input }),
3570
3847
  employment: jsx(EmploymentField, { field: field, input: input }),
@@ -3611,6 +3888,7 @@
3611
3888
  confirmationIncome: jsx(ConfirmationIncomeField, { field: field, input: input }),
3612
3889
  methodObtain: jsx(MethodObtainField, { field: field, input: input }),
3613
3890
  deliveryDate: jsx(DeliveryDateFiels, { field: field, input: input }),
3891
+ calculator: jsx(CreditCalcField, { field: field, params: params }),
3614
3892
  };
3615
3893
  return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name || ''] }, String(i))) : null;
3616
3894
  };
@@ -3759,7 +4037,7 @@
3759
4037
  reset();
3760
4038
  }
3761
4039
  }, [responseType]);
3762
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
4040
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm }))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
3763
4041
  });
3764
4042
  const getFilteredInputs = (inputs, data) => inputs
3765
4043
  .filter((_) => (_?.name === 'secondaryPhone' ? Boolean(data.secondaryPhone) : _))
@@ -3769,15 +4047,6 @@
3769
4047
  return _ === (dataValue?.key ?? dataValue);
3770
4048
  }));
3771
4049
 
3772
- function useLocalStorage(key) {
3773
- const [storedValue, setStoredValue] = useState(JSON.parse(globalThis.localStorage?.getItem(key) || 'null'));
3774
- const setValue = useCallback((value) => {
3775
- globalThis.localStorage?.setItem(key, JSON.stringify(value));
3776
- setStoredValue(value);
3777
- }, [key, globalThis.localStorage]);
3778
- return [storedValue, setValue];
3779
- }
3780
-
3781
4050
  const CONSENT_ALL_DOCS_TEXT = 'Согласие на все документы';
3782
4051
  const CONSENT_REQUIRED = 'Отметьте все обязательные соглашения';
3783
4052
  const GroupedConsents = JSX(({ inputs = [], typeForm = '', field, key }) => {
@@ -3791,20 +4060,19 @@
3791
4060
  const hasValidationErrors = useMemo(() => inputs
3792
4061
  ?.filter((_) => _.required)
3793
4062
  ?.some((_) => Boolean(withValidator(field(_?.name), validatorObj[_?.name]).error)), [inputs]);
3794
- return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, typeForm)) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
4063
+ return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, { typeForm })) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
3795
4064
  });
3796
4065
  const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", type: "button", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
3797
4066
 
3798
4067
  const renderInputs$2 = ({ field, typeForm = '', inputs }) => {
3799
4068
  const { consentInputs, restInputs } = splitInputs(inputs || []);
3800
- return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
4069
+ return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, { typeForm })), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, { typeForm })));
3801
4070
  };
3802
4071
  const splitInputs = (inputs) => ({
3803
4072
  consentInputs: inputs?.filter((_) => Object.keys(CONSENTS).includes(_.name || '')) || [],
3804
4073
  restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name || '')) || [],
3805
4074
  });
3806
4075
 
3807
- /* eslint-disable max-lines */
3808
4076
  const initialFormState = {
3809
4077
  typeForm: '',
3810
4078
  region: { key: '', text: '' },
@@ -3866,19 +4134,19 @@
3866
4134
 
3867
4135
  const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
3868
4136
 
3869
- const updateUserProfile = (body) => fetchRetailJSON('/user-data/updateUserProfile', 'PUT', body);
4137
+ const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
3870
4138
 
3871
- const updateUserTask = (body) => fetchRetailJSON('/user-data/updateUserTask', 'PUT', body);
4139
+ const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
3872
4140
 
3873
4141
  const getUpdateUserProfileData = (profileId, formData) => {
3874
- const { name = '', surname = '', middleName = '', birthday = '', phone = '', email = '', processPersonalDataFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
4142
+ const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', processPersonalDataFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
3875
4143
  return {
3876
4144
  profile: {
3877
4145
  id: profileId,
3878
4146
  name,
3879
4147
  surname,
3880
4148
  midname: middleName,
3881
- birthDate: birthday && formatDate(birthday, true),
4149
+ birthDate: limitedBirthday && formatDate(limitedBirthday, true),
3882
4150
  email,
3883
4151
  phone: formatPhone(phone),
3884
4152
  processPersonalDataFlg: Boolean(processPersonalDataFlg),
@@ -4159,16 +4427,21 @@
4159
4427
  const { open, close } = useDialogManager();
4160
4428
  const verifyPhoneDialog = useVerifyPhoneDialog();
4161
4429
  const handleSuccessVerify = (profileId) => async (smsCode) => {
4162
- if (profileId) {
4163
- await updateUserProfile({
4164
- profile: {
4165
- id: profileId,
4166
- consentBkiFlg: true,
4167
- smsConsentBki: smsCode,
4168
- },
4169
- });
4430
+ try {
4431
+ if (profileId) {
4432
+ await updateUserProfile({
4433
+ profile: {
4434
+ id: profileId,
4435
+ consentBkiFlg: true,
4436
+ smsConsentBki: smsCode,
4437
+ },
4438
+ });
4439
+ }
4440
+ onClose();
4441
+ }
4442
+ catch (ex) {
4443
+ console.log(ex);
4170
4444
  }
4171
- onClose();
4172
4445
  };
4173
4446
  const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
4174
4447
  close();
@@ -4324,13 +4597,15 @@
4324
4597
  const [, setTaskId] = useLocalStorage('taskId');
4325
4598
  const [, setProfileId] = useLocalStorage('profileId');
4326
4599
  const [, setParticipantId] = useLocalStorage('participantId');
4600
+ const [, setProgramId] = useLocalStorage('programId');
4327
4601
  const esiaLoginDialog = useEsiaLoginDialog(nextStepLink);
4328
4602
  const consentBkiDialog = useConsentBkiDialog(esiaLoginDialog.open);
4329
4603
  const verifyPhoneDialog = useVerifyPhoneDialog();
4330
- const saveUserData = useCallback((participantId, taskId, profileId) => {
4604
+ const saveUserData = useCallback(({ participantId, taskId, profileId, programId: programNumber }) => {
4331
4605
  setParticipantId(participantId);
4332
4606
  setTaskId(taskId);
4333
4607
  setProfileId(profileId);
4608
+ setProgramId(programNumber);
4334
4609
  }, []);
4335
4610
  // eslint-disable-next-line consistent-return
4336
4611
  const handleSubmit = useCallback(async (formData) => {
@@ -4381,13 +4656,18 @@
4381
4656
  profileId,
4382
4657
  programId,
4383
4658
  });
4384
- await updateUserTask(getLeadFormTaskData({
4385
- participantId,
4386
- taskId,
4387
- profileId,
4388
- formData: transformedForm,
4389
- }));
4390
- saveUserData(participantId, taskId, profileId);
4659
+ try {
4660
+ await updateUserTask(getLeadFormTaskData({
4661
+ participantId,
4662
+ taskId,
4663
+ profileId,
4664
+ formData: transformedForm,
4665
+ }));
4666
+ }
4667
+ catch (ex) {
4668
+ console.log(ex);
4669
+ }
4670
+ saveUserData({ participantId, taskId, profileId, programId });
4391
4671
  saveForm(formData);
4392
4672
  };
4393
4673
  const verifyPhoneContent = (phone, consents) => ({
@@ -4644,13 +4924,6 @@
4644
4924
 
4645
4925
  const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
4646
4926
 
4647
- const defaultDiscriminator = (_) => _;
4648
- const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
4649
- const max = maxBy();
4650
-
4651
- const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
4652
- const min = minBy();
4653
-
4654
4927
  const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
4655
4928
  const scrollBy = (container) => (itemCount, delta) => {
4656
4929
  container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
@@ -5004,39 +5277,12 @@
5004
5277
  return (jsx(BlockWrapper, { className: style('!bg-transparent', alignStyle, className), defaultPadding: "p-0", ...rest, children: renderButtonsSection(buttons) }));
5005
5278
  });
5006
5279
 
5007
- const CalculatorLayout = JSX(({ className, title, children, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-xl', className), defaultPadding: "p-4xl", ...rest, children: [title ? jsx(Heading, { className: "text-center", title: title }) : null, children] })));
5008
-
5009
- const CalculatorStyle = {
5010
- wrapper: 'flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl',
5011
- input: 'flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl',
5012
- result: 'flex flex-col gap-y-xl min-w-52',
5013
- };
5014
-
5015
- const FormatValue = JSX(({ value, fractionDigits, fixed, prefix, postfix }) => (jsx(Text, { size: "text-h3", children: typeof value === 'number'
5016
- ? [prefix, toLocalNumberFormat(fractionDigits, { fixed })(value), postfix]
5017
- .filter(Boolean)
5018
- .join(' ')
5019
- : value })));
5020
-
5021
- const CalculatorValueStyle = 'flex justify-between @xl:flex-col';
5022
- const CalculatorValue = JSX(({ className, title, value, color = 'text-secondary-text', ...rest }) => (jsxs("div", { className: style(CalculatorValueStyle, className), children: [title ? (jsx(Text, { size: "text-l", font: "font-light", color: color, children: title })) : null, value ? jsx(FormatValue, { value: value, ...rest }) : jsx(Text, { size: "text-h3", children: "-" })] })));
5023
-
5024
- const renderFootnote = (text, key) => text ? (jsx(Paragraph, { size: "text-xs", font: "font-light", color: "text-secondary-text", children: text }, String(key))) : null;
5025
-
5026
5280
  const Rate = JSX(({ rate = 0, title = 'Ставка', unit, fractionDigits = 2, depositeName, isShowDepositeName, color = 'text-secondary-text', }) => (jsxs("div", { children: [jsx(Text, { size: "text-l", font: "font-light", color: color, children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex @xl:justify-center gradient-color-text", children: [jsx("span", { className: "font-mohave text-title-huge -mt-m tracking-[-15px]", children: toLocalNumberFormat(fractionDigits, { fixed: true })(rate) }), unit ? jsx("span", { className: "text-7xl mt-5", children: unit }) : null] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-2 w-full text-left whitespace-nowrap", children: depositeName })) : null] })] })));
5027
5281
 
5028
5282
  const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { className: "space-y-s min-w-96", children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsx(Icon, { className: "w-10 h-auto lg:w-40", name: "PercentIcon" }), jsx("div", { className: "w-64", children: jsx(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: "\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430, \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B" }) })] })));
5029
5283
 
5030
5284
  const renderRate = ({ title = 'Ставка', rate = 0, unit = '%', fractionDigits = 2, color = 'text-secondary-text', children, ...rest }) => rate ? (jsxs("div", { className: "flex flex-col", children: [jsx("div", { className: "hidden lg:block min-w-96", children: jsx(Rate, { title: title, rate: rate, unit: unit, fractionDigits: fractionDigits, color: color, ...rest }) }), jsx(CalculatorValue, { className: "lg:hidden", title: title, value: rate, postfix: unit, fractionDigits: fractionDigits, fixed: true, color: color, ...rest }), children] })) : (jsx(UnknownRate, { title: title, ...rest }));
5031
5285
 
5032
- const DEFAULT_MONEY_STEP = 1000;
5033
- const renderWantedSumInput = ({ isShowItems = true, step = DEFAULT_MONEY_STEP, postfix = '₽', ...rest }) => (jsx(InputRange, { items: isShowItems
5034
- ? [
5035
- `От ${toLocalNumberFormat(1)(rest.min || 0)} ${postfix}`,
5036
- `До ${toLocalNumberFormat(1)(rest.max || 0)} ${postfix}`,
5037
- ]
5038
- : [], step: step, ...rest }));
5039
-
5040
5286
  const DEFAULT_BONUS_CALCULATOR_PARAMS$1 = {
5041
5287
  minSumTravel: 6000,
5042
5288
  maxSumTravel: 200000,
@@ -5049,13 +5295,13 @@
5049
5295
  travelBonusRate: 0.015,
5050
5296
  restBonusRate: 0.01,
5051
5297
  };
5052
- const MONTHS_IN_YEAR$1 = 12;
5298
+ const MONTHS_IN_YEAR = 12;
5053
5299
  const getBonus = (params, bonusTravelValue, bonusOtherValue) => {
5054
5300
  const { maxBonus = 5000, prefMonthsNum = DEFAULT_BONUS_CALCULATOR_PARAMS$1.prefMonthsNum, prefTravelBonusRate = DEFAULT_BONUS_CALCULATOR_PARAMS$1.prefTravelBonusRate, prefRestBonusRate = 0.01, travelBonusRate = 0.015, restBonusRate = 0.01, } = params;
5055
5301
  const prefBonus = Math.min(Math.round(prefTravelBonusRate * bonusTravelValue) +
5056
5302
  Math.round(prefRestBonusRate * bonusOtherValue), maxBonus);
5057
5303
  const bonus = Math.min(Math.round(travelBonusRate * bonusTravelValue) + Math.round(restBonusRate * bonusOtherValue), maxBonus);
5058
- const yearBonus = prefBonus * prefMonthsNum + bonus * (MONTHS_IN_YEAR$1 - prefMonthsNum);
5304
+ const yearBonus = prefBonus * prefMonthsNum + bonus * (MONTHS_IN_YEAR - prefMonthsNum);
5059
5305
  return [prefBonus, yearBonus];
5060
5306
  };
5061
5307
 
@@ -5111,29 +5357,14 @@
5111
5357
  fractionDigits: 0,
5112
5358
  unit: '',
5113
5359
  color: 'text-primary-text',
5114
- })
5115
- : null }), jsxs("div", { className: CalculatorStyle.result, children: [yearBonus >= 0 ? (jsx(CalculatorValue, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus, color: "text-primary-text" })) : null, renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
5116
- });
5117
-
5118
- const MONTHS_IN_YEAR = 12;
5119
- const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR * 100;
5120
- const DEFAULT_MIN_MONTHS = 1;
5121
- const DEFAULT_MAX_MONTHS = 60;
5122
- const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
5123
-
5124
- const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
5125
- const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
5126
- defaultParams.period >= DEFAULT_MIN_MONTHS &&
5127
- defaultParams.period <= DEFAULT_MAX_MONTHS
5128
- ? defaultParams.period
5129
- : defaultMonth;
5360
+ })
5361
+ : null }), jsxs("div", { className: CalculatorStyle.result, children: [yearBonus >= 0 ? (jsx(CalculatorValue, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus, color: "text-primary-text" })) : null, renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
5362
+ });
5130
5363
 
5131
5364
  const STEP_DAYS = 1;
5132
5365
  const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
5133
5366
  const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
5134
5367
 
5135
- const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, value: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id), ...rest })] }));
5136
-
5137
5368
  const renderPayout = (props) => renderBinaryRadioButtonGroup({
5138
5369
  ...props,
5139
5370
  items: [
@@ -5145,22 +5376,6 @@
5145
5376
  const CAPITALIZATION = ' (c капитализацией)';
5146
5377
  const renderDepositResult = ({ income, finalSum, postfix = '₽', buttons = [], footnotes = [], isCapitalization = false, }) => (jsxs("div", { className: CalculatorStyle.result, children: [jsx(CalculatorValue, { title: `Доход в конце срока${isCapitalization ? CAPITALIZATION : ''}`, value: income, postfix: postfix, prefix: "+" }), jsx(CalculatorValue, { title: `Сумма в конце срока${isCapitalization ? CAPITALIZATION : ''}`, value: finalSum, postfix: postfix }), renderButtonsSection(buttons, { isVertical: true }), footnotes?.map(renderFootnote)] }));
5147
5378
 
5148
- const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
5149
- ? {
5150
- [minKey]: limitParams[minKey],
5151
- [maxKey]: limitParams[maxKey],
5152
- }
5153
- : getRangeByKeys([minKey, maxKey], rateRows);
5154
- const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
5155
- [minKey]: rows.length
5156
- ? min(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[minKey]))
5157
- : 0,
5158
- [maxKey]: rows.length
5159
- ? max(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[maxKey]))
5160
- : 0,
5161
- });
5162
- const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
5163
-
5164
5379
  const DEPOSIT_RATES_SERVICE_MAP = {
5165
5380
  UL: 'businessdepositrates',
5166
5381
  IP: 'selfemployeddepositrates',
@@ -5170,320 +5385,104 @@
5170
5385
  const { data } = useAsyncData(serviceName ? `${API_BASE_URI}/depositrates/${serviceName}` : null, fetchJSONUnsafe);
5171
5386
  return Array.isArray(data) ? data : [];
5172
5387
  }
5173
-
5174
- const BUSINESS_MIN_DAYS = 1;
5175
- const BUSINESS_MAX_DAYS = 1095;
5176
- const BUSINESS_OPERATING_MIN_DAYS = 90;
5177
- const BUSINESS_OPERATING_MAX_DAYS = 730;
5178
- const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
5179
- minSum: 1000,
5180
- maxSum: 100000001,
5181
- minDays: BUSINESS_MIN_DAYS,
5182
- maxDays: BUSINESS_MAX_DAYS,
5183
- rate: 0,
5184
- isMonthlyInterestPayment: true,
5185
- isReplenished: false,
5186
- isPartialWithdrawal: false,
5187
- depositeName: "Депозит 'Стабильный'",
5188
- };
5189
- const useBusinessDepositParams = (userInputParams, rateParams) => {
5190
- const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isMonthlyInterestPayment } = userInputParams;
5191
- const isOperatingDeposit = isReplenished || isPartialWithdrawal;
5192
- const isDisabledOperatingDeposit = daysValue < BUSINESS_OPERATING_MIN_DAYS || daysValue > BUSINESS_OPERATING_MAX_DAYS;
5193
- const rateRows = useBusinessDepositRates(rateParams);
5194
- const businessDepositCalculatorSourceBookParams = rateRows?.find((_) => {
5195
- return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
5196
- checkIsOperatingDeposit(isOperatingDeposit, _) &&
5197
- checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
5198
- checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
5199
- }) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
5200
- const { rate } = businessDepositCalculatorSourceBookParams;
5201
- const income = getDepositIncome$1(rate, userInputParams);
5202
- const finalSum = moneyValue + income;
5203
- const sourceBookRows = rateRows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
5204
- return {
5205
- ...businessDepositCalculatorSourceBookParams,
5206
- ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
5207
- ...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
5208
- ...userInputParams,
5209
- isDisabledOperatingDeposit,
5210
- income,
5211
- finalSum,
5212
- };
5213
- };
5214
- const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
5215
- ? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
5216
- : !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
5217
- const getDepositIncome$1 = (rate, userInputParams) => {
5218
- const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
5219
- /*
5220
- Приблизительный расчёт, не учитывающий разницу в количестве дней в месяцах. Месяц принят за 30 дней, год за 365 дней.
5221
- */
5222
- if (isMonthlyInterestPayment) {
5223
- return Math.round(moneyValue * Math.pow((1200 + rate) / 1200, daysValue / 30) - moneyValue);
5224
- }
5225
- else {
5226
- return Math.round((moneyValue * rate * daysValue) / 365 / 100);
5227
- }
5228
- };
5229
-
5230
- const BUSINESS_DEFAULT_SUM = 100000;
5231
- const BUSINESS_DEFAULT_DAYS = 60;
5232
- const CalculatorBusinessDeposit = UniBlock(({ className = '', title, buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, rateParams, ...rest }) => {
5233
- const [userInputParams, { field }] = useForm({
5234
- moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
5235
- daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
5236
- isReplenished: Boolean(defaultParams?.isReplenished),
5237
- isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
5238
- isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
5239
- });
5240
- const calculatorParams = useBusinessDepositParams(userInputParams, rateParams);
5241
- const { income, finalSum, rate, depositeName } = calculatorParams;
5242
- return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
5243
- title: 'Сумма, ₽',
5244
- min: calculatorParams.minSum,
5245
- max: calculatorParams.maxSum,
5246
- ...field('moneyValue'),
5247
- value: calculatorParams.moneyValue,
5248
- }), renderDaysInput({
5249
- title: 'Срок, дней',
5250
- min: calculatorParams.minDays,
5251
- max: calculatorParams.maxDays,
5252
- ...field('daysValue'),
5253
- value: calculatorParams.daysValue,
5254
- }), jsxs("div", { className: "flex flex-col sm:flex-row gap-y-m gap-x-5xl", children: [renderBusinessDepositParamsForm(calculatorParams, field), renderPayout({
5255
- title: 'Выплата процентов',
5256
- orientation: 'vertical',
5257
- ...field('isMonthlyInterestPayment'),
5258
- className: 'sm:flex-col',
5259
- })] })] }), renderRate({
5260
- rate,
5261
- depositeName,
5262
- isShowDepositeName,
5263
- }), renderDepositResult({
5264
- income,
5265
- finalSum,
5266
- buttons,
5267
- footnotes: [footnote, bottomFootnote],
5268
- })] }) }));
5269
- });
5270
- const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { className: "space-y-s", children: [jsx(Text, { color: "text-secondary-text", font: "font-light", children: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B" }), jsxs("div", { className: "flex flex-col gap-y-lg sm:gap-y-s", children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal })] })] }));
5271
-
5272
- const getDefaultParamsMin = (rateRows) => getDefaultParams([(i, acc) => i < acc, (i, prev) => i?.maxSum > prev?.maxSum], rateRows);
5273
- const getDefaultParamsMax = (rateRows = [], isNewClient = false) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)));
5274
- const getDefaultParams = (comparators, rateRows) => {
5275
- if (!rateRows?.length) {
5276
- return undefined;
5277
- }
5278
- const rates = rateRows?.reduce((acc, i) => {
5279
- if (comparators[0](i.rate, acc[0].rate)) {
5280
- return [i];
5281
- }
5282
- else if (i.rate === acc[0].rate) {
5283
- return [...acc, i];
5284
- }
5285
- return acc;
5286
- }, [rateRows[0]]);
5287
- if (rates.length > 1) {
5288
- return rates.reduce((prev, i) => (comparators[1](i, prev) ? i : prev), rates[0]);
5289
- }
5290
- return rates[0];
5291
- };
5292
-
5293
- const STEP_MONTHS = 1;
5294
- const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
5295
- const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
5296
-
5297
- const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
5298
- ...props,
5299
- className: 'sm:flex-col',
5300
- items: [
5301
- { id: 'annuity', text: 'Аннуитетный' },
5302
- { id: 'differential', text: 'Дифференцированный' },
5303
- ],
5304
- });
5305
-
5306
- const setDefaultParamsCalc = ({ field, defParams, calcParams, map, monthsValue = 'maxMonths', }) => {
5307
- Object.entries(map).forEach(([key, value]) => {
5308
- field?.(key)?.onChange?.(defParams?.[value]);
5309
- });
5310
- field?.('monthsValue')?.onChange?.(clamp(defParams?.[monthsValue], calcParams.minMonths, calcParams.maxMonths));
5311
- };
5312
-
5313
- /**
5314
- * Формулы расчёта аннуитетных и дифференцированных платежей:
5315
- * https://finuslugi.ru/potrebitelskie_kredity/stat_annuitetnye_i_differentsirovannye_platezhi
5316
- */
5317
- const getMonthlyPayment = (rate, params) => {
5318
- const { isAnnuity, moneyValue, monthsValue, moneyExtra } = params;
5319
- if (rate === 0) {
5320
- return 0;
5321
- }
5322
- else if (isAnnuity) {
5323
- const i = rate / MONTHLY_INTEREST_RATE; // Используется значение ставки в процентах
5324
- if (moneyExtra) {
5325
- return (moneyValue + moneyExtra) * (i + i / (Math.pow(1 + i, monthsValue) - 1));
5326
- }
5327
- else {
5328
- return moneyValue * (i + i / (Math.pow(1 + i, monthsValue) - 1));
5329
- }
5330
- }
5331
- else {
5332
- return Math.round(moneyValue / monthsValue) + moneyValue * (rate / (MONTHS_IN_YEAR * 100)); // Используется значение ставки (rate) в процентах, делённое на сто.
5333
- }
5334
- };
5335
-
5336
- const DEFAULT_MIN_SUM$2 = 10000;
5337
- const DEFAULT_MAX_SUM$1 = 5000000;
5338
- const DEFAULT_CREDIT_CALCULATOR_PARAMS = {
5339
- minSum: DEFAULT_MIN_SUM$2,
5340
- maxSum: DEFAULT_MAX_SUM$1,
5341
- minMonths: DEFAULT_MIN_MONTHS,
5342
- maxMonths: DEFAULT_MAX_MONTHS,
5343
- rate: 0,
5344
- isSalaryClient: false,
5345
- isPensionClient: false,
5346
- isStateEmployee: false,
5347
- isInsurance: true,
5348
- };
5349
-
5350
- const checkCreditSourceBookRowCommonParams = (props) => checkRowParam$1({
5351
- ...props,
5352
- fieldKey: 'isSalaryClient',
5353
- viewSettingFieldKey: 'isShowSalaryClient',
5354
- }) &&
5355
- checkRowParam$1({
5356
- ...props,
5357
- fieldKey: 'isStateEmployee',
5358
- viewSettingFieldKey: 'isShowStateEmployee',
5359
- }) &&
5360
- checkRowParam$1({
5361
- ...props,
5362
- fieldKey: 'isPensionClient',
5363
- viewSettingFieldKey: 'isShowPensionClient',
5364
- }) &&
5365
- checkRowParam$1({
5366
- ...props,
5367
- fieldKey: 'isInsurance',
5368
- viewSettingFieldKey: 'isShowInsurance',
5369
- });
5370
- const checkRowParam$1 = ({ row, userInputParams, paramsViewSettings, fieldKey, viewSettingFieldKey, }) => {
5371
- const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
5372
- return isExclude || userInputParams[fieldKey] === row[fieldKey];
5373
- };
5374
-
5375
- const getCreditCalculatorLimitParams = ({ limitRows, userInputParams, paramsViewSettings, }) => limitRows?.find((row) => checkCreditSourceBookRowCommonParams({
5376
- row,
5377
- userInputParams,
5378
- paramsViewSettings,
5379
- }));
5380
-
5381
- const getCreditCalculatorRateParams = ({ rateRows = [], userInputParams, paramsViewSettings, moneyValue, monthsValue, }) => rateRows?.find((row) => checkCreditSourceBookRowCommonParams({
5382
- row,
5383
- userInputParams,
5384
- paramsViewSettings,
5385
- }) &&
5386
- checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
5387
- checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
5388
-
5389
- const getCreditCalculatorParams = (userInputParams, calcSource, paramsViewSettings) => {
5390
- const { moneyValue, monthsValue } = userInputParams;
5391
- const rateRows = calcSource?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
5392
- const limitRows = calcSource?.limitRows || [];
5393
- const creditCalculatorSourceBookLimitParams = getCreditCalculatorLimitParams({
5394
- limitRows,
5395
- userInputParams,
5396
- paramsViewSettings,
5397
- });
5398
- const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], creditCalculatorSourceBookLimitParams, rateRows);
5399
- const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], creditCalculatorSourceBookLimitParams, rateRows);
5400
- const creditCalculatorRateParams = getCreditCalculatorRateParams({
5401
- rateRows,
5402
- userInputParams,
5403
- paramsViewSettings,
5404
- moneyValue,
5405
- monthsValue,
5406
- });
5407
- const { rate } = creditCalculatorRateParams;
5408
- const monthlyPayment = getMonthlyPayment(rate, userInputParams);
5388
+
5389
+ const BUSINESS_MIN_DAYS = 1;
5390
+ const BUSINESS_MAX_DAYS = 1095;
5391
+ const BUSINESS_OPERATING_MIN_DAYS = 90;
5392
+ const BUSINESS_OPERATING_MAX_DAYS = 730;
5393
+ const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
5394
+ minSum: 1000,
5395
+ maxSum: 100000001,
5396
+ minDays: BUSINESS_MIN_DAYS,
5397
+ maxDays: BUSINESS_MAX_DAYS,
5398
+ rate: 0,
5399
+ isMonthlyInterestPayment: true,
5400
+ isReplenished: false,
5401
+ isPartialWithdrawal: false,
5402
+ depositeName: "Депозит 'Стабильный'",
5403
+ };
5404
+ const useBusinessDepositParams = (userInputParams, rateParams) => {
5405
+ const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isMonthlyInterestPayment } = userInputParams;
5406
+ const isOperatingDeposit = isReplenished || isPartialWithdrawal;
5407
+ const isDisabledOperatingDeposit = daysValue < BUSINESS_OPERATING_MIN_DAYS || daysValue > BUSINESS_OPERATING_MAX_DAYS;
5408
+ const rateRows = useBusinessDepositRates(rateParams);
5409
+ const businessDepositCalculatorSourceBookParams = rateRows?.find((_) => {
5410
+ return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
5411
+ checkIsOperatingDeposit(isOperatingDeposit, _) &&
5412
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
5413
+ checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
5414
+ }) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
5415
+ const { rate } = businessDepositCalculatorSourceBookParams;
5416
+ const income = getDepositIncome$1(rate, userInputParams);
5417
+ const finalSum = moneyValue + income;
5418
+ const sourceBookRows = rateRows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
5409
5419
  return {
5410
- ...creditCalculatorRateParams,
5420
+ ...businessDepositCalculatorSourceBookParams,
5421
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
5422
+ ...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
5411
5423
  ...userInputParams,
5412
- minSum,
5413
- maxSum,
5414
- minMonths,
5415
- maxMonths,
5416
- moneyValue,
5417
- monthsValue,
5418
- monthlyPayment,
5424
+ isDisabledOperatingDeposit,
5425
+ income,
5426
+ finalSum,
5419
5427
  };
5420
5428
  };
5421
-
5422
- const isDefaultParams = (defaultParams = {}) => Boolean(Object.values(defaultParams).filter((_) => _).length);
5423
-
5424
- const CREDIT_DEFAULT_SUM = 200000;
5425
- const MAP$1 = {
5426
- isSalaryClient: 'isSalaryClient',
5427
- isStateEmployee: 'isStateEmployee',
5428
- isPensionClient: 'isPensionClient',
5429
- isInsurance: 'isInsurance',
5430
- moneyValue: 'maxSum',
5429
+ const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
5430
+ ? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
5431
+ : !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
5432
+ const getDepositIncome$1 = (rate, userInputParams) => {
5433
+ const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
5434
+ /*
5435
+ Приблизительный расчёт, не учитывающий разницу в количестве дней в месяцах. Месяц принят за 30 дней, год за 365 дней.
5436
+ */
5437
+ if (isMonthlyInterestPayment) {
5438
+ return Math.round(moneyValue * Math.pow((1200 + rate) / 1200, daysValue / 30) - moneyValue);
5439
+ }
5440
+ else {
5441
+ return Math.round((moneyValue * rate * daysValue) / 365 / 100);
5442
+ }
5431
5443
  };
5432
- const CalculatorCredit = UniBlock(({ className, title, calcSource, buttons, footnote, paramsViewSettings, defaultParams, registerSubmit, ...rest }) => {
5433
- const defaultParamsCals = getDefaultParamsMin(calcSource?.rateRows);
5434
- const [userInputParams, { field, onSubmit }] = useForm({
5435
- moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
5436
- monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
5437
- isAnnuity: Boolean(defaultParams?.isAnnuity),
5438
- isInsurance: Boolean(defaultParams?.isEnableInsurance),
5439
- isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
5440
- isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
5441
- isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
5442
- });
5443
- registerSubmit?.(onSubmit);
5444
- const calcParams = getCreditCalculatorParams(userInputParams, calcSource, paramsViewSettings);
5445
- const paymentTypeElement = renderPaymentType({
5446
- title: 'Тип платежа',
5447
- orientation: 'vertical',
5448
- ...field('isAnnuity'),
5444
+
5445
+ const BUSINESS_DEFAULT_SUM = 100000;
5446
+ const BUSINESS_DEFAULT_DAYS = 60;
5447
+ const CalculatorBusinessDeposit = UniBlock(({ className = '', title, buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, rateParams, ...rest }) => {
5448
+ const [userInputParams, { field }] = useForm({
5449
+ moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
5450
+ daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
5451
+ isReplenished: Boolean(defaultParams?.isReplenished),
5452
+ isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
5453
+ isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
5449
5454
  });
5450
- const { onChange: setMoneyValue } = field('moneyValue');
5451
- const { onChange: setMonthsValue } = field('monthsValue');
5452
- useEffect(() => {
5453
- setMoneyValue &&
5454
- setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
5455
- }, [calcParams.minSum, calcParams.maxSum]);
5456
- useEffect(() => {
5457
- setMonthsValue &&
5458
- setMonthsValue(clamp(userInputParams.monthsValue, calcParams.minMonths, calcParams.maxMonths));
5459
- }, [calcParams.minMonths, calcParams.maxMonths]);
5460
- useEffect(() => {
5461
- if (!isDefaultParams(defaultParams) && defaultParamsCals) {
5462
- setDefaultParamsCalc({
5463
- field,
5464
- defParams: defaultParamsCals,
5465
- calcParams,
5466
- map: MAP$1,
5467
- monthsValue: 'minMonths',
5468
- });
5469
- }
5470
- }, [calcSource, defaultParams]);
5455
+ const calculatorParams = useBusinessDepositParams(userInputParams, rateParams);
5456
+ const { income, finalSum, rate, depositeName } = calculatorParams;
5471
5457
  return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
5472
- title: 'Сумма кредита, ₽',
5473
- step: 500,
5474
- min: calcParams.minSum,
5475
- max: calcParams.maxSum,
5458
+ title: 'Сумма, ₽',
5459
+ min: calculatorParams.minSum,
5460
+ max: calculatorParams.maxSum,
5476
5461
  ...field('moneyValue'),
5477
- value: calcParams.moneyValue,
5478
- }), renderMonthsInput({
5479
- title: 'Срок кредита, месяцев',
5480
- min: calcParams.minMonths,
5481
- max: calcParams.maxMonths,
5482
- ...field('monthsValue'),
5483
- value: calcParams.monthsValue,
5484
- }), renderCreditParamsForm$1({ ...calcParams, ...paramsViewSettings }, field), jsx("div", { className: "sm:hidden", children: paymentTypeElement })] }), jsxs("div", { className: style(CalculatorStyle.result, '@4xl:w-1/2'), children: [jsx(CalculatorValue, { title: "\u041F\u043E\u043B\u043D\u0430\u044F \u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: calcSource?.totalLoanCost }), jsx(CalculatorValue, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: calcParams?.rate, fractionDigits: 2, postfix: "%" }), jsx(CalculatorValue, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calcParams.monthlyPayment, postfix: "\u20BD" }), jsx("div", { className: "hidden sm:block mb-lg", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
5462
+ value: calculatorParams.moneyValue,
5463
+ }), renderDaysInput({
5464
+ title: 'Срок, дней',
5465
+ min: calculatorParams.minDays,
5466
+ max: calculatorParams.maxDays,
5467
+ ...field('daysValue'),
5468
+ value: calculatorParams.daysValue,
5469
+ }), jsxs("div", { className: "flex flex-col sm:flex-row gap-y-m gap-x-5xl", children: [renderBusinessDepositParamsForm(calculatorParams, field), renderPayout({
5470
+ title: 'Выплата процентов',
5471
+ orientation: 'vertical',
5472
+ ...field('isMonthlyInterestPayment'),
5473
+ className: 'sm:flex-col',
5474
+ })] })] }), renderRate({
5475
+ rate,
5476
+ depositeName,
5477
+ isShowDepositeName,
5478
+ }), renderDepositResult({
5479
+ income,
5480
+ finalSum,
5481
+ buttons,
5482
+ footnotes: [footnote, bottomFootnote],
5483
+ })] }) }));
5485
5484
  });
5486
- const renderCreditParamsForm$1 = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
5485
+ const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { className: "space-y-s", children: [jsx(Text, { color: "text-secondary-text", font: "font-light", children: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B" }), jsxs("div", { className: "flex flex-col gap-y-lg sm:gap-y-s", children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal })] })] }));
5487
5486
 
5488
5487
  const arrayByRange = (start, stop, step = 1) => Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) => stop >= start ? start + index * step : start - index * step);
5489
5488
 
@@ -6137,10 +6136,10 @@
6137
6136
  }
6138
6137
  }), [options?.parent]);
6139
6138
  return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (jsx(Foldable, { renderFoldableSection: () => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isVisible, children: hiddenCells })] })), renderFoldButton: cardCells.length >= visibleCellsCount
6140
- ? renderFoldButton$1(options?.parent, data, isVisible)
6139
+ ? renderFoldButton$2(options?.parent, data, isVisible)
6141
6140
  : null })) : (jsx("div", { children: visibleCells }))] }));
6142
6141
  });
6143
- const renderFoldButton$1 = (parent, data, isUnfolded = false) => () => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
6142
+ const renderFoldButton$2 = (parent, data, isUnfolded = false) => () => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
6144
6143
  if (parent !== undefined) {
6145
6144
  defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
6146
6145
  }
@@ -6202,6 +6201,16 @@
6202
6201
 
6203
6202
  const sendSignalToProcess = (body) => doRequest('/user-data/sendSignalToProcess', 'POST', body);
6204
6203
 
6204
+ const useInterval = (handler, period) => {
6205
+ const timer = useRef(null);
6206
+ const clearTimer = useCallback(() => timer.current && clearInterval(timer.current), []);
6207
+ useEffect(() => {
6208
+ timer.current = setInterval(() => handler(clearTimer), period);
6209
+ return clearTimer;
6210
+ }, [handler, period]);
6211
+ return clearTimer;
6212
+ };
6213
+
6205
6214
  const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black', link }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsxs("div", { className: "", children: [jsx(RichText, { __html: __html }), link?.text ? jsx(LinkButton, { className: "text-primary-main", children: link.text }) : null] })] })));
6206
6215
 
6207
6216
  const TimerCircle = JSX(({ interval = 0, intervalExpireAction = () => null, title, __html }) => {
@@ -6218,7 +6227,9 @@
6218
6227
  } }), jsx("div", { className: "z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m", children: jsx(Timer, { interval: interval, time: time, setTime: setTimeWithHandleExpire }) })] }), __html ? jsx(RichText, { __html: __html }) : null] })] }));
6219
6228
  });
6220
6229
 
6221
- const CreditCardFormStatus = JSX(({ title, description: dsc, infoCard, sectionInfoTitle, sectionInfo, sectionAdditionalTitle, sectionInfoAdditional, buttonText, interval, ...props }) => (jsxs(BlockWrapper, { ...props, children: [jsxs("div", { className: "flex flex-col md:flex-row items-center", children: [jsx(Headline, { headlineVersion: "M", title: title, description: dsc, align: "text-left", padding: "p-xl", className: "w-full" }), interval ? jsx(TimerCircle, { interval: interval }) : null] }), jsx(SectionInfo$1, { title: sectionInfoTitle, items: sectionInfo }), jsx(SectionInfo$1, { title: sectionAdditionalTitle, items: sectionInfoAdditional, countColumns: true }), infoCard?.__html ? (jsx(InfoCard, { __html: infoCard?.__html, icon: infoCard?.icon, link: {
6230
+ const CreditCardFormStatus = JSX(({ title, description: dsc, infoCard, sectionInfoTitle, sectionInfo, sectionAdditionalTitle, sectionInfoAdditional, buttonText, interval, intervalExpireAction = () => {
6231
+ return;
6232
+ }, ...props }) => (jsxs(BlockWrapper, { ...props, children: [jsxs("div", { className: "flex flex-col md:flex-row items-center", children: [jsx(Headline, { headlineVersion: "M", title: title, description: dsc, align: "text-left", padding: "p-xl", className: "w-full" }), interval ? (jsx(TimerCircle, { interval: interval, intervalExpireAction: intervalExpireAction })) : null] }), jsx(SectionInfo$1, { title: sectionInfoTitle, items: sectionInfo }), jsx(SectionInfo$1, { title: sectionAdditionalTitle, items: sectionInfoAdditional, countColumns: true }), infoCard?.__html ? (jsx(InfoCard, { __html: infoCard?.__html, icon: infoCard?.icon, link: {
6222
6233
  text: infoCard?.link?.text,
6223
6234
  } })) : null, buttonText ? (jsx(LinkButton, { href: "/natural", text: buttonText, version: "primary", className: "w-full mt-lg" })) : null] })));
6224
6235
  const SectionInfo$1 = ({ title, items, countColumns = false, }) => {
@@ -6232,9 +6243,9 @@
6232
6243
 
6233
6244
  const FailedStatusContent$1 = JSX(() => (jsx(CreditCardFormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", description: "\u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0411\u0430\u043D\u043A \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0438\u0442\u044C \u0412\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435. \u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0432 \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB.", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
6234
6245
 
6235
- const PendingStatusContent$1 = JSX(() => {
6246
+ const PendingStatusContent$1 = JSX(({ handleExpireTimer }) => {
6236
6247
  const [leadForm] = useLocalStorage('leadForm');
6237
- return (jsx(CreditCardFormStatus, { interval: 300, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
6248
+ return (jsx(CreditCardFormStatus, { interval: 300, intervalExpireAction: handleExpireTimer, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
6238
6249
  {
6239
6250
  label: 'Название продукта',
6240
6251
  description: 'Кредитная карта',
@@ -6304,20 +6315,21 @@
6304
6315
  await sendSignalToProcess({ signalType, taskId });
6305
6316
  }
6306
6317
  })();
6307
- const trackStatus = useCallback(async () => {
6308
- const res = await getTaskStatus({ taskId });
6309
- if (res && res?.statusCd !== STATUS_TYPE.process) {
6310
- clearInterval(pullingInterval);
6311
- setStatus(res.statusCd);
6312
- }
6313
- }, []);
6314
- const pullingInterval = setInterval(trackStatus, 30000);
6315
- }, []);
6316
- return renderStatus$1(status);
6318
+ }, [taskId]);
6319
+ const trackStatus = useCallback(async (stopInterval) => {
6320
+ const res = await getTaskStatus({ taskId });
6321
+ if (res && res?.statusCd !== STATUS_TYPE.process) {
6322
+ stopInterval();
6323
+ setStatus(res.statusCd);
6324
+ }
6325
+ }, [taskId]);
6326
+ useInterval(trackStatus, 30000);
6327
+ const handleExpire = () => setStatus(STATUS_TYPE.rework);
6328
+ return renderStatus$1(status, handleExpire);
6317
6329
  });
6318
- const renderStatus$1 = (status) => {
6330
+ const renderStatus$1 = (status, handleExpire) => {
6319
6331
  const statusesMap = {
6320
- IN_PROCESS: jsx(PendingStatusContent$1, {}),
6332
+ IN_PROCESS: jsx(PendingStatusContent$1, { handleExpireTimer: handleExpire }),
6321
6333
  CANCELLED: jsx(FailedStatusContent$1, {}),
6322
6334
  APPROVED: jsx(SuccessStatusContent$1, {}),
6323
6335
  REVISION: jsx(ReworkStatusContent$1, {}),
@@ -6469,12 +6481,12 @@
6469
6481
  : null;
6470
6482
  };
6471
6483
 
6472
- const renderInputs$1 = ({ field, inputs }) => inputs.map(getField(field, ''));
6484
+ const renderInputs$1 = ({ field, inputs, params }) => inputs.map(getField(field, params));
6473
6485
 
6474
- const renderStep$2 = ({ sections, field, step }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
6486
+ const renderStep$2 = ({ sections, field, step, params }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
6475
6487
  const inputs = calculateInputs$1(getValue$3(field))(origInputs, step);
6476
6488
  const filteredInputs = inputs.filter((_) => !checkCondition$1(_, getValue$3(field)));
6477
- return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(filteredInputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`));
6489
+ return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(filteredInputs), renderTitle(title), renderInputs$1({ field, inputs, params })] }, `section-${i}`));
6478
6490
  });
6479
6491
  const getValue$3 = (field) => (name) => field(name)?.value;
6480
6492
 
@@ -6694,11 +6706,7 @@
6694
6706
  const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm }) => {
6695
6707
  const [localStorageData, saveStep] = useLocalStorage('leadForm');
6696
6708
  const initialState = getInitialFormState$1(step, localStorageData);
6697
- const customSubmit = useRef(undefined);
6698
6709
  const inputs = (sections?.flatMap((_) => _?.inputs) || []);
6699
- const registerSubmit = useCallback((submit) => {
6700
- customSubmit.current = submit;
6701
- }, []);
6702
6710
  const { handleSubmit } = useCreditCardFormAPI({
6703
6711
  step,
6704
6712
  inputs,
@@ -6707,16 +6715,9 @@
6707
6715
  finishForm,
6708
6716
  });
6709
6717
  const [, { field, onSubmit }] = useForm(initialState, {
6710
- onSubmit: (formData, ev) => {
6711
- handleSubmit({ ...formData, ...customSubmit.current?.(ev) });
6712
- },
6718
+ onSubmit: handleSubmit,
6713
6719
  });
6714
- return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$2({
6715
- sections,
6716
- field,
6717
- step,
6718
- registerSubmit,
6719
- }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
6720
+ return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
6720
6721
  });
6721
6722
 
6722
6723
  /* eslint-disable max-lines */
@@ -7059,8 +7060,8 @@
7059
7060
  ],
7060
7061
  ];
7061
7062
 
7062
- const WIZARD_STEPS$1 = 6;
7063
- const WIZARD_TITLES$1 = [
7063
+ const STEPS$1 = 6;
7064
+ const TITLES = [
7064
7065
  'Параметры карты',
7065
7066
  'Персональные данные',
7066
7067
  'Данные о трудоустройстве',
@@ -7074,7 +7075,7 @@
7074
7075
  const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
7075
7076
  useEffect(updateRefreshToken, []);
7076
7077
  const handleNextStep = useCallback(() => {
7077
- setStep((_) => Math.min(_ + 1, WIZARD_STEPS$1));
7078
+ setStep((_) => Math.min(_ + 1, STEPS$1));
7078
7079
  scrollToTop();
7079
7080
  }, []);
7080
7081
  const handlePrevStep = useCallback(() => {
@@ -7084,7 +7085,7 @@
7084
7085
  }, []);
7085
7086
  const sections = useMemo(() => stepsSectionsMap$1[step], [step]);
7086
7087
  const [isFormFinished, setIsFormFinished] = useState(false);
7087
- return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: WIZARD_TITLES$1, step: step, totalSteps: WIZARD_STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished }, String(step)) })] }) }));
7088
+ return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished }, String(step)) })] }) }));
7088
7089
  });
7089
7090
 
7090
7091
  const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
@@ -7194,16 +7195,15 @@
7194
7195
  await sendSignalToProcess({ signalType, taskId });
7195
7196
  }
7196
7197
  })();
7197
- const trackStatus = () => taskId &&
7198
- getTaskStatus({ taskId }).then((res) => {
7199
- if (res?.statusCd && res.statusCd !== STATUS_TYPE.process) {
7200
- clearInterval(pullingInterval);
7201
- setStatus(res.statusCd);
7202
- }
7203
- });
7204
- const pullingInterval = setInterval(trackStatus, 30000);
7205
- return () => clearInterval(pullingInterval);
7206
- }, []);
7198
+ }, [taskId]);
7199
+ const trackStatus = useCallback(async (stopInterval) => {
7200
+ const res = await getTaskStatus({ taskId });
7201
+ if (res && res?.statusCd !== STATUS_TYPE.process) {
7202
+ stopInterval();
7203
+ setStatus(res.statusCd);
7204
+ }
7205
+ }, [taskId]);
7206
+ useInterval(trackStatus, 30000);
7207
7207
  const handleExpire = () => setStatus(STATUS_TYPE.rework);
7208
7208
  return renderStatus(status, handleExpire);
7209
7209
  });
@@ -7219,13 +7219,15 @@
7219
7219
 
7220
7220
  const formStateMap = [
7221
7221
  {
7222
- moneyValue: 0,
7223
- monthsValue: 0,
7224
- isAnnuity: false,
7225
- isInsurance: false,
7226
- isSalaryClient: false,
7227
- isPensionClient: false,
7228
- isStateEmployee: false,
7222
+ calculator: {
7223
+ moneyValue: 0,
7224
+ monthsValue: 0,
7225
+ isAnnuity: false,
7226
+ isInsurance: false,
7227
+ isSalaryClient: false,
7228
+ isPensionClient: false,
7229
+ isStateEmployee: false,
7230
+ },
7229
7231
  },
7230
7232
  {
7231
7233
  surname: '',
@@ -7351,11 +7353,11 @@
7351
7353
  : null;
7352
7354
  };
7353
7355
 
7354
- const renderInputs = ({ field, inputs }) => inputs.map(getField(field, ''));
7356
+ const renderInputs = ({ field, inputs, params }) => inputs.map(getField(field, params));
7355
7357
 
7356
- const renderStep$1 = ({ sections, field, step }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
7358
+ const renderStep$1 = ({ sections, field, step, params }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
7357
7359
  const inputs = calculateInputs(getValue$1(field))(origInputs, step);
7358
- return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$1(inputs), renderTitle(title), renderInputs({ field, inputs })] }, `section-${i}`));
7360
+ return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$1(inputs), renderTitle(title), renderInputs({ field, inputs, params })] }, `section-${i}`));
7359
7361
  });
7360
7362
  const getValue$1 = (field) => (name) => field(name)?.value;
7361
7363
 
@@ -7365,6 +7367,19 @@
7365
7367
  return (jsxs("div", { className: 'flex justify-between gap-m', children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
7366
7368
  });
7367
7369
 
7370
+ const PAYMENT_TYPE_DATA = {
7371
+ annuity: { key: 'ANNUITY', value: 'Аннуитетный' },
7372
+ differential: { key: 'DIFFERENTIAL', value: 'Дифференцированный ' },
7373
+ };
7374
+ const getCalcData = (formData) => {
7375
+ const { moneyValue, monthsValue, isAnnuity } = formData?.calculator ?? {};
7376
+ return {
7377
+ loanAmount: moneyValue,
7378
+ creditPeriod: monthsValue,
7379
+ paymentTypeCd: PAYMENT_TYPE_DATA[isAnnuity ? 'annuity' : 'differential'],
7380
+ };
7381
+ };
7382
+
7368
7383
  const getFifthStepData = (formData) => {
7369
7384
  const { addressRetail } = formData;
7370
7385
  return {
@@ -7427,7 +7442,6 @@
7427
7442
  generalSeniority: experience5Years,
7428
7443
  jobsNumber,
7429
7444
  lastWorkDuration: lastJobExperience,
7430
- payrollCardRshbFlg: true,
7431
7445
  positionCd: positionOrganization,
7432
7446
  participantContacts: getParticipantContacts({
7433
7447
  organizationPhone: organizationPhone && formatPhone(organizationPhone),
@@ -7460,16 +7474,11 @@
7460
7474
  };
7461
7475
  };
7462
7476
 
7463
- const PAYMENT_TYPE_DATA = {
7464
- annuity: { key: 'ANNUITY', value: 'Аннуитетный' },
7465
- differential: { key: 'DIFFERENTIAL', value: 'Дифференцированный ' },
7466
- };
7467
7477
  const getZeroStepData = (formData) => {
7468
- const { moneyValue, monthsValue, isAnnuity } = formData;
7478
+ const { isInsurance, isSalaryClient } = formData?.calculator ?? {};
7469
7479
  return {
7470
- loanAmount: moneyValue,
7471
- creditPeriod: monthsValue,
7472
- paymentTypeCd: PAYMENT_TYPE_DATA[isAnnuity ? 'annuity' : 'differential'],
7480
+ payrollCardRshbFlg: isInsurance,
7481
+ consentInsuranceFlg: isSalaryClient,
7473
7482
  };
7474
7483
  };
7475
7484
 
@@ -7495,7 +7504,7 @@
7495
7504
  ...getCurrentStepData(step, formData),
7496
7505
  },
7497
7506
  ],
7498
- ...getZeroStepData(formData),
7507
+ ...getCalcData(formData),
7499
7508
  ...getFifthStepData(formData),
7500
7509
  esiaAccountTypeCd: {
7501
7510
  key: formData?.esiaAccountTypeCd?.key,
@@ -7506,7 +7515,7 @@
7506
7515
  const getCurrentStepData = (step, formData) => {
7507
7516
  switch (step) {
7508
7517
  case 0:
7509
- return {};
7518
+ return getZeroStepData(formData);
7510
7519
  case 1:
7511
7520
  return getFirstStepData(formData);
7512
7521
  case 2:
@@ -7556,14 +7565,12 @@
7556
7565
  };
7557
7566
  const getValue = (formData) => (name) => formData[name];
7558
7567
 
7559
- const CreditFormStep = JSX(({ step, sections, onPrevStep, onNextStep, renderStep = renderStep$1, isFormFinished, finishForm, }) => {
7568
+ const CreditFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm, programsSource }) => {
7560
7569
  const [localStorageData, saveStep] = useLocalStorage('leadForm');
7570
+ const [programId] = useLocalStorage('programId');
7571
+ const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
7561
7572
  const initialState = getInitialFormState(step, localStorageData);
7562
- const customSubmit = useRef(undefined);
7563
7573
  const inputs = (sections?.flatMap((_) => _?.inputs) || []);
7564
- const registerSubmit = useCallback((submit) => {
7565
- customSubmit.current = submit;
7566
- }, []);
7567
7574
  const { handleSubmit } = useCreditFormAPI({
7568
7575
  step,
7569
7576
  inputs,
@@ -7572,18 +7579,24 @@
7572
7579
  finishForm,
7573
7580
  });
7574
7581
  const [, { field, onSubmit }] = useForm(initialState, {
7575
- onSubmit: (formData, ev) => {
7576
- handleSubmit({ ...formData, ...customSubmit.current?.(ev) });
7577
- },
7582
+ onSubmit: handleSubmit,
7578
7583
  });
7579
- return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep({ sections, field, step, registerSubmit }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
7584
+ return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
7580
7585
  });
7581
7586
 
7582
7587
  /* eslint-disable max-lines */
7583
7588
  /* eslint-disable max-len */
7584
7589
  const stepsSectionsMap = [
7585
7590
  [
7586
- // zero step for calculator
7591
+ {
7592
+ columns: 1,
7593
+ inputs: [
7594
+ {
7595
+ fieldType: 'common',
7596
+ name: 'calculator',
7597
+ },
7598
+ ],
7599
+ },
7587
7600
  ],
7588
7601
  [
7589
7602
  {
@@ -7853,8 +7866,8 @@
7853
7866
  ],
7854
7867
  ];
7855
7868
 
7856
- const WIZARD_STEPS = 5;
7857
- const WIZARD_TITLES = [
7869
+ const STEPS = 5;
7870
+ const STEP_TITLES = [
7858
7871
  '',
7859
7872
  'Персональные данные',
7860
7873
  'Данные о трудоустройстве',
@@ -7862,13 +7875,13 @@
7862
7875
  'Дополнительные сведения',
7863
7876
  'Отделение Банка',
7864
7877
  ];
7865
- const CreditForm = JSX(({ className, ...rest }) => {
7878
+ const CreditForm = UniBlock(({ className, programsSource, ...rest }) => {
7866
7879
  const [step, setStep] = useState(0);
7867
7880
  const formContainerRef = useRef(null);
7868
7881
  const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
7869
7882
  useEffect(updateRefreshToken, []);
7870
7883
  const handleNextStep = useCallback(() => {
7871
- setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
7884
+ setStep((_) => Math.min(_ + 1, STEPS));
7872
7885
  scrollToTop();
7873
7886
  }, []);
7874
7887
  const handlePrevStep = useCallback(() => {
@@ -7879,20 +7892,7 @@
7879
7892
  const sections = useMemo(() => stepsSectionsMap[step], [step]);
7880
7893
  const isStartStep = step === 0;
7881
7894
  const [isFormFinished, setIsFormFinished] = useState(false);
7882
- return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: WIZARD_TITLES, step: step, totalSteps: WIZARD_STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished, renderStep: isStartStep
7883
- ? ({ registerSubmit, field }) => (jsx(CalculatorCredit, { ...{
7884
- defaultParams: {
7885
- sum: field('moneyValue').value,
7886
- period: field('monthsValue').value,
7887
- isAnnuity: field('isAnnuity').value,
7888
- },
7889
- title: 'Калькулятор кредита',
7890
- footnote: 'Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.',
7891
- calcSource: {
7892
- $ref: '/wcms-resources/credit-calculator-data.json',
7893
- },
7894
- }, registerSubmit: registerSubmit }))
7895
- : undefined }, String(step)) })] }) }));
7895
+ return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished, programsSource: programsSource }, String(step)) })] }) }));
7896
7896
  });
7897
7897
 
7898
7898
  const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
@@ -9264,6 +9264,8 @@
9264
9264
  return (jsx(BlockWrapper, { className: style('min-h-80', className), padding: "p-0", version: version, ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, defaultPadding: "p-6xl", title: jsx(Heading, { headingType: headingType, title: title, className: style('whitespace-pre-wrap', align) }), rightImage: img, buttons: renderButtonsSection(buttons, { className: 'flex-wrap' }), children: [description ? (jsx(Text, { size: "text-xl", "font-weight": "font-light", children: description })) : null, jsxs("div", { className: style('gap-m', 'flex flex-1 flex-col', 'flex-col items-start @xl:flex-row @xl:items-center'), children: [__html ? jsx(RichText, { __html: __html, itemSize: "list-m" }) : null, jsx(Text, { size: "text-m", "font-weight": "font-light", color: "text-secondary-text", children: additionalDescription }), qr?.src ? (jsx("div", { className: style('flex justify-center bg-white rounded-md @xl:-order-1', containerStyle), children: jsx(Img, { className: "w-fit", image: qr }) })) : null, image?.src ? jsx(Img, { className: "lg:hidden", image: image }) : null] })] }) }));
9265
9265
  });
9266
9266
 
9267
+ const getVersion = (isPrimary, type) => isPrimary && type !== 'underlined' ? 'primary' : 'secondary';
9268
+
9267
9269
  const getBadgeCount = (blocks = [], filter = {}) => blocks.filter(({ content = {} }) => targetMatchPattern(filter, content)).length;
9268
9270
 
9269
9271
  const scalarCmp = (a, b) => a === b;
@@ -9409,6 +9411,63 @@
9409
9411
  childSchema: (content) => content?.filtrationSchema || {},
9410
9412
  });
9411
9413
 
9414
+ const renderButtonsGroup = (data, activeButton, onButtonClick) => {
9415
+ const allButtonVersion = getVersion(activeButton === 'all');
9416
+ const businessButtonVersion = getVersion(activeButton === 'business');
9417
+ const handleClick = (e, key, branches) => {
9418
+ const filteredBranches = e.currentTarget === e.target && key === 'business' ? filterBranches(branches) : branches;
9419
+ onButtonClick(key);
9420
+ return filteredBranches;
9421
+ };
9422
+ const filterBranches = (branches) => branches.filter((branch) => branch.workSchedule &&
9423
+ branch.workSchedule.businessScheduleVisibleTag &&
9424
+ !branch.workSchedule.businessScheduleDescription);
9425
+ return (jsxs("div", { className: "flex gap-lg flex-col sm:flex-row pb-lg", children: [jsx(Button, { "data-id": "all", onClick: (e) => handleClick(e, 'all', data), version: allButtonVersion, children: "\u0414\u043B\u044F \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" }), jsx(Button, { "data-id": "business", onClick: (e) => handleClick(e, 'business', data), version: businessButtonVersion, children: "\u0414\u043B\u044F \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" })] }));
9426
+ };
9427
+
9428
+ const renderDescriptionBlock$1 = ({ __html, list, richVersion }) => __html || list?.length ? (jsxs("div", { className: "mb-2xl border-b sm:border border-main-divider sm:rounded-md", children: [__html ? (jsx("div", { className: "mb-2xl", children: jsx(RichText, { __html: __html, richVersion: richVersion }) })) : null, list?.length ? (jsx("div", { className: "flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
9429
+
9430
+ const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
9431
+ const renderFiltrationForm = ({ filters, field: { field, reset }, onlyOffice, labels, }) => {
9432
+ const visibleFiltersNum = onlyOffice ? 5 : 6;
9433
+ const filtersCheckbox = (filters || []).map((key) => (jsx(Checkbox, { text: labels[key], ...field(key) }, key)));
9434
+ const [visibleFilters, hiddenFilters] = visibleFiltersNum > 0
9435
+ ? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
9436
+ : [filtersCheckbox, []];
9437
+ return (jsx("div", { children: filters?.length ? (jsx("div", { children: jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }), jsx(FoldableSection, { className: COMMON_FILTERS_STYLES, isUnfolded: isUnfolded, children: hiddenFilters })] })), renderFoldButton: renderFoldButton$1(reset, onlyOffice) }) })) : null }));
9438
+ };
9439
+ const renderFoldButton$1 = (reset, onlyOffice = false) => ({ isUnfolded, onToggle }) => {
9440
+ const labels = ['Больше фильтров', 'Меньше фильтров'];
9441
+ const icons = ['ArrowDownIcon', 'ArrowUpIcon'];
9442
+ return (jsxs("div", { className: "flex space-x-lg", children: [onlyOffice ? (jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", appendRight: jsx(Icon, { name: icons[Number(isUnfolded)], width: "16", height: "16" }), text: labels[Number(isUnfolded)], onClick: onToggle })) : null, jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, children: renderBtnInner() })] }));
9443
+ };
9444
+ const renderBtnInner = () => (jsxs("div", { className: "flex items-center", children: ["\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", jsx(Icon, { name: "CloseIcon", width: "16", height: "16", className: "ml-2xs" })] }));
9445
+
9446
+ const renderHeading = (title, lengthItems) => (jsx("div", { className: "flex flex-col sm:flex-row gap-xs mb-2xl", children: jsxs(Heading, { headingType: "h3", children: [jsx("span", { suppressHydrationWarning: true, children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: jsx("span", { suppressHydrationWarning: true, children: ` (${lengthItems})` }) })) : null] }) }));
9447
+
9448
+ const defaultEmptyFunction = () => void 0;
9449
+ const filtersVisibleStyles = (activeButton) => activeButton === 'all' ? 'block' : 'hidden';
9450
+ const OfficesAtmsMapLayout = JSX(({ className, data = [], isLoad, remoteWorkplaces = [], renderCard = defaultEmptyFunction, renderRemoteWorkplaceCard = defaultEmptyFunction, getBalloon = defaultEmptyFunction, getBalloonRemoteWorkplaces = defaultEmptyFunction, descriptionData, title, }) => {
9451
+ const onlyOffice = title?.includes('Офис');
9452
+ const [filtrationState, { field, reset }] = useForm(INITIAL_FILTRATION_STATE$1);
9453
+ const { filteredItems, points, filteredRemoteWorkplaces, lengthItems } = useOfficesAtmsMapData({
9454
+ data,
9455
+ remoteWorkplaces,
9456
+ filtrationState,
9457
+ getBalloon,
9458
+ getBalloonRemoteWorkplaces,
9459
+ });
9460
+ const [activeButton, setActiveButton] = useState('all');
9461
+ const filterOptions = {
9462
+ filters: getFiltersWithNonEmptyData([...data, ...remoteWorkplaces]),
9463
+ field: { field, reset },
9464
+ onlyOffice,
9465
+ labels: FILTRATION_LABELS,
9466
+ };
9467
+ return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [renderHeading(title, lengthItems), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton), jsx("div", { className: style('pb-3xl', filtersVisibleStyles(activeButton)), children: renderFiltrationForm(filterOptions) })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: isLoad, className: "h-full" }) }) })] }), jsxs(ClientOnly, { children: [filteredItems.map(renderCard), filteredRemoteWorkplaces.map(renderRemoteWorkplaceCard)] })] }));
9468
+ });
9469
+ const getFiltersWithNonEmptyData = (data) => Object.keys(INITIAL_FILTRATION_STATE$1).filter((_) => data.filter((item) => FILTRATION_PREDICATES$1[_](item)).length);
9470
+
9412
9471
  const renderAtmCard = ({ location, address, billAcceptorType, terminalType, billAcceptorEnable, atmCode = '', atmAccess = '', workTime, }, i) => {
9413
9472
  const additionalInfo = [
9414
9473
  {
@@ -10326,7 +10385,7 @@
10326
10385
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10327
10386
  });
10328
10387
 
10329
- const packageVersion = "0.14.682";
10388
+ const packageVersion = "0.14.684";
10330
10389
 
10331
10390
  exports.Blocks = Blocks;
10332
10391
  exports.ContentPage = ContentPage;