@redneckz/wildless-cms-uni-blocks 0.14.722 → 0.14.724

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 (148) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +136 -151
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
  5. package/bundle/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
  6. package/bundle/hooks/useRetailFormStore.d.ts +2 -0
  7. package/bundle/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
  8. package/bundle/ui-kit/DraftDialog/utils.d.ts +1 -1
  9. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  10. package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
  11. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  12. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  13. package/dist/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
  14. package/dist/components/CreditCardForm/SuccessStatusCardContent.js +37 -0
  15. package/dist/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
  16. package/dist/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
  17. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  18. package/dist/components/CreditForm/useCreditFormAPI.js +0 -1
  19. package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  20. package/dist/hooks/useRetailFormStore.d.ts +2 -0
  21. package/dist/hooks/useRetailFormStore.js.map +1 -1
  22. package/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
  23. package/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js +5 -3
  24. package/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  25. package/dist/ui-kit/DraftDialog/utils.d.ts +1 -1
  26. package/dist/ui-kit/DraftDialog/utils.js +2 -1
  27. package/dist/ui-kit/DraftDialog/utils.js.map +1 -1
  28. package/dist/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
  29. package/dist/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
  30. package/dist/ui-kit/FormField/Fields/WagesField.js +1 -10
  31. package/dist/ui-kit/FormField/Fields/WagesField.js.map +1 -1
  32. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  33. package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
  34. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  35. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  36. package/lib/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
  37. package/lib/components/CreditCardForm/SuccessStatusCardContent.js +35 -0
  38. package/lib/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
  39. package/lib/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
  40. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  41. package/lib/components/CreditForm/useCreditFormAPI.js +0 -1
  42. package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  43. package/lib/hooks/useRetailFormStore.d.ts +2 -0
  44. package/lib/hooks/useRetailFormStore.js.map +1 -1
  45. package/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
  46. package/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js +3 -2
  47. package/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  48. package/lib/ui-kit/DraftDialog/utils.d.ts +1 -1
  49. package/lib/ui-kit/DraftDialog/utils.js +2 -1
  50. package/lib/ui-kit/DraftDialog/utils.js.map +1 -1
  51. package/lib/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
  52. package/lib/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
  53. package/lib/ui-kit/FormField/Fields/WagesField.js +1 -10
  54. package/lib/ui-kit/FormField/Fields/WagesField.js.map +1 -1
  55. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  56. package/mobile/bundle/bundle.umd.js +136 -151
  57. package/mobile/bundle/bundle.umd.min.js +1 -1
  58. package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
  59. package/mobile/bundle/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
  60. package/mobile/bundle/hooks/useRetailFormStore.d.ts +2 -0
  61. package/mobile/bundle/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
  62. package/mobile/bundle/ui-kit/DraftDialog/utils.d.ts +1 -1
  63. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  64. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
  65. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  66. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  67. package/mobile/dist/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
  68. package/mobile/dist/components/CreditCardForm/SuccessStatusCardContent.js +37 -0
  69. package/mobile/dist/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
  70. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
  71. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  72. package/mobile/dist/components/CreditForm/useCreditFormAPI.js +0 -1
  73. package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  74. package/mobile/dist/hooks/useRetailFormStore.d.ts +2 -0
  75. package/mobile/dist/hooks/useRetailFormStore.js.map +1 -1
  76. package/mobile/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
  77. package/mobile/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js +5 -3
  78. package/mobile/dist/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  79. package/mobile/dist/ui-kit/DraftDialog/utils.d.ts +1 -1
  80. package/mobile/dist/ui-kit/DraftDialog/utils.js +2 -1
  81. package/mobile/dist/ui-kit/DraftDialog/utils.js.map +1 -1
  82. package/mobile/dist/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
  83. package/mobile/dist/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
  84. package/mobile/dist/ui-kit/FormField/Fields/WagesField.js +1 -10
  85. package/mobile/dist/ui-kit/FormField/Fields/WagesField.js.map +1 -1
  86. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  87. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +0 -1
  88. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  89. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  90. package/mobile/lib/components/CreditCardForm/SuccessStatusCardContent.d.ts +1 -0
  91. package/mobile/lib/components/CreditCardForm/SuccessStatusCardContent.js +35 -0
  92. package/mobile/lib/components/CreditCardForm/SuccessStatusCardContent.js.map +1 -0
  93. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +2 -5
  94. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  95. package/mobile/lib/components/CreditForm/useCreditFormAPI.js +0 -1
  96. package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  97. package/mobile/lib/hooks/useRetailFormStore.d.ts +2 -0
  98. package/mobile/lib/hooks/useRetailFormStore.js.map +1 -1
  99. package/mobile/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.d.ts +1 -0
  100. package/mobile/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js +3 -2
  101. package/mobile/lib/services/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  102. package/mobile/lib/ui-kit/DraftDialog/utils.d.ts +1 -1
  103. package/mobile/lib/ui-kit/DraftDialog/utils.js +2 -1
  104. package/mobile/lib/ui-kit/DraftDialog/utils.js.map +1 -1
  105. package/mobile/lib/ui-kit/FormField/Fields/RetirementIncomeField.js +1 -10
  106. package/mobile/lib/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
  107. package/mobile/lib/ui-kit/FormField/Fields/WagesField.js +1 -10
  108. package/mobile/lib/ui-kit/FormField/Fields/WagesField.js.map +1 -1
  109. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  110. package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +0 -1
  111. package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -3
  112. package/mobile/src/components/CreditCardForm/SuccessStatusCardContent.tsx +45 -0
  113. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +2 -5
  114. package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +0 -1
  115. package/mobile/src/hooks/useRetailFormStore.tsx +2 -0
  116. package/mobile/src/services/retail/adaptors/getFamilyStatusAndIncomeData.ts +4 -2
  117. package/mobile/src/ui-kit/DraftDialog/utils.ts +2 -3
  118. package/mobile/src/ui-kit/FormField/Fields/RetirementIncomeField.tsx +9 -25
  119. package/mobile/src/ui-kit/FormField/Fields/WagesField.tsx +9 -25
  120. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +0 -1
  121. package/package.json +1 -1
  122. package/src/components/ApplicationLeadForm/LeadFormState.ts +0 -1
  123. package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -3
  124. package/src/components/CreditCardForm/SuccessStatusCardContent.tsx +45 -0
  125. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +2 -5
  126. package/src/components/CreditForm/useCreditFormAPI.tsx +0 -1
  127. package/src/hooks/useRetailFormStore.tsx +2 -0
  128. package/src/services/retail/adaptors/getFamilyStatusAndIncomeData.ts +4 -2
  129. package/src/ui-kit/DraftDialog/utils.ts +2 -3
  130. package/src/ui-kit/FormField/Fields/RetirementIncomeField.tsx +9 -25
  131. package/src/ui-kit/FormField/Fields/WagesField.tsx +9 -25
  132. package/src/ui-kit/FormField/NameFieldDef.ts +0 -1
  133. package/bundle/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
  134. package/dist/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
  135. package/dist/components/CreditCardForm/SuccessStatusContent.js +0 -32
  136. package/dist/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
  137. package/lib/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
  138. package/lib/components/CreditCardForm/SuccessStatusContent.js +0 -30
  139. package/lib/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
  140. package/mobile/bundle/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
  141. package/mobile/dist/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
  142. package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js +0 -32
  143. package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
  144. package/mobile/lib/components/CreditCardForm/SuccessStatusContent.d.ts +0 -1
  145. package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js +0 -30
  146. package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js.map +0 -1
  147. package/mobile/src/components/CreditCardForm/SuccessStatusContent.tsx +0 -37
  148. package/src/components/CreditCardForm/SuccessStatusContent.tsx +0 -37
