@redneckz/wildless-cms-uni-blocks 0.14.1029 → 0.14.1031

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 (215) hide show
  1. package/bundle/api/getSubmitBody.d.ts +4225 -865
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +79 -7
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  6. package/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
  7. package/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  8. package/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
  9. package/bundle/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  10. package/bundle/components/ReferalForm/ResultLink.d.ts +7 -0
  11. package/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
  12. package/bundle/components/ReferalForm/renderLinkInput.d.ts +7 -0
  13. package/bundle/components/ReferalForm/renderSections.d.ts +3 -0
  14. package/bundle/model/FormTypeFieldDef.d.ts +1 -1
  15. package/dist/api/getSubmitBody.d.ts +4225 -865
  16. package/dist/api/getSubmitBody.js +14 -0
  17. package/dist/api/getSubmitBody.js.map +1 -1
  18. package/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  19. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  20. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  21. package/dist/components/ApplicationForm/Footnote.d.ts +1 -0
  22. package/dist/components/ApplicationForm/Footnote.js +1 -1
  23. package/dist/components/ApplicationForm/Footnote.js.map +1 -1
  24. package/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  25. package/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  26. package/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  27. package/dist/components/Blocks.js +2 -0
  28. package/dist/components/Blocks.js.map +1 -1
  29. package/dist/components/Blocks.mobile.js +2 -0
  30. package/dist/components/Blocks.mobile.js.map +1 -1
  31. package/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
  32. package/dist/components/ReferalForm/ReferalForm.js +33 -0
  33. package/dist/components/ReferalForm/ReferalForm.js.map +1 -0
  34. package/dist/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  35. package/dist/components/ReferalForm/ReferalFormContent.js +2 -0
  36. package/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
  37. package/dist/components/ReferalForm/ResultLink.d.ts +7 -0
  38. package/dist/components/ReferalForm/ResultLink.js +13 -0
  39. package/dist/components/ReferalForm/ResultLink.js.map +1 -0
  40. package/dist/components/ReferalForm/referalFormData.d.ts +2 -0
  41. package/dist/components/ReferalForm/referalFormData.js +19 -0
  42. package/dist/components/ReferalForm/referalFormData.js.map +1 -0
  43. package/dist/components/ReferalForm/renderLinkInput.d.ts +7 -0
  44. package/dist/components/ReferalForm/renderLinkInput.js +20 -0
  45. package/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
  46. package/dist/components/ReferalForm/renderSections.d.ts +3 -0
  47. package/dist/components/ReferalForm/renderSections.js +10 -0
  48. package/dist/components/ReferalForm/renderSections.js.map +1 -0
  49. package/dist/hooks/useDadataParty.js +1 -1
  50. package/dist/hooks/useDadataParty.js.map +1 -1
  51. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  52. package/lib/api/getSubmitBody.d.ts +4225 -865
  53. package/lib/api/getSubmitBody.js +14 -0
  54. package/lib/api/getSubmitBody.js.map +1 -1
  55. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  56. package/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  57. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  58. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  59. package/lib/components/ApplicationForm/Footnote.d.ts +1 -0
  60. package/lib/components/ApplicationForm/Footnote.js +1 -1
  61. package/lib/components/ApplicationForm/Footnote.js.map +1 -1
  62. package/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  63. package/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  64. package/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  65. package/lib/components/Blocks.js +2 -0
  66. package/lib/components/Blocks.js.map +1 -1
  67. package/lib/components/Blocks.mobile.js +2 -0
  68. package/lib/components/Blocks.mobile.js.map +1 -1
  69. package/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
  70. package/lib/components/ReferalForm/ReferalForm.fixture.d.ts +5 -0
  71. package/lib/components/ReferalForm/ReferalForm.fixture.mobile.d.ts +5 -0
  72. package/lib/components/ReferalForm/ReferalForm.js +31 -0
  73. package/lib/components/ReferalForm/ReferalForm.js.map +1 -0
  74. package/lib/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  75. package/lib/components/ReferalForm/ReferalFormContent.js +2 -0
  76. package/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
  77. package/lib/components/ReferalForm/ResultLink.d.ts +7 -0
  78. package/lib/components/ReferalForm/ResultLink.js +11 -0
  79. package/lib/components/ReferalForm/ResultLink.js.map +1 -0
  80. package/lib/components/ReferalForm/referalFormData.d.ts +2 -0
  81. package/lib/components/ReferalForm/referalFormData.js +17 -0
  82. package/lib/components/ReferalForm/referalFormData.js.map +1 -0
  83. package/lib/components/ReferalForm/renderLinkInput.d.ts +7 -0
  84. package/lib/components/ReferalForm/renderLinkInput.js +18 -0
  85. package/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
  86. package/lib/components/ReferalForm/renderSections.d.ts +3 -0
  87. package/lib/components/ReferalForm/renderSections.js +7 -0
  88. package/lib/components/ReferalForm/renderSections.js.map +1 -0
  89. package/lib/hooks/useDadataParty.js +1 -1
  90. package/lib/hooks/useDadataParty.js.map +1 -1
  91. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  92. package/mobile/bundle/api/getSubmitBody.d.ts +4225 -865
  93. package/mobile/bundle/bundle.umd.js +79 -7
  94. package/mobile/bundle/bundle.umd.min.js +1 -1
  95. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  96. package/mobile/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
  97. package/mobile/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  98. package/mobile/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
  99. package/mobile/bundle/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  100. package/mobile/bundle/components/ReferalForm/ResultLink.d.ts +7 -0
  101. package/mobile/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
  102. package/mobile/bundle/components/ReferalForm/renderLinkInput.d.ts +7 -0
  103. package/mobile/bundle/components/ReferalForm/renderSections.d.ts +3 -0
  104. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  105. package/mobile/dist/api/getSubmitBody.d.ts +4225 -865
  106. package/mobile/dist/api/getSubmitBody.js +14 -0
  107. package/mobile/dist/api/getSubmitBody.js.map +1 -1
  108. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  109. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  110. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  111. package/mobile/dist/components/ApplicationForm/Footnote.d.ts +1 -0
  112. package/mobile/dist/components/ApplicationForm/Footnote.js +1 -1
  113. package/mobile/dist/components/ApplicationForm/Footnote.js.map +1 -1
  114. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  115. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  116. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  117. package/mobile/dist/components/Blocks.js +2 -0
  118. package/mobile/dist/components/Blocks.js.map +1 -1
  119. package/mobile/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
  120. package/mobile/dist/components/ReferalForm/ReferalForm.js +33 -0
  121. package/mobile/dist/components/ReferalForm/ReferalForm.js.map +1 -0
  122. package/mobile/dist/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  123. package/mobile/dist/components/ReferalForm/ReferalFormContent.js +2 -0
  124. package/mobile/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
  125. package/mobile/dist/components/ReferalForm/ResultLink.d.ts +7 -0
  126. package/mobile/dist/components/ReferalForm/ResultLink.js +13 -0
  127. package/mobile/dist/components/ReferalForm/ResultLink.js.map +1 -0
  128. package/mobile/dist/components/ReferalForm/referalFormData.d.ts +2 -0
  129. package/mobile/dist/components/ReferalForm/referalFormData.js +19 -0
  130. package/mobile/dist/components/ReferalForm/referalFormData.js.map +1 -0
  131. package/mobile/dist/components/ReferalForm/renderLinkInput.d.ts +7 -0
  132. package/mobile/dist/components/ReferalForm/renderLinkInput.js +20 -0
  133. package/mobile/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
  134. package/mobile/dist/components/ReferalForm/renderSections.d.ts +3 -0
  135. package/mobile/dist/components/ReferalForm/renderSections.js +10 -0
  136. package/mobile/dist/components/ReferalForm/renderSections.js.map +1 -0
  137. package/mobile/dist/hooks/useDadataParty.js +1 -1
  138. package/mobile/dist/hooks/useDadataParty.js.map +1 -1
  139. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  140. package/mobile/lib/api/getSubmitBody.d.ts +4225 -865
  141. package/mobile/lib/api/getSubmitBody.js +14 -0
  142. package/mobile/lib/api/getSubmitBody.js.map +1 -1
  143. package/mobile/lib/common.css +1 -1
  144. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  145. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  146. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  147. package/mobile/lib/components/ApplicationForm/Footnote.d.ts +1 -0
  148. package/mobile/lib/components/ApplicationForm/Footnote.js +1 -1
  149. package/mobile/lib/components/ApplicationForm/Footnote.js.map +1 -1
  150. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  151. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  152. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  153. package/mobile/lib/components/Blocks.js +2 -0
  154. package/mobile/lib/components/Blocks.js.map +1 -1
  155. package/mobile/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
  156. package/mobile/lib/components/ReferalForm/ReferalForm.js +31 -0
  157. package/mobile/lib/components/ReferalForm/ReferalForm.js.map +1 -0
  158. package/mobile/lib/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  159. package/mobile/lib/components/ReferalForm/ReferalFormContent.js +2 -0
  160. package/mobile/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
  161. package/mobile/lib/components/ReferalForm/ResultLink.d.ts +7 -0
  162. package/mobile/lib/components/ReferalForm/ResultLink.js +11 -0
  163. package/mobile/lib/components/ReferalForm/ResultLink.js.map +1 -0
  164. package/mobile/lib/components/ReferalForm/referalFormData.d.ts +2 -0
  165. package/mobile/lib/components/ReferalForm/referalFormData.js +17 -0
  166. package/mobile/lib/components/ReferalForm/referalFormData.js.map +1 -0
  167. package/mobile/lib/components/ReferalForm/renderLinkInput.d.ts +7 -0
  168. package/mobile/lib/components/ReferalForm/renderLinkInput.js +18 -0
  169. package/mobile/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
  170. package/mobile/lib/components/ReferalForm/renderSections.d.ts +3 -0
  171. package/mobile/lib/components/ReferalForm/renderSections.js +7 -0
  172. package/mobile/lib/components/ReferalForm/renderSections.js.map +1 -0
  173. package/mobile/lib/hooks/useDadataParty.js +1 -1
  174. package/mobile/lib/hooks/useDadataParty.js.map +1 -1
  175. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  176. package/mobile/src/api/getSubmitBody.ts +17 -0
  177. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
  178. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  179. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
  180. package/mobile/src/components/ApplicationForm/Footnote.tsx +10 -1
  181. package/mobile/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
  182. package/mobile/src/components/Blocks.ts +2 -0
  183. package/mobile/src/components/ReferalForm/ReferalForm.example.json +8 -0
  184. package/mobile/src/components/ReferalForm/ReferalForm.tsx +80 -0
  185. package/mobile/src/components/ReferalForm/ReferalForm.ui.json +12 -0
  186. package/mobile/src/components/ReferalForm/ReferalFormContent.ts +15 -0
  187. package/mobile/src/components/ReferalForm/ResultLink.tsx +23 -0
  188. package/mobile/src/components/ReferalForm/referalFormData.ts +18 -0
  189. package/mobile/src/components/ReferalForm/renderLinkInput.tsx +35 -0
  190. package/mobile/src/components/ReferalForm/renderSections.tsx +18 -0
  191. package/mobile/src/hooks/useDadataParty.ts +1 -1
  192. package/mobile/src/model/FormTypeFieldDef.ts +2 -1
  193. package/package.json +1 -1
  194. package/src/api/getSubmitBody.ts +17 -0
  195. package/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
  196. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +36 -0
  197. package/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  198. package/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
  199. package/src/components/ApplicationForm/Footnote.tsx +10 -1
  200. package/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
  201. package/src/components/Blocks.mobile.ts +2 -0
  202. package/src/components/Blocks.ts +2 -0
  203. package/src/components/ReferalForm/ReferalForm.example.json +8 -0
  204. package/src/components/ReferalForm/ReferalForm.fixture.mobile.tsx +24 -0
  205. package/src/components/ReferalForm/ReferalForm.fixture.tsx +24 -0
  206. package/src/components/ReferalForm/ReferalForm.tsx +80 -0
  207. package/src/components/ReferalForm/ReferalForm.ui.json +12 -0
  208. package/src/components/ReferalForm/ReferalFormContent.ts +15 -0
  209. package/src/components/ReferalForm/ResultLink.tsx +23 -0
  210. package/src/components/ReferalForm/referalFormData.ts +18 -0
  211. package/src/components/ReferalForm/renderLinkInput.tsx +35 -0
  212. package/src/components/ReferalForm/renderSections.tsx +18 -0
  213. package/src/hooks/useDadataParty.ts +1 -1
  214. package/src/icons/IconName.ts +4 -4
  215. package/src/model/FormTypeFieldDef.ts +2 -1