@@ -4057,15 +4057,7 @@
4057
4057
  return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: formatRegions, ...getValidation(field('regionRetail'), validatorObj.regionRetail, input?.required) }));
4058
4058
  });
4059
4059
 
4060
- const RetirementIncomeField = JSX(({ field, input }) => {
4061
- const currentWages = field('wages')?.value;
4062
- const onChange = useCallback((_) => {
4063
- const incomesSum = Number(_) + Number(currentWages || 0);
4064
- field('retirementIncome')?.onChange?.(_);
4065
- field('incomeAverage')?.onChange?.(String(incomesSum));
4066
- }, [currentWages]);
4067
- return (jsx(InputControl, { label: "\u041F\u0435\u043D\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required), ...input, onChange: onChange }));
4068
- });
4060
+ const RetirementIncomeField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041F\u0435\u043D\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required), ...input })));
4069
4061
 
4070
4062
  const SecondaryPhoneField = JSX(({ field }) => {
4071
4063
  const fieldPhone = field('secondaryPhone');
@@ -4154,15 +4146,7 @@
4154
4146
  return (jsx("div", { className: "py-m gap-m grid @xl:flex @xl:items-center", children: jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: VED_TYPES, value: value, onChange: (_) => onChange && onChange(_) }) }));
4155
4147
  });