@@ -1655,6 +1655,7 @@
1655
1655
  }),
1656
1656
  ...getRkoTariffName(typeForm),
1657
1657
  ...staticBody,
1658
+ ...getReferalRkoData(body, typeForm),
1658
1659
  };
1659
1660
  };
1660
1661
  const getPhoneBody = (phone) => {
@@ -1690,6 +1691,19 @@
1690
1691
  partnerComments: globalThis?.sessionStorage.getItem('rkoTariffName') ?? 'Неизвестный тариф',
1691
1692
  }
1692
1693
  : {};
1694
+ const getReferalRkoData = (body, typeForm) => {
1695
+ const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
1696
+ const partnerComments = params.get('utm_mail');
1697
+ const partner = params.get('utm_source');
1698
+ return typeForm === 'REF'
1699
+ ? {
1700
+ name: body.fullName,
1701
+ fullName: undefined,
1702
+ partnerComments,
1703
+ partner,
1704
+ }
1705
+ : {};
1706
+ };
1693
1707
 
1694
1708
  // eslint-disable-next-line max-lines-per-function
1695
1709
  function LeadServiceAPI() {
@@ -2530,11 +2544,11 @@
2530
2544
  });
2531
2545
  const renderText$3 = (text, aboveText) => text || aboveText ? (jsxs("div", { className: "whitespace-pre", children: [aboveText ? jsx("div", { className: "font-light text-left text-xs", children: aboveText }) : null, jsx("div", { className: style('text-left', { 'text-s -mt-3xs': Boolean(aboveText) }), children: text })] })) : null;
2532
2546
 
2533
- const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(Link, { ...link, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: link.text })) : null] })));
2547
+ const Footnote = JSX(({ text, link, additionalLink }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(Link, { ...link, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: link.text })) : null, additionalLink ? (jsxs(Text, { children: [' и ', jsx(Link, { ...additionalLink, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0430\u043A\u0446\u0438\u0438", children: additionalLink.text })] })) : null] })));
2534
2548
 
2535
2549
  const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
2536
2550
  const agreementTextPF = 'Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ';
2537
- const renderAgreementSubmit = ({ consentDataProcessing, link, button, typeForm, }) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: typeForm === 'PF' ? agreementTextPF : agreementText, link: link })), jsx(SubmitButton$1, { className: "w-full @xl:w-auto", children: button?.text ? button.text : 'Отправить заявку' })] }));
2551
+ const renderAgreementSubmit = ({ consentDataProcessing, link, additionalLink, button, typeForm, }) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: typeForm === 'PF' ? agreementTextPF : agreementText, link: link, additionalLink: additionalLink })), jsx(SubmitButton$1, { className: "w-full @xl:w-auto", children: button?.text ? button.text : 'Отправить заявку' })] }));
2538
2552
 
2539
2553
  const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), jsxs("div", { className: "flex sm:justify-center gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "\u0442\u0435\u043B\u0435\u0444\u043E\u043D 8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "\u043F\u043E\u0447\u0442\u0430 ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
2540
2554
 
@@ -3077,7 +3091,7 @@
3077
3091
  };
3078
3092
 
3079
3093
  const INN_DADATA_URL = 'suggest/party';
3080
- const useDadataParty = async (searchQuery) => (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery })).map((_) => ({
3094
+ const useDadataParty = async (searchQuery) => (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery }))?.map((_) => ({
3081
3095
  fullName: _?.value,
3082
3096
  address: _?.data?.address?.value,
3083
3097
  inn: _?.data?.inn,
@@ -3825,7 +3839,7 @@
3825
3839
 
3826
3840
  const renderTitle = (title) => title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: title }) })) : null;