4156
4148
 
4157
- const WagesField = JSX(({ field, input }) => {
4158
- const currentRetirementIncome = field('retirementIncome')?.value;
4159
- const onChange = useCallback((_) => {
4160
- const incomesSum = Number(_) + Number(currentRetirementIncome || 0);
4161
- field('wages')?.onChange?.(_);
4162
- field('incomeAverage')?.onChange?.(String(incomesSum));
4163
- }, [currentRetirementIncome]);
4164
- return (jsx(InputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('wages'), validatorObj.wages, input?.required), ...input, onChange: onChange }));
4165
- });
4149
+ const WagesField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('wages'), validatorObj.wages, input?.required), ...input })));
4166
4150
 
4167
4151
  function isRenderField({ input, field, }) {
4168
4152
  const { condition } = input;
@@ -4792,6 +4776,98 @@
4792
4776
 
4793
4777
  const DraftActionButton = JSX(({ title, icon, description, onClick = noop }) => (jsxs("button", { className: "flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green", type: "button", onClick: onClick, children: [jsx(Img, { image: { icon: icon, iconVersion: 'black' }, width: "78", height: "78" }), jsxs("div", { className: "w-full md:w-auto", children: [jsx(Heading, { className: "text-center md:text-left", title: title, headingType: "h5" }), description ? (jsx(Paragraph, { color: "text-secondary-text", size: "text-m", children: description })) : null] })] })));
4794
4778
 
4779
+ const fieldsNamesToContactKeysMap = {
4780
+ email: 'EMAIL',
4781
+ phone: 'MAIN_PHONE',
4782
+ organizationPhone: 'ORGANIZATION_PHONE',
4783
+ };
4784
+ const fieldsNamesToAddressKeysMap = {
4785
+ addressRegistration: 'REGISTRATION',
4786
+ addressFact: 'RESIDENTAL',
4787
+ organizationAddress: 'WORK',
4788
+ addressCourier: 'DELIVERY',
4789
+ };
4790
+ const fieldsNamesToIncomeKeysMap = {
4791
+ incomeAverage: 'INCOME_AVERAGE',
4792
+ mandatoryPayments: 'MANDATORY_PAYMENTS',
4793
+ additionalIncome: 'ADDITIONAL_INCOME',
4794
+ otherIncome: 'OTHER_INCOME',
4795
+ otherPayments: 'OTHER_PAYMENTS',
4796
+ rentalIncome: 'RENTAL_INCOME',
4797
+ wages: 'WAGES',
4798
+ retirementIncome: 'RETIREMENT_INCOME',
4799
+ };
4800
+ const getParticipantContacts$1 = (fields) => Object.entries(fields).reduce((acc, [key, value]) => {
4801
+ if (key in fieldsNamesToContactKeysMap) {
4802
+ return [
4803
+ ...acc,
4804
+ {
4805
+ contactTypeCd: {
4806
+ key: fieldsNamesToContactKeysMap[key],
4807
+ },
4808
+ value,
4809
+ },
4810
+ ];
4811
+ }
4812
+ return acc;
4813
+ }, []);
4814
+ const getParticipantAddresses$1 = (fields) => Object.entries(fields).reduce((acc, [key, value]) => {
4815
+ if (key in fieldsNamesToAddressKeysMap) {
4816
+ const address = Object.fromEntries(Object.entries(value ?? {})
4817
+ .filter(([k]) => !k.startsWith('qc')) // exclude dadata fields
4818
+ .map(([k, v]) => [k, v ?? '']));
4819
+ return [
4820
+ ...acc,
4821
+ {
4822
+ addressType: {
4823
+ key: fieldsNamesToAddressKeysMap[key],
4824
+ },
4825
+ ...address,
4826
+ },
4827
+ ];
4828
+ }
4829
+ return acc;
4830
+ }, []);
4831
+ const getParticipantIncomes$1 = (fields) => Object.entries(fields).reduce((acc, [key, value]) => {
4832
+ if (key in fieldsNamesToIncomeKeysMap) {
4833
+ return [
4834
+ ...acc,
4835
+ {
4836
+ incomeTypeCd: {
4837
+ key: fieldsNamesToIncomeKeysMap[key],
4838
+ },
4839
+ value: Number(value || 0),
4840
+ },
4841
+ ];
4842
+ }
4843
+ return acc;
4844
+ }, []);
4845
+
4846
+ const getFamilyStatusAndIncomeData = (formData) => {
4847
+ const { familyStatus, dependents, familyMembers, children, confirmationIncome, wages, mandatoryPayments, additionalIncome, otherIncome, otherPayments, rentalIncome, retirementIncome, snils, armyIdFlg, conscription, } = formData;
4848
+ return {
4849
+ maritalStatusCd: familyStatus,
4850
+ totalDependents: familyMembers,
4851
+ incomeCertificateCd: confirmationIncome,
4852
+ otherDependents: dependents,
4853
+ childrenDependents: children,
4854
+ militaryStatusCd: conscription,
4855
+ participantIncomes: getParticipantIncomes$1({
4856
+ wages,
4857
+ mandatoryPayments,
4858
+ incomeAverage: countIncomeAverage(wages, retirementIncome),
4859
+ additionalIncome,
4860
+ otherIncome,
4861
+ otherPayments,
4862
+ rentalIncome,
4863
+ retirementIncome,
4864
+ }),
4865
+ snils: snils?.replaceAll(' ', '').replaceAll('-', ''),
4866
+ armyIdFlg,
4867
+ };
4868
+ };
4869
+ const countIncomeAverage = (wages, retirementIncome) => Number(wages) + Number(retirementIncome);
4870
+
4795
4871
  const creditCodesToProgrammIdMap = {
4796
4872
  credit_cash: '10',
4797
4873
  credit_cash_single_doc: '28',
@@ -4814,15 +4890,15 @@
4814
4890
  ...creditCodesToProgrammIdMap,
4815
4891
  ...cardCodesToProgrammIdMap,
4816
4892
  };
4817
- const getParticipantIncomes$1 = (participantIncomes) => {
4893
+ const getParticipantIncomes = (participantIncomes) => {
4818
4894
  const wages = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "WAGES" /* EIncomesType.WAGES */)?.value;
4819
4895
  const mandatoryPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "MANDATORY_PAYMENTS" /* EIncomesType.MANDATORY_PAYMENTS */)?.value;
4820
- const incomeAverage = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "INCOME_AVERAGE" /* EIncomesType.INCOME_AVERAGE */)?.value;
4821
4896
  const additionalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "ADDITIONAL_INCOME" /* EIncomesType.ADDITIONAL_INCOME */)?.value;