3827
3841
 
3828
- const renderSections = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
3842
+ const renderSections$1 = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
3829
3843
 
3830
3844
  const useInterval = (handler, period) => {
3831
3845
  const timer = useRef(null);
@@ -3999,7 +4013,7 @@
3999
4013
  };
4000
4014
  const ApplicationForm = UniBlock(
4001
4015
  // eslint-disable-next-line max-lines-per-function
4002
- ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
4016
+ ({ className, title, typeForm = '', sections = [], button, link, additionalLink, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
4003
4017
  const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
4004
4018
  const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
4005
4019
  const router = useRouter();
@@ -4031,9 +4045,10 @@
4031
4045
  });
4032
4046
  const fieldName = getConsentDataProcessing(inputs)?.name;
4033
4047
  const consentDataProcessing = fieldName ? field('consentDataProcessing') : undefined;
4034
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field, { typeForm, additionalParams }), renderAgreementSubmit({
4048
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections$1(sections, field, { typeForm, additionalParams }), renderAgreementSubmit({
4035
4049
  consentDataProcessing,
4036
4050
  link,
4051
+ additionalLink,
4037
4052
  button,
4038
4053
  typeForm,
4039
4054
  })] }), isContacts ? renderContacts() : null] }));
@@ -13548,6 +13563,62 @@
13548
13563
  return (jsxs(BlockWrapper, { className: style('p-6xl space-y-xl', className), defaultPadding: "p-0", ...rest, children: [jsx(Heading, { className: "mb-xl", children: title }), isArchive ? renderDataPickForm() : null, ratesList.map((list, i) => (jsx(RatesTableItem, { list: list, isRatesValid: isRatesValid, isArchive: isArchive, infoMessage: infoMessage }, String(i)))), href ? renderLink(href) : null] }));