4822
4897
  const otherIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_INCOME" /* EIncomesType.OTHER_INCOME */)?.value;
4823
4898
  const otherPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_PAYMENTS" /* EIncomesType.OTHER_PAYMENTS */)?.value;
4824
4899
  const rentalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RENTAL_INCOME" /* EIncomesType.RENTAL_INCOME */)?.value;
4825
4900
  const retirementIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RETIREMENT_INCOME" /* EIncomesType.RETIREMENT_INCOME */)?.value;
4901
+ const incomeAverage = countIncomeAverage(wages, retirementIncome);
4826
4902
  return {
4827
4903
  wages,
4828
4904
  mandatoryPayments,
@@ -4834,7 +4910,7 @@
4834
4910
  retirementIncome,
4835
4911
  };
4836
4912
  };
4837
- const getParticipantAddresses$1 = (participantAddresses) => {
4913
+ const getParticipantAddresses = (participantAddresses) => {
4838
4914
  const addressRegistration = participantAddresses?.find((address) => address.addressType.key === "REGISTRATION" /* EAddressType.REGISTRATION */);
4839
4915
  const addressFact = participantAddresses?.find((address) => address.addressType.key === "RESIDENTAL" /* EAddressType.RESIDENTAL */);
4840
4916
  const organizationAddress = participantAddresses?.find((address) => address.addressType.key === "WORK" /* EAddressType.WORK */);
@@ -4844,7 +4920,7 @@
4844
4920
  organizationAddress,
4845
4921
  };
4846
4922
  };
4847
- const getParticipantContacts$1 = (participantContacts) => {
4923
+ const getParticipantContacts = (participantContacts) => {
4848
4924
  const email = participantContacts?.find((contact) => contact.contactTypeCd.key === "EMAIL" /* EContactType.EMail */)?.value;
4849
4925
  const phone = participantContacts?.find((contact) => contact.contactTypeCd.key === "MAIN_PHONE" /* EContactType.MainPhone */)?.value;
4850
4926
  const organizationPhone = participantContacts?.find((contact) => contact.contactTypeCd.key === "ORGANIZATION_PHONE" /* EContactType.OrganizationPhone */)?.value;
@@ -4926,9 +5002,9 @@
4926
5002
  monthsValue,
4927
5003
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
4928
5004
  },
4929
- ...getParticipantIncomes$1(participantIncomes),
4930
- ...getParticipantAddresses$1(participantAddresses),
4931
- ...getParticipantContacts$1(participantContacts),
5005
+ ...getParticipantIncomes(participantIncomes),
5006
+ ...getParticipantAddresses(participantAddresses),
5007
+ ...getParticipantContacts(participantContacts),
4932
5008
  ...getParticipantGender(genderCd),
4933
5009
  };
4934
5010
  };
@@ -5013,73 +5089,6 @@
5013
5089
  }, [open, nextStepLink]);
5014
5090
  };
5015
5091
 
5016
- const fieldsNamesToContactKeysMap = {
5017
- email: 'EMAIL',
5018
- phone: 'MAIN_PHONE',
5019
- organizationPhone: 'ORGANIZATION_PHONE',
5020
- };
5021
- const fieldsNamesToAddressKeysMap = {
5022
- addressRegistration: 'REGISTRATION',
5023
- addressFact: 'RESIDENTAL',
5024
- organizationAddress: 'WORK',
5025
- addressCourier: 'DELIVERY',
5026
- };
5027
- const fieldsNamesToIncomeKeysMap = {
5028
- incomeAverage: 'INCOME_AVERAGE',
5029
- mandatoryPayments: 'MANDATORY_PAYMENTS',
5030
- additionalIncome: 'ADDITIONAL_INCOME',
5031
- otherIncome: 'OTHER_INCOME',
5032
- otherPayments: 'OTHER_PAYMENTS',
5033
- rentalIncome: 'RENTAL_INCOME',
5034
- wages: 'WAGES',
5035
- retirementIncome: 'RETIREMENT_INCOME',
5036
- };
5037
- const getParticipantContacts = (fields) => Object.entries(fields).reduce((acc, [key, value]) => {
5038
- if (key in fieldsNamesToContactKeysMap) {
5039
- return [
5040
- ...acc,
5041
- {
5042
- contactTypeCd: {
5043
- key: fieldsNamesToContactKeysMap[key],
5044
- },
5045
- value,
5046
- },
5047
- ];
5048
- }
5049
- return acc;
5050
- }, []);
5051
- const getParticipantAddresses = (fields) => Object.entries(fields).reduce((acc, [key, value]) => {
5052
- if (key in fieldsNamesToAddressKeysMap) {
5053
- const address = Object.fromEntries(Object.entries(value ?? {})
5054
- .filter(([k]) => !k.startsWith('qc')) // exclude dadata fields
5055
- .map(([k, v]) => [k, v ?? '']));
5056
- return [
5057
- ...acc,
5058
- {
5059
- addressType: {
5060
- key: fieldsNamesToAddressKeysMap[key],
5061
- },
5062
- ...address,
5063
- },
5064
- ];
5065
- }
5066
- return acc;
5067
- }, []);
5068
- const getParticipantIncomes = (fields) => Object.entries(fields).reduce((acc, [key, value]) => {
5069
- if (key in fieldsNamesToIncomeKeysMap) {
5070
- return [
5071
- ...acc,
5072
- {
5073
- incomeTypeCd: {
5074
- key: fieldsNamesToIncomeKeysMap[key],
5075
- },
5076
- value: Number(value || 0),
5077
- },
5078
- ];
5079
- }
5080
- return acc;
5081
- }, []);
5082
-
5083
5092
  const getLeadFormTaskData = ({ participantId, taskId, profileId, formData, }) => {
5084
5093
  const { name, surname, middleName, limitedBirthday, phone, email } = formData;
5085
5094
  const navigator = locationNavigator();
@@ -5099,7 +5108,7 @@
5099
5108
  profile: {
5100
5109
  id: profileId,
5101
5110
  },
5102
- participantContacts: getParticipantContacts({
5111
+ participantContacts: getParticipantContacts$1({
5103
5112
  phone: phone && formatPhone(phone),
5104
5113
  email,
5105
5114
  }),
@@ -6887,31 +6896,35 @@
6887
6896
  ], buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" }));
6888
6897
  });