13549
13564
  });
13550
13565
 
13566
+ const sections = [
13567
+ { title: 'Заполните ваши данные и получите персональную ссылку', inputs: [] },
13568
+ {
13569
+ columns: 2,
13570
+ inputs: [
13571
+ {
13572
+ name: 'dadataPartyInnSelect',
13573
+ required: true,
13574
+ },
13575
+ {
13576
+ name: 'email',
13577
+ required: true,
13578
+ },
13579
+ ],
13580
+ },
13581
+ ];
13582
+
13583
+ const renderSections = (sections, field) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field))] }, `section-${i}`)));
13584
+
13585
+ const renderLinkInput = JSX(({ className, value = '', copyIcon }) => {
13586
+ const onClick = useCallback(async () => {
13587
+ try {
13588
+ await globalThis.navigator.clipboard.writeText(value);
13589
+ }
13590
+ catch {
13591
+ console.log('Ошибка копирования');
13592
+ }
13593
+ }, []);
13594
+ return (jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle$1), type: "text", value: value, disabled: true }), jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: jsx(Img, { image: copyIcon }) })] }));
13595
+ });
13596
+
13597
+ const ResultLink = JSX(({ link, copyIcon }) => {
13598
+ return (jsxs("div", { children: [jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: "\u0421\u043A\u043E\u043F\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u0441\u044B\u043B\u043A\u0443 \u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u0434\u0440\u0443\u0433\u0443" }) }), renderLinkInput({
13599
+ value: link,
13600
+ copyIcon,
13601
+ })] }));
13602
+ });
13603
+
13604
+ const ReferalForm = UniBlock(({ link = '', button, copyIcon, ...rest }) => {
13605
+ const [isShowResultLink, setIsShowResultLink] = useState(false);
13606
+ const [referalLink, setReferalLink] = useState('');
13607
+ const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
13608
+ const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
13609
+ const handleSubmit = useCallback(async (formData) => {
13610
+ setReferalLink(`${link}?utm_source=${formData.dadataPartyInnSelect?.text}&utm_mail=${formData.email}`);
13611
+ setIsShowResultLink(true);
13612
+ }, []);
13613
+ const [, { field, onSubmit }] = useForm({}, {
13614
+ resetOnSubmit: true,
13615
+ formValidator,
13616
+ onSubmit: handleSubmit,
13617
+ });
13618
+ return (jsx(ApplicationFormLayout, { className: "container space-y-m col-span-12", title: getTitle(isShowResultLink), ...rest, children: isShowResultLink ? (jsx(ResultLink, { link: referalLink, copyIcon: copyIcon })) : (jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field), jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: "\u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u0441 " }), jsx(Link, { href: "/privacy-policy", target: "_blank", ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C\u0438 \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(SubmitButton$1, { className: "w-full @xl:w-auto mt-xs", children: button?.text ?? 'Получить ссылку' })] })) }));
13619
+ });
13620
+ const getTitle = (isShowResultLink = false) => isShowResultLink ? 'Ваша личная ссылка' : 'Как получить бесплатное обслуживание счёта';
13621
+
13551
13622
  const RichTextBlock = UniBlock((props) => {
13552
13623
  const { __html, dynamicQueryParamText = {}, dynamicTextSource, richVersion = '', ...rest } = props;
13553
13624
  const formatText = getFormatDynamicText(dynamicQueryParamText, dynamicTextSource?.list, __html);
@@ -14191,6 +14262,7 @@
14191
14262
  CalculatorRko,
14192
14263
  RkoTariffCardsTable,
14193
14264
  RatesTable,
14265
+ ReferalForm,
14194
14266
  };
14195
14267
 
14196
14268
  const applyAspects = (aspects) => (ev) => {
@@ -14315,7 +14387,7 @@
14315
14387
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
14316
14388
  });
14317
14389
 
14318
- const packageVersion = "0.14.1028";
14390
+ const packageVersion = "0.14.1030";
14319
14391
 
14320
14392
  exports.Blocks = Blocks;
14321
14393
  exports.ContentPage = ContentPage;