6889
6898
 
6890
- const SuccessStatusContent$1 = JSX(() => {
6899
+ const SuccessStatusCardContent = JSX(() => {
6891
6900
  const { statusInfo } = useRetailFormStore();
6892
- return (jsx(CreditCardFormStatus, { title: "\u0411\u0430\u043D\u043A \u043E\u0434\u043E\u0431\u0440\u0438\u043B \u0432\u0430\u043C \u043A\u0440\u0435\u0434\u0438\u0442", description: "\u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u0432 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442 \u0432\u0430\u0448 \u043A\u0440\u0435\u0434\u0438\u0442", sectionInfo: [
6893
- {
6894
- label: 'Название продукта',
6895
- description: 'Кредит на любые цели',
6896
- },
6897
- {
6898
- label: 'Ставка',
6899
- description: '14,5%',
6900
- },
6901
- {
6902
- label: 'Ежемесячный платеж',
6903
- description: '86 052 ₽',
6904
- },
6901
+ return (jsx(CreditCardFormStatus, { title: "\u0411\u0430\u043D\u043A \u043E\u0434\u043E\u0431\u0440\u0438\u043B \u0432\u0430\u043C \u043A\u0440\u0435\u0434\u0438\u0442", description: "\u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u0432 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442 \u0432\u0430\u0448 \u043A\u0440\u0435\u0434\u0438\u0442", sectionInfo: getSectionInfo(statusInfo), buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" }));
6902
+ });
6903
+ const getSectionInfo = (statusInfo) => {
6904
+ const sectionInfo = [
6905
+ {
6906
+ label: 'Название продукта',
6907
+ description: 'Кредитная карта',
6908
+ },
6909
+ {
6910
+ label: 'Категория',
6911
+ description: statusInfo?.cardCategory,
6912
+ },
6913
+ ];
6914
+ if (statusInfo?.deliveryAddress && statusInfo?.deliveryDate) {
6915
+ return sectionInfo.concat([
6905
6916
  {
6906
- label: 'Срок кредита',
6907
- description: statusInfo?.calculator?.monthsValue + ' мес',
6917
+ label: 'Адрес доставки',
6918
+ description: statusInfo?.deliveryAddress,
6908
6919
  },
6909
6920
  {
6910
- label: 'Тип платежа',
6911
- description: statusInfo?.calculator?.isAnnuity ? 'Аннуитетный' : 'Дифференцированный',
6921
+ label: 'Дата доставки',
6922
+ description: formatDate(statusInfo?.deliveryDate),
6912
6923
  },
6913
- ], buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" }));
6914
- });
6924
+ ]);
6925
+ }
6926
+ return sectionInfo;
6927
+ };
6915
6928
 
6916
6929
  const SIGNAL_TYPES$1 = [
6917
6930
  'CREATE_APPLICATION_SHORT_SIGNAL',
@@ -6944,8 +6957,8 @@
6944
6957
  CANCELLED: jsx(FailedStatusContent$1, {}),
6945
6958
  FAILED: jsx(FailedStatusContent$1, {}),
6946
6959
  DRAFT: jsx(FailedStatusContent$1, {}),
6947
- APPROVED: jsx(SuccessStatusContent$1, {}),
6948
- PRE_DECISION: jsx(SuccessStatusContent$1, {}),
6960
+ APPROVED: jsx(SuccessStatusCardContent, {}),
6961
+ PRE_DECISION: jsx(SuccessStatusCardContent, {}),
6949
6962
  REVISION: jsx(ReworkStatusContent$1, {}),
6950
6963
  };
6951
6964
  return statusesMap[status] || jsx(ReworkStatusContent$1, {});
@@ -7037,38 +7050,14 @@
7037
7050
  jobsNumber,
7038
7051
  lastWorkDuration: lastJobExperience,
7039
7052
  positionCd: positionOrganization,
7040
- participantContacts: getParticipantContacts({
7053
+ participantContacts: getParticipantContacts$1({
7041
7054
  organizationPhone: organizationPhone && formatPhone(organizationPhone),
7042
7055
  }),
7043
- participantAddresses: getParticipantAddresses({ organizationAddress }),
7056
+ participantAddresses: getParticipantAddresses$1({ organizationAddress }),
7044
7057
  ownershipShare: positionOrganization?.key === 'BUSINESS_OWNER' ? partInBusiness : '',
7045
7058
  };
7046
7059
  };
7047
7060
 
7048
- const getFamilyStatusAndIncomeData = (formData) => {
7049
- const { familyStatus, dependents, familyMembers, children, confirmationIncome, wages, mandatoryPayments, incomeAverage, additionalIncome, otherIncome, otherPayments, rentalIncome, retirementIncome, snils, armyIdFlg, conscription, } = formData;
7050
- return {
7051
- maritalStatusCd: familyStatus,
7052
- totalDependents: familyMembers,
7053
- incomeCertificateCd: confirmationIncome,
7054
- otherDependents: dependents,
7055
- childrenDependents: children,
7056
- militaryStatusCd: conscription,
7057
- participantIncomes: getParticipantIncomes({
7058
- wages,
7059
- mandatoryPayments,
7060
- incomeAverage,
7061
- additionalIncome,
7062
- otherIncome,
7063
- otherPayments,
7064
- rentalIncome,
7065
- retirementIncome,
7066
- }),
7067
- snils: snils?.replaceAll(' ', '').replaceAll('-', ''),
7068
- armyIdFlg,
7069
- };
7070
- };
7071
-
7072
7061
  const getPersonalInfoData = (formData) => {
7073
7062
  const { name, surname, middleName, limitedBirthday = '', phone = '', email, sex, birthPlace, dulIssueDateField = '', dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, education, participantDateRegistration = '', housing, addressRegistration, addressFact, } = formData;
7074
7063
  return {
@@ -7085,11 +7074,11 @@
7085
7074
  educationLevelCd: education,
7086
7075
  registrationDate: formatDate(participantDateRegistration, true),
7087
7076
  houseTypeCd: housing,
7088
- participantContacts: getParticipantContacts({
7077
+ participantContacts: getParticipantContacts$1({
7089
7078
  phone: formatPhone(phone),
7090
7079
  email,
7091
7080
  }),
7092
- participantAddresses: getParticipantAddresses({ addressRegistration, addressFact }),
7081
+ participantAddresses: getParticipantAddresses$1({ addressRegistration, addressFact }),
7093
7082
  genderCd: sex
7094
7083
  ? {
7095
7084
  key: sex === 'male' ? 'MAN' : 'WOMAN',
@@ -7130,7 +7119,7 @@
7130
7119
  const isCourierDelivery = methodObtain === 'courier';
7131
7120
  return isCourierDelivery
7132
7121
  ? {
7133
- participantAddresses: getParticipantAddresses({ addressCourier }),
7122
+ participantAddresses: getParticipantAddresses$1({ addressCourier }),
7134
7123
  }
7135
7124
  : {};
7136
7125
  };
@@ -7298,12 +7287,9 @@
7298
7287
  retailFormStore.statusInfo = {
7299
7288
  regionRetail: leadForm?.regionRetail?.text,
7300
7289
  addressRetail: leadForm?.addressRetail?.text,
7290
+ deliveryAddress: leadForm?.addressCourier?.fullAddress,
7301
7291
  cardCategory: leadForm?.cardCategory?.text,
7302
- calculator: {
7303
- monthsValue: leadForm?.calculator?.monthsValue,
7304
- moneyValue: leadForm?.calculator?.moneyValue,
7305
- isAnnuity: leadForm?.calculator?.isAnnuity,
7306
- },
7292
+ deliveryDate: leadForm?.deliveryDate,
7307
7293
  };
7308
7294
  retailFormStore.leadForm = initialState;
7309
7295
  }
@@ -8142,7 +8128,6 @@
8142
8128
  retailFormStore.statusInfo = {
8143
8129
  regionRetail: leadForm?.regionRetail?.text,
8144
8130
  addressRetail: leadForm?.addressRetail?.text,
8145
- cardCategory: leadForm?.cardCategory?.text,
8146
8131
  calculator: {
8147
8132
  monthsValue: leadForm?.calculator?.monthsValue,
8148
8133
  moneyValue: leadForm?.calculator?.moneyValue,
@@ -10510,7 +10495,7 @@
10510
10495
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10511
10496
  });
10512
10497
 
10513
- const packageVersion = "0.14.721";
10498
+ const packageVersion = "0.14.723";
10514
10499
 
10515
10500
  exports.Blocks = Blocks;
10516
10501
  exports.ContentPage = ContentPage;