@redneckz/wildless-cms-uni-blocks 0.14.819 → 0.14.821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +188 -222
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/bundle/retail/api/checkCode.d.ts +0 -1
- package/{dist/retail/api/esiaRequestProfile.d.ts → bundle/retail/api/updateProfileEsia.d.ts} +4 -11
- package/bundle/retail/api/updateUserTask.d.ts +0 -1
- package/bundle/retail/api/uploadFile.d.ts +1 -1
- package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/retail/api/checkCode.d.ts +0 -1
- package/dist/retail/api/checkCode.js +2 -3
- package/dist/retail/api/checkCode.js.map +1 -1
- package/{bundle/retail/api/esiaRequestProfile.d.ts → dist/retail/api/updateProfileEsia.d.ts} +4 -11
- package/dist/retail/api/updateProfileEsia.js +6 -0
- package/dist/retail/api/updateProfileEsia.js.map +1 -0
- package/dist/retail/api/updateUserTask.d.ts +0 -1
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/uploadFile.d.ts +1 -1
- package/dist/retail/api/uploadFile.js +3 -2
- package/dist/retail/api/uploadFile.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/dist/retail/components/Fields/BeginDateField.js +1 -2
- package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
- package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +1 -2
- package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/dist/retail/components/Fields/Experience5YearsField.js +1 -2
- package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/retail/components/Fields/JobsNumberField.js +1 -2
- package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/retail/components/Fields/OrganizationNameField.js +1 -2
- package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/dist/retail/components/Fields/WagesField.js +1 -2
- package/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/dist/retail/content.js +5 -11
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/utils/mainFormStateMap.js +0 -1
- package/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/AcquiringField.js +4 -0
- package/dist/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
- package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/retail/api/checkCode.d.ts +0 -1
- package/lib/retail/api/checkCode.js +1 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
- package/lib/retail/api/updateProfileEsia.js +3 -0
- package/lib/retail/api/updateProfileEsia.js.map +1 -0
- package/lib/retail/api/updateUserTask.d.ts +0 -1
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/uploadFile.d.ts +1 -1
- package/lib/retail/api/uploadFile.js +3 -2
- package/lib/retail/api/uploadFile.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/lib/retail/components/Fields/BeginDateField.js +1 -2
- package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
- package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +1 -2
- package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
- package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/retail/components/Fields/JobsNumberField.js +1 -2
- package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
- package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/lib/retail/components/Fields/WagesField.js +1 -2
- package/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/lib/retail/content.js +5 -11
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/utils/mainFormStateMap.js +0 -1
- package/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AcquiringField.js +4 -0
- package/lib/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
- package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +188 -222
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
- package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
- package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
- package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
- package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +0 -1
- package/mobile/dist/retail/api/checkCode.js +2 -3
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
- package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
- package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
- package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
- package/mobile/dist/retail/api/uploadFile.js +3 -2
- package/mobile/dist/retail/api/uploadFile.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
- package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
- package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
- package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
- package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/dist/retail/content.js +5 -11
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
- package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AcquiringField.js +4 -0
- package/mobile/dist/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +0 -1
- package/mobile/lib/retail/api/checkCode.js +1 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
- package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
- package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
- package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
- package/mobile/lib/retail/api/uploadFile.js +3 -2
- package/mobile/lib/retail/api/uploadFile.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
- package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
- package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
- package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
- package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/lib/retail/content.js +5 -11
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
- package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AcquiringField.js +4 -0
- package/mobile/lib/ui-kit/FormField/Fields/AcquiringField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
- package/mobile/src/retail/api/checkCode.ts +1 -1
- package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
- package/mobile/src/retail/api/updateUserTask.ts +0 -1
- package/mobile/src/retail/api/uploadFile.ts +3 -2
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
- package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
- package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
- package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
- package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
- package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
- package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
- package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
- package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
- package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
- package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
- package/mobile/src/retail/content.tsx +5 -11
- package/mobile/src/retail/model/NameFieldDef.ts +0 -1
- package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
- package/mobile/src/ui-kit/FormField/Fields/AcquiringField.tsx +4 -0
- package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
- package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
- package/src/retail/api/checkCode.ts +1 -1
- package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
- package/src/retail/api/updateUserTask.ts +0 -1
- package/src/retail/api/uploadFile.ts +3 -2
- package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
- package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
- package/src/retail/components/Fields/BeginDateField.tsx +0 -2
- package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
- package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
- package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
- package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
- package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
- package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
- package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
- package/src/retail/components/Fields/WagesField.tsx +0 -2
- package/src/retail/content.tsx +5 -11
- package/src/retail/model/NameFieldDef.ts +0 -1
- package/src/retail/utils/mainFormStateMap.ts +0 -1
- package/src/ui-kit/FormField/Fields/AcquiringField.tsx +4 -0
- package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
- package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
- package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/dist/retail/api/esiaRequestProfile.js +0 -10
- package/dist/retail/api/esiaRequestProfile.js.map +0 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/lib/retail/api/esiaRequestProfile.js +0 -7
- package/lib/retail/api/esiaRequestProfile.js.map +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
- package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
- package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),k={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},S=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=k[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function P(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{...r,...a,className:u(l,r?.className),block:e,options:t},i):null}},i)}const R=[],B=(e,{key:t,ancestors:n=R,slotName:a=null,extraProps:i,renderProps:l=P,...r})=>{const s=i?(e,t)=>P(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||R,[r.parent,a]]:n},i)))};function E({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?B(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const _=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return _.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),z=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:F,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:z,hasPrefix:V});const $="/api/",j=`${$}v1/storage`,U=[A.CDN,$],q=e=>(t,n)=>{if(W(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const a=t?.startsWith("/");return z(V(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||M(e)||F(e)||U.some(V(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",size:r,width:s=r&&Y[r],height:d=s})=>{const m=D(),h="normal"===l?`${n}.svg`:`sprites.svg#${n}`,p=q(m)(z(A.CDN,"/icons/",h));return"normal"===l?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[l],{"w-full h-full":!s,invert:"white"===l},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Z(e=""){try{return new URL(e).pathname}catch(e){return""}}const Q=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Z(J.SITE_URL);return t&&!M(t)?q(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:Q(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ne({...t,src:Q(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(G,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),le={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return r((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const pe=new he,ge=()=>ue(pe.emitter,"dialog");function fe(){const e=D(),{closeAll:t}=ge();return n=>{const a=q(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const l=Z(J.SITE_URL);xe(a,n.target,l)&&(t(),i?.preventDefault(),e.push(((e,t="")=>e?.replace(t,"")||"/")(a,l)))}))}}}const xe=(e,t,n)=>O(e,t)&&!J.SUB_PORTALS?.split(",")?.some(V(e))&&V(e)(n||"/"),ye=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},be=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=Ne(e)&&"hidden lg:block";return c("div",{className:u(ve(e),"flex gap-xs"),children:[a?o("div",{className:u(r,ce[l]),children:a}):null,Ne(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,ce[l]),children:i}):null]})})),ve=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ne(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ne=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),we=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ce=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[e,t]))({method:n,href:a}),s=fe()({onClick:r,href:a,...i}),c=t??o(be,{...s});return o(e?Se:ke,{...s,children:c})})),ke=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ye(d),children:m}))),Se=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:we({className:e,rounded:a,version:n}),children:i})));function Ie({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Ce,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Te=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Pe={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Re=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Pe[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Te(),v=D(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Ie({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Re(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-auto"),children:[Ee(h,x),_e(E({...y,extraProps:{className:"@container-normal"}})),Re(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[De(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ee=(e,t)=>e||t?c("div",{className:"grow space-y-lg min-w-fit",children:[e,t]}):null,De=e=>u(e?"row-span-2":"@xl:row-span-2"),_e=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ae=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Oe=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Fe=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?o(Fe,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ve=(e,t)=>["label"in e?ze(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Oe(e.description,t)},String(t)):null,"__html"in e?o(Me,{...e},`rte-${t}`):null],Le=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Ae(n.icon,t):null,o("div",{children:Ve(n)})]}))),$e=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Le,{benefitsVersion:t,...e},String(n))))}):null)),je=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ve)}):null)),Ue=d((({isTabularBenefits:e,...t})=>o(e?je:$e,{...t}))),qe=e=>Boolean(e?.src||e?.icon),We=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(He(n))}):null,He=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=Ye(i,r),d=Ye(l,r);return a||i?.icon?o(Ce,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ge({...i,iconVersion:c}),appendRight:Ge({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},Ye=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ge=e=>qe(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ke=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Xe=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Je)}):null)),Je=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Fe,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Ke(2)(t)," ",n||"₽"]}):null]},String(a)),Ze=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Qe)}):null)),Qe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Fe,{size:"text-m",font:"font-light",children:e})},String(t)),et={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},tt=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:x,image:y,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const P=y?.src?o(ie,{image:y,imageClassName:C}):null,R=o(S,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),B=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...p?{title:R}:{insetTitle:R},...rt(P,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:We(x),backwardButton:k,...T,children:lt(nt(B,{benefitsVersion:s,isTabularBenefits:c}),at(u,{richVersion:h,isDotted:d,headlineVersion:l}),I,it(g),st(f))})})),nt=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(Ue,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,at=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Me,{__html:e,richVersion:t,isDotted:n,itemSize:et[a??"L"]}):null,it=e=>e?.length?o(Xe,{priceList:e}):null,lt=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},rt=(e,t)=>t?{rightImage:e}:{leftImage:e},st=e=>e?.length?o(Ze,{tags:e}):null;class ot{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof ot?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const ct=()=>!0,dt=(e,t)=>(...n)=>e(...n)&&t(...n),mt=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const ut=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&"object"==typeof e&&!ut(e)),pt=e=>e;function gt(e){return e instanceof ot?e._:e}class ft extends ot{from(e){return this.of(e.map(((e=pt)=>([,t])=>e(t))(gt)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(ut(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class xt extends ot{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class yt extends ot{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,gt(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class bt extends ot{proto=mt([e=>ut(this._)||"number"==typeof e,()=>ft.prototype],[e=>ht(this._)||"string"==typeof e,()=>yt.prototype],[ct,()=>xt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const vt=e=>e instanceof ot?e:new bt(e),Nt=e=>{const t=(t,...n)=>gt(e(vt(t),...n));return t.fn=e,t},wt=[],Ct=e=>e instanceof Function?e:t=>e===t,kt=e=>(t,n,a=wt)=>vt(t).entries().reduce(((t,[n,i])=>kt(e)(i,t,a.concat(n))),e(n,[a,vt(t)])),St=Nt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?St(e.get(a),[i,n]):n)})),It=Nt(((e,t)=>t.reduce(St.fn,e))),Tt=e=>kt(((e,[t,n])=>Pt(n)?[...e,[t,gt(n)]]:e))(e,[]),Pt=e=>0===e.size();Nt(((e,t=wt)=>t.reduce(((e,t)=>e.get(t)),e)));const Rt=Nt(((e,[t,...n])=>n.length?e.set(t,Rt(e.get(t),n)):e.filter((([e])=>e!==t)))),Bt=(Et=["$ref"]).map(((e,t)=>n=>Ct(e)(n[t+n.length-Et.length]))).reduceRight(dt,ct);var Et;const Dt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(_t,e),_t=mt([ut,(e,t)=>e[parseInt(t,10)]],[ht,(e,t)=>e[t]],[ct,pt]),At=(e,t)=>((e,t={})=>n=>It(t,Tt(n).map((t=>e(t)))))((([e,n])=>{return Bt(e)?[(a=e,a.slice(0,-1)),Dt(t(n),n)]:[e,n];var a}))(e),Mt=e=>Tt(e).filter(((e=pt)=>([t])=>e(t))(Bt)),Ot=e=>{return t=Mt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Ft(e,t){try{return e?await zt(e,t):null}catch(e){console.error(e)}return null}const zt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Vt=e=>[...new Set(e)],Lt={},$t=["/portal-resources"],jt=(e,t)=>At(e,(e=>t?.[e])),Ut=(e,t)=>{const n=Ot(e),[l,r]=a({});return i((()=>{qt(n).then(r)}),[n.join()]),n.length?jt(e,{...t,...l}):e},qt=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Vt(e).filter((e=>!$t.some((t=>e.startsWith(t))))).map((async e=>[e,Lt[e]||=await zt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Ot(e)));return i.length?qt(i,a):a}return t};function Wt(e,t={}){const n=d((t=>{const n=Ut((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Ht=Wt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(tt,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),Yt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Gt(0,t?.length)),[t]),a=t?.[n];return a?o(Ht,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Gt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Kt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Xt=e=>e?.replace(/[^+\d]/g,""),Jt="/api/v1";const Zt=e=>e?{phone:Xt(e)}:{},Qt=(e,t="birthday")=>e?{[t]:Kt(e)}:{},en=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),tn=(e,t=!0)=>({[t?"email":"mail"]:e}),nn=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Xt(e)}:{},an=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[])t[a??""]?.(n,i)};function ln(){return ln._impl()}ln._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),ln.setup=e=>{ln._impl=e};const rn="rshb-query-params";function sn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(rn)||"";return e&&globalThis.sessionStorage?.setItem(rn,e),e}const on=e=>{const t=e.target?.closest("a"),n=ln();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=sn();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function cn(){return cn._impl()}function dn(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}cn._impl=()=>({forwardQuery:on}),cn.setup=e=>{cn._impl=e};const mn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],un=e=>!e?.length,hn=e=>t=>n=>e(n)?[]:[t],pn={},gn=[];const fn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function xn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[r,s]=a(e),o=l((e=>s((a=>{const i=e instanceof Function?e(a):e,l=t?t(i):i,r=fn(i,l)?i:l;return!fn(a,r)&&n?.(r),r}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[r,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=dn(!1),f=s({}),[x,{isValid:y,errors:b}]=function(e,t){const n=r((()=>t?.(e)??pn),[t,e]),a=r((()=>mn(n)(e)??gn),[n,e]),i=un(a);return[n,{isValid:i,errors:a}]}(m,n),v=l(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,l=m[e],r=h||f.current?.[String(e)],s=t?.validator??x[e],o=r&&s?s(l):[];return{value:a?a(l):l,isDirty:r,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,x,u]),N=l((e=>{f.current=e,u(e)}),[u]),w=l((()=>{f.current={},g(),u(e)}),[e,u]),C=l((e=>{e.preventDefault(),y?(t&&w(),d?.(m,e)):p()}),[t,m,y,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const yn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function bn(e,t={}){const{open:n,close:a,...i}=ge();return{open:l(((i,l={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...l})),[e,n,a]),close:a,...i}}function vn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Nn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return vn(globalThis.document,"click",n),t}const wn=({label:e,errors:t})=>e&&t?`${e}*`:e,Cn=()=>{},kn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Sn=e=>e?kn:"border-error",In=e=>e?o(Fe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Tn=d((({key:e,className:t,id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:x=!1,disabled:y=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),k=l((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const S=b?"pr-3xl":"",I=Sn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[In(d),x?o("textarea",{className:u("block resize-y min-h-24",Pn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:y,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Pn,S,I),id:n,type:r,value:h,name:a||n,placeholder:m,pattern:g,disabled:y,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e)]}),b]})})),Pn="w-full border rounded-md text-primary-text outline-none p-m",Rn=e=>o("div",{className:"h-6",children:e?o(Fe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Bn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=Cn,onBlur:m,isTextarea:h,type:p,isInteger:g=!1,maxLength:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=dn(),N=Nn(b),w=l((e=>{!y&&v(),f?e.length<=f&&d(e):d(e)}),[y,d]);return i((()=>{g&&n&&d(En(n))}),[n]),c("div",{className:u("shrink-0 w-full",e),ref:N,onBlur:b,onFocus:v,children:[o("div",{children:o(Tn,{disabled:x,type:p||"text","aria-label":t,label:wn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:w,onBlur:m,isTextarea:h,placeholder:Dn(a,s,t)})}),Rn(r)]})})),En=(e="")=>e.replace(/[^\d]+/g,""),Dn=(e,t,n)=>t&&!n?`${e}*`:e,_n=e=>e?.text||e?.key||"",An=()=>ue(pe.emitter,"popup"),Mn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,On=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Mn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:_n(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Fn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,disabled:g=!1,iconVersion:f="black",onChange:x})=>{const[y,{setFalse:b,setTrue:v}]=dn(),[N,w]=a(""),C=Ln(g,n.length),k=y&&!C,S=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=An(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=Nn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(On,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:x,onClose:I,iconVersion:f});return c("div",{className:u("space-y-xs",e),children:[In(t),c("div",{className:u("relative",k?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Vn(m,d,C)),onClick:k?I:S,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:_n(r)||h}),zn(k,f)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Tn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),zn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Vn=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Ln=(e,t)=>e||0===t,$n=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(Fn,{...i,valid:!n,label:wn({label:t,errors:a})}),Rn(n)]}))),jn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Un=d((({field:e,input:t})=>o($n,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:jn,...e(t?.name??"")}))),qn=(e="")=>Boolean("trade"===e||"all"===e),Wn=e=>null!=e,Hn=new Map,Yn=(e,t=Hn)=>n=>{const a=Kn(n),i=t.get(a);if(a&&Wn(i))return i;const l=e(...n);return a&&Wn(l)&&t.set(a,Promise.resolve(l)),l},Gn=e=>Boolean(e?.every((e=>Array.isArray(e)?Gn(e):!e||"string"==typeof e))),Kn=e=>Gn(e)?e.toString():"",Xn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Jn(e,t,{fallback:n,cache:l}={}){const s=r((()=>Zn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Wn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await Yn(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&Xn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Zn(e){return Array.isArray(e)?e:e instanceof Function?Zn(e()):[e]}const Qn=`${Jt}/branches`,ea=[];const ta=async e=>await Ft(e,{method:"GET"})||ea;function na(e=!1){const{data:t}=Jn(`${Jt}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,zt);return Array.isArray(t)?t:[]}const aa=(e="")=>"ULTRASERVICE"===e,ia=d((({field:e,input:t,params:n})=>{const a=aa(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?na(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Jn(e?`${Qn}?regionCode=${e}`:null,ta);return t||ea}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o($n,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),la=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},ra=(e,t,n)=>Math.max(t,Math.min(e,n));function sa(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function oa({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:l,onChange:t=>{const n=sa(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const ca=1,da=100,ma=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:ca),max:s=(i.length?i.length-1:da),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=la(e,{normalize:(e=0)=>i.length?ua(i)(e):ra(e,r,s),format:Ke()}),f=l((e=>{p&&p(sa(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Fe,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",kn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),oa({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),ha(a)]})})),ua=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),ha=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Fe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),pa=["От 1 000 ₽","До 1 000 000 000 ₽"],ga=d((({field:e,input:t})=>o(ma,{title:"Сумма, ₽",items:pa,min:1e3,max:1e9,...e(t?.name??"")}))),fa=d((({field:e,input:t})=>o(Bn,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),xa="client",ya=[{key:xa,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],ba=d((({field:e,input:t})=>o($n,{label:"Тип обратившегося",...t,options:ya,...e("applierType")}))),va=d((({field:e,input:t})=>o(Bn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),Na=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=wa(t,e),c=Ca(t,l,r);u.push(o("td",{children:o("div",{className:ka(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},wa=(e,t)=>t&&e.toDateString()===t.toDateString(),Ca=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),ka=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Sa=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ia=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:l=Cn})=>{const{firstDayOfWeek:s,totalDays:d}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Sa.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Na({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:l})})]})})),Ta=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Pa(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Ra),l=a.map(((e,t)=>Ea(e)?a.slice(0,t).filter(Ea).length:-1)),r=a.map(((e,t)=>Ba(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Ra=e=>"_"===e,Ba=e=>/\d/.test(e),Ea=e=>Ra(e)||Ba(e),Da=1940,_a={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Aa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),i((()=>{Oa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Pa(t,"__.__.____"))},onBlur:()=>{Ma(p)?Oa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(l||"")},disabled:r}),r?null:o(G,{className:"mr-s",..._a})]})})),Ma=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Da&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Oa=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Ma(e)){const{day:i,month:l,year:r}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(l),n(r),a?.(new Date(r,l,i))}},Fa=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Aa,{onChange:a,disabled:r,onClick:e,value:t&&Kt(t),setSelectedMonth:i,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),za=Ta.map((e=>({key:e}))),Va=Array.from({length:(new Date).getFullYear()-Da+1},((e,t)=>Da+t)).reverse().map((e=>({key:String(e)}))),La=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},$a=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},ja={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ua={className:"min-w-32",iconVersion:"black",isBorder:!1},qa=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=dn(!1),[x,y]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=l((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:k,handleSelectYear:S,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:P,ref:R}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=Nn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(Ta.indexOf(e));const t=La(r,Ta.indexOf(e));$a({maxDateOfMonth:t,selectedYear:r,selectedMonth:Ta.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:za,yearsOptions:Va,ref:c}})({onYearSelect:v,onMonthSelect:y,onShowCalendar:g,selectedYear:b,selectedMonth:x,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(R,370);return c("div",{className:u("space-y-xs",e),ref:R,children:[In(t),c("div",{className:"relative",children:[Fa({handleChangeVisibleCalendar:P,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:y,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...ja,className:"-rotate-90 cursor-pointer"})}),o(Fn,{onChange:k,value:{key:Ta[x]},options:I,...Ua}),o(Fn,{onChange:S,value:{key:String(b)},options:T,...Ua}),o("div",{className:"my-auto",onClick:C,children:o(G,{...ja,className:"rotate-90 cursor-pointer"})})]}),o(Ia,{today:n,currentMonth:x,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),Wa=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(qa,{label:wn({label:t,errors:a}),valid:Boolean(!n),...i}),Rn(n)]}))),Ha=d((({field:e,input:t})=>o(Wa,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),Ya=d((({field:e,input:t})=>o(Bn,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Ga=d((({field:e,input:t})=>o(Bn,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),Ka=d((({field:e,input:t})=>o(Wa,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Xa=d((({field:e,input:t})=>o(Bn,{label:"Электронная почта",...e(t?.name??""),...t}))),Ja=[{key:"ULTRASERVICE",text:"Ультра"}],Za=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Qa=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],ei=d((({field:e,input:t})=>o($n,{label:"Способ получения ответа",options:Qa,...e(t?.name??"")}))),ti=d((({field:e,input:t})=>o(Bn,{label:"ФИО",...e(t?.name??""),...t}))),ni=d((({field:e,input:t})=>o(Bn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),ai=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),ii="appearance-none w-5 h-5 border-solid flex-none",li=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],ri=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(ai,{paths:li,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",oi(a)),onClick:s,children:[o("div",{className:u(ii,"m-0",i?"rounded-full border-2":di(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ci(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,si(n)]})})})),si=e=>e?o("div",{className:"ml-s",children:o(Fe,{size:"text-l",font:"font-light",children:e})}):null,oi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ci=(e=!1)=>e?"radio":"checkbox",di=(e=!1)=>u("rounded border",{"bg-primary-main":e}),mi=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ri,{text:t,value:n,disabled:i,onChange:r},a),Rn(l)]}))),ui=d((({field:e,input:t})=>o(mi,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),hi=`${Jt}/outservice`,pi=[];async function gi(){const e=await Ft(`${hi}/outserviceregions`);return e&&Array.isArray(e)?e:pi}const fi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=Jn("outServiceRegions",gi),s=r((()=>l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[l,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o($n,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),xi=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,yi=d((({field:e,input:t})=>o(Bn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),bi=d((({field:e,input:t})=>o(Bn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),vi=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Fe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Ni=d((({field:e,input:t})=>qn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),wi=d((({field:e,input:t})=>o(Bn,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),Ci=e=>"_"===e,ki=e=>/\d/.test(e),Si=e=>Ci(e)||ki(e),Ii=[..."+7 (___) ___-__-__"],Ti=Ii.findIndex(Ci),Pi=Ii.map(((e,t)=>Si(e)?Ii.slice(0,t).filter(Si).length:-1));function Ri(e){const t=e.replace(/\D/g,""),n=Ii.map(((e,n)=>ki(e)?e:t.charAt(Pi[n])||e)),a=Pi.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Ti,a)):n).join("")}const Bi=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Ri(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Tn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Ei=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Bi,{"aria-label":t,label:wn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Rn(a)]}))),Di=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Ei,{label:"Телефон",disabled:t?.filledByEsia&&xi(e,t.name??""),...e(n),...t})})),_i=d((({field:e})=>qn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ai=Wt((({field:e,input:t,source:n})=>o($n,{placeholder:"Выберите продукт",label:"Продукт",options:Mi(n?.productList),...e(t?.name??"")}))),Mi=e=>(e??[]).map((e=>({key:e,value:e}))),Oi=`${Jt}/regions`,Fi=[];function zi(e=Oi){const{data:t}=Jn(e,zt);return Array.isArray(t)?t:Fi}const Vi=`${Jt}/outservice/outserviceregions`,Li=d((({field:e,input:t,params:n})=>{var a;const i=zi((a=n?.typeForm,"OUTSERVICE"===a?Vi:void 0));return o($n,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),$i=d((({field:e,input:t})=>{const n=na(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o($n,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),ji=d((({field:e,input:t})=>o(Bn,{label:"ФИО представителя",...t,...e("representativeName")}))),Ui=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},qi=/^[\u0400-\u04FF\d\s]+$/u,Wi=(e="")=>qi.test(e),Hi=hn((e=>null!=e&&""!==e)),Yi="Некорректно заполненное поле",Gi=e=>Hi(e??Yi),Ki=e=>hn((e=>e?.key&&""!==e?.key))(e??Yi),Xi=e=>hn((e=>"string"==typeof e&&e.length>1&&Wi(e)))(e??Yi),Ji=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Zi=e=>hn(Ji)(e),Qi=hn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),el={fullName:Gi(),addressBranch:Ki(),desiredMeetingDate:Gi(),product:Gi(),localities:Gi(),partnerComments:Gi(),collectionCount:Gi(),acquiringType:Ki(),serviceType:Ki(),annualRevenue:Gi(),feedbackMethod:Ki(),serviceDirection:Ki(),secondaryPhone:Zi("Укажите номер телефона"),region:Ki(),situationDescription:Gi(),sufferedFrom:Gi(),applierType:Gi(),surname:Xi("Укажите свою фамилию на кириллице"),name:Xi("Укажите своё имя на кириллице"),middleName:Xi("Укажите своё отчество на кириллице"),birthday:Gi("Укажите дату рождения"),phone:Zi("Укажите номер телефона"),email:(tl="Укажите электронную почту",hn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(tl)),inn:(e=>hn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Gi(),typeForm:Gi(),consentToReceiveMaterials:Qi,consentDataProcessing:Qi};var tl;const nl=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...el,...t},i=n.some((e=>e.condition?.values)),l=Object.fromEntries(n.filter(al(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(al(a)).filter(il(e)).map((({name:e})=>[e,a[e??""]]))):l},al=(e={})=>({name:t})=>Boolean(e[t??""]),il=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),ll=d((({field:e})=>{const t=e("secondaryPhone");return o(Ei,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Ui(t,el.secondaryPhone):t})})),rl=d((({field:e,input:t})=>o($n,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Za,...e(t?.name??"")}))),sl=d((({field:e,input:t})=>o(Bn,{label:"Описание ситуации",...t,...e("situationDescription")}))),ol=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],cl=d((({field:e,input:t})=>o($n,{label:"Пострадал в",...t,options:ol,...e("sufferedFrom")}))),dl=d((({field:e,input:t})=>o(Bn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),ml=["От 1 мес","До 15 лет"],ul=d((({field:e})=>o(ma,{title:"Срок, месяцев",items:ml,min:1,max:180,...e("term")}))),hl=d((({field:e,input:t})=>o($n,{label:"Тип обслуживания",options:Ja,...e(t?.name??"")}))),pl={horizontal:"@lg:flex-row",vertical:""},gl=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:l="horizontal",onChange:r})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Fe,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",pl[l],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ri,{isRadio:!0,text:t,value:n===e,onChange:()=>r?.(e),disabled:i},String(e))))})]}))),fl=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],xl=d((({field:e,input:t})=>{const n=l((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(gl,{className:"whitespace-normal",orientation:"horizontal",items:fl,...e(t?.name??"",{onChange:n})})})})),yl=d((({field:e,input:t})=>o(ri,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const bl={$ref:"/wcms-resources/outservice-productlist.json"},vl={fullName:ti,addressBranch:ia,desiredMeetingDate:Ka,product:e=>o(Ai,{...e,source:bl}),localities:fi,isClient:ui,partnerComments:wi,collectionCount:Ya,acquiringType:Un,onlineCheckout:Ni,posTerminal:_i,serviceType:hl,term:ul,amount:ga,annualRevenue:fa,vedTypes:xl,feedbackMethod:ei,serviceDirection:rl,bankEmpolee:va,secondaryPhone:ll,applicationDate:e=>o(Bn,{label:"Дата и время обращения в Банк",...e}),region:e=>aa(e?.params?.typeForm)?o($i,{...e}):o(Li,{...e}),consentToReceiveMaterials:yl,sufferedFrom:cl,situationDescription:sl,representativeName:ji,applierType:ba,surname:dl,name:bi,middleName:yi,birthday:Ha,phone:Di,email:Xa,inn:ni,comment:Ga},Nl=(e,t,n={})=>(a,i)=>{const l={...vl,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.includes(a?.key??a)}({input:a,field:e})&&l?o("div",{children:o(l,{field:e,input:a,params:t})},i):null},wl=e=>2===e?"@xl:grid-cols-2":"",Cl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Fe,{size:"text-h6",children:e})}):null,kl={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","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"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","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")},Sl=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Il=u("bg-main-gray text-main-disabled cursor-not-allowed"),Tl=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=Cn})=>{const x=l("tab"!==c?me(f):f,[c,f]),y=r((()=>ye(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[kl[n]]:!s&&!i,[Sl]:i,[Il]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...y,onClick:x,children:p})})),Pl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Rl=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Pl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Bl=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Rl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Tl,{type:"button",onClick:n,children:"Хорошо"})]})})})),El=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,...p}=e,g=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${qn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,f={...p,...Ml(o),...Al(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},..._l(m?.text,u),...Dl(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Dl=e=>e?.key?{isClient:e?.key===xa}:{},_l=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Al=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ml=e=>e?{vedTypes:Object.fromEntries(fl.map((({id:t})=>[t,t===e])))}:{},Ol={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:jn[0],serviceType:Ja[0],feedbackMethod:Qa[0],serviceDirection:Za[0],vedTypes:fl[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Fl=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),zl=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Tl,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(Fl,{blur:!0,size:"small"}):null,n]}))),Vl={primary:kl.primary,secondary:kl.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:kl.secondary,transparent:"","":""},Ll=d((e=>{const t=fe(),{className:n,href:a,target:i,text:l,aboveText:r,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[Vl[s]]:Boolean(s),[r?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${l}`,role:a?"link":"button",onClick:p,...ye(m),children:h??$l(l,r)})})),$l=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,jl=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Fe,{children:e}):null,t?o(Ll,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),Ul=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(ri,{...e}),o(jl,{link:t})]}),Rn(Ui(e,Qi).error)]}):o(jl,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(zl,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),ql={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Jt}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...en(a,g),...tn(l,g),...Zt(i),...Qt(s,"desiredMeetingDate"),...g?Qt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...nn(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Wl=d((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=r((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),x=r((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Ol[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),y=r((()=>nl(f)),[f]),b=bn(Bl),v=cn(),N=l((async(e,t)=>{const a=El({...e,...m}),i=Boolean(await ql.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&an({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:k}]=xn(x,{resetOnSubmit:!0,formValidator:y,onSubmit:N}),S=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(yn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:k,children:[a.map(((e,t)=>c("div",{className:u(wl(e.columns),"grid gap-x-m"),children:[Cl(e.title),(e?.inputs||[])?.map(Nl(C,{typeForm:n}))]},`section-${t}`))),Ul(S?C("consentDataProcessing"):void 0,s,i)]}),h?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),Hl="Некорректно заполненное поле",Yl="Укажите регион, город/населенный пункт, улицу, дом",Gl=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),Kl=()=>hn(Gl)(Yl),Xl=e=>hn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??Hl),Jl=(e,t)=>hn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Hl),Zl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},Ql=e=>hn((e=>"string"==typeof e&&6===e.length))(e),er=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},tr={processPersonalDataFlg:Qi,consentProviderFlg:Qi,consentInformFlg:Qi,consentPfrFlg:Qi,consentOthersFlg:Qi,consentFATCA:Qi},nr={addressCourier:Kl(),paymentSystem:Gi("Укажите тип платежной системы"),currency:Gi("Укажите валюту"),cardCategory:Gi("Укажите категорию карты"),codeWord:(e=>hn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Wi(e)))(e??Hl))("Необходимо ввести кодовое слово"),confirmationIncome:Ki(),methodObtain:Gi(),deliveryDate:Gi("Укажите дату доставки")},ar={organization:Ki("Выберите тип организации"),organizationAddress:hn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(Yl),organizationPhone:Zi("Укажите номер телефона"),organizationName:Gi("Укажите наименование организации"),legalForm:Gi("Укажите ОПФ"),generalSeniority:Xl("Укажите количество лет стажа"),lastJobExperience:Xl("Укажите стаж на последнем месте работы"),experience5Years:Xl("Укажите общий стаж за последние 5 лет"),jobsNumber:Xl("Укажите количество мест работы за последние 5 лет"),beginDate:Gi("Укажите дату заключения трудового договора"),addressFact:Kl(),addressRegistration:Kl(),addressRetail:Ki("Выберите адрес банка"),addressMatch:Gi(),sex:Gi("Укажите свой пол"),limitedBirthday:hn(Zl)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:Gi("Укажите место рождения"),education:Ki("Выберите ваше образование"),housing:Ki("Выберите тип жилья"),amountWorkers:Ki("Выберите информацию о количестве сотрудников"),employment:Ki("Выберите информацию о трудоустройстве"),employerActivities:Ki("Выберите вид деятельности организации"),employerOrganization:Ki("Выберите вид организации"),positionOrganization:Ki("Выберите вашу должность"),familyStatus:Ki("Выберите семейное положение"),familyMembers:Jl(2,"Укажите количество членов семьи"),children:Jl(2,"Укажите количество детей"),dependents:Jl(2,"Укажите количество иждивенцев"),totalIncome:Jl(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Jl(10,"Укажите сумму обязательных выплат"),snils:(e=>hn(er)(e))("Некорректный номер СНИЛС"),conscription:Gi(),armyIdFlg:Qi,dulSerie:(e=>hn((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:Ql("Укажите номер паспорта"),dulIssueDate:Gi("Укажите дату выдачи паспорта"),dulSubdivisionCode:Ql("Укажите код подразделения"),dulIssuedBy:Gi("Укажите организацию, выдавшую паспорт"),participantDateRegistration:Gi("Укажите дату регистрации"),retirementIncome:Gi(),otherIncome:Gi(),wages:Gi(),mandatoryPayments:Gi(),bankruptcyFlg:Gi(),shareholderFlg:Gi(),legalEntityName:Gi(),bankEmployeeCode:Gi(),partInBusiness:Gi(),regionRetail:Ki("Выберите регион"),latinSurname:Gi("Укажите фамилию")},ir={...ar,...nr,...tr},lr={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18},consentPhotoFlg:{text:"Согласие на фотографирование",docId:17}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}},rr=async(e,t,n)=>{try{return(await sr(e,t,n)).json()}catch(e){return console.error(e),null}};async function sr(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...or()},credentials:"include",body:n?JSON.stringify(n):null})}const or=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},cr=d((()=>{const e=ln(),t=l((async()=>{const t=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},rr("/esia/getLink","POST",n));var n;t?.link&&e.assign(t.link)}),[]);return c("div",{className:"flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9",children:[c("div",{className:"flex flex-col justify-around w-full",children:[o("p",{className:"mb-4 text-xl @md:text-2xl @md:mb-6",children:"Заполните данные через Госуслуги"}),c("ul",{className:"list-disc list-inside mb-9",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block mb-6 self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Tl,{type:"button",onClick:t,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),dr=e=>e?.value||"",mr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=dr}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`,c=globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(r);return c},ur={url:"suggest/address"},hr={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:ur,addressFact:ur,organizationAddress:ur,addressCourier:ur},pr=d((({options:e,container:t,onChange:n})=>{const[l,r]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?r(l<a?l+1:0):"ArrowUp"===t.key?r(l>0?l-1:a):"Enter"===t.key&&e[l]&&(t.preventDefault(),n(e[l]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[l]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>o("div",{className:u("flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",{"bg-main-divider":l===t}),role:"listitem",onMouseDown:()=>n(e),children:o("span",{className:"min-h-6",children:e.processedValue})},t.toString())))})}));function gr({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=An(),x=hr[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await mr({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(pr,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const fr=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=Cn,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:k}]=dn(),S=Nn(C),I=l((e=>{v&&!w&&k(),b?e.length<=b&&d(e):d(e)}),[w,d]);i((()=>{y&&n&&d(xr(n))}),[n]);const T=gr({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:S,onBlur:C,onFocus:k,children:[o("div",{ref:T,children:o(Tn,{disabled:N,type:g||"text","aria-label":t,label:wn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:yr(a,s,t)})}),Rn(r)]})})),xr=(e="")=>e.replace(/[^\d]+/g,""),yr=(e,t,n)=>t&&!n?`${e}*`:e,br=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(vr(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(fr,{disabled:t?.filledByEsia&&xi(e,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:r,...t,onDaDataChange:i})})),vr=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),Nr=Wt((({field:e,input:t,source:n})=>{const[r,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=l((t=>{e?.("addressCourier")?.onChange?.(vr(t))}),[]),h=l((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(fr,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:r||e("addressCourier")?.error,onDaDataChange:u})})),wr=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(fr,{label:"Адрес",disabled:r,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Cr=d((({field:e,input:t})=>o(mi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),kr=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:Sr({textItems:l,subText:t,children:n,isPhone:a,...i})})),Sr=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Fe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Ir(n,s),i?o(Fe,{color:a,size:"text-m",children:i}):null]}),Ir=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Fe,{size:"text-l",children:t?o("a",{href:`tel:${Tr(e)}`,children:e.trim()}):e.trim()},String(n)))),Tr=e=>e.replace(/\D/g,""),Pr=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Rr=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),Br=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),Er=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...l})=>c(Tl,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...l,children:[o(Rr,{children:a}),o(Br,{isUnfolded:t,iconVersion:i?"color":""})]}))),Dr=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const _r=d((({className:e,isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:u("transition-max-h duration-300 overflow-hidden",{"max-h-0":Boolean(a.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:n})})})),Ar=d((({children:e})=>{const[t,{toggle:n}]=dn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Dr,{className:"block sm:hidden",children:[o(_r,{isUnfolded:t,children:e}),o(Er,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),Mr=e=>{const t=Fr(e);return o(kr,{label:"Режим работы",value:t,className:"max-w-none"})},Or=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Fr=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Or({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Or({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},zr=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Vr=e=>zr.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),Lr=e=>{if(!e)return null;const t=$r(e);return c(Pr,{className:"border-none",children:[o(kr,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(jr)})}),o(kr,{label:"Режим работы",className:"max-w-none",children:o(Fe,{children:e})})]})},$r=e=>{const t=zr.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},jr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Fe,{size:"text-xs",children:e})},String(n)),Ur=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(kr,{label:"Валюта",value:e.currency}):null,t?o(kr,{label:"Купить",value:String(t)}):null,n?o(kr,{label:"Продать",value:String(n)}):null]},String(a)),qr={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Wr=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",qr[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Fe,{size:"text-m",color:qr[n].text,children:t})]}))),Hr=(new Date).getDay(),Yr=e=>{const[t]=e?.slice(Hr-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Wr,{color:"green",children:i}):null,n&&l?o(Wr,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Wr,{color:"red",children:"Выходной"})},Gr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Kr=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(kr,{label:e,value:t&&n?n:"",subText:Gr({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Xr=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Jr=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Zr=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Qr=(e,t)=>{if(!e.workSchedule)return null;const n=Vr(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Fe,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:e.address})]}):null]}),Yr(n)]}),o(Ar,{children:es(e)})]},String(t))},es=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=Vr(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Pr,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(kr,{label:"Факс",value:t,isPhone:!0}),o(kr,{label:"Телефон филиала",value:e,isPhone:!0}),o(kr,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(kr,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(kr,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(kr,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(Pr,{children:o(kr,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Kr)})})}):c(Pr,{children:[o(kr,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(jr)})}),Mr(d)]}),r?.businessScheduleVisibleTag?Lr(r?.businessScheduleDescription):null,s?.currencies?.length?o(Pr,{className:"flex-wrap",children:s?.currencies?.map(Ur)}):null]})},ts=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=Vr(e),n=e?Fr(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Xr(n):Zr(n,a):Jr(n):""})(n)}`;return{header:a,body:l}},ns={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},as={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},is={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},ls=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>is[t](e)))))},rs=()=>{},ss=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=rs,getBalloonRemoteWorkplaces:i=rs})=>{const[l,s,o,c]=r((()=>{const l=ls(e,n),r=ls(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},os=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),cs=d((({children:e})=>os?e:null)),ds="/icons/MapMarkerClusterIcon.svg",ms="/icons/MapMarkerClusterYellowIcon.svg";function us({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=hs("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=hs("workplaces",e,i),r=ps(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ps(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=ps(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const hs=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?ds:ms,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ps=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?ds:ms,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),gs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},fs={...gs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},xs=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(fs).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),ys=e=>globalThis[e],bs=(e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=ys(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(ys(e))}))}))}return new Promise(((a,i)=>{const l=globalThis.document.createElement("script");l.src=t,l.async=!0,l.id=t,n&&(l.type="module"),l.addEventListener("load",(()=>{a(ys(e))})),l.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(l)}))};const vs=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return bs(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Ns={...gs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},ws=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Ns).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),Cs=[55.753995,37.614069],ks=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=vs();if(i((()=>{r.current?us({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Ss(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),us({yandexMaps:m,map:r.current,points:e,isLoad:a})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,a,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(Fl,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(ws,{yandexMaps:r}),o(ws,{yandexMaps:r,direction:"out"})]}),xs(r,m,u("right-2 top-80",h))]})})),Ss=e=>{const t=[Ts(Is(e,0)),Ts(Is(e,1))];return t.every((e=>e))?t:Cs},Is=(e,t)=>e.map((e=>e.coords?.[t])),Ts=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Ps=e=>Number(e.toString().replace(",",".")),Rs=e=>{const{data:t,error:n}=Jn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Bs);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Bs=async e=>await Ft(e,{method:"POST"})||[],Es=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=Rs("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await rr("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Ps(e.latitude??Cs[0]),gpsLongitude:Ps(e.longitude??Cs[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=ss({data:n,filtrationState:{},getBalloon:ts});return c("div",{children:[o($n,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(cs,{children:o(ks,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Ds(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function _s(e,t){return Ds(e,t),Ds(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class As{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class Ms{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const Os={};function Fs(e,t=Os){const n=s(null),o=function(){const[,e]=a(0);return l((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const zs=new Ms;function Vs(e){return Fs(zs,e)}_s(zs,new As(globalThis?.localStorage));const Ls=()=>Vs(),$s=Wt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...l})=>{const r=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o($n,{placeholder:a,options:r,...e(n),...l})})),js=d((({field:e,input:t})=>{const{data:n}=Rs("EMPLOYEES_NUMBER"),a=Ls();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o($s,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Us=d((({field:e,input:t})=>o(mi,{text:"Наличие военного билета",...e(t?.name??"")}))),qs=d((({field:e,input:t})=>o(fr,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),Ws=d((({field:e,input:t})=>o(mi,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Hs=d((({field:e,input:t})=>o(Wa,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:t?.filledByEsia&&xi(e,t?.name??"")}))),Ys=d((({field:e,input:t})=>o(fr,{label:"Место рождения",...e(t?.name??""),...t,disabled:t?.filledByEsia&&xi(e,"birthPlace")})));function Gs(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?(e=>{try{return JSON.parse(String(e))}catch(e){return null}})(t):null);return[n,l((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const Ks=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Me,{__html:e})})]}))),Xs=d((({field:e,input:t})=>{const[n,l]=a([]),[s]=Gs("programId"),{value:d,onChange:m}=e("cardCategory"),u=e("paymentSystem")?.value?.key;i((()=>{u&&s&&(async()=>{const e=await(async(e,t)=>{const n=await rr("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(u,s);l(e),Js(e,d)||m&&m(null)})()}),[u]);const h=r((()=>n?.find((e=>e.key===d?.key))?.description),[n,d]);return c("div",{children:[o($s,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),h?o(Ks,{__html:h}):null]})})),Js=(e,t)=>e.some((e=>e.key===t?.key)),Zs=d((({field:e,input:t})=>o(fr,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Qs=d((({field:e,input:t})=>o(fr,{label:"Кодовое слово",...e(t?.name??""),...t}))),eo=d((({field:e,input:t})=>{const{data:n}=Rs("INCOME_CERT_UNITED"),a=t?.filledByEsia&&xi(e,t?.name??"");return c("div",{children:[a?o("div",{className:"mb-6",children:o(Ks,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"})}):null,o($s,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t,disabled:a})]})})),to=d((({field:e,input:t})=>{const{data:n}=Rs("MILITARY_STATUS");return o($s,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),no=()=>Vs(),ao=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Te();return c(Rl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Tl,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),io=(e,t)=>{const{open:n}=bn(ao),a=Te();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await sr(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},lo=d((({className:e,error:t,docId:n,...a})=>{const i=io(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ri,{...a}),n?o(Tl,{embedded:!0,onClick:i,children:o(Rr,{children:"Ознакомиться"})}):null]}),Rn(t)]})})),ro=d((({field:e,input:t})=>{const{productType:n}=no(),a=lr[n??""];return t&&t.name?o(lo,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),so=Math.round(29.5),oo=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),co="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",mo="flex flex-col lg:w-1/2 gap-2xl",uo="flex flex-col gap-y-xl min-w-52",ho=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Fe,{size:"text-h3",children:"number"==typeof e?[a,Ke(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),po=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Fe,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(ho,{value:n,...i}):o(Fe,{size:"text-h3",children:"-"})]}))),go=e=>xo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),fo=(e=[],t=!1,n=[])=>({...xo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),xo=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},yo=(e,t=0)=>e?.sum?e.sum:t,bo=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,vo=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,No=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ma,{items:[`От ${wo(e)}`,`До ${wo(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),wo=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Co=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...l})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(Fe,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(gl,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...l})]}),ko=e=>Co({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),So=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ma,{items:e?[`От ${Ke(1)(a.min||0)} ${n}`,`До ${Ke(1)(a.max||0)} ${n}`]:[],step:t,...a}),Io=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(ra(t?.[i],n.minMonths,n.maxMonths))},To=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},Po=e=>e,Ro=(e=Po)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Bo=Ro(),Eo=(e=Po)=>Ro((t=>-e(t))),Do=Eo(),_o=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Ao([e,t],a),Ao=([e,t],n=[])=>({[e]:n.length?Do(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Bo(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Mo=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Oo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Fo=e=>zo({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&zo({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&zo({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&zo({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),zo=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Vo=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Oo],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Fo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=_o(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=_o(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Fo({row:e,userInputParams:t,paramsViewSettings:n})&&Mo(a,["minSum","maxSum"],e)&&Mo(i,["minMonths","maxMonths"],e)))||Oo)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=To(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Lo=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),$o={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},jo=Wt((({className:e,title:t,calcSource:n,buttons:a,footnote:r,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=go(n?.rateRows),g=l((e=>{const t=Vo(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:x}]=xn({moneyValue:yo(d,2e5),monthsValue:bo(d,so),monthlyPayment:0,rate:0,isAnnuity:Boolean(d?.isAnnuity),isInsurance:Boolean(d?.isEnableInsurance),isSalaryClient:Boolean(d?.isEnableSalaryClient),isPensionClient:Boolean(d?.isEnablePensionClient),isStateEmployee:Boolean(d?.isEnableStateEmployee)},{onChange:g}),y=Vo(f,n,s),b=ko({...x("isAnnuity")}),{onChange:v}=x("moneyValue"),{onChange:N}=x("monthsValue");return i((()=>{v&&v(ra(f.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),i((()=>{N&&N(ra(f.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),i((()=>{!Lo(d)&&p&&Io({field:x,defParams:p,calcParams:y,map:$o,monthsValue:"minMonths"})}),[n,d]),o(oo,{className:e,title:t,...h,children:c("section",{className:u(co,e),children:[c("div",{className:mo,children:[So({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...x("moneyValue"),value:y.moneyValue}),No({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...x("monthsValue"),value:y.monthsValue}),Uo({...y,...s},x),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(uo,"@4xl:w-1/2"),children:[o(po,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(po,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(po,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),We(a,{isVertical:!0}),vo(r)]})]})})})),Uo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ri,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ri,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ri,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),qo="calculator",Wo=d((({field:e,params:t})=>{const n=l((t=>{e(qo).onChange?.(t)}),[]);return o(jo,{...t?.calcData,padding:"p-0",defaultParams:Yo(e(qo).value),onChange:n})})),Ho={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Yo=(e,t=!1)=>{const n=t?Go(Ho):Ho;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Go=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Ko=d((({field:e,input:t})=>{const{data:n}=Rs("CREDIT_IN_RSHB");return o($s,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Xo={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card"},Jo=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gl,{label:wn({label:t,errors:a?.errors}),...a}),Rn(n)]}))),Zo=[{id:"810",text:"Рубли"}],Qo=d((({field:e,input:t})=>{const{data:n}=Rs("CURRENCY"),{programId:a}=no(),i=r((()=>!Object.keys(Xo).includes(a||"")||"38"===a),[]),l=r((()=>i?Zo:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(Jo,{label:"Валюта",orientation:"horizontal",items:l,...e(t?.name??"")})})),ec=(e,t)=>{if(!t)return null;const n=ic(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},tc=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},nc=(e,t)=>{const n=ic(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},ac=(e,t,n)=>{const a=ic(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},ic=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,lc=(e,t,n)=>{const{okved:a,okopf:i,inn:l,organizationName:r}=rc(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(vr(n.data?.address));const s={amountWorkers:tc(e?.amountWorkers,n.data?.employee_count),employerActivities:ec(e?.employerActivities??[],a),organization:ac(e?.organization??[],i,l),employerOrganization:nc(e?.employerOrganization??[],i),organizationName:r};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},rc=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),sc=d((({field:e,input:t})=>{const n=Ls(),{employerActivities:a,employerOrganization:r,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=l((t=>{lc(n,e,t)}),[]);return i((()=>{d&&m&&a&&r&&s&&c&&(async()=>{const t=await(async e=>{const t=await mr({url:"suggest/party",query:e});return t?.[0]})(m);t&&lc(n,e,t)})()}),[a,r,s,c]),o(fr,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u,disabled:t?.filledByEsia&&xi(e,t?.name??"")})})),oc=d((({field:e,input:t})=>o(Wa,{label:"Дата доставки",...e(t?.name??"")}))),cc=d((({field:e,input:t})=>{const{data:n}=Rs("COURIER_DELIVERY_TIME"),a=r((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(Jo,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),dc=d((({field:e,input:t})=>o(fr,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),mc=d((({field:e,input:t})=>o(Wa,{label:"Дата выдачи",...e(t?.name??""),disabled:t?.filledByEsia&&xi(e,t?.name??"")}))),uc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(fr,{disabled:t?.filledByEsia&&xi(e,t?.name??""),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),hc=d((({field:e,input:t})=>o(fr,{disabled:t?.filledByEsia&&xi(e,t.name??""),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),pc=d((({field:e,input:t})=>o(fr,{disabled:t?.filledByEsia&&xi(e,t.name??""),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),gc=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(fr,{disabled:t?.filledByEsia&&xi(e,t.name??""),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),fc=d((({field:e,input:t})=>{const{data:n}=Rs("EDUCATION_LEVEL");return o($s,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),xc=d((({field:e,input:t})=>o(fr,{label:"Электронная почта",...e(t?.name??""),...t}))),yc=d((({field:e,input:t})=>{const{data:n}=Rs("ORGANIZATION_ACTIVITY_TYPE"),a=Ls();return i((()=>{n&&(a.employerActivities=n)}),[n]),o($s,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),bc=d((({field:e,input:t})=>{const{data:n}=Rs("ORGANIZATION_KIND"),a=Ls();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o($s,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),vc=d((({field:e,input:t})=>{const{data:n}=Rs("EMPLOYMENT_INFO_UNITED");return o($s,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Nc=d((({field:e,input:t})=>o(fr,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),wc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ra(Number(n),0,5)))),[]);return o(fr,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:t?.filledByEsia&&xi(e,t?.name??"")})})),Cc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),l=e("familyStatus")?.value?.key,r="MARRIED"===l?2:1,s=Number(e("children")?.value),c=Number(e("dependents")?.value),d=r+s+c;return i((()=>{a?.(d)}),[l,s,c]),o(fr,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),kc=d((({field:e,input:t})=>{const{data:n}=Rs("MARITAL_STATUS");return o($s,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Sc=d((({field:e,input:t})=>o(fr,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t,disabled:t?.filledByEsia&&xi(e,t?.name??"")}))),Ic=d((({field:e,input:t})=>{const{data:n}=Rs("HOUSE_TYPE");return o($s,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Tc=d((({input:e})=>o(Ks,{__html:e?.label}))),Pc=d((({field:e,input:t})=>o(fr,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:t?.filledByEsia&&xi(e,t?.name??"")}))),Rc=d((({field:e,input:t})=>o(fr,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t,disabled:t?.filledByEsia&&xi(e,t?.name??"")}))),Bc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Ec=(e="")=>Bc.test(e),Dc=e=>{const t={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},_c=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,r=e("latinName")?.onChange;i((()=>{r?.(Dc(a))}),[]);const s=l((e=>{(Ec(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(Bn,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Ac=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,r=e("latinSurname")?.onChange;i((()=>{r?.(Dc(a))}),[]);const s=l((e=>{(Ec(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(Bn,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Mc=d((({field:e,input:t})=>o(fr,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),Oc=d((({field:e,input:t})=>o(fr,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),Fc=d((({field:e,input:t})=>o(Wa,{label:"Дата рождения",...e(t?.name??""),disabled:t?.filledByEsia&&xi(e,t.name??"")}))),zc=d((({field:e,input:t})=>o(fr,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Vc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Lc=d((({field:e,input:t})=>o(Jo,{orientation:"horizontal",items:Vc,...e(t?.name??"")}))),$c=d((({field:e,input:t})=>o(fr,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&xi(e,t?.name??""),...e(t?.name??""),...t}))),jc=d((({field:e,input:t})=>o(fr,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),Uc=d((({field:e,input:t})=>{const{data:n}=Rs("ORGANIZATION_TYPE"),a=Ls();return i((()=>{n&&(a.organization=n)}),[n]),o($s,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),qc=d((({field:e,input:t})=>{const n=Ls(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),lc(n,e,t)}),[]);return o(fr,{label:"Наименование организации",...t,...e(t?.name??""),disabled:t?.filledByEsia&&xi(e,t?.name??""),onDaDataChange:a})})),Wc=d((({field:e,input:t})=>o(fr,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Hc=d((({field:e,input:t})=>o(Wa,{label:"Дата регистрации по месту жительства",...e(t?.name??"")}))),Yc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ra(Number(n),0,100)))),[]);return o(fr,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const Gc=e=>e.map((e=>({key:e.type,text:e.name}))),Kc=e=>e?.key,Xc=d((({field:e,input:t})=>{const[n,l]=a([]),s=Vs();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await rr("/public-data/creditProgramConditions","POST",{creditProgramId:e});return Gc(t?.paymentSystems||[])})(e);l(t??[])}},i((()=>{const e=c();return()=>{e.then((e=>{e instanceof Function&&e()}))}}),[]);const d=r((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(Jo,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:Kc,parse:e=>n?.find((t=>t.key===e))})})})),Jc=d((({field:e,input:t})=>{const{data:n}=Rs("POSITION");return o($s,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Zc=async()=>await rr("/public-data/regionsCardDelivery","GET")||void 0,Qc=d((({field:e,input:t})=>{const{data:n}=Rs("REGION_RF"),{data:a}=Jn("regionsDelivery",Zc),{programId:i}=Ls(),r="38"===i,s=n?.map((({key:e,value:t})=>({key:e,text:t}))),c=e("regionRetail")?.onChange,d=e("regionHasDelivery")?.onChange,m=e("methodObtain")?.onChange,u=l((e=>{const t=a?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!r;d?.(t),m?.(t?"courier":"office"),c?.(e)}),[a]);return o($n,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:s,...e(t?.name??""),onChange:u})})),ed=d((({field:e,input:t})=>o(fr,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),td=["male","female"],nd=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],ad=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:l}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await mr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return td.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Jo,{label:"Пол",orientation:"horizontal",items:nd,...e(t?.name??"")})})),id=d((({field:e,input:t})=>o(mi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),ld=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Pa(e,"___-___-___ __")):t?.(Pa(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Tn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),rd=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ld,{"aria-label":t,label:wn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),Rn(a)]}))),sd=d((({field:e,input:t})=>o(rd,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),od=d((({field:e,input:t})=>o(fr,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&xi(e,"surname"),...e(t?.name??""),...t}))),cd=d((({field:e,input:t})=>o(fr,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),dd=d((({field:e,input:t})=>o(fr,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t,disabled:t?.filledByEsia&&xi(e,t?.name??"")}))),md={$ref:"/wcms-resources/delivery-cities-data.json"},ud={limitedBirthday:Fc,name:jc,surname:od,middleName:$c,email:xc},hd={processPersonalDataFlg:ro,consentProviderFlg:ro,consentOthersFlg:ro,consentInformFlg:ro,consentPfrFlg:ro,consentInformMaterialsFlg:ro,consentPhotoFlg:ro,consentFATCA:ro},pd={organization:Uc,organizationAddress:br,organizationPhone:Di,organizationName:qc,legalForm:Oc,generalSeniority:Sc,lastJobExperience:Rc,experience5Years:wc,jobsNumber:Pc,beginDate:Hs,addressFact:wr,addressRegistration:br,addressRetail:Es,addressMatch:Cr,sex:ad,limitedBirthday:Fc,birthPlace:Ys,education:fc,housing:Ic,amountWorkers:js,employment:vc,employerActivities:yc,employerOrganization:bc,positionOrganization:Jc,familyStatus:kc,familyMembers:Cc,children:Zs,dependents:dc,totalIncome:cd,expenses:Nc,snils:sd,conscription:to,armyIdFlg:Us,dulSerie:pc,dulNumber:hc,dulIssueDate:mc,dulSubdivisionCode:gc,dulIssuedBy:uc,participantDateRegistration:Hc,retirementIncome:ed,otherIncome:Wc,wages:dd,mandatoryPayments:zc,bankruptcyFlg:Ws,shareholderFlg:id,legalEntityName:Mc,creditInRshbCd:Ko,bankEmployeeCode:qs,partInBusiness:Yc,regionRetail:Qc,infoCard:Tc,calculator:Wo,confirmationIncome:eo,inn:sc},gd={addressCourier:e=>o(Nr,{...e,source:md}),paymentSystem:Xc,currency:Qo,cardCategory:Xs,codeWord:Qs,methodObtain:Lc,deliveryDate:oc,latinName:_c,latinSurname:Ac,deliveryTime:cc},fd="Согласие на все документы",xd=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=l((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Ui(t(e?.name),Qi).error)))),[e]),[d,{toggle:m}]=dn(!0);return o("div",{className:"w-fit",children:c(Dr,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ri,{text:fd,value:a,onChange:i},n),Rn(s?"Отметьте все обязательные соглашения":"")]}),o(Tl,{embedded:!0,ariaLabel:fd,onClick:m,children:o(Br,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(_r,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(Nl(t,{},hd))})]})})})),yd=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=bd(t||[],n);return a.length>2?c("div",{children:[i.map(Nl(e,{},{...ud})),o(xd,{inputs:a,field:e})]}):(t||[])?.map(Nl(e,{},{...ud}))},bd=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(lr[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(lr[t]).includes(String(e))))}),vd=(e,t=!1)=>o(zl,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),Nd=e=>sr("/user-data/updateUserProfile","PUT",e),wd=e=>sr("/user-data/updateUserTask","PUT",e),Cd=d((({className:e,seconds:t})=>o("span",{className:e,children:kd(t)}))),kd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),Sd=(e,t)=>{const n=s(null),a=l((()=>clearInterval(n.current)),[]),r=l((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(r(),a)),[r,a]),{start:r,stop:a}};function Id({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),r=l((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=Sd(r,t);return l((e=>{i.current=e,o()}),[])}const Td={width:"103",height:"21"},Pd={"bg-white":"color",transparent:"white"},Rd={"bg-white":"text-primary-main",transparent:"text-white"},Bd=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Pd[e]},className:Rd[e],width:n?.width,height:n?.height}),Ed={"bg-white":"text-primary-text",transparent:"text-white"},Dd=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ye(s),children:[Bd(l,n?.image,Td),r?a??o("div",{className:"ml-s",children:o(Fe,{font:"font-medium",color:Ed[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),_d=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=dn(!1),x=l((async()=>{g();var e;await(e={captchaText:d},sr("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),y=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>sr(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(y,[]),o(Rl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Dd,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o(Tl,{className:"w-8",embedded:!0,onClick:y,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Tn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Tl,{version:"secondary",onClick:close,children:"Вернуться"}),o(zl,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),p?o(Fl,{blur:!1}):null]})})})),Ad=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=l((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Md(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Md=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${Sn(!n||!a)} rounded-md caret-transparent outline-none`},Od=d((({isDisabled:e,onClick:t,text:n})=>o(Tl,{type:"button",onClick:t,disabled:e,children:o(Fe,{font:"font-normal",children:n})}))),Fd=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},zd=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,{setTrue:o,setFalse:c}]=dn(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=l((()=>r("")),[]),x=Boolean(0===d&&u),y=p>2||x||!e.every(Boolean),b=l((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>rr("/sms/checkCode","POST",e).then(Fd))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{r(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{r(x?"Код просрочен":"")}),[x]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:y,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},Vd=d((({phone:e,code:t=!0,withDescription:n=!0,codeLength:r=4,consents:s,onSuccess:d=Cn,onClose:m=Cn})=>{const[u,h]=a(Array(r).fill("")),{handleSubmit:p,hasError:g,errorText:f,isLoading:x,timeNextReq:y,isSubmitButtonDisabled:b,setTimeNextReq:v,setIsTimerStarted:N,setAttempts:w}=zd({values:u,onSuccess:d}),C=bn(_d),k=Xt(e),I=Id({seconds:y,onTick:v}),T=l((async()=>{var e;await(e={phoneNumber:k,smsCodesSetName:{key:"AUTHENTICATION"}},sr("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(w(0),v(180),I(180),N(!0)):C.open({phoneNumber:k,sendCode:T})}),[k,I,m]);return i((()=>{T()}),[]),o(Rl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:m,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Ad,{values:u,setValues:h,errorText:f,hasError:g}):null,$d(y,T),n?c(Me,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:s?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Ld(b,p),x?o(Fl,{blur:!1}):null]})})})),Ld=(e,t)=>o(Od,{text:"Далее",isDisabled:e,onClick:t}),$d=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Cd,{className:"ml-1",seconds:e})]}):o(Tl,{embedded:!0,onClick:t,children:o(Rr,{children:"Получить новый код"})}),jd={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Ud={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},qd=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Wd=d((({onSubmit:e=Cn,onClose:t=Cn})=>{const[n,i]=a(""),[r,s]=a(!1),d=io(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),s("REFUSE"===e)}),[]),h=r?Ud:jd;return o(Rl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(gl,{className:"whitespace-normal",orientation:"horizontal",items:qd,value:n,onChange:u}),o(Tl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Hd=d((({title:e,icon:t,description:n,onClick:a=Cn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[o(Fe,{font:"font-medium",size:"text-s",children:e}),n?o(Fe,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),Yd={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Gd={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Kd={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Xd=e=>Object.entries(e).reduce(((e,[t,n])=>t in Yd?[...e,{contactTypeCd:{key:Yd[t]},value:n}]:e),[]),Jd=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Gd){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Gd[t]},...a}]}return e}),[]),Zd=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:l,wages:r,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:l,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(f={wages:r,mandatoryPayments:s,incomeAverage:Qd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(f).reduce(((e,[t,n])=>t in Kd?[...e,{incomeTypeCd:{key:Kd[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p};var f},Qd=(e,t)=>(Number(e??0)+Number(t??0)).toString(),em={WORK:"Работаю",RETIREE:"Пенсионер"},tm={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},nm={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},am={...nm,amur_card:"14",owner_card:"13",travel_card:"15"},im=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Qd(t,s),additionalIncome:a,otherIncome:i,otherPayments:l,rentalIncome:r,retirementIncome:s}},lm=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},rm=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},sm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,om=d((function({task:e,isFromLead:t=!1,sendAspects:n=Cn,onClose:a=Cn}){const i=Ls(),r=ln(),{participants:s,creditProgram:d,createdDate:m="",id:u}=e,h=am[d.code],p=Boolean(nm[d.code]),g=p?"/credit-lead":"/credit-card-lead",{id:f,profile:x}=s[0],y=l((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:l}=e,{loanAmount:r,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:k=[],employmentContractDate:S,employmentTypeCd:I,organizationName:T,organizationInn:P,organizationActivityTypeCd:R,organizationTypeCd:B,organizationKindCd:E,employeesNumberCd:D,opf:_,seniority:A,generalSeniority:M,jobsNumber:O,lastWorkDuration:F,positionCd:z,maritalStatusCd:V,childrenDependents:L,totalDependents:$,otherDependents:j,militaryStatusCd:U,participantIncomes:q,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q,profile:ee}=t;return{currency:l?.key,paymentSystem:sm(i),cardCategory:sm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:sm(b),participantDateRegistration:v,housing:sm(N),beginDate:S,employment:sm(I,em),organizationName:T,inn:P,employerActivities:sm(R),organization:sm(B),employerOrganization:sm(E),amountWorkers:sm(D),legalForm:_,generalSeniority:A?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:F?.toString(),positionOrganization:sm(z),familyStatus:sm(V),children:L?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:sm(U),confirmationIncome:sm(Q,tm),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:sm(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:r,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},esiaAccountTypeCd:ee?.esiaAccountTypeCd,...im(q),...lm(k),...rm(C),...(te=w,te?.key?{sex:"MAN"===te.key?"male":"female"}:null)};var te})(e);i.participantId=f??null,i.taskId=u,i.profileId=x?.id??null,i.programId=h,i.leadForm=t,x?.id&&n(x.id,u),r.assign(g)}),[]),b=l((()=>{r.assign(p?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(Rl,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:a,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs md:mt-0 mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(Hd,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:m?`Черновик от ${Kt(new Date(m))}`:"",onClick:y}),o(Hd,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?a:b})]})]})})})),cm=d((function({onClose:e=Cn}){const t=ln(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(Rl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Tl,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Tl,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),dm=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},mm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),um=({programId:e,nextStepLink:t,productType:n,data:i})=>{const[r,{setTrue:s,setFalse:o}]=dn(!1),[c,d]=a(),m=(()=>{const e=no();return l((({participantId:t,taskId:n,profileId:a,programId:i,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=l}),[])})(),u=(({data:e})=>{const t=cn();return l(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});an({aspectsAttributes:mm(e,i),aspects:t,ev:{}})}),[e])})({data:i}),h=ln(),p=l((()=>{h.assign(t)}),[]),g=(e=>{const{open:t}=bn(Wd),n=bn(Vd),a=t=>async n=>{try{t&&await Nd({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(p),f=bn(Vd),x=(()=>{const{open:e}=bn(om),{open:t}=bn(cm);return{open:({task:n,isFromLead:a,onClose:i,sendAspects:l})=>{n?e({task:n,isFromLead:a,onClose:i,sendAspects:l}):t({})}}})();return{isSending:r,ok:c,handleSubmit:l((async t=>{try{s();const i=await(a={profile:{phone:Xt(t.phone)}},rr("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null)));if(i&&t?.phone){const a=async()=>{await pm({programId:e,profileId:i,formData:t,productType:n,saveUserData:m,sendAspects:u}),f.close(),"debitCard"===n?p():g.open(t.phone,i)},l=async()=>{try{const t=await(async e=>{const t=await rr("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:i,programId:e});if(t){const e=await(async e=>await rr("/user-data/getTaskById","POST",e)||void 0)({taskId:t});f.close(),x.open({task:e,isFromLead:!0,sendAspects:u,onClose:a})}else await a()}catch{d(!1)}},r=hm(t,n);f.open({phone:t?.phone,consents:r,onSuccess:l}),o()}}catch{d(!1)}var a}),[])}},hm=(e,t)=>{const n=lr[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},pm=async({programId:e,profileId:t,formData:n,productType:a,saveUserData:i,sendAspects:l})=>{let r,s;const o=gm(n,a);await Nd(((e,t,n)=>{const{name:a="",surname:i="",middleName:l="",limitedBirthday:r="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:l,birthDate:r&&Kt(r,!0),email:o,phone:Xt(s),...n}}})(t,n,o));try{if("debitCard"===a){const t=await(async e=>await rr("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t)=>{const{name:n,surname:a,middleName:i,limitedBirthday:l,phone:r,email:s}=e;return{task:{taskSource:ln().origin,creditProgram:{code:Xo[t]},participants:[{birthDate:l&&Kt(l,!0),midname:i,name:n,surname:a,participantContacts:Xd({phone:r&&Xt(r),email:s})}]}}})(n,e));r=t.taskId,s=t.participantId}else{const a=await(async e=>await rr("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});r=a.taskId,s=a.participantId,await wd((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:ln().origin,id:t,participants:[{birthDate:s&&Kt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:Xd({phone:o&&Xt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:dm()}}})({participantId:s,taskId:r,profileId:t,formData:n}))}l(t,r),i({participantId:s,taskId:r,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},gm=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentInformMaterialsFlg:s,consentPhotoFlg:o,consentFATCA:c}=e;let d;return d="credit"===t?{consentPhotoFlg:n,consentPfrFlg:a,consentInformMaterialsFlg:n}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:o}:{consentFATCA:c,consentPhotoFlg:n},{...d,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},fm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},xm=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,fm[e.name||""]])))}},ym=async(e,t,n=!1)=>{const a=new FormData;a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml"));return await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...or()},credentials:"include",body:a}).then((e=>e.json())))},bm=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},vm=e=>Math.floor(e/12),Nm=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1},{file:e.pdfFileSigWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.xmlFileSigWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>ym(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},wm=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every((e=>Boolean(e))))throw new Error},Cm=e=>{const{esiaAdditionalDocument:t}=e;return[t.inn,t.averageMonthlyIncome.toString(),t.startWorkDate,t.workLengthInFiveYears.toString(),t.workLength.toString(),t.workLengthLastJob.toString(),t.jobsNumberInFiveYears.toString(),t.pdfFilePayout,t.pdfFileWorkbook,t.pdfFileSigPayout,t.xmlFilePayout,t.xmlFileSigPayout,t.xmlFileWorkbook,t.pdfFileSigWorkbook,t.xmlFileSigWorkbook].every((e=>Boolean(e)))},km=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a})=>{const s=no(),o=l((e=>{const t=e instanceof Function?e(c[d]):e;null!=t?c[d]=t:delete c[d]}),[c=s,d="leadForm"]);var c,d;const m=r((()=>xm(e,s.leadForm,a)),[e,s.leadForm]),u=l((async(e,a)=>{n(Sm.Pending);try{const l=await(i={code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0},rr("/esia/requestProfile","POST",i).then((e=>(Fd(e),e))));if(l){const e=await(async(e,t)=>{wm(e);const n=!t&&Cm(e),{profile:a,addInfo:i,document:l,addressRegistration:r,addressFact:s,esiaAdditionalDocument:o}=e;let c=[];return n&&(c=await Nm(o)),{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Ri(a.phone),email:a.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:bm(r),addressFact:bm(s),esiaAccountTypeCd:t?a.esiaAccountType:{key:""},...n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:vm(o.workLengthInFiveYears).toString(),generalSeniority:vm(o.workLength).toString(),lastJobExperience:vm(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:a.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:c}}})(l,"debitCard"===t);o((t=>({...t,...e}))),n(Sm.Success)}}catch{n(Sm.Error)}var i}),[]);return i((()=>{s.productType=t;const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=e.get("code"),a=e.get("state");n&&a?u(n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),m};var Sm;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(Sm||(Sm={}));const Im=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",button:d,productType:m="credit",data:h,...p})=>{const[g,f]=a(),x=s(null),y=r((()=>(e=>{const t=lr[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"phone",required:!0,filledByEsia:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentInformMaterialsFlg"},{name:"consentPhotoFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),b=r((()=>y?.flatMap((e=>e?.inputs))||[]),[y]),v=r((()=>nl(b,ir)),[b]),N=km({inputs:b,nextStepLink:l,productType:m,setEsiaStatus:f,esiaAuthSuccess:g===Sm.Success}),{isSending:w,ok:C,handleSubmit:k}=um({programId:n,nextStepLink:l,productType:m,data:h}),[,{field:S,onSubmit:I,reset:T}]=xn(N,{formValidator:v,onSubmit:k}),P=bn(Bl);return i((()=>{void 0!==C&&P.open({ok:C})}),[C]),i((()=>{g&&x?.current&&x.current.scrollIntoView({block:"start"}),g===Sm.Success&&T()}),[x?.current,g]),c(yn,{className:u("container space-y-m",e),title:t,...p,children:[g?null:o(cr,{}),c("form",{onSubmit:I,className:"space-y-m relative",ref:x,children:[g===Sm.Pending?o(Fl,{blur:!1}):null,y.map(((e,t)=>c("div",{className:u(wl(e.columns),"grid gap-x-m"),children:[Cl(e.title),yd({field:S,inputs:e?.inputs},m)]},`section-${t}`))),vd(d,w),g===Sm.Error?o(Fe,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),Tm=d((({title:e,description:t})=>{const n=Te();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Pm=e=>e%2!=0,Rm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Bm=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=dn(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Rm),children:[B(l,{...i.options,parent:n}),Pm(l.length)?o(Yt,{className:"col-span-6",...i}):null]}),c(Dr,{children:[c(_r,{className:u(Rm),isUnfolded:s,children:[B(r,{...i.options,parent:n}),Pm(r.length)?o(Yt,{className:"col-span-6",...i}):null]}),o(Er,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!r?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Em=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Dm=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),_m=10;function Am(e=0){const t=Math.round(e*_m);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Mm=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Am(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:h,role:"listitem",children:d})})),Om=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Fm=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Vm(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?zm(c,v):{},...N?Dm(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(Mm,{className:u(m,i?Om[i-1]:"",{"h-full":N},t),style:w?zm(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),zm=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Vm=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Lm={"horizontal-list":"w-6","vertical-list":"h-6"},$m=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Lm[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),jm=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},Um=e=>t=>e.scrollWidth/t,qm=e=>(t,n)=>{e.scrollBy({left:n*Um(e)(t),behavior:"smooth"})},Wm=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[Eo()(i),Ro()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?qm(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?qm(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Hm={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Ym=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Te(),[h,p]=Wm({itemCount:s.length}),g=Gm(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Fm,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(jm({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Hm[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map($m({activeIndex:t,onClick:f,listType:a}))}):null})),Gm=(e=!1)=>({behavior:e?"auto":"smooth"}),Km=d((({className:e,name:t,...n})=>o(Tl,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),Xm=d((e=>o(Km,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),Jm=d((e=>o(Km,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Zm="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Qm=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?eu(t):null,l?o(Xm,{wcmsIgnore:!0,className:u(tu(i),m?"left-1":"left-0"),onClick:s}):null,r?o(Jm,{wcmsIgnore:!0,className:u(tu(i),m?"right-1":"right-0"),onClick:d}):null]})})),eu=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Zm,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Zm,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),tu=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),nu=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Wm({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Fm,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Qm,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Ym,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),au=({blocksToRender:e,...t})=>o(nu,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:B(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Em(!0)),children:P(e,t)},String(n))})}),iu=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[lu(n,t),o(Bm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[lu(n,t),au({...a,blocksToRender:t})]});default:return null}})),lu=(e,t)=>e&&!t.length?o(Tm,{...e}):null,ru=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),su=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(vi,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),ou=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,ru(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(cu(a)).filter(Boolean))]}),n?o("div",{children:o(Tl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),cu=e=>([t,n])=>{const a=n?.type;return"array"===a?du(t,e)(n):null},du=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Fe,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(su,{items:a,multiple:!n?.single,...t(e)})]},e)},mu=e=>e;function uu(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const hu=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,pu=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>hu(t[e])||hu(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>hu(t[e])||hu(n[e])||gu(t[e])<=gu(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>hu(t[e])||hu(n[e])||gu(t[e]?.min)>=gu(n[e]?.min)&&gu(t[e]?.min)<=gu(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>hu(t[e])||hu(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>hu(t[e])||hu(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),gu=e=>Number(e||0),fu=(e,{block:t,page:n,normalize:a=mu})=>{const i=t?.blocks||[],[l,s]=xn(e),o=r((()=>uu(i,i.map((e=>jt(e.content,n?.fallback))))),[i,n?.fallback]),c=l===e?i:((e,t)=>(n=mu)=>e?.filter((([,e])=>pu(t,n(e)||{}))).map((([e])=>e)))(o,l)(a);return[l,{blocksToRender:c,blocksWithProps:o},s]},xu={},yu={},bu=Wt((({className:e,filtrationSchema:t=xu,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=fu(yu,{block:i.block,page:i.options?.page}),d=o(Fn,{className:"w-64",label:n?.title,options:vu(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>vu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(ou,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Tl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(iu,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),vu=e=>uu(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Nu=(e=!1)=>e?"text-left":"text-center",wu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Cu=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const l=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",wu[t],e),style:{width:l,height:l},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),ku=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Te();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:Nu(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(Su)}):null]})})),Su=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Cu,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Fe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Me,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),Iu=(e,t,n)=>{return o(nu,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Fe,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Fe,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},Tu=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?Iu(e,0,t):null]}))),Pu={start:"justify-start",center:"justify-center",end:"justify-end"},Ru=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Pu[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:We(e)})})),Bu=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Fe,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ke(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Eu=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Fe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Du=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Bu,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(po,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Eu,{title:e,...r}),_u={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Au={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Mu=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=_u.prefMonthsNum,prefTravelBonusRate:l=_u.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Au,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Ou=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=xn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Mu(r,n);return o(oo,{className:e,title:t,...l,children:c("section",{className:u(co,e),children:[c("div",{className:mo,children:[So({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),So({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Du({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:uo,children:[f>=0?o(po,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,We(a,{isVertical:!0}),vo(i)]})]})})})),Fu=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,zu=e=>Co({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Vu=" (c капитализацией)",Lu=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:uo,children:[o(po,{title:`Доход в конце срока${l?Vu:""}`,value:e,postfix:n,prefix:"+"}),o(po,{title:`Сумма в конце срока${l?Vu:""}`,value:t,postfix:n}),We(a,{isVertical:!0}),i?.map(vo)]}),$u={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const ju={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Uu=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?$u[e?.rateType]:"",{data:n}=Jn(t?`${Jt}/depositrates/${t}`:null,zt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&qu(s,e)&&Mo(a,["minSum","maxSum"],e)&&Mo(n,["minDays","maxDays"],e)))||ju,{rate:m}=d,u=Wu(m,e),h=a+u,p=c||[ju];return{...d,...Ao(["minSum","maxSum"],p),...Ao(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},qu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Wu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},Hu=Wt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=xn({moneyValue:yo(r,1e5),daysValue:bo(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Uu(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(oo,{className:e,title:t,...d,children:c("section",{className:u(co,e),children:[c("div",{className:mo,children:[So({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ma,{items:[`От ${Fu(b.min||0)}`,`До ${Fu(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Yu(p,h),zu({...h("isMonthlyInterestPayment")})]})]}),Du({rate:x,depositeName:y,isShowDepositeName:l}),Lu({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Yu=(e,t)=>c("div",{className:"space-y-s",children:[o(Fe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ri,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ri,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Gu=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},Ku={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Xu=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Qu(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Zu({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Zu({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Zu({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Zu({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Mo(a,["minSum","maxSum"],t),Mo(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||Ku,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=Ju(p,e),f=a+g,x=t||[Ku];return{...m,...Ao(["minSum","maxSum"],x),...Ao(["minMonths","maxMonths"],x),availableMonths:Gu(x.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:l,income:g,finalSum:f}},Ju=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},Zu=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Qu=(e,t)=>e+Math.round((t-e)/2),eh=(e="rub")=>"rub"===e,th=(e,t)=>{const{minMonths:n,maxMonths:a}=Ao(["minMonths","maxMonths"],lh(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ra(i,n,a)}},nh=(e,t)=>{const{minSum:n,maxSum:a}=Ao(["minSum","maxSum"],lh(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ra(i,n,a)}},ah=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),ih=e=>{const t=eh(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},lh=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},rh=(e,t=!1)=>t?Co({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,sh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[oh(t("isReplenish"),e,a),ch(t("isWithdrawn"),e,a),dh(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?zu(t("isMonthlyInterestPayment")):null,rh(t("isRemoteRegistration"),e.isShowRemoteRegistration),mh(t("extraPercent"),n),e.isShowNewClient?o(ri,{text:"Новый сберегатель",...t("isNewClient")}):null]})},oh=(e,t,n=!1)=>t.isShowReplenish?Co({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,ch=(e,t,n=!1)=>t.isShowWithdrawn?Co({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,dh=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,mh=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Fe,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(Fn,{options:t,...e})]}):null,uh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},hh={text:"₽",key:"rub"},ph={text:"Без учета надбавки",key:"0"},gh=Wt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[hh],g=l((e=>t=>e?{...t,...ih(t),...nh(t,e),...th(t,e),...ah(t,e)}:t)(h),[h]),[f,{field:x}]=xn({moneyValue:yo(d,2e4),monthsValue:bo(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:hh,extraPercent:d?.extraPercent??ph},{normalizer:g}),y=vh(x),b=Boolean(x?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=lh(h,y),w=Xu(f,N,s),{rate:C,income:k,finalSum:S,type:I=""}=w,T=l((()=>{Io({field:x,defParams:fo(N,b,v),calcParams:w,monthsValue:"minMonths",map:uh})}),[x,h,v]);i((()=>{!Lo(d)&&N&&T()}),[d,h]);const P=x?.("extraPercent")?.value?.key,R=bh(C,P),B=C===fo(N,b)?.rate&&P===v?.at(-1)?.key;return o(oo,{className:e,title:t,...m,children:c("section",{className:u(co,e),children:[c("div",{className:mo,children:[c("div",{className:"flex gap-m",children:[So({className:"w-full",title:`Сумма, ${y?.text}`,min:w.minSum,max:w.maxSum,...x("moneyValue"),value:w.moneyValue,postfix:y?.text,step:fh(y?.key)}),h&&h?.length>1?o($n,{label:"Валюта",options:p,...x("currency")}):null]}),No({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...x("monthsValue"),value:w.monthsValue}),sh({...w,...s},x,v)]}),Du({rate:R,children:yh(T,B)}),Lu({income:k,finalSum:S,buttons:[...a,xh(n?.buttons,I)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),fh=(e="")=>eh(e)?1e3:100,xh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},yh=(e,t=!1)=>t?null:o(Tl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),bh=(e,t)=>Number(e)+Number(t??0),vh=e=>e?.("currency")?.value??hh,Nh=e=>wh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&wh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),wh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Ch={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},kh=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Ch],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Nh({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=_o(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=_o(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Nh({row:e,userInputParams:t,paramsViewSettings:n})&&Mo(a+r,["minSum","maxSum"],e)&&Mo(l,["minSumOld","maxSumOld"],e)&&Mo(r,["minSumExtra","maxSumExtra"],e)&&Mo(i,["minMonths","maxMonths"],e)))||Ch)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=To(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Sh=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...s})=>{const[d,{field:m}]=xn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=kh(d,n,l),p=r((()=>go(n?.rateRows)?.rate),[n?.rateRows]),g=ko({...m("isAnnuity")});return o(oo,{className:e,title:t,...s,children:c("section",{className:u(co,e),children:[c("div",{className:mo,children:[So({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),So({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),No({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),Ih({...h,...l},m),h.isExtraMoney?So({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:g})]}),c("div",{className:u(uo,"@4xl:w-1/2"),children:[o(po,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(po,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(po,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(po,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),We(a,{isVertical:!0}),vo(i)]})]})})})),Ih=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ri,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ri,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Th=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=la(e,{normalize:(e=i)=>n&&a?String(ra(Number(Ph(e)),n,a)):Ph(e),format:Ke(r)}),d=l((e=>t&&t(Ph(e))),[t]);return o(Tn,{onChange:d,...s,...c})})),Ph=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Rh=d((e=>o(Th,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Fe,{size:"text-xl",font:"font-light",children:"₽"})})}))),Bh=new Ms;function Eh(){return Fs(Bh)}_s(Bh,new As(globalThis?.sessionStorage));const Dh={private:"p2p/registerP2P",business:"b2c/registerB2C"},_h=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Rl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl px-4 pt-4 pb-8 grid gap-4 grid-cols-12",children:[c("div",{className:"col-span-8",children:[" ",n]}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Ah=e=>{const t=bn(_h),n=Eh(),a=ln(),i="private"===e?"p2p":"b2c";return l((async({amount:l})=>{const r=await(async(e,t)=>{const n=ln(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Jt}/payment/${Dh[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,l);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(r)&&(n.transaction={orderId:r.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(r.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(r)&&t.open({errorCode:r.errorCode,errorMessage:r.errorMessage})}),[e])},Mh={amount:1500},Oh=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:l="private",...r})=>{const[s,{setValue:d}]=dn(!1),m=Ah(l),[{amount:h},{field:p,onSubmit:f}]=xn(Mh,{onSubmit:m});return i((()=>{d(h<=0)}),[h]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",onSubmit:f,children:[o(Rh,{valid:!s,label:n,max:3e5,min:1,...p("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:h}),a?.text?o(zl,{className:"w-full mt-lg",disabled:s,children:a.text}):null]})]})})),Fh=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(G,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),zh="relative h-full",Vh={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Lh=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Uh),r=n?{defaultPadding:"p-6xl pb-m"}:{};return E({...a,renderProps:(n,a,i)=>c("div",{className:$h(n,{someCardsHighlighted:l}),children:[P(n,a,{className:jh(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Uh(n)?Fh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},$h=(e,{someCardsHighlighted:t})=>u(zh,t&&(Uh(e)?"pt-3xl":"pt-3xl sm:pt-16")),jh=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(zh,"min-w-80",Vh[a],t&&(Uh(e)?"pt-3xl sm:pt-16":"pt-3xl"),Em(n),n&&"h-full"),Uh=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,qh=Wt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(nu,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Wh(s?.block?.blocks):[],hasBlur:!0,children:Lh({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Wh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Hh="z-10 border border-solid w-full h-full",Yh=u(Hh,"absolute hidden @xl:block border-transparent"),Gh=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Yh,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Yh,"top-6 right-8 bg-green")}),o("div",{className:u(Yh,"top-3 right-4 bg-green-light")}),c("div",{className:u(Hh,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),We([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Kh={black:"bg-black",white:"bg-white"},Xh=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:We([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Fe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Jh)]}):null,i?c(Fe,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Jh=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Kh[e]}`},String(t)),Zh=d((({icon:e,...t})=>{const n=fe(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ie,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Qh=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?ep(a):null]})}))),ep=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Zh,{...e},String(t))))}),tp=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=fe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ye(i),children:l})})),np=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],ap=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>np.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=qe(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},ip(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:We(m,{className:lp(s??!1,i??!1,n),buttonClassName:h})}),r?o(Fe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),ip=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",lp=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),rp=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(tp,{href:i,target:m,className:"h-full",data:mm(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...rt(qe(l)?o(ie,{image:l}):null,x),buttons:d.length?o(ap,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Ue,{benefits:f}),s?o(Me,{__html:s,isDotted:r,itemSize:"list-s"}):null,sp(a,p)]})})}))),sp=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,op=new he,cp=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Fe,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Fe,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:We(i)}):null]},String(t))},dp=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...x})=>{const y=r((()=>h.map(cp)),[h]),[b,v]=r((()=>m>0?[y.slice(0,m),y.slice(m)]:[y,[]]),[m,y]),[N,C]=a(!1);i((()=>op.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const k=l((()=>{op.fire("fold",{type:"fold",isUnfolded:!N,parent:p?.parent})}),[N,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...x,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(Ce,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Dr,{children:[c("div",{children:[b,o(_r,{isUnfolded:N,children:v})]}),h.length>=m?o(Er,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:k}):null]}):o("div",{children:b})]})})),mp=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=ln();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await sr("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},up=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),hp=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(up,{step:a,showPercentage:!1})]})})}));var pp;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND"}(pp||(pp={}));const gp=e=>rr("/user-data/getTaskStatus","POST",e),fp=async e=>{const t=await rr("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},xp=d((({title:e,interval:t=0,onEnd:n=Cn})=>{const[i,l]=a(t);Id({seconds:t,onTick:l,onEnd:n});const r=100-(t-i)/t*100;return c("div",{children:[e?o(S,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${r}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(Cd,{seconds:i})})]})]})})),yp=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:l,buttonText:r,interval:s,onExpire:d=Cn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(xp,{interval:s,onEnd:d}):null]}),o(bp,{title:n,items:a}),o(bp,{title:i,items:l,countColumns:!0}),r?o(Ll,{href:"/natural",text:r,version:"primary",className:"w-full mt-lg"}):null]}))),bp=({title:e,items:t,countColumns:n=!1})=>{const a=Te();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Fe,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",wl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:vp(e)},t)))}):null]})]}):null},vp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Fe,{color:"text-secondary-text",size:"text-l",children:e}),o(Fe,{color:"text-primary-text",size:"text-xl",children:t})]}),Np=d((()=>o(yp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),wp=d((({onExpire:e})=>{const{statusInfo:t}=Ls();return o(yp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),Cp=d((()=>{const{statusInfo:e}=Ls(),t="courier"===e?.methodObtain;return o(yp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),kp=d((()=>{const{statusInfo:e}=Ls();return o(yp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:Sp(e),buttonText:"Вернуться на главную"})})),Sp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:Kt(e?.deliveryDate)}]):t},Ip=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Tp=d((()=>{const[e,t]=a(pp.process),{taskId:n}=Ls();i((()=>{(async()=>{for(const e of Ip)await fp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await gp({taskId:n});a&&a?.statusCd!==pp.process&&(e(),t(a.statusCd))}),[n]);Sd(r,3e4);const s=l((()=>t(pp.rework)),[]);return Pp(e,s)})),Pp=(e,t)=>({IN_PROCESS:o(wp,{onExpire:t}),CANCELLED:o(Np,{}),FAILED:o(Np,{}),DRAFT:o(Np,{}),APPROVED:o(kp,{}),PRE_DECISION:o(kp,{}),REVISION:o(Cp,{})}[e]||o(Cp,{})),Rp=e=>(t,n)=>t.filter((e=>e)).map((t=>[Bp(n,e),Ep(t,e),Mp(t,e),Dp(t,e),_p(t,e),Ap(t,e)].some(Boolean)?{...t,required:!1}:t)),Bp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ep=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Dp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,_p=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Ap=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Mp=({name:e},t)=>"snils"===e&&Op(t),Op=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Fp={...pd,...gd},zp=({field:e,inputs:t,params:n})=>t.map(Nl(e,n,Fp)),Vp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l,condition:r},s)=>{const o=Rp(Lp(t))(e,n);return c("div",{className:u(wl(i),"grid gap-x-m"),children:[Ap({condition:r},Lp(t))?null:Cl(l),zp({field:t,inputs:o,params:a})]},`section-${s}`)})),Lp=e=>t=>e(t)?.value,$p=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tl,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(zl,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),jp=(e,t,n)=>({...n[e],...t,limitedBirthday:Up(t?.limitedBirthday),dulIssueDate:Up(t?.dulIssueDate),participantDateRegistration:Up(t?.participantDateRegistration),beginDate:Up(t?.beginDate),deliveryDate:Up(t?.deliveryDate)}),Up=e=>{try{return e?new Date(e):void 0}catch(e){return}},qp=[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1,esiaAccountTypeCd:{key:"",text:""}},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],Wp=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...qp,{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Hp=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Yp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Gp=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:x}=e;return{employmentContractDate:Kt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:Xd({organizationPhone:p&&Xt(p)}),participantAddresses:Jd({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?x:""}},Kp=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y,addressMatch:b}=e;return{birthDate:Kt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:Kt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Kt(g,!0),homeMatchFlg:b,houseTypeCd:f,participantContacts:Xd({phone:Xt(l),email:r}),participantAddresses:Jd({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Xp=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,l=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:(r=n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000"),r?new Date(r).toISOString().split(".")[0]:""),office:{id:"3"},...l}:{};var r},Jp=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Zp=(e,t)=>{switch(e){case 0:default:return{};case 1:return Kp(t);case 2:return Gp(t);case 3:return Zd(t);case 4:return Hp(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Jd({addressCourier:t})}:{}})(t)}},Qp=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=Ls(),d=r((()=>jp(e,c.leadForm,Wp)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await wd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:ln().origin,id:t,...Jp(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Zp(i,a)}],...Yp(a),...Xp(a),files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},eg=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=r((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=l((t=>nl(Rp((e=>t[e]))(s,e),ir)(t)),[s]),[m,u,h]=Qp({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=xn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[Vp({sections:t,field:p,step:e}),o($p,{isSending:h,step:e,onPrevStep:n})]})})),tg=[[{title:"Персональные данные",columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}]],ng=[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}],ag=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],...tg,ng],ig=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],lg=d((({className:e,...t})=>{const[n,r]=a(0),d=s(null),m=l((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(mp,[]);const u=l((()=>{r((e=>Math.min(e+1,6))),m()}),[]),h=l((()=>{r((e=>Math.max(e-1,0))),m()}),[]),p=ag[n],[f,{setTrue:x}]=dn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(hp,{stepsTitles:ig,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Tp,{}):o(eg,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),rg=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(up,{step:a,showPercentage:!1})]})})})),sg=d((()=>o(yp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),og=d((({onExpire:e})=>{const{statusInfo:t}=Ls();return o(yp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),cg=d((()=>{const{statusInfo:e}=Ls();return o(yp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),dg=d((()=>{const{statusInfo:e}=Ls();return o(yp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),mg=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ug=d((()=>{const[e,t]=a(pp.process),{taskId:n}=Ls();i((()=>{(async()=>{for(const e of mg)await fp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await gp({taskId:n});a&&a?.statusCd!==pp.process&&(e(),t(a.statusCd))}),[n]);Sd(r,3e4);const s=l((()=>t(pp.rework)),[]);return hg(e,s)})),hg=(e,t)=>({IN_PROCESS:o(og,{onExpire:t}),CANCELLED:o(sg,{}),FAILED:o(sg,{}),DRAFT:o(sg,{}),APPROVED:o(dg,{}),PRE_DECISION:o(dg,{}),REVISION:o(cg,{})}[e]||o(cg,{})),pg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tl,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(zl,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),gg={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},fg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:gg[a?"annuity":"differential"]}},xg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},yg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Kp(t);case 2:return Gp(t);case 3:return Zd(t);case 4:return Hp(t);default:return{}}},bg=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...qp,{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],vg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=Ls(),d=r((()=>jp(e,c.leadForm,bg)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await wd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:ln().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...yg(i,a)}],...fg(a),...xg(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Ng=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=Ls(),m=n?.[d??""],u=r((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=l((t=>nl(Rp((e=>t[e]))(u,e),ir)(t)),[u]),[p,g,f]=vg({step:e,onNextStep:i,onFinish:s}),[,{field:x,onSubmit:y}]=xn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:y,className:"space-y-m",children:[Vp({sections:t,field:x,step:e,params:{calcData:m}}),o(pg,{step:e,isSending:f,onPrevStep:a})]})})),wg=[[{columns:1,inputs:[{name:"calculator"}]}],...tg,[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],Cg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],kg=Wt((({className:e,programsSource:t,...n})=>{const[r,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(mp,[]);const h=l((()=>{d((e=>Math.min(e+1,5))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=wg[r],x=0===r,[y,{setTrue:b}]=dn(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x||y?null:o(rg,{stepsTitles:Cg,step:r,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(ug,{}):o(Ng,{step:r,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(r))})]})})})),Sg=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Ig=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Tg=1e9,Pg={sum:{min:1e4,max:Tg},period:3},Rg=Wt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=fu(Pg,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Bg(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Eg(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(ou,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Rh,{label:a?.title,min:500,max:Tg,...d("sum",{parse:e=>({min:Number(e),max:Tg}),format:({min:e})=>String(e)})}),o(ma,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(iu,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Bg=e=>Vt((e?.paramsSource?.rateRows||[]).filter(Sg).flatMap((e=>Ig(e.minMonths,e.maxMonths)))),Eg=e=>Vt(e.flatMap((e=>e||[])).filter(Sg).flatMap((e=>Ig(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Dg=[{key:"10"},{key:"50"},{key:"100"}],_g=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Fn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Dg,iconVersion:"black"})]})},Ag="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Mg=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:Ag,"aria-label":`Страница ${l}`,children:l},String(t)):null},Og={width:"24",height:"24"},Fg=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(G,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:zg(1===e),...Og})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Ag,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Mg),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Ag,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(G,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:zg(e===n),...Og})})]})},zg=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Vg=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Fg,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(_g,{itemCount:a,onItemCountChange:i}):null]}),Lg=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ie,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",kn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),$g=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Lg,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(qa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(qa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Tl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),jg=d((({title:e,timestamp:t,publicId:n})=>{const a=fe(),{href:i}=a({href:`${Jt}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[o(Cu,{className:"shrink-0",icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Fe,{size:"text-m","font-weight":"font-light",children:Kt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Ug=`${Jt}/depository`,qg={startDate:void 0,endDate:void 0,query:""},Wg=Wt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=xn(qg),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?Kt(a,!0):"",r=i?Kt(i,!0):"",s=new URLSearchParams(Ug);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=Jn(Ug+o,zt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),y=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o($g,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Fe,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Fe,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(jg,{...e},String(e.publicId)))):o(Tm,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Vg,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Hg=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Yg=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Hg(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ce,{version:i?.version,text:i?.text,...i}):null]}))),Gg=`${Jt}/region`;function Kg(e="Москва"){return Vs().location??{name:e}}function Xg(e="Москва"){const t=Vs(),n=l((async()=>{if(!t.location){const n=await Ft(Gg);t.location=n??{name:e}}}),[t,e]);return Jn(Gg,n),t}var Jg;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Jg||(Jg={}));const Zg=new Intl.NumberFormat("ru",{style:"currency",currency:Jg.RUB}),Qg=e=>e?Zg.format(e):"",ef="text-m font-light text-secondary-text ",tf=`${ef} text-left`,nf=`${ef} pl-5xl text-center`,af=`${ef} pl-5xl text-right`,lf={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},rf=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:tf,children:o(Fe,{size:"text-m",children:"Валюта"})}),o("th",{className:nf,children:o(Fe,{size:"text-m",children:"Купить"})}),o("th",{className:af,children:o(Fe,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(sf)})]}))),sf=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ie,{image:{icon:lf[t]},width:"24",height:"24"}):null,o(Fe,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Fe,{size:"text-h6",children:Qg(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Fe,{size:"text-h6",children:Qg(e?.buyExchangeRate)})})]},t)},of={icon:"GpsIcon"},cf=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Cu,{...of,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),df=(e,t,n)=>{const a=Number(mf(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},mf=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function uf(e){if(!e)throw new Error("Value should be fulfilled");return e}const hf=e=>t=>{const[,n]=uf(e.find((([e])=>e(t))));return n(t)},pf=e=>hf(e.map((([e,t])=>[e,()=>t])));pf.if=e=>new gf(void 0,e);class gf{parent;predicate;unit;get entry(){return[uf(this.predicate),uf(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new gf(this,e)}then(e){return new gf(this.parent,this.predicate,e)}else(e){return hf([...ff(this),[()=>!0,e]])}}const ff=e=>[...e?.parent?ff(e.parent):[],e.entry],xf=e=>pf([[e=>e.value!==Jg.RUB&&e.oppositeValue!==Jg.RUB,()=>e.handleConvert(e.value,Jg.RUB)],[e=>e.value===Jg.RUB&&e.oppositeValue===Jg.RUB,()=>e.handleConvert(e.value,Jg.USD)],[e=>e.value===Jg.RUB&&e.oppositeValue===Jg.RUB,()=>e.handleConvert(e.value,Jg.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function yf(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Tn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(Fn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const bf=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Jg.RUB,selectBuy:n?.[0]?.currency?.currency||Jg.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[yf({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:vf(r,d,n),value:r.inputSell,setValue:e=>wf(d,n)(e,r.selectSell,r.selectBuy)}),yf({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Nf(r,d,t),value:r.inputBuy,setValue:e=>Cf(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ce,{text:i.text,version:i?.version,...i}):null]})})),vf=(e,t,n)=>a=>{t({selectSell:a}),xf({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{wf(t,n)(e.inputSell,a,i)}})},Nf=(e,t,n)=>a=>{t({selectBuy:a}),xf({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Cf(t,n)(e.inputBuy,a,i)})},wf=(e,t)=>(n,a,i)=>{e({inputSell:mf(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(df(n,l,a===Jg.RUB)||"")})},Cf=(e,t)=>(n,a,i)=>{e({inputBuy:mf(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(df(n,l,a===Jg.RUB)||"")})},kf=`${Jt}/exchangerates`;const Sf=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=Jn(kf+`?regionCode=${t}`,zt);return n||{}}(Kg()),l=If(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Jg.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Jg.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Be,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(rf,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(cf,{address:i?.address})]}),o(bf,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),If=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Tf=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Pf(n))})})),Pf=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ye(t),children:i||null})},String(a)):null},Rf=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Bf(e)}))),Bf=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Ef,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Ef=d((({className:e,item:t})=>{const[n,{toggle:a}]=dn(!1);return c(Dr,{className:e,role:"menuitem",children:[c(Tl,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(Rr,{children:[o(Cu,{className:"shrink-0",...t.icon}),o(Fe,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Br,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(_r,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(Tf,{items:t.items}):null})]})})),Df=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(_f)}):null)),_f=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Fe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Af)})]},String(t)),Af=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Mf(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Mf=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Of(t)}`,children:o(Fe,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Of=e=>e.replaceAll(/\D/g,""),Ff=d((({className:e="",index:t,text:n,...a})=>{const i=fe(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),zf=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Fe,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Ff,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Vf=d((({className:e="",index:t,...n})=>{const a=fe(),{href:i,target:l,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),Lf=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Fe,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(Vf,{index:t,...e},String(t))))}):null]}))),$f=Wt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Rf,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Df,{items:r}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(ap,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ll,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(zf,{title:d,links:l}),o(Lf,{links:i,license:h})]})})),jf=(e=!1)=>e?{}:{padding:"p-0"},Uf={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},qf=[1,2,3,4],Wf={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},Hf=Wt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,...s})=>o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",Uf[n],e),padding:t,version:i,isTheme:l,...s,children:E({...s,renderProps:Yf({isInnerPadding:a,isCardBorder:r})})})),{childrenTypes:["ProductBlock"],childSchema:()=>Wf,allowRemoveChild:e=>(e?.blocks??[]).length>5}),Yf=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>P(n,{...a,blockDecorator:Gf(a.blockDecorator,i)},{className:u("w-full",Em(t)),...jf(e)}),Gf=(e,t=0)=>(n,a)=>e?.({...n,render:e=>Kf(t)({...n,...e},a)},`wrap_${a}`)??Kf(t)(n,a),Kf=e=>({blockClassName:t,block:n,render:a},i)=>{const l=Jf(n,e);return o(tp,{...l.content?.link,className:Xf(e),children:a({blockClassName:u(t,"h-full"),block:l})},String(i))},Xf=e=>qf.includes(e)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2",Jf=(e,t)=>{const n={...e.content};return qf.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"}):(n.buttons??[]).length&&delete n.link,{...e,content:n}},Zf=Wt((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o($n,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(Ll,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:mm(l,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Qf={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},ex=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d,isLoading:m,dataTestId:h=""})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Qf[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...tx(h),...ye(s),children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),tx=e=>e?{"data-test-id":e}:null,nx="chatbot",ax="text-page__btn-chat",ix="webchat-js-container:webchat_rshb",lx={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},rx=async(e,t)=>{const n=e.target;n?.classList.contains(ax)||n?.classList.add(ax);globalThis.document.getElementById(ix)||await bs(nx,t)},sx=async e=>{const t=await bs(nx,`${e}/bundle.js`,!0);((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(`${e}/bundle.css`);globalThis.document.getElementById(ix)?t?.chatOpen?.():(ox(),t?.render?.(ix,!0,"/webchat-api","@container fixed right-0 bottom-0 top-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},ox=()=>{const e=globalThis.document.createElement("div");e.id=ix,globalThis.document.body.appendChild(e)},cx=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:r="Чат",version:s,buttonSize:c="large"})=>{const{load:d,isLoading:m}=(e=>{const[t,n]=a(!1);i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const r=lx[e??""];return{load:l((t=>{r&&(n(!0),"business"===e?sx(r).finally((()=>n(!1))):rx(t,r).finally((()=>n(!1))))}),[r,e]),isLoading:t}})(e);return o(ex,{className:n,image:{icon:"ChatBotIcon",iconVersion:t},ariaLabel:r,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),dx={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},mx=d((({version:e,text:t,mobileText:n,...a})=>{const i=Te()?n:t;return i?o(Ce,{className:u("py-s px-lg font-light whitespace-nowrap",dx["transparent"===e?"transparent":"default"]),...a,children:i}):null})),ux=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:r})=>{const s=D(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:h,...p}=t??{},g=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Dd,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):hx(g,r),c("div",{className:"flex gap-lg items-center",children:[A.CHAT_BOT?o(cx,{version:i,iconVersion:m,chat:A.CHAT_BOT,buttonSize:"medium"}):null,o(mx,{version:i,...a})]})]})})),hx=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(G,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,px={"bg-white":"primary",transparent:"transparent"},gx=Wt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=px[e],portal:a,logo:i={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(ux,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),fx=Wt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Uf[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Q(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:E({...c,extraProps:{className:u("w-full",Em(r)),...jf(a)}})})}),{childrenTypes:[]}),xx=Wt((e=>o(fx,{...e})),{childrenTypes:[]}),yx=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Pu[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),bx=["байт","Кб","Мб","Гб","Тб","Пб"],vx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...ye(l),children:[e,t?c(Fe,{size:"text-l",font:"font-light",children:[t," ",Nx(d,m),o(Fe,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Nx=(e,t)=>e||t?o("span",{children:", "}):"",wx=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${bx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?kx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(vx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:Cx(t),data:n?.data}),o(Me,{__html:n?.__html})]},String(a))},Cx=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,kx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},Sx=d((({href:e,__html:t,target:n,onClose:a})=>c(Rl,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Me,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ll,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Tl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),Ix=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=bn(Sx),s=l((()=>r({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Cx(i),o(Fe,{font:"font-light",children:e})]}):null})),Tx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Px=Wt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Tx[r]),role:"list",children:i.map(Rx(d,l))}):null]})})),Rx=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Bx(t)(n,a):wx(e,t)(n,a)},Bx=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Ix,{...a,icon:e,href:Ex(t)?t?.href:t?.attachment?.src}),o(Me,{__html:t?.__html})]},String(n)):null},Ex=e=>"href"in e,Dx=Wt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ie,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:We(a,{className:"flex-wrap"}),children:[i?o(Fe,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Me,{__html:r,itemSize:"list-m"}):null,o(Fe,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ie,{className:"w-fit",image:d})}):null,l?.src?o(ie,{className:"lg:hidden",image:l}):null]})]})})})),_x=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Ax=(e=[],t={})=>e.filter((({content:e={}})=>pu(t,e))).length,Mx=(e,t)=>e===t;const Ox=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,a])=>e(a,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Mx,((e=Mx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),Fx=[],zx={},Vx={primary:"bg-white/30",secondary:"bg-main-divider"},Lx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},$x=d((({count:e,version:t="secondary"})=>{const n=Te(),a=n?"bg-main-divider":Vx[t],i=Lx[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Fe,{size:"text-xs",color:i,children:e})})})),jx=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},Ux={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},qx={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Wx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Hx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Yx=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Ux[a],n?Hx[a]:Wx[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?qx[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[jx({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o($x,{count:m,version:_x(n,a)})}):null]})})})),Gx=d((e=>o(e?.item?.href?Kx:Xx,{...e}))),Kx=d((e=>{const t=fe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Yx,{...e,tag:"a",item:i,onClick:a})})),Xx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Yx,{item:e,onClick:a,...n})})),Jx=(e,t,n)=>(a,i)=>o(Gx,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Zx=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Jx(a,i,t))}))),Qx={categories:[],extraOptions:[],propertyType:[],stage:[]},ey=Wt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=fu(Qx,{block:i.block,page:i.options?.page}),f=l(((e=Qx)=>p(e)),[]),x=(({hotFilters:e=Fx,filtrationState:t=zx,blocks:n=Fx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Ox(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Ax(n,t.filter),version:_x(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Zx,{...x}),o(ou,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(iu,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),ty="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",ny=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(ri,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]],[m,{toggle:u}]=dn(!1);return o("div",{children:e?.length?o("div",{children:c(Dr,{children:[c("div",{children:[o("div",{className:ty,children:s}),o(_r,{className:ty,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(Er,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Tl,{embedded:!0,onClick:n,children:[o(Rr,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),ay=(e,t,n)=>{const a=_x("all"===t),i=_x("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Tl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(Tl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},iy=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ie,{image:e.image}):null,e?.text?o(Fe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,ly=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Fe,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),ry=()=>{},sy=e=>"all"===e?"block":"hidden",oy=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=ry,renderRemoteWorkplaceCard:r=ry,getBalloon:s=ry,getBalloonRemoteWorkplaces:d=ry,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=xn(ns),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=ss({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[ly(h,N),m?iy(m):null,p&&ay(t,w,C),o("div",{className:u("pb-3xl",sy(w)),children:o(ny,{filters:cy([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:as})})]}),o("div",{className:"h-[600px]",children:o(cs,{children:o(ks,{points:b,isLoad:n,className:"h-full"})})})]}),c(cs,{children:[y.map(l),v.map(r)]})]})})),cy=e=>Object.keys(ns).filter((t=>e.filter((e=>is[t](e))).length)),dy=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",my=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:dy(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Fe,{size:"text-h4",children:dy(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Wr,{color:"green",children:dy(s)})})]}),o(Ar,{children:o(Pr,{className:"flex-wrap",children:m?.map(((e,t)=>o(kr,{...e},String(t))))})})]},String(d))},uy=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${dy(t)} №${n}`,body:e.toUpperCase()}),hy=[];const py=async e=>{const t=await Ft(e,{method:"GET"});return Array.isArray(t)?t:hy},gy={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},fy={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},xy=d((({descriptionData:e,className:t})=>{const n=Kg(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=Jn(`${Jt}/atms?regionCode=${e}`,py);return{data:t||hy,isLoad:!t&&!n}}(a);return o(oy,{className:t,filterItems:yy,data:i,isLoad:l,initFilterState:gy,renderCard:my,getBalloon:uy,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),yy=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>fy[t](e))),n=!a.length||a.some((t=>fy[t](e)));return t&&n}))},by=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Fe,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:e})]}):null]})}),o(Ar,{children:vy(t)})]},String(n)):null,vy=e=>c("div",{children:[c(Pr,{className:"flex",children:[o(kr,{label:"Операции для физических лиц",children:o(Fe,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(kr,{label:"Операции для физических лиц",children:o(Fe,{children:"Оформление и обслуживание банковских карт"})}),o(kr,{label:"Операции для физических лиц",children:o(Fe,{children:"Инвестиционное и накопительное страхование"})}),o(kr,{label:"Операции для физических лиц",children:o(Fe,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(kr,{label:"Режим работы",className:"max-w-none",children:o(Fe,{children:e})})]}),Ny=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),wy={branches:[],remoteWorkplaces:[]};const Cy=async e=>await Ft(e,{method:"GET"})||wy,ky=d((({className:e})=>{const t=Kg(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Jn(`${Jt}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Cy);return{data:t||wy,isLoad:!t&&!n}}(n);return o(oy,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:Qr,renderRemoteWorkplaceCard:by,getBalloon:ts,getBalloonRemoteWorkplaces:Ny,title:`Офисы филиала ${t?.name}`})})),Sy=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(ky,{}):o(xy,{descriptionData:e})})})),Iy=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Ty=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(nu,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(tt,{className:"px-5 h-full",headlineVersion:"L",...e,...a})},String(t))))})}))),Py=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[qe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ie,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?Ry({__html:l,richVersion:r}):null,By({label:"Адрес",data:e,iconName:"GeolocationIcon"}),By({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),By({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?We([a]):null]})]}))),Ry=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Me,{...e,itemSize:"list-s"})}),By=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(G,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Fe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Fe,{size:"text-xl",color:a,children:t})]})]}):null,Ey=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Me,{__html:t,richVersion:n})})})),Dy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",_y=Wt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:l,role:r,...s})=>{const d=Te(),[m,{toggle:h}]=dn(t),p=o(_r,{className:u("gap-lg",Dy(d)),isUnfolded:m,children:E({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,x=o(Er,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:r,...s,children:c(Dr,{children:[n?x:p,n?p:x]})})}),{childrenTypes:{exclude:["RollupItem"]}}),Ay=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(kn.split(" ").filter((e=>"rounded"!==e)),ii,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(Fe,{color:"text-primary-text",children:t}):null]})}))),My=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Ay,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(Ay,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Oy=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(Fn,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),Fy=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Oy,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Oy,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),zy=["От 1 дня","До 365 дней"],Vy=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Fe,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ma,{min:1,max:365,value:e,items:zy,onChange:t})]}))),Ly=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Oy,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Oy,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),$y=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Fy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:jy(m)}),o(Vy,{days:i,setDays:e=>m({days:e})}),o(Ly,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Uy(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Fe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(My,{}),o(Tl,{className:"order-6",version:"primary",onClick:u,children:"Офисы на карте"})]})]}))),jy=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Uy=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},qy=d((({days:e,tariffs:t=[]})=>{const n=Hy(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[Wy("Аренда за",e),Wy("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(G,{className:"@xl:h-60",name:"PackA4Icon"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),Wy=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Fe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Hy=(e,t)=>{const n=Yy(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Yy=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},Gy=(e,t)=>e.find((e=>e.branchCode===t)),Ky=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Gy(a,n.selectedBranch),d=Xy(s?.safeBoxCaseVolumes),m=Jy(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Zy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o($y,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(qy,{days:n.days,tariffs:u})]})})),Xy=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Jy=(e,t)=>e?.find((e=>e.volume===t)),Zy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Qy=`${Jt}/safeboxes`,eb=[];const tb=async e=>await Ft(e,{method:"GET"})||eb,nb=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=zi(),p=ab(m.selectedRegion,h),f=function(e){const{data:t}=Jn(e?`${Qy}?regionCode=${e}`:null,tb);return t||eb}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Gy(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Ky,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(ks,{points:y,className:"h-[640px]"}):null]})})),ab=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,ib={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},lb=(e,t,n)=>(a,i)=>{const{button:l}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:rb(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[sb(a),l?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},rb=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=ob(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:cb({step:n,iconVersion:i,i:a,stepVersion:t})})})},sb=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",ib.description),children:e.description}):null,o(Me,{__html:e.__html})]}),ob=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",cb=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return qe(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?ib.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},db=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:l="gray",version:r="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(lb(d,r,l))}):null,We(i,{isVertical:!0})]})})),mb=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(G,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),ub=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Pl,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function hb(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const pb=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}();return hb(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},gb=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const fb=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Fe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(xb,{...e},String(t))))})]}):null,xb=d((({icon:e,...t})=>{const n=fe(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(Fe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),yb=(e,t)=>n=>n.name?o(tp,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:mm(e,n.name),children:o(Fe,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,bb=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(kn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),vb=d((({defaultLocation:e})=>{const t=Kg(e),n=fe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(tp,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Nb=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Xg(t?.default),[s,d]=a(""),m=zi(),u=r((()=>Cb(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,wb)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Rl,{className:"pb-20",head:c("div",{children:[o(Fe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(vb,{defaultLocation:t?.default}),o(bb,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&gb(e.toLowerCase())(s.toLowerCase())>=.8)).map(yb(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Fe,{size:"text-h6",children:e})}),t.map(yb(f,g))]},e)))}),fb(e)]});var g,f})),wb=e=>e.name?.charAt(0)??"",Cb=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),kb=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=bn(Nb,n),{name:r}=Kg(),s=e?.current?.getBoundingClientRect(),c=Z(J.SITE_URL);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(ub,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Sb="burgerMenuDialog",Ib=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Cn})=>{const{open:i}=bn(kb),[r]=pb(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Sb,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:Sb})),[e,n,t,a]);return[s,{toggle:s?a:o}]},Tb=[],Pb=Wt((({sticky:e,...t})=>{const{menuItems:n=Tb}=e??{},i=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=a(-1),[f,x]=a(""),{closeAll:y}=ge(),b=l((()=>{p(-1),x(""),y()}),[y]),v=Nn(b),N=s(null),[C,{toggle:k}]=Ib({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),S=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:r,close:s}=ge(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:a[l].title,dialog:o(ub,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),k()}),[b,k]),T=l(((e,t)=>{x(t),p(e),y(),S(e,t)}),[y,S]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Rb(T,"left",{activeIndex:h,currentItemPosition:f})),o(mb,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Rb(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Rb=(e,t,n)=>(a,i,l)=>o(mb,{item:a,isActive:l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||r.stopPropagation(),e(i,t)}},a.title||String(i)),Bb="hidden sm:flex absolute z-40",Eb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Db=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=Wm({itemCount:t?.length||0});return i((()=>_b(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Fm,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Eb[l].item,gap:Eb[l].gap,children:t.map(Jx(n,a,l))}),s.canScrollLeft?o(Xm,{wcmsIgnore:!0,className:u("left-6",Bb,Eb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Jm,{wcmsIgnore:!0,className:u("right-6",Bb,Eb[l].buttonTop),onClick:s.scrollRight}):null]})})),_b=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},Ab={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Mb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Ab[t].wrapper,e),children:o(Db,{className:Ab[t].component,tabsType:t,...n})}):null,Ob=Wt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Fb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=a(Lb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Vb(x[b],b),k=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[Mb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:zb(t,x),activeItem:N,tabsType:r,onChange:k}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>B(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Vb)?.filter(Boolean)||[]}),Fb=({__id:e,anchor:t})=>t??e??"tabs",zb=(e,t)=>t?.length?t:e,Vb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Lb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),$b={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},jb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:$b[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),Ub=d((({className:e="",isOpen:t,onClick:n})=>o(Er,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),qb={Buttons:({buttons:e})=>We(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ie,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Me,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Fe,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Fe,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(Ub,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Wb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return Hb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Hb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in qb))return null;return o(qb[n],{...t,...a})},Yb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Wb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Gb=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Kb=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Fe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Xb=d((({rows:e})=>{return o(Fm,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Fe,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Gb(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Fe,{size:"text-xl",children:e.data}):null,e?.cols?Kb(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Jb=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Fe,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Xb,{rows:t.rowsData})})})]},a)}))}))),Zb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Qb=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Fe,{size:"text-xl",font:"font-light",color:Zb(t===n),children:e||t+1})},e)))}):null,t?o(Ce,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),ev=Wt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Qb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Jb,{activeTabIndex:r,items:m}),o(Ub,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Fe,{size:"text-h6",children:"Данных нет"}),o(Ub,{onClick:n,isOpen:!0})]})})),tv=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(ev,{...t,onClick:n})}):null]}))),nv=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(tv,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ie,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Fe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(jb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Yb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),av=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:l})=>n||a?c("div",{children:[n?o(Xm,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(Jm,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:l}):null]}):null,iv=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,av({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),lv=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(nv,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]],[N,{toggle:w}]=dn(!1);return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?c(Dr,{children:[c(iv,{controls:x,children:[b,o(_r,{isUnfolded:N,children:v})]}),o(Er,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(iv,{controls:x,children:y})})]})})),rv=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?sv():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Fe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ov(n):null,i?o(Me,{richVersion:l,__html:i}):null]})]}))),sv=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),ov=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),cv=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Fe,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Fe,{size:"text-h2",children:n})}):null]}))),dv=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(cv,{prefix:t,unit:n,suffix:a})})})),mv={AdTile:Yt,ApplicationForm:Wl,BankAccountFiltration:bu,BenefitsBlock:ku,BonusBenefitsBlock:Tu,ButtonsBlock:Ru,CalculatorBonus:Ou,CalculatorBusinessDeposit:Hu,CalculatorCredit:jo,CalculatorDeposit:gh,CalculatorRefinancing:Sh,CardTransfer:Oh,Carousel:qh,CarouselCard:Gh,CarouselCatalogCard:Xh,CarouselLinks:Qh,CarouselRecommendationCard:rp,CarouselTariffsCard:dp,DepositFiltration:Rg,Depository:Wg,ErrorBlock:Yg,ExchangeRateTile:Sf,Footer:$f,GalleryLayout:Hf,GrantSupport:Zf,Header:gx,Headline:S,HorizontalLayout:xx,ImgBlock:yx,LinkDocs:Px,MobileAppTile:Dx,MortgageFiltration:ey,OfficesAtmsMap:Sy,Placeholder:Iy,ProductBlock:Ht,ProductGallery:Ty,RepresentativeOfficeInfo:Py,RichTextBlock:Ey,RollupItem:_y,SafeDepositRental:nb,StepsBlock:db,StickyBottomMenu:Pb,TabsLayout:Ob,TariffsTable:lv,TextBlock:rv,UnitBlock:dv,VerticalLayout:fx,ApplicationLeadForm:Im,CreditCardForm:lg,CreditForm:kg},uv=me((()=>{i((()=>{sn()}),[]);const e=cn();vn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");an({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const hv="cookie",pv=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=dn();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(hv)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(hv,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Me,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Pl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function gv(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);vn(globalThis.document,"keydown",t)}const fv=d((()=>{const[e,{close:t}]=pb(),n=Boolean(e.length);return gv(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),xv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return hb(pe.observable,"popup",{open:t,close:n}),gv(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),yv="header",bv="footer",vv="sticky-footer",Nv={},wv=d((({className:e,data:t=Nv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Ut(s,r);uv(),Xg();const m={key:"",page:{slots:i,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[yv]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:B(i?.[yv],{...m,slotName:yv})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[E({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),B(i?.[bv],{...m,slotName:bv})]})]}),i?.[vv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:B(i?.[vv],{...m,slotName:vv})}):null,o(fv,{}),o(xv,{}),o(pv,{__html:d?.cookieContent?.__html})]})}));Object.assign(wv,{childrenTypes:[],slots:()=>[yv,bv,vv]});e.Blocks=mv,e.ContentPage=wv,e.handlerDecorator=me,e.joinList=ru,e.locationNavigator=ln,e.packageVersion="0.14.818",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),k={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},S=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=k[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{...r,...a,className:u(l,r?.className),block:e,options:t},i):null}},i)}const P=[],B=(e,{key:t,ancestors:n=P,slotName:a=null,extraProps:i,renderProps:l=R,...r})=>{const s=i?(e,t)=>R(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||P,[r.parent,a]]:n},i)))};function E({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?B(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const _=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return _.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),F=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:z,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:F});const $="/api/",j=`${$}v1/storage`,U=[A.CDN,$],q=e=>(t,n)=>{if(W(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const a=t?.startsWith("/");return V(F(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||M(e)||z(e)||U.some(F(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",size:r,width:s=r&&Y[r],height:d=s})=>{const m=D(),h="normal"===l?`${n}.svg`:`sprites.svg#${n}`,p=q(m)(V(A.CDN,"/icons/",h));return"normal"===l?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[l],{"w-full h-full":!s,invert:"white"===l},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Z(e=""){try{return new URL(e).pathname}catch(e){return""}}const Q=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Z(J.SITE_URL);return t&&!M(t)?q(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:Q(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ne({...t,src:Q(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(G,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),le={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return r((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const pe=new he,ge=()=>ue(pe.emitter,"dialog");function fe(){const e=D(),{closeAll:t}=ge();return n=>{const a=q(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const l=Z(J.SITE_URL);xe(a,n.target,l)&&(t(),i?.preventDefault(),e.push(((e,t="")=>e?.replace(t,"")||"/")(a,l)))}))}}}const xe=(e,t,n)=>O(e,t)&&!J.SUB_PORTALS?.split(",")?.some(F(e))&&F(e)(n||"/"),ye=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},be=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=Ne(e)&&"hidden lg:block";return c("div",{className:u(ve(e),"flex gap-xs"),children:[a?o("div",{className:u(r,ce[l]),children:a}):null,Ne(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,ce[l]),children:i}):null]})})),ve=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ne(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ne=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),we=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ce=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[e,t]))({method:n,href:a}),s=fe()({onClick:r,href:a,...i}),c=t??o(be,{...s});return o(e?Se:ke,{...s,children:c})})),ke=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ye(d),children:m}))),Se=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:we({className:e,rounded:a,version:n}),children:i})));function Ie({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Ce,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Te=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Re={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Pe=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Re[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Te(),v=D(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Ie({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Pe(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-auto"),children:[Ee(h,x),_e(E({...y,extraProps:{className:"@container-normal"}})),Pe(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[De(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ee=(e,t)=>e||t?c("div",{className:"grow space-y-lg min-w-fit",children:[e,t]}):null,De=e=>u(e?"row-span-2":"@xl:row-span-2"),_e=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ae=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Oe=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,ze=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ve=(e,t)=>e?o(ze,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Fe=(e,t)=>["label"in e?Ve(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Oe(e.description,t)},String(t)):null,"__html"in e?o(Me,{...e},`rte-${t}`):null],Le=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Ae(n.icon,t):null,o("div",{children:Fe(n)})]}))),$e=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Le,{benefitsVersion:t,...e},String(n))))}):null)),je=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Fe)}):null)),Ue=d((({isTabularBenefits:e,...t})=>o(e?je:$e,{...t}))),qe=e=>Boolean(e?.src||e?.icon),We=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(He(n))}):null,He=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=Ye(i,r),d=Ye(l,r);return a||i?.icon?o(Ce,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ge({...i,iconVersion:c}),appendRight:Ge({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},Ye=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ge=e=>qe(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ke=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Xe=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Je)}):null)),Je=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(ze,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Ke(2)(t)," ",n||"₽"]}):null]},String(a)),Ze=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Qe)}):null)),Qe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(ze,{size:"text-m",font:"font-light",children:e})},String(t)),et={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},tt=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:x,image:y,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const R=y?.src?o(ie,{image:y,imageClassName:C}):null,P=o(S,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),B=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...p?{title:P}:{insetTitle:P},...rt(R,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:We(x),backwardButton:k,...T,children:lt(nt(B,{benefitsVersion:s,isTabularBenefits:c}),at(u,{richVersion:h,isDotted:d,headlineVersion:l}),I,it(g),st(f))})})),nt=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(Ue,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,at=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Me,{__html:e,richVersion:t,isDotted:n,itemSize:et[a??"L"]}):null,it=e=>e?.length?o(Xe,{priceList:e}):null,lt=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},rt=(e,t)=>t?{rightImage:e}:{leftImage:e},st=e=>e?.length?o(Ze,{tags:e}):null;class ot{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof ot?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const ct=()=>!0,dt=(e,t)=>(...n)=>e(...n)&&t(...n),mt=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const ut=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&"object"==typeof e&&!ut(e)),pt=e=>e;function gt(e){return e instanceof ot?e._:e}class ft extends ot{from(e){return this.of(e.map(((e=pt)=>([,t])=>e(t))(gt)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(ut(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class xt extends ot{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class yt extends ot{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,gt(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class bt extends ot{proto=mt([e=>ut(this._)||"number"==typeof e,()=>ft.prototype],[e=>ht(this._)||"string"==typeof e,()=>yt.prototype],[ct,()=>xt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const vt=e=>e instanceof ot?e:new bt(e),Nt=e=>{const t=(t,...n)=>gt(e(vt(t),...n));return t.fn=e,t},wt=[],Ct=e=>e instanceof Function?e:t=>e===t,kt=e=>(t,n,a=wt)=>vt(t).entries().reduce(((t,[n,i])=>kt(e)(i,t,a.concat(n))),e(n,[a,vt(t)])),St=Nt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?St(e.get(a),[i,n]):n)})),It=Nt(((e,t)=>t.reduce(St.fn,e))),Tt=e=>kt(((e,[t,n])=>Rt(n)?[...e,[t,gt(n)]]:e))(e,[]),Rt=e=>0===e.size();Nt(((e,t=wt)=>t.reduce(((e,t)=>e.get(t)),e)));const Pt=Nt(((e,[t,...n])=>n.length?e.set(t,Pt(e.get(t),n)):e.filter((([e])=>e!==t)))),Bt=(Et=["$ref"]).map(((e,t)=>n=>Ct(e)(n[t+n.length-Et.length]))).reduceRight(dt,ct);var Et;const Dt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(_t,e),_t=mt([ut,(e,t)=>e[parseInt(t,10)]],[ht,(e,t)=>e[t]],[ct,pt]),At=(e,t)=>((e,t={})=>n=>It(t,Tt(n).map((t=>e(t)))))((([e,n])=>{return Bt(e)?[(a=e,a.slice(0,-1)),Dt(t(n),n)]:[e,n];var a}))(e),Mt=e=>Tt(e).filter(((e=pt)=>([t])=>e(t))(Bt)),Ot=e=>{return t=Mt(e).map((([,e])=>e)),[...new Set(t)];var t};async function zt(e,t){try{return e?await Vt(e,t):null}catch(e){console.error(e)}return null}const Vt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Ft=e=>[...new Set(e)],Lt={},$t=["/portal-resources"],jt=(e,t)=>At(e,(e=>t?.[e])),Ut=(e,t)=>{const n=Ot(e),[l,r]=a({});return i((()=>{qt(n).then(r)}),[n.join()]),n.length?jt(e,{...t,...l}):e},qt=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Ft(e).filter((e=>!$t.some((t=>e.startsWith(t))))).map((async e=>[e,Lt[e]||=await Vt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Ot(e)));return i.length?qt(i,a):a}return t};function Wt(e,t={}){const n=d((t=>{const n=Ut((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Ht=Wt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(tt,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),Yt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Gt(0,t?.length)),[t]),a=t?.[n];return a?o(Ht,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Gt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Kt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Xt=e=>e?.replace(/[^+\d]/g,""),Jt="/api/v1";const Zt=e=>e?{phone:Xt(e)}:{},Qt=(e,t="birthday")=>e?{[t]:Kt(e)}:{},en=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),tn=(e,t=!0)=>({[t?"email":"mail"]:e}),nn=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Xt(e)}:{},an=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[])t[a??""]?.(n,i)};function ln(){return ln._impl()}ln._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),ln.setup=e=>{ln._impl=e};const rn="rshb-query-params";function sn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(rn)||"";return e&&globalThis.sessionStorage?.setItem(rn,e),e}const on=e=>{const t=e.target?.closest("a"),n=ln();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=sn();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function cn(){return cn._impl()}function dn(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}cn._impl=()=>({forwardQuery:on}),cn.setup=e=>{cn._impl=e};const mn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],un=e=>!e?.length,hn=e=>t=>n=>e(n)?[]:[t],pn={},gn=[];const fn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function xn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[r,s]=a(e),o=l((e=>s((a=>{const i=e instanceof Function?e(a):e,l=t?t(i):i,r=fn(i,l)?i:l;return!fn(a,r)&&n?.(r),r}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[r,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=dn(!1),f=s({}),[x,{isValid:y,errors:b}]=function(e,t){const n=r((()=>t?.(e)??pn),[t,e]),a=r((()=>mn(n)(e)??gn),[n,e]),i=un(a);return[n,{isValid:i,errors:a}]}(m,n),v=l(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,l=m[e],r=h||f.current?.[String(e)],s=t?.validator??x[e],o=r&&s?s(l):[];return{value:a?a(l):l,isDirty:r,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,x,u]),N=l((e=>{f.current=e,u(e)}),[u]),w=l((()=>{f.current={},g(),u(e)}),[e,u]),C=l((e=>{e.preventDefault(),y?(t&&w(),d?.(m,e)):p()}),[t,m,y,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const yn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function bn(e,t={}){const{open:n,close:a,...i}=ge();return{open:l(((i,l={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...l})),[e,n,a]),close:a,...i}}function vn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Nn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return vn(globalThis.document,"click",n),t}const wn=({label:e,errors:t})=>e&&t?`${e}*`:e,Cn=()=>{},kn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Sn=e=>e?kn:"border-error",In=e=>e?o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Tn=d((({key:e,className:t,id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:x=!1,disabled:y=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),k=l((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const S=b?"pr-3xl":"",I=Sn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[In(d),x?o("textarea",{className:u("block resize-y min-h-24",Rn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:y,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Rn,S,I),id:n,type:r,value:h,name:a||n,placeholder:m,pattern:g,disabled:y,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e)]}),b]})})),Rn="w-full border rounded-md text-primary-text outline-none p-m",Pn=e=>o("div",{className:"h-6",children:e?o(ze,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Bn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=Cn,onBlur:m,isTextarea:h,type:p,isInteger:g=!1,maxLength:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=dn(),N=Nn(b),w=l((e=>{!y&&v(),f?e.length<=f&&d(e):d(e)}),[y,d]);return i((()=>{g&&n&&d(En(n))}),[n]),c("div",{className:u("shrink-0 w-full",e),ref:N,onBlur:b,onFocus:v,children:[o("div",{children:o(Tn,{disabled:x,type:p||"text","aria-label":t,label:wn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:w,onBlur:m,isTextarea:h,placeholder:Dn(a,s,t)})}),Pn(r)]})})),En=(e="")=>e.replace(/[^\d]+/g,""),Dn=(e,t,n)=>t&&!n?`${e}*`:e,_n=e=>e?.text||e?.key||"",An=()=>ue(pe.emitter,"popup"),Mn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,On=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Mn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:_n(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const zn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,disabled:g=!1,iconVersion:f="black",onChange:x})=>{const[y,{setFalse:b,setTrue:v}]=dn(),[N,w]=a(""),C=Ln(g,n.length),k=y&&!C,S=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=An(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=Nn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(On,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:x,onClose:I,iconVersion:f});return c("div",{className:u("space-y-xs",e),children:[In(t),c("div",{className:u("relative",k?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Fn(m,d,C)),onClick:k?I:S,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:_n(r)||h}),Vn(k,f)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Tn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),Vn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Fn=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Ln=(e,t)=>e||0===t,$n=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(zn,{...i,valid:!n,label:wn({label:t,errors:a})}),Pn(n)]}))),jn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Un=d((({field:e,input:t})=>o($n,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:jn,...e(t?.name??"")}))),qn=(e="")=>Boolean("trade"===e||"all"===e),Wn=e=>null!=e,Hn=new Map,Yn=(e,t=Hn)=>n=>{const a=Kn(n),i=t.get(a);if(a&&Wn(i))return i;const l=e(...n);return a&&Wn(l)&&t.set(a,Promise.resolve(l)),l},Gn=e=>Boolean(e?.every((e=>Array.isArray(e)?Gn(e):!e||"string"==typeof e))),Kn=e=>Gn(e)?e.toString():"",Xn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Jn(e,t,{fallback:n,cache:l}={}){const s=r((()=>Zn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Wn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await Yn(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&Xn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Zn(e){return Array.isArray(e)?e:e instanceof Function?Zn(e()):[e]}const Qn=`${Jt}/branches`,ea=[];const ta=async e=>await zt(e,{method:"GET"})||ea;function na(e=!1){const{data:t}=Jn(`${Jt}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Vt);return Array.isArray(t)?t:[]}const aa=(e="")=>"ULTRASERVICE"===e,ia=d((({field:e,input:t,params:n})=>{const a=aa(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?na(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Jn(e?`${Qn}?regionCode=${e}`:null,ta);return t||ea}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o($n,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),la=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},ra=(e,t,n)=>Math.max(t,Math.min(e,n));function sa(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function oa({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:l,onChange:t=>{const n=sa(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const ca=1,da=100,ma=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:ca),max:s=(i.length?i.length-1:da),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=la(e,{normalize:(e=0)=>i.length?ua(i)(e):ra(e,r,s),format:Ke()}),f=l((e=>{p&&p(sa(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",kn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),oa({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),ha(a)]})})),ua=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),ha=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),pa=["От 1 000 ₽","До 1 000 000 000 ₽"],ga=d((({field:e,input:t})=>o(ma,{title:"Сумма, ₽",items:pa,min:1e3,max:1e9,...e(t?.name??"")}))),fa=d((({field:e,input:t})=>o(Bn,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),xa="client",ya=[{key:xa,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],ba=d((({field:e,input:t})=>o($n,{label:"Тип обратившегося",...t,options:ya,...e("applierType")}))),va=d((({field:e,input:t})=>o(Bn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),Na=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=wa(t,e),c=Ca(t,l,r);u.push(o("td",{children:o("div",{className:ka(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},wa=(e,t)=>t&&e.toDateString()===t.toDateString(),Ca=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),ka=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Sa=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ia=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:l=Cn})=>{const{firstDayOfWeek:s,totalDays:d}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Sa.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Na({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:l})})]})})),Ta=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ra(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Pa),l=a.map(((e,t)=>Ea(e)?a.slice(0,t).filter(Ea).length:-1)),r=a.map(((e,t)=>Ba(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Pa=e=>"_"===e,Ba=e=>/\d/.test(e),Ea=e=>Pa(e)||Ba(e),Da=1940,_a={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Aa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),i((()=>{Oa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Ra(t,"__.__.____"))},onBlur:()=>{Ma(p)?Oa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(l||"")},disabled:r}),r?null:o(G,{className:"mr-s",..._a})]})})),Ma=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Da&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Oa=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Ma(e)){const{day:i,month:l,year:r}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(l),n(r),a?.(new Date(r,l,i))}},za=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Aa,{onChange:a,disabled:r,onClick:e,value:t&&Kt(t),setSelectedMonth:i,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Va=Ta.map((e=>({key:e}))),Fa=Array.from({length:(new Date).getFullYear()-Da+1},((e,t)=>Da+t)).reverse().map((e=>({key:String(e)}))),La=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},$a=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},ja={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ua={className:"min-w-32",iconVersion:"black",isBorder:!1},qa=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=dn(!1),[x,y]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=l((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:k,handleSelectYear:S,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:R,ref:P}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=Nn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(Ta.indexOf(e));const t=La(r,Ta.indexOf(e));$a({maxDateOfMonth:t,selectedYear:r,selectedMonth:Ta.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Va,yearsOptions:Fa,ref:c}})({onYearSelect:v,onMonthSelect:y,onShowCalendar:g,selectedYear:b,selectedMonth:x,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(P,370);return c("div",{className:u("space-y-xs",e),ref:P,children:[In(t),c("div",{className:"relative",children:[za({handleChangeVisibleCalendar:R,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:y,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...ja,className:"-rotate-90 cursor-pointer"})}),o(zn,{onChange:k,value:{key:Ta[x]},options:I,...Ua}),o(zn,{onChange:S,value:{key:String(b)},options:T,...Ua}),o("div",{className:"my-auto",onClick:C,children:o(G,{...ja,className:"rotate-90 cursor-pointer"})})]}),o(Ia,{today:n,currentMonth:x,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),Wa=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(qa,{label:wn({label:t,errors:a}),valid:Boolean(!n),...i}),Pn(n)]}))),Ha=d((({field:e,input:t})=>o(Wa,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),Ya=d((({field:e,input:t})=>o(Bn,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Ga=d((({field:e,input:t})=>o(Bn,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),Ka=d((({field:e,input:t})=>o(Wa,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Xa=d((({field:e,input:t})=>o(Bn,{label:"Электронная почта",...e(t?.name??""),...t}))),Ja=[{key:"ULTRASERVICE",text:"Ультра"}],Za=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Qa=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],ei=d((({field:e,input:t})=>o($n,{label:"Способ получения ответа",options:Qa,...e(t?.name??"")}))),ti=d((({field:e,input:t})=>o(Bn,{label:"ФИО",...e(t?.name??""),...t}))),ni=d((({field:e,input:t})=>o(Bn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),ai=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),ii="appearance-none w-5 h-5 border-solid flex-none",li=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],ri=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(ai,{paths:li,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",oi(a)),onClick:s,children:[o("div",{className:u(ii,"m-0",i?"rounded-full border-2":di(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ci(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,si(n)]})})})),si=e=>e?o("div",{className:"ml-s",children:o(ze,{size:"text-l",font:"font-light",children:e})}):null,oi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ci=(e=!1)=>e?"radio":"checkbox",di=(e=!1)=>u("rounded border",{"bg-primary-main":e}),mi=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ri,{text:t,value:n,disabled:i,onChange:r},a),Pn(l)]}))),ui=d((({field:e,input:t})=>o(mi,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),hi=`${Jt}/outservice`,pi=[];async function gi(){const e=await zt(`${hi}/outserviceregions`);return e&&Array.isArray(e)?e:pi}const fi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=Jn("outServiceRegions",gi),s=r((()=>l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[l,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o($n,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),xi=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,yi=d((({field:e,input:t})=>o(Bn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),bi=d((({field:e,input:t})=>o(Bn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),vi=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Ni=d((({field:e,input:t})=>qn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),wi=d((({field:e,input:t})=>o(Bn,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),Ci=e=>"_"===e,ki=e=>/\d/.test(e),Si=e=>Ci(e)||ki(e),Ii=[..."+7 (___) ___-__-__"],Ti=Ii.findIndex(Ci),Ri=Ii.map(((e,t)=>Si(e)?Ii.slice(0,t).filter(Si).length:-1));function Pi(e){const t=e.replace(/\D/g,""),n=Ii.map(((e,n)=>ki(e)?e:t.charAt(Ri[n])||e)),a=Ri.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Ti,a)):n).join("")}const Bi=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Pi(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Tn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Ei=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Bi,{"aria-label":t,label:wn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Pn(a)]}))),Di=d((({field:e,input:t})=>o(Ei,{label:"Телефон",...e(t?.name||"phone"),...t}))),_i=d((({field:e})=>qn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ai=Wt((({field:e,input:t,source:n})=>o($n,{placeholder:"Выберите продукт",label:"Продукт",options:Mi(n?.productList),...e(t?.name??"")}))),Mi=e=>(e??[]).map((e=>({key:e,value:e}))),Oi=`${Jt}/regions`,zi=[];function Vi(e=Oi){const{data:t}=Jn(e,Vt);return Array.isArray(t)?t:zi}const Fi=`${Jt}/outservice/outserviceregions`,Li=d((({field:e,input:t,params:n})=>{var a;const i=Vi((a=n?.typeForm,"OUTSERVICE"===a?Fi:void 0));return o($n,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),$i=d((({field:e,input:t})=>{const n=na(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o($n,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),ji=d((({field:e,input:t})=>o(Bn,{label:"ФИО представителя",...t,...e("representativeName")}))),Ui=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},qi=/^[\u0400-\u04FF\d\s]+$/u,Wi=(e="")=>qi.test(e),Hi=hn((e=>null!=e&&""!==e)),Yi="Некорректно заполненное поле",Gi=e=>Hi(e??Yi),Ki=e=>hn((e=>e?.key&&""!==e?.key))(e??Yi),Xi=e=>hn((e=>"string"==typeof e&&e.length>1&&Wi(e)))(e??Yi),Ji=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Zi=e=>hn(Ji)(e),Qi=hn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),el={fullName:Gi(),addressBranch:Ki(),desiredMeetingDate:Gi(),product:Gi(),localities:Gi(),partnerComments:Gi(),collectionCount:Gi(),acquiringType:Ki(),serviceType:Ki(),annualRevenue:Gi(),feedbackMethod:Ki(),serviceDirection:Ki(),secondaryPhone:Zi("Укажите номер телефона"),region:Ki(),situationDescription:Gi(),sufferedFrom:Gi(),applierType:Gi(),surname:Xi("Укажите свою фамилию на кириллице"),name:Xi("Укажите своё имя на кириллице"),middleName:Xi("Укажите своё отчество на кириллице"),birthday:Gi("Укажите дату рождения"),phone:Zi("Укажите номер телефона"),email:(tl="Укажите электронную почту",hn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(tl)),inn:(e=>hn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Gi(),typeForm:Gi(),consentToReceiveMaterials:Qi,consentDataProcessing:Qi};var tl;const nl=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...el,...t},i=n.some((e=>e.condition?.values)),l=Object.fromEntries(n.filter(al(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(al(a)).filter(il(e)).map((({name:e})=>[e,a[e??""]]))):l},al=(e={})=>({name:t})=>Boolean(e[t??""]),il=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),ll=d((({field:e})=>{const t=e("secondaryPhone");return o(Ei,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Ui(t,el.secondaryPhone):t})})),rl=d((({field:e,input:t})=>o($n,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Za,...e(t?.name??"")}))),sl=d((({field:e,input:t})=>o(Bn,{label:"Описание ситуации",...t,...e("situationDescription")}))),ol=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],cl=d((({field:e,input:t})=>o($n,{label:"Пострадал в",...t,options:ol,...e("sufferedFrom")}))),dl=d((({field:e,input:t})=>o(Bn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),ml=["От 1 мес","До 15 лет"],ul=d((({field:e})=>o(ma,{title:"Срок, месяцев",items:ml,min:1,max:180,...e("term")}))),hl=d((({field:e,input:t})=>o($n,{label:"Тип обслуживания",options:Ja,...e(t?.name??"")}))),pl={horizontal:"@lg:flex-row",vertical:""},gl=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:l="horizontal",onChange:r})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(ze,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",pl[l],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ri,{isRadio:!0,text:t,value:n===e,onChange:()=>r?.(e),disabled:i},String(e))))})]}))),fl=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],xl=d((({field:e,input:t})=>{const n=l((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(gl,{className:"whitespace-normal",orientation:"horizontal",items:fl,...e(t?.name??"",{onChange:n})})})})),yl=d((({field:e,input:t})=>o(ri,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const bl={$ref:"/wcms-resources/outservice-productlist.json"},vl={fullName:ti,addressBranch:ia,desiredMeetingDate:Ka,product:e=>o(Ai,{...e,source:bl}),localities:fi,isClient:ui,partnerComments:wi,collectionCount:Ya,acquiringType:Un,onlineCheckout:Ni,posTerminal:_i,serviceType:hl,term:ul,amount:ga,annualRevenue:fa,vedTypes:xl,feedbackMethod:ei,serviceDirection:rl,bankEmpolee:va,secondaryPhone:ll,applicationDate:e=>o(Bn,{label:"Дата и время обращения в Банк",...e}),region:e=>aa(e?.params?.typeForm)?o($i,{...e}):o(Li,{...e}),consentToReceiveMaterials:yl,sufferedFrom:cl,situationDescription:sl,representativeName:ji,applierType:ba,surname:dl,name:bi,middleName:yi,birthday:Ha,phone:Di,email:Xa,inn:ni,comment:Ga},Nl=(e,t,n={})=>(a,i)=>{const l={...vl,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})&&l?o("div",{children:o(l,{field:e,input:a,params:t})},i):null},wl=e=>2===e?"@xl:grid-cols-2":"",Cl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(ze,{size:"text-h6",children:e})}):null,kl={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","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"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","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")},Sl=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Il=u("bg-main-gray text-main-disabled cursor-not-allowed"),Tl=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=Cn})=>{const x=l("tab"!==c?me(f):f,[c,f]),y=r((()=>ye(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[kl[n]]:!s&&!i,[Sl]:i,[Il]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...y,onClick:x,children:p})})),Rl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Pl=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Rl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Bl=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Tl,{type:"button",onClick:n,children:"Хорошо"})]})})})),El=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,...p}=e,g=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${qn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,f={...p,...Ml(o),...Al(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},..._l(m?.text,u),...Dl(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Dl=e=>e?.key?{isClient:e?.key===xa}:{},_l=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Al=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ml=e=>e?{vedTypes:Object.fromEntries(fl.map((({id:t})=>[t,t===e])))}:{},Ol={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:jn[0],serviceType:Ja[0],feedbackMethod:Qa[0],serviceDirection:Za[0],vedTypes:fl[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},zl=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),Vl=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Tl,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(zl,{blur:!0,size:"small"}):null,n]}))),Fl={primary:kl.primary,secondary:kl.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:kl.secondary,transparent:"","":""},Ll=d((e=>{const t=fe(),{className:n,href:a,target:i,text:l,aboveText:r,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[Fl[s]]:Boolean(s),[r?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${l}`,role:a?"link":"button",onClick:p,...ye(m),children:h??$l(l,r)})})),$l=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,jl=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(ze,{children:e}):null,t?o(Ll,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),Ul=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(ri,{...e}),o(jl,{link:t})]}),Pn(Ui(e,Qi).error)]}):o(jl,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(Vl,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),ql={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Jt}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...en(a,g),...tn(l,g),...Zt(i),...Qt(s,"desiredMeetingDate"),...g?Qt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...nn(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Wl=d((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=r((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),x=r((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Ol[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),y=r((()=>nl(f)),[f]),b=bn(Bl),v=cn(),N=l((async(e,t)=>{const a=El({...e,...m}),i=Boolean(await ql.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&an({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:k}]=xn(x,{resetOnSubmit:!0,formValidator:y,onSubmit:N}),S=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(yn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:k,children:[a.map(((e,t)=>c("div",{className:u(wl(e.columns),"grid gap-x-m"),children:[Cl(e.title),(e?.inputs||[])?.map(Nl(C,{typeForm:n}))]},`section-${t}`))),Ul(S?C("consentDataProcessing"):void 0,s,i)]}),h?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),Hl="Некорректно заполненное поле",Yl="Укажите регион, город/населенный пункт, улицу, дом",Gl=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),Kl=()=>hn(Gl)(Yl),Xl=e=>hn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??Hl),Jl=(e,t)=>hn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Hl),Zl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},Ql=e=>hn((e=>"string"==typeof e&&6===e.length))(e),er=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},tr={processPersonalDataFlg:Qi,consentProviderFlg:Qi,consentInformFlg:Qi,consentPfrFlg:Qi,consentOthersFlg:Qi,consentFATCA:Qi},nr={addressCourier:Kl(),paymentSystem:Gi("Укажите тип платежной системы"),currency:Gi("Укажите валюту"),cardCategory:Gi("Укажите категорию карты"),codeWord:(e=>hn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Wi(e)))(e??Hl))("Необходимо ввести кодовое слово"),confirmationIncome:Ki(),methodObtain:Gi(),deliveryDate:Gi("Укажите дату доставки")},ar={organization:Ki("Выберите тип организации"),organizationAddress:hn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(Yl),organizationPhone:Zi("Укажите номер телефона"),organizationName:Gi("Укажите наименование организации"),legalForm:Gi("Укажите ОПФ"),generalSeniority:Xl("Укажите количество лет стажа"),lastJobExperience:Xl("Укажите стаж на последнем месте работы"),experience5Years:Xl("Укажите общий стаж за последние 5 лет"),jobsNumber:Xl("Укажите количество мест работы за последние 5 лет"),beginDate:Gi("Укажите дату заключения трудового договора"),addressFact:Kl(),addressRegistration:Kl(),addressRetail:Ki("Выберите адрес банка"),addressMatch:Gi(),sex:Gi("Укажите свой пол"),limitedBirthday:hn(Zl)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:Gi("Укажите место рождения"),education:Ki("Выберите ваше образование"),housing:Ki("Выберите тип жилья"),amountWorkers:Ki("Выберите информацию о количестве сотрудников"),employment:Ki("Выберите информацию о трудоустройстве"),employerActivities:Ki("Выберите вид деятельности организации"),employerOrganization:Ki("Выберите вид организации"),positionOrganization:Ki("Выберите вашу должность"),familyStatus:Ki("Выберите семейное положение"),familyMembers:Jl(2,"Укажите количество членов семьи"),children:Jl(2,"Укажите количество детей"),dependents:Jl(2,"Укажите количество иждивенцев"),totalIncome:Jl(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Jl(10,"Укажите сумму обязательных выплат"),snils:(e=>hn(er)(e))("Некорректный номер СНИЛС"),conscription:Gi(),armyIdFlg:Qi,dulSerie:(e=>hn((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:Ql("Укажите номер паспорта"),dulIssueDate:Gi("Укажите дату выдачи паспорта"),dulSubdivisionCode:Ql("Укажите код подразделения"),dulIssuedBy:Gi("Укажите организацию, выдавшую паспорт"),participantDateRegistration:Gi("Укажите дату регистрации"),retirementIncome:Gi(),otherIncome:Gi(),wages:Gi(),mandatoryPayments:Gi(),bankruptcyFlg:Gi(),shareholderFlg:Gi(),legalEntityName:Gi(),bankEmployeeCode:Gi(),partInBusiness:Gi(),regionRetail:Ki("Выберите регион"),latinSurname:Gi("Укажите фамилию")},ir={...ar,...nr,...tr},lr={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18},consentPhotoFlg:{text:"Согласие на фотографирование",docId:17}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}},rr=e=>e?.value||"",sr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=rr}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`,c=globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(r);return c},or={url:"suggest/address"},cr={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:or,addressFact:or,organizationAddress:or,addressCourier:or},dr=d((({options:e,container:t,onChange:n})=>{const[l,r]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?r(l<a?l+1:0):"ArrowUp"===t.key?r(l>0?l-1:a):"Enter"===t.key&&e[l]&&(t.preventDefault(),n(e[l]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[l]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>o("div",{className:u("flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",{"bg-main-divider":l===t}),role:"listitem",onMouseDown:()=>n(e),children:o("span",{className:"min-h-6",children:e.processedValue})},t.toString())))})}));function mr({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=An(),x=cr[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await sr({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(dr,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const ur=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=Cn,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:k}]=dn(),S=Nn(C),I=l((e=>{v&&!w&&k(),b?e.length<=b&&d(e):d(e)}),[w,d]);i((()=>{y&&n&&d(hr(n))}),[n]);const T=mr({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:S,onBlur:C,onFocus:k,children:[o("div",{ref:T,children:o(Tn,{disabled:N,type:g||"text","aria-label":t,label:wn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:pr(a,s,t)})}),Pn(r)]})})),hr=(e="")=>e.replace(/[^\d]+/g,""),pr=(e,t,n)=>t&&!n?`${e}*`:e,gr=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(fr(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(ur,{disabled:t?.filledByEsia&&xi(e,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:r,...t,onDaDataChange:i})})),fr=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),xr=Wt((({field:e,input:t,source:n})=>{const[r,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=l((t=>{e?.("addressCourier")?.onChange?.(fr(t))}),[]),h=l((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(ur,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:r||e("addressCourier")?.error,onDaDataChange:u})})),yr=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(ur,{label:"Адрес",disabled:r,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),br=d((({field:e,input:t})=>o(mi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),vr=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:Nr({textItems:l,subText:t,children:n,isPhone:a,...i})})),Nr=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(ze,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||wr(n,s),i?o(ze,{color:a,size:"text-m",children:i}):null]}),wr=(e,t)=>e.filter(Boolean).map(((e,n)=>o(ze,{size:"text-l",children:t?o("a",{href:`tel:${Cr(e)}`,children:e.trim()}):e.trim()},String(n)))),Cr=e=>e.replace(/\D/g,""),kr=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Sr=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),Ir=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),Tr=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...l})=>c(Tl,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...l,children:[o(Sr,{children:a}),o(Ir,{isUnfolded:t,iconVersion:i?"color":""})]}))),Rr=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const Pr=d((({className:e,isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:u("transition-max-h duration-300 overflow-hidden",{"max-h-0":Boolean(a.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:n})})})),Br=d((({children:e})=>{const[t,{toggle:n}]=dn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Rr,{className:"block sm:hidden",children:[o(Pr,{isUnfolded:t,children:e}),o(Tr,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),Er=e=>{const t=_r(e);return o(vr,{label:"Режим работы",value:t,className:"max-w-none"})},Dr=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",_r=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Dr({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Dr({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Ar=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Mr=e=>Ar.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),Or=e=>{if(!e)return null;const t=zr(e);return c(kr,{className:"border-none",children:[o(vr,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Vr)})}),o(vr,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]})},zr=e=>{const t=Ar.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},Vr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(ze,{size:"text-xs",children:e})},String(n)),Fr=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(vr,{label:"Валюта",value:e.currency}):null,t?o(vr,{label:"Купить",value:String(t)}):null,n?o(vr,{label:"Продать",value:String(n)}):null]},String(a)),Lr={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},$r=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",Lr[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(ze,{size:"text-m",color:Lr[n].text,children:t})]}))),jr=(new Date).getDay(),Ur=e=>{const[t]=e?.slice(jr-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o($r,{color:"green",children:i}):null,n&&l?o($r,{color:"yellow",children:`перерыв: ${n}`}):null]}):o($r,{color:"red",children:"Выходной"})},qr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Wr=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(vr,{label:e,value:t&&n?n:"",subText:qr({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Hr=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Yr=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Gr=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Kr=(e,t)=>{if(!e.workSchedule)return null;const n=Mr(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e.address})]}):null]}),Ur(n)]}),o(Br,{children:Xr(e)})]},String(t))},Xr=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=Mr(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(kr,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(vr,{label:"Факс",value:t,isPhone:!0}),o(vr,{label:"Телефон филиала",value:e,isPhone:!0}),o(vr,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(vr,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(vr,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(vr,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(kr,{children:o(vr,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Wr)})})}):c(kr,{children:[o(vr,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Vr)})}),Er(d)]}),r?.businessScheduleVisibleTag?Or(r?.businessScheduleDescription):null,s?.currencies?.length?o(kr,{className:"flex-wrap",children:s?.currencies?.map(Fr)}):null]})},Jr=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=Mr(e),n=e?_r(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Hr(n):Gr(n,a):Yr(n):""})(n)}`;return{header:a,body:l}},Zr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Qr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},es={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},ts=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>es[t](e)))))},ns=()=>{},as=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=ns,getBalloonRemoteWorkplaces:i=ns})=>{const[l,s,o,c]=r((()=>{const l=ts(e,n),r=ts(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},is=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),ls=d((({children:e})=>is?e:null)),rs="/icons/MapMarkerClusterIcon.svg",ss="/icons/MapMarkerClusterYellowIcon.svg";function os({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=cs("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=cs("workplaces",e,i),r=ds(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ds(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=ds(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const cs=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?rs:ss,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ds=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?rs:ss,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),ms={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},us={...ms,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},hs=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(us).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),ps=e=>globalThis[e],gs=(e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=ps(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(ps(e))}))}))}return new Promise(((a,i)=>{const l=globalThis.document.createElement("script");l.src=t,l.async=!0,l.id=t,n&&(l.type="module"),l.addEventListener("load",(()=>{a(ps(e))})),l.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(l)}))};const fs=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return gs(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),xs={...ms,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},ys=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(xs).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),bs=[55.753995,37.614069],vs=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=fs();if(i((()=>{r.current?os({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Ns(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),os({yandexMaps:m,map:r.current,points:e,isLoad:a})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,a,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(zl,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(ys,{yandexMaps:r}),o(ys,{yandexMaps:r,direction:"out"})]}),hs(r,m,u("right-2 top-80",h))]})})),Ns=e=>{const t=[Cs(ws(e,0)),Cs(ws(e,1))];return t.every((e=>e))?t:bs},ws=(e,t)=>e.map((e=>e.coords?.[t])),Cs=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ks=async(e,t,n)=>{try{return(await Ss(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ss(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...Is()},credentials:"include",body:n?JSON.stringify(n):null})}const Is=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Ts=e=>Number(e.toString().replace(",",".")),Rs=e=>{const{data:t,error:n}=Jn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Ps);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Ps=async e=>await zt(e,{method:"POST"})||[],Bs=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=Rs("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await ks("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Ts(e.latitude??bs[0]),gpsLongitude:Ts(e.longitude??bs[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=as({data:n,filtrationState:{},getBalloon:Jr});return c("div",{children:[o($n,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(ls,{children:o(vs,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Es(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Ds(e,t){return Es(e,t),Es(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class _s{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class As{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const Ms={};function Os(e,t=Ms){const n=s(null),o=function(){const[,e]=a(0);return l((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const zs=new As;function Vs(e){return Os(zs,e)}Ds(zs,new _s(globalThis?.localStorage));const Fs=()=>Vs(),Ls=Wt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...l})=>{const r=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o($n,{placeholder:a,options:r,...e(n),...l})})),$s=d((({field:e,input:t})=>{const{data:n}=Rs("EMPLOYEES_NUMBER"),a=Fs();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(Ls,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),js=d((({field:e,input:t})=>o(mi,{text:"Наличие военного билета",...e(t?.name??"")}))),Us=d((({field:e,input:t})=>o(ur,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),qs=d((({field:e,input:t})=>o(mi,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Ws=d((({field:e,input:t})=>o(Wa,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t}))),Hs=d((({field:e,input:t})=>o(ur,{label:"Место рождения",...e(t?.name??""),...t,disabled:t?.filledByEsia&&xi(e,"birthPlace")}))),Ys=e=>{try{return JSON.parse(String(e))}catch(e){return null}};const Gs=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Me,{__html:e})})]}))),Ks=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=function(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?Ys(t):null);return[n,l((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}("programId"),{value:m,onChange:u}=e("cardCategory"),h=e("paymentSystem")?.value?.key;i((()=>{h&&d&&(async()=>{const e=await(async(e,t)=>{const n=await ks("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(h,d);s(e),Xs(e,m)||u&&u(null)})()}),[h]);const p=r((()=>n?.find((e=>e.key===m?.key))?.description),[n,m]);return c("div",{children:[o(Ls,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),p?o(Gs,{__html:p}):null]})})),Xs=(e,t)=>e.some((e=>e.key===t?.key)),Js=d((({field:e,input:t})=>o(ur,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Zs=d((({field:e,input:t})=>o(ur,{label:"Кодовое слово",...e(t?.name??""),...t}))),Qs=d((({field:e,input:t})=>{const{data:n}=Rs("INCOME_CERT_UNITED");return o(Ls,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),eo=d((({field:e,input:t})=>{const{data:n}=Rs("MILITARY_STATUS");return o(Ls,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),to=()=>Vs(),no=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Te();return c(Pl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Tl,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),ao=(e,t)=>{const{open:n}=bn(no),a=Te();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await Ss(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},io=d((({className:e,error:t,docId:n,...a})=>{const i=ao(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ri,{...a}),n?o(Tl,{embedded:!0,onClick:i,children:o(Sr,{children:"Ознакомиться"})}):null]}),Pn(t)]})})),lo=d((({field:e,input:t})=>{const{productType:n}=to(),a=lr[n??""];return t&&t.name?o(io,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),ro=Math.round(29.5),so=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),oo="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",co="flex flex-col lg:w-1/2 gap-2xl",mo="flex flex-col gap-y-xl min-w-52",uo=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(ze,{size:"text-h3",children:"number"==typeof e?[a,Ke(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),ho=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(ze,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(uo,{value:n,...i}):o(ze,{size:"text-h3",children:"-"})]}))),po=e=>fo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),go=(e=[],t=!1,n=[])=>({...fo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),fo=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},xo=(e,t=0)=>e?.sum?e.sum:t,yo=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,bo=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,vo=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ma,{items:[`От ${No(e)}`,`До ${No(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),No=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,wo=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...l})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(ze,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(gl,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...l})]}),Co=e=>wo({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),ko=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ma,{items:e?[`От ${Ke(1)(a.min||0)} ${n}`,`До ${Ke(1)(a.max||0)} ${n}`]:[],step:t,...a}),So=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(ra(t?.[i],n.minMonths,n.maxMonths))},Io=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},To=e=>e,Ro=(e=To)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Po=Ro(),Bo=(e=To)=>Ro((t=>-e(t))),Eo=Bo(),Do=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:_o([e,t],a),_o=([e,t],n=[])=>({[e]:n.length?Eo(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Po(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Ao=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Mo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Oo=e=>zo({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&zo({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&zo({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&zo({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),zo=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Vo=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Mo],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Oo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Do(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Do(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Oo({row:e,userInputParams:t,paramsViewSettings:n})&&Ao(a,["minSum","maxSum"],e)&&Ao(i,["minMonths","maxMonths"],e)))||Mo)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Io(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Fo=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Lo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},$o=Wt((({className:e,title:t,calcSource:n,buttons:a,footnote:r,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=po(n?.rateRows),g=l((e=>{const t=Vo(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:x}]=xn({moneyValue:xo(d,2e5),monthsValue:yo(d,ro),monthlyPayment:0,rate:0,isAnnuity:Boolean(d?.isAnnuity),isInsurance:Boolean(d?.isEnableInsurance),isSalaryClient:Boolean(d?.isEnableSalaryClient),isPensionClient:Boolean(d?.isEnablePensionClient),isStateEmployee:Boolean(d?.isEnableStateEmployee)},{onChange:g}),y=Vo(f,n,s),b=Co({...x("isAnnuity")}),{onChange:v}=x("moneyValue"),{onChange:N}=x("monthsValue");return i((()=>{v&&v(ra(f.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),i((()=>{N&&N(ra(f.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),i((()=>{!Fo(d)&&p&&So({field:x,defParams:p,calcParams:y,map:Lo,monthsValue:"minMonths"})}),[n,d]),o(so,{className:e,title:t,...h,children:c("section",{className:u(oo,e),children:[c("div",{className:co,children:[ko({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...x("moneyValue"),value:y.moneyValue}),vo({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...x("monthsValue"),value:y.monthsValue}),jo({...y,...s},x),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(mo,"@4xl:w-1/2"),children:[o(ho,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ho,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(ho,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),We(a,{isVertical:!0}),bo(r)]})]})})})),jo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ri,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ri,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ri,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Uo="calculator",qo=d((({field:e,params:t})=>{const n=l((t=>{e(Uo).onChange?.(t)}),[]);return o($o,{...t?.calcData,padding:"p-0",defaultParams:Ho(e(Uo).value),onChange:n})})),Wo={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Ho=(e,t=!1)=>{const n=t?Yo(Wo):Wo;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Yo=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Go=d((({field:e,input:t})=>{const{data:n}=Rs("CREDIT_IN_RSHB");return o(Ls,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Ko={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card"},Xo=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gl,{label:wn({label:t,errors:a?.errors}),...a}),Pn(n)]}))),Jo=[{id:"810",text:"Рубли"}],Zo=d((({field:e,input:t})=>{const{data:n}=Rs("CURRENCY"),{programId:a}=to(),i=r((()=>!Object.keys(Ko).includes(a||"")||"38"===a),[]),l=r((()=>i?Jo:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(Xo,{label:"Валюта",orientation:"horizontal",items:l,...e(t?.name??"")})})),Qo=(e,t)=>{if(!t)return null;const n=ac(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},ec=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},tc=(e,t)=>{const n=ac(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},nc=(e,t,n)=>{const a=ac(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},ac=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,ic=(e,t,n)=>{const{okved:a,okopf:i,inn:l,organizationName:r}=lc(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(fr(n.data?.address));const s={amountWorkers:ec(e?.amountWorkers,n.data?.employee_count),employerActivities:Qo(e?.employerActivities??[],a),organization:nc(e?.organization??[],i,l),employerOrganization:tc(e?.employerOrganization??[],i),organizationName:r};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},lc=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),rc=d((({field:e,input:t})=>{const n=Fs(),{employerActivities:a,employerOrganization:r,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=l((t=>{ic(n,e,t)}),[]);return i((()=>{d&&m&&a&&r&&s&&c&&(async()=>{const t=await(async e=>{const t=await sr({url:"suggest/party",query:e});return t?.[0]})(m);t&&ic(n,e,t)})()}),[a,r,s,c]),o(ur,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u})})),sc=d((({field:e,input:t})=>o(Wa,{label:"Дата доставки",...e(t?.name??"")}))),oc=d((({field:e,input:t})=>{const{data:n}=Rs("COURIER_DELIVERY_TIME"),a=r((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(Xo,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),cc=d((({field:e,input:t})=>o(ur,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),dc=d((({field:e,input:t})=>o(Wa,{label:"Дата выдачи",...e(t?.name??""),disabled:t?.filledByEsia&&xi(e,t?.name??"")}))),mc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(ur,{disabled:t?.filledByEsia&&xi(e,t?.name??""),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),uc=d((({field:e,input:t})=>o(ur,{disabled:t?.filledByEsia&&xi(e,t.name??""),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),hc=d((({field:e,input:t})=>o(ur,{disabled:t?.filledByEsia&&xi(e,t.name??""),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),pc=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(ur,{disabled:t?.filledByEsia&&xi(e,t.name??""),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),gc=d((({field:e,input:t})=>{const{data:n}=Rs("EDUCATION_LEVEL");return o(Ls,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),fc=d((({field:e,input:t})=>o(ur,{label:"Электронная почта",...e(t?.name??""),...t}))),xc=d((({field:e,input:t})=>{const{data:n}=Rs("ORGANIZATION_ACTIVITY_TYPE"),a=Fs();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(Ls,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),yc=d((({field:e,input:t})=>{const{data:n}=Rs("ORGANIZATION_KIND"),a=Fs();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(Ls,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),bc=d((({field:e,input:t})=>{const{data:n}=Rs("EMPLOYMENT_INFO_UNITED");return o(Ls,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),vc=d((({field:e,input:t})=>o(ur,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Nc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ra(Number(n),0,5)))),[]);return o(ur,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n})})),wc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),l=e("familyStatus")?.value?.key,r="MARRIED"===l?2:1,s=Number(e("children")?.value),c=Number(e("dependents")?.value),d=r+s+c;return i((()=>{a?.(d)}),[l,s,c]),o(ur,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),Cc=d((({field:e,input:t})=>{const{data:n}=Rs("MARITAL_STATUS");return o(Ls,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),kc=d((({field:e,input:t})=>o(ur,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t}))),Sc=d((({field:e,input:t})=>{const{data:n}=Rs("HOUSE_TYPE");return o(Ls,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Ic=d((({input:e})=>o(Gs,{__html:e?.label}))),Tc=d((({field:e,input:t})=>o(ur,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),Rc=d((({field:e,input:t})=>o(ur,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t}))),Pc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Bc=(e="")=>Pc.test(e),Ec=e=>{const t={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},Dc=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,r=e("latinName")?.onChange;i((()=>{r?.(Ec(a))}),[]);const s=l((e=>{(Bc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(Bn,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),_c=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,r=e("latinSurname")?.onChange;i((()=>{r?.(Ec(a))}),[]);const s=l((e=>{(Bc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(Bn,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Ac=d((({field:e,input:t})=>o(ur,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),Mc=d((({field:e,input:t})=>o(ur,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),Oc=d((({field:e,input:t})=>o(Wa,{label:"Дата рождения",...e(t?.name??""),disabled:t?.filledByEsia&&xi(e,t.name??"")}))),zc=d((({field:e,input:t})=>o(ur,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Vc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Fc=d((({field:e,input:t})=>o(Xo,{orientation:"horizontal",items:Vc,...e(t?.name??"")}))),Lc=d((({field:e,input:t})=>o(ur,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&xi(e,t?.name??""),...e(t?.name??""),...t}))),$c=d((({field:e,input:t})=>o(ur,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&xi(e,t.name??""),...e(t?.name??""),...t}))),jc=d((({field:e,input:t})=>{const{data:n}=Rs("ORGANIZATION_TYPE"),a=Fs();return i((()=>{n&&(a.organization=n)}),[n]),o(Ls,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Uc=d((({field:e,input:t})=>{const n=Fs(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),ic(n,e,t)}),[]);return o(ur,{label:"Наименование организации",...t,...e(t?.name??""),onDaDataChange:a})})),qc=d((({field:e,input:t})=>o(ur,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Wc=d((({field:e,input:t})=>o(Wa,{label:"Дата регистрации по месту жительства",...e(t?.name??"")}))),Hc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ra(Number(n),0,100)))),[]);return o(ur,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const Yc=e=>e.map((e=>({key:e.type,text:e.name}))),Gc=e=>e?.key,Kc=d((({field:e,input:t})=>{const[n,l]=a([]),s=Vs();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await ks("/public-data/creditProgramConditions","POST",{creditProgramId:e});return Yc(t?.paymentSystems||[])})(e);l(t??[])}},i((()=>{const e=c();return()=>{e.then((e=>{e instanceof Function&&e()}))}}),[]);const d=r((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(Xo,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:Gc,parse:e=>n?.find((t=>t.key===e))})})})),Xc=d((({field:e,input:t})=>{const{data:n}=Rs("POSITION");return o(Ls,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Jc=async()=>await ks("/public-data/regionsCardDelivery","GET")||void 0,Zc=d((({field:e,input:t})=>{const{data:n}=Rs("REGION_RF"),{data:a}=Jn("regionsDelivery",Jc),{programId:i}=Fs(),r="38"===i,s=n?.map((({key:e,value:t})=>({key:e,text:t}))),c=e("regionRetail")?.onChange,d=e("regionHasDelivery")?.onChange,m=e("methodObtain")?.onChange,u=l((e=>{const t=a?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!r;d?.(t),m?.(t?"courier":"office"),c?.(e)}),[a]);return o($n,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:s,...e(t?.name??""),onChange:u})})),Qc=d((({field:e,input:t})=>o(ur,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),ed=["male","female"],td=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],nd=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:l}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await sr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return ed.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Xo,{label:"Пол",orientation:"horizontal",items:td,...e(t?.name??"")})})),ad=d((({field:e,input:t})=>o(mi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),id=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Ra(e,"___-___-___ __")):t?.(Ra(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Tn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),ld=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(id,{"aria-label":t,label:wn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),Pn(a)]}))),rd=d((({field:e,input:t})=>o(ld,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),sd=d((({field:e,input:t})=>o(ur,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&xi(e,"surname"),...e(t?.name??""),...t}))),od=d((({field:e,input:t})=>o(ur,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),cd=d((({field:e,input:t})=>o(ur,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),dd={$ref:"/wcms-resources/delivery-cities-data.json"},md={limitedBirthday:Oc,name:$c,surname:sd,middleName:Lc,email:fc},ud={processPersonalDataFlg:lo,consentProviderFlg:lo,consentOthersFlg:lo,consentInformFlg:lo,consentPfrFlg:lo,consentInformMaterialsFlg:lo,consentPhotoFlg:lo,consentFATCA:lo},hd={organization:jc,organizationAddress:gr,organizationPhone:Di,organizationName:Uc,legalForm:Mc,generalSeniority:kc,lastJobExperience:Rc,experience5Years:Nc,jobsNumber:Tc,beginDate:Ws,addressFact:yr,addressRegistration:gr,addressRetail:Bs,addressMatch:br,sex:nd,limitedBirthday:Oc,birthPlace:Hs,education:gc,housing:Sc,amountWorkers:$s,employment:bc,employerActivities:xc,employerOrganization:yc,positionOrganization:Xc,familyStatus:Cc,familyMembers:wc,children:Js,dependents:cc,totalIncome:od,expenses:vc,snils:rd,conscription:eo,armyIdFlg:js,dulSerie:hc,dulNumber:uc,dulIssueDate:dc,dulSubdivisionCode:pc,dulIssuedBy:mc,participantDateRegistration:Wc,retirementIncome:Qc,otherIncome:qc,wages:cd,mandatoryPayments:zc,bankruptcyFlg:qs,shareholderFlg:ad,legalEntityName:Ac,creditInRshbCd:Go,bankEmployeeCode:Us,partInBusiness:Hc,regionRetail:Zc,infoCard:Ic,calculator:qo,confirmationIncome:Qs,inn:rc},pd={addressCourier:e=>o(xr,{...e,source:dd}),paymentSystem:Kc,currency:Zo,cardCategory:Ks,codeWord:Zs,methodObtain:Fc,deliveryDate:sc,latinName:Dc,latinSurname:_c,deliveryTime:oc},gd="Согласие на все документы",fd=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=l((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Ui(t(e?.name),Qi).error)))),[e]),[d,{toggle:m}]=dn(!0);return o("div",{className:"w-fit",children:c(Rr,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ri,{text:gd,value:a,onChange:i},n),Pn(s?"Отметьте все обязательные соглашения":"")]}),o(Tl,{embedded:!0,ariaLabel:gd,onClick:m,children:o(Ir,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(Pr,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(Nl(t,{},ud))})]})})})),xd=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=yd(t||[],n);return a.length>2?c("div",{children:[i.map(Nl(e,{},{...md})),o(fd,{inputs:a,field:e})]}):(t||[])?.map(Nl(e,{},{...md}))},yd=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(lr[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(lr[t]).includes(String(e))))}),bd=(e,t=!1)=>o(Vl,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),vd=e=>Ss("/user-data/updateUserProfile","PUT",e),Nd=e=>Ss("/user-data/updateUserTask","PUT",e),wd=d((({className:e,seconds:t})=>o("span",{className:e,children:Cd(t)}))),Cd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),kd=(e,t)=>{const n=s(null),a=l((()=>clearInterval(n.current)),[]),r=l((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(r(),a)),[r,a]),{start:r,stop:a}};function Sd({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),r=l((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=kd(r,t);return l((e=>{i.current=e,o()}),[])}const Id={width:"103",height:"21"},Td={"bg-white":"color",transparent:"white"},Rd={"bg-white":"text-primary-main",transparent:"text-white"},Pd=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Td[e]},className:Rd[e],width:n?.width,height:n?.height}),Bd={"bg-white":"text-primary-text",transparent:"text-white"},Ed=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ye(s),children:[Pd(l,n?.image,Id),r?a??o("div",{className:"ml-s",children:o(ze,{font:"font-medium",color:Bd[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Dd=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=dn(!1),x=l((async()=>{g();var e;await(e={captchaText:d},Ss("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),y=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>Ss(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(y,[]),o(Pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Ed,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o(Tl,{className:"w-8",embedded:!0,onClick:y,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Tn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Tl,{version:"secondary",onClick:close,children:"Вернуться"}),o(Vl,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),p?o(zl,{blur:!1}):null]})})})),_d=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=l((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Ad(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Ad=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${Sn(!n||!a)} rounded-md caret-transparent outline-none`},Md=d((({isDisabled:e,onClick:t,text:n})=>o(Tl,{type:"button",onClick:t,disabled:e,children:o(ze,{font:"font-normal",children:n})}))),Od=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},zd=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,{setTrue:o,setFalse:c}]=dn(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=l((()=>r("")),[]),x=Boolean(0===d&&u),y=p>2||x||!e.every(Boolean),b=l((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>ks("/sms/checkCode","POST",e).then(Od))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{r(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{r(x?"Код просрочен":"")}),[x]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:y,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},Vd=d((({phone:e,code:t=!0,withDescription:n=!0,codeLength:r=4,consents:s,onSuccess:d=Cn,onClose:m=Cn})=>{const[u,h]=a(Array(r).fill("")),{handleSubmit:p,hasError:g,errorText:f,isLoading:x,timeNextReq:y,isSubmitButtonDisabled:b,setTimeNextReq:v,setIsTimerStarted:N,setAttempts:w}=zd({values:u,onSuccess:d}),C=bn(Dd),k=Xt(e),I=Sd({seconds:y,onTick:v}),T=l((async()=>{var e;await(e={phoneNumber:k,smsCodesSetName:{key:"AUTHENTICATION"}},Ss("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(w(0),v(180),I(180),N(!0)):C.open({phoneNumber:k,sendCode:T})}),[k,I,m]);return i((()=>{T()}),[]),o(Pl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:m,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(_d,{values:u,setValues:h,errorText:f,hasError:g}):null,Ld(y,T),n?c(Me,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:s?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Fd(b,p),x?o(zl,{blur:!1}):null]})})})),Fd=(e,t)=>o(Md,{text:"Далее",isDisabled:e,onClick:t}),Ld=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(wd,{className:"ml-1",seconds:e})]}):o(Tl,{embedded:!0,onClick:t,children:o(Sr,{children:"Получить новый код"})}),$d={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},jd={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Ud=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],qd=d((({onSubmit:e=Cn,onClose:t=Cn})=>{const[n,i]=a(""),[r,s]=a(!1),d=ao(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),s("REFUSE"===e)}),[]),h=r?jd:$d;return o(Pl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(gl,{className:"whitespace-normal",orientation:"horizontal",items:Ud,value:n,onChange:u}),o(Tl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Wd=d((({title:e,icon:t,description:n,onClick:a=Cn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[o(ze,{font:"font-medium",size:"text-s",children:e}),n?o(ze,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),Hd={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Yd={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Gd={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Kd=e=>Object.entries(e).reduce(((e,[t,n])=>t in Hd?[...e,{contactTypeCd:{key:Hd[t]},value:n}]:e),[]),Xd=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Yd){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Yd[t]},...a}]}return e}),[]),Jd=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:l,wages:r,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:l,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(f={wages:r,mandatoryPayments:s,incomeAverage:Zd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(f).reduce(((e,[t,n])=>t in Gd?[...e,{incomeTypeCd:{key:Gd[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p};var f},Zd=(e,t)=>(Number(e??0)+Number(t??0)).toString(),Qd={WORK:"Работаю",RETIREE:"Пенсионер"},em={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},tm={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},nm={...tm,amur_card:"14",owner_card:"13",travel_card:"15"},am=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Zd(t,s),additionalIncome:a,otherIncome:i,otherPayments:l,rentalIncome:r,retirementIncome:s}},im=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},lm=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},rm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,sm=d((function({task:e,isFromLead:t=!1,sendAspects:n=Cn,onClose:a=Cn}){const i=Fs(),r=ln(),{participants:s,creditProgram:d,createdDate:m="",id:u}=e,h=nm[d.code],p=Boolean(tm[d.code]),g=p?"/credit-lead":"/credit-card-lead",{id:f,profile:x}=s[0],y=l((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:l}=e,{loanAmount:r,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:k=[],employmentContractDate:S,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:P,organizationTypeCd:B,organizationKindCd:E,employeesNumberCd:D,opf:_,seniority:A,generalSeniority:M,jobsNumber:O,lastWorkDuration:z,positionCd:V,maritalStatusCd:F,childrenDependents:L,totalDependents:$,otherDependents:j,militaryStatusCd:U,participantIncomes:q,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q}=t;return{currency:l?.key,paymentSystem:rm(i),cardCategory:rm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:rm(b),participantDateRegistration:v,housing:rm(N),beginDate:S,employment:rm(I,Qd),organizationName:T,inn:R,employerActivities:rm(P),organization:rm(B),employerOrganization:rm(E),amountWorkers:rm(D),legalForm:_,generalSeniority:A?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:z?.toString(),positionOrganization:rm(V),familyStatus:rm(F),children:L?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:rm(U),confirmationIncome:rm(Q,em),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:rm(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:r,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...am(q),...im(k),...lm(C),...(ee=w,ee?.key?{sex:"MAN"===ee.key?"male":"female"}:null)};var ee})(e);i.participantId=f??null,i.taskId=u,i.profileId=x?.id??null,i.programId=h,i.leadForm=t,x?.id&&n(x.id,u),r.assign(g)}),[]),b=l((()=>{r.assign(p?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(Pl,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:a,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs md:mt-0 mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(Wd,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:m?`Черновик от ${Kt(new Date(m))}`:"",onClick:y}),o(Wd,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?a:b})]})]})})})),om=d((function({onClose:e=Cn}){const t=ln(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(Pl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Tl,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Tl,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),cm=d((({onClose:e})=>{const t=ln(),n=Fs(),a=l((async()=>{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},ks("/esia/getLink","POST",n));var n;e?.link&&(t.assign(e.link),globalThis.location.href=e.link)}),[]),i=l((()=>{if(n.leadForm){const e={...n.leadForm};delete e.esiaAccountTypeCd,n.leadForm=e}e?.()}),[]);return o(Pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"@container flex flex-wrap gap-lg w-full",children:[o(Tl,{type:"button",onClick:a,className:"w-full md:w-auto",children:"Заполнить через Госуслуги"}),o(Tl,{type:"button",version:"secondary",onClick:i,className:"w-full md:w-auto",children:"Пропустить"})]})]})})})),dm=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},mm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),um=({programId:e,nextStepLink:t,productType:n,esiaError:i,data:r})=>{const[s,{setTrue:o,setFalse:c}]=dn(!1),[d,m]=a(),u=(()=>{const e=to();return l((({participantId:t,taskId:n,profileId:a,programId:i,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=l}),[])})(),h=(({data:e})=>{const t=cn();return l(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});an({aspectsAttributes:mm(e,i),aspects:t,ev:{}})}),[e])})({data:r}),p=ln(),g=(e=>{const{open:t}=bn(cm),n=ln();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(t),f=(e=>{const{open:t}=bn(qd),n=bn(Vd),a=t=>async n=>{try{t&&await vd({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(g),x=bn(Vd),y=(()=>{const{open:e}=bn(sm),{open:t}=bn(om);return{open:({task:n,isFromLead:a,onClose:i,sendAspects:l})=>{n?e({task:n,isFromLead:a,onClose:i,sendAspects:l}):t({})}}})();return{isSending:s,ok:d,handleSubmit:l((async a=>{var l;if(i)p.assign(t);else try{o();const t=await(l={profile:{phone:Xt(a.phone)}},ks("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(t&&a?.phone){const i=async()=>{await pm({programId:e,profileId:t,formData:a,productType:n,saveUserData:u,sendAspects:h}),x.close(),"debitCard"===n?g():f.open(a.phone,t)},l=async()=>{try{const n=await(async e=>{const t=await ks("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:t,programId:e});if(n){const e=await(async e=>await ks("/user-data/getTaskById","POST",e)||void 0)({taskId:n});x.close(),y.open({task:e,isFromLead:!0,sendAspects:h,onClose:i})}else await i()}catch{m(!1)}},r=hm(a,n);x.open({phone:a?.phone,consents:r,onSuccess:l}),c()}}catch{m(!1)}}),[i])}},hm=(e,t)=>{const n=lr[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},pm=async({programId:e,profileId:t,formData:n,productType:a,saveUserData:i,sendAspects:l})=>{let r,s;const o=gm(n,a);await vd(((e,t,n)=>{const{name:a="",surname:i="",middleName:l="",limitedBirthday:r="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:l,birthDate:r&&Kt(r,!0),email:o,phone:Xt(s),...n}}})(t,n,o));try{if("debitCard"===a){const t=await(async e=>await ks("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t)=>{const{name:n,surname:a,middleName:i,limitedBirthday:l,phone:r,email:s}=e;return{task:{taskSource:ln().origin,creditProgram:{code:Ko[t]},participants:[{birthDate:l&&Kt(l,!0),midname:i,name:n,surname:a,participantContacts:Kd({phone:r&&Xt(r),email:s})}]}}})(n,e));r=t.taskId,s=t.participantId}else{const a=await(async e=>await ks("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});r=a.taskId,s=a.participantId,await Nd((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:ln().origin,id:t,participants:[{birthDate:s&&Kt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:Kd({phone:o&&Xt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:dm()}}})({participantId:s,taskId:r,profileId:t,formData:n}))}l(t,r),i({participantId:s,taskId:r,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},gm=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentInformMaterialsFlg:s,consentPhotoFlg:o,consentFATCA:c}=e;let d;return d="credit"===t?{consentPhotoFlg:n,consentPfrFlg:a,consentInformMaterialsFlg:n}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:o}:{consentFATCA:c,consentPhotoFlg:n},{...d,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},fm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},xm=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,fm[e.name||""]])))}},ym=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},bm=e=>Math.floor(e/12),vm=async({document:e,taskId:t,category:n,files:a})=>{await fetch(`data:application/pdf;base64,${e}`).then((e=>e.blob())).then((e=>(async(e,t,n)=>{const a=new FormData;return a.append("taskId",t),a.append("documentCategory",n),a.append("file",e,"file.pdf"),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...Is()},credentials:"include",body:a}).then((e=>e.json())))})(e,t,n))).then((e=>a.push(e)))},Nm=e=>{const{profile:t,document:n,addressRegistration:a,esiaAdditionalDocument:i}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,t.email,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType,i.inn,i.averageMonthlyIncome.toString(),i.startWorkDate,i.workLengthInFiveYears.toString(),i.workLength.toString(),i.workLengthLastJob.toString(),i.jobsNumberInFiveYears.toString(),i.pdfFilePayout,i.pdfFileWorkbook].every((e=>Boolean(e))))throw new Error},wm=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,t.email,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every((e=>Boolean(e))))throw new Error},Cm=({inputs:e,nextStepLink:t,productType:n,setEsiaError:a})=>{const s=ln(),[o,{setTrue:c,setFalse:d}]=dn(!1),m=to(),u=l((e=>{const t=e instanceof Function?e(h[p]):e;null!=t?h[p]=t:delete h[p]}),[h=m,p="leadForm"]);var h,p;const g=r((()=>xm(e,m.leadForm)),[e,m.leadForm]),f=l((async(e,i,l)=>{c();try{const a=await(r={profileId:e,code:i,state:l,redirectUri:globalThis.location?.href},ks("/esia/updateProfileEsia","POST",r));if(a&&m?.taskId){const e=await(async(e,t,n)=>{n?wm(e):Nm(e);const{profile:a,addInfo:i,document:l,addressRegistration:r,addressFact:s,esiaAdditionalDocument:o}=e,c=[];return n||(await vm({document:o.pdfFileWorkbook,taskId:t,category:"CONFIRMING_INCOME_DOC",files:c}),await vm({document:o.pdfFilePayout,taskId:t,category:"CONFIRMING_EMPLOYMENT_DOC",files:c})),{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Pi(a.phone),email:a.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:ym(r),addressFact:ym(s),esiaAccountTypeCd:a.esiaAccountType,...!n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:bm(o.workLengthInFiveYears).toString(),generalSeniority:bm(o.workLength).toString(),lastJobExperience:bm(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),files:c}}})(a,m.taskId.toString(),"debitCard"===n);u((t=>({...t,...e})))}s.assign(t)}catch{a()}finally{d()}var r}),[t]);return i((()=>{m.productType=n;const e=Ys(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=t.get("code"),i=t.get("state");e&&a&&i?f(e,a,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[g,{isLoading:o}]},km=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,productType:s="credit",data:d,...m})=>{const[h,{setTrue:p}]=dn(!1),g=r((()=>(e=>{const t=lr[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0},{name:"name",required:!0,dadata:!0},{name:"middleName",dadata:!0},{name:"limitedBirthday",required:!0},{name:"phone",required:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentInformMaterialsFlg"},{name:"consentPhotoFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(s)),[s]),f=r((()=>g?.flatMap((e=>e?.inputs))||[]),[g]),x=r((()=>nl(f,ir)),[f]),[y,{isLoading:b}]=Cm({inputs:f,nextStepLink:a,productType:s,setEsiaError:p}),{isSending:v,ok:N,handleSubmit:w}=um({programId:n,nextStepLink:a,productType:s,esiaError:h,data:d}),[,{field:C,onSubmit:k}]=xn(y,{formValidator:x,onSubmit:w}),S=bn(Bl);return i((()=>{void 0!==N&&S.open({ok:N})}),[N]),o(yn,{className:u("container space-y-m",e),title:t,...m,children:c("form",{onSubmit:k,className:"space-y-m relative",children:[b?o(zl,{blur:!1}):null,g.map(((e,t)=>c("div",{className:u(wl(e.columns),"grid gap-x-m"),children:[Cl(e.title),xd({field:C,inputs:e?.inputs},s)]},`section-${t}`))),bd(l,v),h?o(ze,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})})})),Sm=d((({title:e,description:t})=>{const n=Te();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Im=e=>e%2!=0,Tm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Rm=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=dn(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Tm),children:[B(l,{...i.options,parent:n}),Im(l.length)?o(Yt,{className:"col-span-6",...i}):null]}),c(Rr,{children:[c(Pr,{className:u(Tm),isUnfolded:s,children:[B(r,{...i.options,parent:n}),Im(r.length)?o(Yt,{className:"col-span-6",...i}):null]}),o(Tr,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!r?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Pm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Bm=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Em=10;function Dm(e=0){const t=Math.round(e*Em);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const _m=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Dm(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:h,role:"listitem",children:d})})),Am=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Mm=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(zm(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Om(c,v):{},...N?Bm(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(_m,{className:u(m,i?Am[i-1]:"",{"h-full":N},t),style:w?Om(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),Om=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),zm=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Vm={"horizontal-list":"w-6","vertical-list":"h-6"},Fm=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Vm[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Lm=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},$m=e=>t=>e.scrollWidth/t,jm=e=>(t,n)=>{e.scrollBy({left:n*$m(e)(t),behavior:"smooth"})},Um=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[Bo()(i),Ro()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?jm(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?jm(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},qm={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Wm=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Te(),[h,p]=Um({itemCount:s.length}),g=Hm(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Mm,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Lm({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",qm[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Fm({activeIndex:t,onClick:f,listType:a}))}):null})),Hm=(e=!1)=>({behavior:e?"auto":"smooth"}),Ym=d((({className:e,name:t,...n})=>o(Tl,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),Gm=d((e=>o(Ym,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),Km=d((e=>o(Ym,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Xm="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Jm=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Zm(t):null,l?o(Gm,{wcmsIgnore:!0,className:u(Qm(i),m?"left-1":"left-0"),onClick:s}):null,r?o(Km,{wcmsIgnore:!0,className:u(Qm(i),m?"right-1":"right-0"),onClick:d}):null]})})),Zm=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Xm,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Xm,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Qm=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),eu=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Um({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Mm,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Jm,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Wm,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),tu=({blocksToRender:e,...t})=>o(eu,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:B(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Pm(!0)),children:R(e,t)},String(n))})}),nu=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[au(n,t),o(Rm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[au(n,t),tu({...a,blocksToRender:t})]});default:return null}})),au=(e,t)=>e&&!t.length?o(Sm,{...e}):null,iu=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),lu=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(vi,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),ru=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,iu(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(su(a)).filter(Boolean))]}),n?o("div",{children:o(Tl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),su=e=>([t,n])=>{const a=n?.type;return"array"===a?ou(t,e)(n):null},ou=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(lu,{items:a,multiple:!n?.single,...t(e)})]},e)},cu=e=>e;function du(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const mu=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,uu=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>mu(t[e])||mu(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>mu(t[e])||mu(n[e])||hu(t[e])<=hu(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>mu(t[e])||mu(n[e])||hu(t[e]?.min)>=hu(n[e]?.min)&&hu(t[e]?.min)<=hu(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>mu(t[e])||mu(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>mu(t[e])||mu(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),hu=e=>Number(e||0),pu=(e,{block:t,page:n,normalize:a=cu})=>{const i=t?.blocks||[],[l,s]=xn(e),o=r((()=>du(i,i.map((e=>jt(e.content,n?.fallback))))),[i,n?.fallback]),c=l===e?i:((e,t)=>(n=cu)=>e?.filter((([,e])=>uu(t,n(e)||{}))).map((([e])=>e)))(o,l)(a);return[l,{blocksToRender:c,blocksWithProps:o},s]},gu={},fu={},xu=Wt((({className:e,filtrationSchema:t=gu,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=pu(fu,{block:i.block,page:i.options?.page}),d=o(zn,{className:"w-64",label:n?.title,options:yu(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>yu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(ru,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Tl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(nu,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),yu=e=>du(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),bu=(e=!1)=>e?"text-left":"text-center",vu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Nu=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const l=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",vu[t],e),style:{width:l,height:l},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),wu=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Te();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:bu(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(Cu)}):null]})})),Cu=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Nu,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(ze,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Me,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),ku=(e,t,n)=>{return o(eu,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(ze,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(ze,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},Su=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?ku(e,0,t):null]}))),Iu={start:"justify-start",center:"justify-center",end:"justify-end"},Tu=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Iu[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:We(e)})})),Ru=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(ze,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ke(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Pu=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Bu=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Ru,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(ho,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Pu,{title:e,...r}),Eu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Du={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},_u=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Eu.prefMonthsNum,prefTravelBonusRate:l=Eu.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Du,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Au=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=xn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=_u(r,n);return o(so,{className:e,title:t,...l,children:c("section",{className:u(oo,e),children:[c("div",{className:co,children:[ko({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),ko({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Bu({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:mo,children:[f>=0?o(ho,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,We(a,{isVertical:!0}),bo(i)]})]})})})),Mu=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Ou=e=>wo({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),zu=" (c капитализацией)",Vu=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:mo,children:[o(ho,{title:`Доход в конце срока${l?zu:""}`,value:e,postfix:n,prefix:"+"}),o(ho,{title:`Сумма в конце срока${l?zu:""}`,value:t,postfix:n}),We(a,{isVertical:!0}),i?.map(bo)]}),Fu={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Lu={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},$u=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Fu[e?.rateType]:"",{data:n}=Jn(t?`${Jt}/depositrates/${t}`:null,Vt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&ju(s,e)&&Ao(a,["minSum","maxSum"],e)&&Ao(n,["minDays","maxDays"],e)))||Lu,{rate:m}=d,u=Uu(m,e),h=a+u,p=c||[Lu];return{...d,..._o(["minSum","maxSum"],p),..._o(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},ju=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Uu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},qu=Wt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=xn({moneyValue:xo(r,1e5),daysValue:yo(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=$u(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(so,{className:e,title:t,...d,children:c("section",{className:u(oo,e),children:[c("div",{className:co,children:[ko({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ma,{items:[`От ${Mu(b.min||0)}`,`До ${Mu(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Wu(p,h),Ou({...h("isMonthlyInterestPayment")})]})]}),Bu({rate:x,depositeName:y,isShowDepositeName:l}),Vu({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Wu=(e,t)=>c("div",{className:"space-y-s",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ri,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ri,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Hu=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},Yu={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Gu=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Ju(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Xu({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Xu({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Xu({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Xu({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Ao(a,["minSum","maxSum"],t),Ao(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||Yu,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=Ku(p,e),f=a+g,x=t||[Yu];return{...m,..._o(["minSum","maxSum"],x),..._o(["minMonths","maxMonths"],x),availableMonths:Hu(x.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:l,income:g,finalSum:f}},Ku=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},Xu=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Ju=(e,t)=>e+Math.round((t-e)/2),Zu=(e="rub")=>"rub"===e,Qu=(e,t)=>{const{minMonths:n,maxMonths:a}=_o(["minMonths","maxMonths"],ah(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ra(i,n,a)}},eh=(e,t)=>{const{minSum:n,maxSum:a}=_o(["minSum","maxSum"],ah(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ra(i,n,a)}},th=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),nh=e=>{const t=Zu(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},ah=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},ih=(e,t=!1)=>t?wo({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,lh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[rh(t("isReplenish"),e,a),sh(t("isWithdrawn"),e,a),oh(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Ou(t("isMonthlyInterestPayment")):null,ih(t("isRemoteRegistration"),e.isShowRemoteRegistration),ch(t("extraPercent"),n),e.isShowNewClient?o(ri,{text:"Новый сберегатель",...t("isNewClient")}):null]})},rh=(e,t,n=!1)=>t.isShowReplenish?wo({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,sh=(e,t,n=!1)=>t.isShowWithdrawn?wo({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,oh=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,ch=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(zn,{options:t,...e})]}):null,dh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},mh={text:"₽",key:"rub"},uh={text:"Без учета надбавки",key:"0"},hh=Wt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[mh],g=l((e=>t=>e?{...t,...nh(t),...eh(t,e),...Qu(t,e),...th(t,e)}:t)(h),[h]),[f,{field:x}]=xn({moneyValue:xo(d,2e4),monthsValue:yo(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:mh,extraPercent:d?.extraPercent??uh},{normalizer:g}),y=yh(x),b=Boolean(x?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=ah(h,y),w=Gu(f,N,s),{rate:C,income:k,finalSum:S,type:I=""}=w,T=l((()=>{So({field:x,defParams:go(N,b,v),calcParams:w,monthsValue:"minMonths",map:dh})}),[x,h,v]);i((()=>{!Fo(d)&&N&&T()}),[d,h]);const R=x?.("extraPercent")?.value?.key,P=xh(C,R),B=C===go(N,b)?.rate&&R===v?.at(-1)?.key;return o(so,{className:e,title:t,...m,children:c("section",{className:u(oo,e),children:[c("div",{className:co,children:[c("div",{className:"flex gap-m",children:[ko({className:"w-full",title:`Сумма, ${y?.text}`,min:w.minSum,max:w.maxSum,...x("moneyValue"),value:w.moneyValue,postfix:y?.text,step:ph(y?.key)}),h&&h?.length>1?o($n,{label:"Валюта",options:p,...x("currency")}):null]}),vo({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...x("monthsValue"),value:w.monthsValue}),lh({...w,...s},x,v)]}),Bu({rate:P,children:fh(T,B)}),Vu({income:k,finalSum:S,buttons:[...a,gh(n?.buttons,I)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),ph=(e="")=>Zu(e)?1e3:100,gh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},fh=(e,t=!1)=>t?null:o(Tl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),xh=(e,t)=>Number(e)+Number(t??0),yh=e=>e?.("currency")?.value??mh,bh=e=>vh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&vh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),vh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Nh={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},wh=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Nh],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>bh({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Do(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Do(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>bh({row:e,userInputParams:t,paramsViewSettings:n})&&Ao(a+r,["minSum","maxSum"],e)&&Ao(l,["minSumOld","maxSumOld"],e)&&Ao(r,["minSumExtra","maxSumExtra"],e)&&Ao(i,["minMonths","maxMonths"],e)))||Nh)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Io(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Ch=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...s})=>{const[d,{field:m}]=xn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=wh(d,n,l),p=r((()=>po(n?.rateRows)?.rate),[n?.rateRows]),g=Co({...m("isAnnuity")});return o(so,{className:e,title:t,...s,children:c("section",{className:u(oo,e),children:[c("div",{className:co,children:[ko({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),ko({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),vo({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),kh({...h,...l},m),h.isExtraMoney?ko({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:g})]}),c("div",{className:u(mo,"@4xl:w-1/2"),children:[o(ho,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ho,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(ho,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(ho,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),We(a,{isVertical:!0}),bo(i)]})]})})})),kh=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ri,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ri,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Sh=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=la(e,{normalize:(e=i)=>n&&a?String(ra(Number(Ih(e)),n,a)):Ih(e),format:Ke(r)}),d=l((e=>t&&t(Ih(e))),[t]);return o(Tn,{onChange:d,...s,...c})})),Ih=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Th=d((e=>o(Sh,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(ze,{size:"text-xl",font:"font-light",children:"₽"})})}))),Rh=new As;function Ph(){return Os(Rh)}Ds(Rh,new _s(globalThis?.sessionStorage));const Bh={private:"p2p/registerP2P",business:"b2c/registerB2C"},Eh=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl px-4 pt-4 pb-8 grid gap-4 grid-cols-12",children:[c("div",{className:"col-span-8",children:[" ",n]}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Dh=e=>{const t=bn(Eh),n=Ph(),a=ln(),i="private"===e?"p2p":"b2c";return l((async({amount:l})=>{const r=await(async(e,t)=>{const n=ln(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Jt}/payment/${Bh[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,l);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(r)&&(n.transaction={orderId:r.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(r.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(r)&&t.open({errorCode:r.errorCode,errorMessage:r.errorMessage})}),[e])},_h={amount:1500},Ah=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:l="private",...r})=>{const[s,{setValue:d}]=dn(!1),m=Dh(l),[{amount:h},{field:p,onSubmit:f}]=xn(_h,{onSubmit:m});return i((()=>{d(h<=0)}),[h]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",onSubmit:f,children:[o(Th,{valid:!s,label:n,max:3e5,min:1,...p("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:h}),a?.text?o(Vl,{className:"w-full mt-lg",disabled:s,children:a.text}):null]})]})})),Mh=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(G,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Oh="relative h-full",zh={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Vh=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some($h),r=n?{defaultPadding:"p-6xl pb-m"}:{};return E({...a,renderProps:(n,a,i)=>c("div",{className:Fh(n,{someCardsHighlighted:l}),children:[R(n,a,{className:Lh(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),$h(n)?Mh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Fh=(e,{someCardsHighlighted:t})=>u(Oh,t&&($h(e)?"pt-3xl":"pt-3xl sm:pt-16")),Lh=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Oh,"min-w-80",zh[a],t&&($h(e)?"pt-3xl sm:pt-16":"pt-3xl"),Pm(n),n&&"h-full"),$h=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,jh=Wt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(eu,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Uh(s?.block?.blocks):[],hasBlur:!0,children:Vh({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Uh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],qh="z-10 border border-solid w-full h-full",Wh=u(qh,"absolute hidden @xl:block border-transparent"),Hh=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Wh,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Wh,"top-6 right-8 bg-green")}),o("div",{className:u(Wh,"top-3 right-4 bg-green-light")}),c("div",{className:u(qh,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),We([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Yh={black:"bg-black",white:"bg-white"},Gh=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:We([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(ze,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Kh)]}):null,i?c(ze,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Kh=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Yh[e]}`},String(t)),Xh=d((({icon:e,...t})=>{const n=fe(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ie,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Jh=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Zh(a):null]})}))),Zh=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Xh,{...e},String(t))))}),Qh=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=fe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ye(i),children:l})})),ep=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],tp=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>ep.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=qe(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},np(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:We(m,{className:ap(s??!1,i??!1,n),buttonClassName:h})}),r?o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),np=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",ap=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),ip=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(Qh,{href:i,target:m,className:"h-full",data:mm(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...rt(qe(l)?o(ie,{image:l}):null,x),buttons:d.length?o(tp,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Ue,{benefits:f}),s?o(Me,{__html:s,isDotted:r,itemSize:"list-s"}):null,lp(a,p)]})})}))),lp=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,rp=new he,sp=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(ze,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(ze,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:We(i)}):null]},String(t))},op=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...x})=>{const y=r((()=>h.map(sp)),[h]),[b,v]=r((()=>m>0?[y.slice(0,m),y.slice(m)]:[y,[]]),[m,y]),[N,C]=a(!1);i((()=>rp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const k=l((()=>{rp.fire("fold",{type:"fold",isUnfolded:!N,parent:p?.parent})}),[N,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...x,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(Ce,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Rr,{children:[c("div",{children:[b,o(Pr,{isUnfolded:N,children:v})]}),h.length>=m?o(Tr,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:k}):null]}):o("div",{children:b})]})})),cp=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=ln();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await Ss("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},dp=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),mp=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(dp,{step:a,showPercentage:!1})]})})}));var up;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND"}(up||(up={}));const hp=e=>ks("/user-data/getTaskStatus","POST",e),pp=async e=>{const t=await ks("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},gp=d((({title:e,interval:t=0,onEnd:n=Cn})=>{const[i,l]=a(t);Sd({seconds:t,onTick:l,onEnd:n});const r=100-(t-i)/t*100;return c("div",{children:[e?o(S,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${r}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(wd,{seconds:i})})]})]})})),fp=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:l,buttonText:r,interval:s,onExpire:d=Cn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(gp,{interval:s,onEnd:d}):null]}),o(xp,{title:n,items:a}),o(xp,{title:i,items:l,countColumns:!0}),r?o(Ll,{href:"/natural",text:r,version:"primary",className:"w-full mt-lg"}):null]}))),xp=({title:e,items:t,countColumns:n=!1})=>{const a=Te();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",wl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:yp(e)},t)))}):null]})]}):null},yp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),bp=d((()=>o(fp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),vp=d((({onExpire:e})=>{const{statusInfo:t}=Fs();return o(fp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),Np=d((()=>{const{statusInfo:e}=Fs(),t="courier"===e?.methodObtain;return o(fp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),wp=d((()=>{const{statusInfo:e}=Fs();return o(fp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:Cp(e),buttonText:"Вернуться на главную"})})),Cp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:Kt(e?.deliveryDate)}]):t},kp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Sp=d((()=>{const[e,t]=a(up.process),{taskId:n}=Fs();i((()=>{(async()=>{for(const e of kp)await pp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await hp({taskId:n});a&&a?.statusCd!==up.process&&(e(),t(a.statusCd))}),[n]);kd(r,3e4);const s=l((()=>t(up.rework)),[]);return Ip(e,s)})),Ip=(e,t)=>({IN_PROCESS:o(vp,{onExpire:t}),CANCELLED:o(bp,{}),FAILED:o(bp,{}),DRAFT:o(bp,{}),APPROVED:o(wp,{}),PRE_DECISION:o(wp,{}),REVISION:o(Np,{})}[e]||o(Np,{})),Tp=e=>(t,n)=>t.filter((e=>e)).map((t=>[Rp(n,e),Pp(t,e),_p(t,e),Bp(t,e),Ep(t,e),Dp(t,e)].some(Boolean)?{...t,required:!1}:t)),Rp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Pp=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Bp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ep=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Dp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),_p=({name:e},t)=>"snils"===e&&Ap(t),Ap=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Mp={...hd,...pd},Op=({field:e,inputs:t,params:n})=>t.map(Nl(e,n,Mp)),zp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l,condition:r},s)=>{const o=Tp(Vp(t))(e,n);return c("div",{className:u(wl(i),"grid gap-x-m"),children:[Dp({condition:r},Vp(t))?null:Cl(l),Op({field:t,inputs:o,params:a})]},`section-${s}`)})),Vp=e=>t=>e(t)?.value,Fp=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tl,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(Vl,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Lp=(e,t,n)=>({...n[e],...t,limitedBirthday:$p(t?.limitedBirthday),dulIssueDate:$p(t?.dulIssueDate),participantDateRegistration:$p(t?.participantDateRegistration),beginDate:$p(t?.beginDate),deliveryDate:$p(t?.deliveryDate)}),$p=e=>{try{return e?new Date(e):void 0}catch(e){return}},jp=[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],Up=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...jp,{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],qp=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Wp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Hp=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:x}=e;return{employmentContractDate:Kt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:Kd({organizationPhone:p&&Xt(p)}),participantAddresses:Xd({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?x:""}},Yp=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y,addressMatch:b}=e;return{birthDate:Kt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:Kt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Kt(g,!0),homeMatchFlg:b,houseTypeCd:f,participantContacts:Kd({phone:Xt(l),email:r}),participantAddresses:Xd({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Gp=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,l=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:(r=n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000"),r?new Date(r).toISOString().split(".")[0]:""),office:{id:"3"},...l}:{};var r},Kp=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Xp=(e,t)=>{switch(e){case 0:default:return{};case 1:return Yp(t);case 2:return Hp(t);case 3:return Jd(t);case 4:return qp(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Xd({addressCourier:t})}:{}})(t)}},Jp=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=Fs(),d=r((()=>Lp(e,c.leadForm,Up)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await Nd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:ln().origin,id:t,...Kp(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Xp(i,a)}],...Wp(a),...Gp(a),files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Zp=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=r((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=l((t=>nl(Tp((e=>t[e]))(s,e),ir)(t)),[s]),[m,u,h]=Jp({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=xn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[zp({sections:t,field:p,step:e}),o(Fp,{isSending:h,step:e,onPrevStep:n})]})})),Qp=[[{title:"Персональные данные",columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}]],eg=[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}],tg=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],...Qp,eg],ng=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],ag=d((({className:e,...t})=>{const[n,r]=a(0),d=s(null),m=l((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(cp,[]);const u=l((()=>{r((e=>Math.min(e+1,6))),m()}),[]),h=l((()=>{r((e=>Math.max(e-1,0))),m()}),[]),p=tg[n],[f,{setTrue:x}]=dn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(mp,{stepsTitles:ng,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Sp,{}):o(Zp,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),ig=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(dp,{step:a,showPercentage:!1})]})})})),lg=d((()=>o(fp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),rg=d((({onExpire:e})=>{const{statusInfo:t}=Fs();return o(fp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),sg=d((()=>{const{statusInfo:e}=Fs();return o(fp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),og=d((()=>{const{statusInfo:e}=Fs();return o(fp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),cg=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],dg=d((()=>{const[e,t]=a(up.process),{taskId:n}=Fs();i((()=>{(async()=>{for(const e of cg)await pp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await hp({taskId:n});a&&a?.statusCd!==up.process&&(e(),t(a.statusCd))}),[n]);kd(r,3e4);const s=l((()=>t(up.rework)),[]);return mg(e,s)})),mg=(e,t)=>({IN_PROCESS:o(rg,{onExpire:t}),CANCELLED:o(lg,{}),FAILED:o(lg,{}),DRAFT:o(lg,{}),APPROVED:o(og,{}),PRE_DECISION:o(og,{}),REVISION:o(sg,{})}[e]||o(sg,{})),ug=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tl,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(Vl,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),hg={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},pg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:hg[a?"annuity":"differential"]}},gg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},fg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Yp(t);case 2:return Hp(t);case 3:return Jd(t);case 4:return qp(t);default:return{}}},xg=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...jp,{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],yg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=Fs(),d=r((()=>Lp(e,c.leadForm,xg)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await Nd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:ln().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...fg(i,a)}],...pg(a),...gg(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},bg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=Fs(),m=n?.[d??""],u=r((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=l((t=>nl(Tp((e=>t[e]))(u,e),ir)(t)),[u]),[p,g,f]=yg({step:e,onNextStep:i,onFinish:s}),[,{field:x,onSubmit:y}]=xn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:y,className:"space-y-m",children:[zp({sections:t,field:x,step:e,params:{calcData:m}}),o(ug,{step:e,isSending:f,onPrevStep:a})]})})),vg=[[{columns:1,inputs:[{name:"calculator"}]}],...Qp,[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],Ng=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],wg=Wt((({className:e,programsSource:t,...n})=>{const[r,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(cp,[]);const h=l((()=>{d((e=>Math.min(e+1,5))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=vg[r],x=0===r,[y,{setTrue:b}]=dn(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x||y?null:o(ig,{stepsTitles:Ng,step:r,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(dg,{}):o(bg,{step:r,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(r))})]})})})),Cg=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,kg=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Sg=1e9,Ig={sum:{min:1e4,max:Sg},period:3},Tg=Wt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=pu(Ig,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Rg(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Pg(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(ru,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Th,{label:a?.title,min:500,max:Sg,...d("sum",{parse:e=>({min:Number(e),max:Sg}),format:({min:e})=>String(e)})}),o(ma,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(nu,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Rg=e=>Ft((e?.paramsSource?.rateRows||[]).filter(Cg).flatMap((e=>kg(e.minMonths,e.maxMonths)))),Pg=e=>Ft(e.flatMap((e=>e||[])).filter(Cg).flatMap((e=>kg(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Bg=[{key:"10"},{key:"50"},{key:"100"}],Eg=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(zn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Bg,iconVersion:"black"})]})},Dg="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",_g=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:Dg,"aria-label":`Страница ${l}`,children:l},String(t)):null},Ag={width:"24",height:"24"},Mg=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(G,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Og(1===e),...Ag})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Dg,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(_g),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Dg,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(G,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Og(e===n),...Ag})})]})},Og=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",zg=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Mg,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Eg,{itemCount:a,onItemCountChange:i}):null]}),Vg=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ie,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",kn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Fg=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Vg,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(qa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(qa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Tl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Lg=d((({title:e,timestamp:t,publicId:n})=>{const a=fe(),{href:i}=a({href:`${Jt}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[o(Nu,{className:"shrink-0",icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(ze,{size:"text-m","font-weight":"font-light",children:Kt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),$g=`${Jt}/depository`,jg={startDate:void 0,endDate:void 0,query:""},Ug=Wt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=xn(jg),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?Kt(a,!0):"",r=i?Kt(i,!0):"",s=new URLSearchParams($g);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=Jn($g+o,Vt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),y=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Fg,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(ze,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(ze,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Lg,{...e},String(e.publicId)))):o(Sm,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(zg,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),qg=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Wg=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:qg(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ce,{version:i?.version,text:i?.text,...i}):null]}))),Hg=`${Jt}/region`;function Yg(e="Москва"){return Vs().location??{name:e}}function Gg(e="Москва"){const t=Vs(),n=l((async()=>{if(!t.location){const n=await zt(Hg);t.location=n??{name:e}}}),[t,e]);return Jn(Hg,n),t}var Kg;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Kg||(Kg={}));const Xg=new Intl.NumberFormat("ru",{style:"currency",currency:Kg.RUB}),Jg=e=>e?Xg.format(e):"",Zg="text-m font-light text-secondary-text ",Qg=`${Zg} text-left`,ef=`${Zg} pl-5xl text-center`,tf=`${Zg} pl-5xl text-right`,nf={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},af=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Qg,children:o(ze,{size:"text-m",children:"Валюта"})}),o("th",{className:ef,children:o(ze,{size:"text-m",children:"Купить"})}),o("th",{className:tf,children:o(ze,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(lf)})]}))),lf=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ie,{image:{icon:nf[t]},width:"24",height:"24"}):null,o(ze,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(ze,{size:"text-h6",children:Jg(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(ze,{size:"text-h6",children:Jg(e?.buyExchangeRate)})})]},t)},rf={icon:"GpsIcon"},sf=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Nu,{...rf,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),of=(e,t,n)=>{const a=Number(cf(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},cf=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function df(e){if(!e)throw new Error("Value should be fulfilled");return e}const mf=e=>t=>{const[,n]=df(e.find((([e])=>e(t))));return n(t)},uf=e=>mf(e.map((([e,t])=>[e,()=>t])));uf.if=e=>new hf(void 0,e);class hf{parent;predicate;unit;get entry(){return[df(this.predicate),df(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new hf(this,e)}then(e){return new hf(this.parent,this.predicate,e)}else(e){return mf([...pf(this),[()=>!0,e]])}}const pf=e=>[...e?.parent?pf(e.parent):[],e.entry],gf=e=>uf([[e=>e.value!==Kg.RUB&&e.oppositeValue!==Kg.RUB,()=>e.handleConvert(e.value,Kg.RUB)],[e=>e.value===Kg.RUB&&e.oppositeValue===Kg.RUB,()=>e.handleConvert(e.value,Kg.USD)],[e=>e.value===Kg.RUB&&e.oppositeValue===Kg.RUB,()=>e.handleConvert(e.value,Kg.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function ff(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Tn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(zn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const xf=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Kg.RUB,selectBuy:n?.[0]?.currency?.currency||Kg.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[ff({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:yf(r,d,n),value:r.inputSell,setValue:e=>vf(d,n)(e,r.selectSell,r.selectBuy)}),ff({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:bf(r,d,t),value:r.inputBuy,setValue:e=>Nf(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ce,{text:i.text,version:i?.version,...i}):null]})})),yf=(e,t,n)=>a=>{t({selectSell:a}),gf({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{vf(t,n)(e.inputSell,a,i)}})},bf=(e,t,n)=>a=>{t({selectBuy:a}),gf({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Nf(t,n)(e.inputBuy,a,i)})},vf=(e,t)=>(n,a,i)=>{e({inputSell:cf(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(of(n,l,a===Kg.RUB)||"")})},Nf=(e,t)=>(n,a,i)=>{e({inputBuy:cf(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(of(n,l,a===Kg.RUB)||"")})},wf=`${Jt}/exchangerates`;const Cf=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=Jn(wf+`?regionCode=${t}`,Vt);return n||{}}(Yg()),l=kf(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Kg.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Kg.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Be,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(af,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(sf,{address:i?.address})]}),o(xf,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),kf=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Sf=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(If(n))})})),If=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ye(t),children:i||null})},String(a)):null},Tf=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Rf(e)}))),Rf=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Pf,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Pf=d((({className:e,item:t})=>{const[n,{toggle:a}]=dn(!1);return c(Rr,{className:e,role:"menuitem",children:[c(Tl,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(Sr,{children:[o(Nu,{className:"shrink-0",...t.icon}),o(ze,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Ir,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(Pr,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(Sf,{items:t.items}):null})]})})),Bf=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ef)}):null)),Ef=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(ze,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Df)})]},String(t)),Df=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:_f(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),_f=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Af(t)}`,children:o(ze,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Af=e=>e.replaceAll(/\D/g,""),Mf=d((({className:e="",index:t,text:n,...a})=>{const i=fe(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Of=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(ze,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Mf,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),zf=d((({className:e="",index:t,...n})=>{const a=fe(),{href:i,target:l,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),Vf=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(ze,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(zf,{index:t,...e},String(t))))}):null]}))),Ff=Wt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Tf,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Bf,{items:r}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(tp,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ll,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Of,{title:d,links:l}),o(Vf,{links:i,license:h})]})})),Lf=(e=!1)=>e?{}:{padding:"p-0"},$f={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},jf=[1,2,3,4],Uf={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},qf=Wt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,...s})=>o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",$f[n],e),padding:t,version:i,isTheme:l,...s,children:E({...s,renderProps:Wf({isInnerPadding:a,isCardBorder:r})})})),{childrenTypes:["ProductBlock"],childSchema:()=>Uf,allowRemoveChild:e=>(e?.blocks??[]).length>5}),Wf=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>R(n,{...a,blockDecorator:Hf(a.blockDecorator,i)},{className:u("w-full",Pm(t)),...Lf(e)}),Hf=(e,t=0)=>(n,a)=>e?.({...n,render:e=>Yf(t)({...n,...e},a)},`wrap_${a}`)??Yf(t)(n,a),Yf=e=>({blockClassName:t,block:n,render:a},i)=>{const l=Kf(n,e);return o(Qh,{...l.content?.link,className:Gf(e),children:a({blockClassName:u(t,"h-full"),block:l})},String(i))},Gf=e=>jf.includes(e)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2",Kf=(e,t)=>{const n={...e.content};return jf.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"}):(n.buttons??[]).length&&delete n.link,{...e,content:n}},Xf=Wt((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o($n,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(Ll,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:mm(l,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Jf={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},Zf=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d,isLoading:m,dataTestId:h=""})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Jf[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...Qf(h),...ye(s),children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Qf=e=>e?{"data-test-id":e}:null,ex="chatbot",tx="text-page__btn-chat",nx="webchat-js-container:webchat_rshb",ax={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},ix=async(e,t)=>{const n=e.target;n?.classList.contains(tx)||n?.classList.add(tx);globalThis.document.getElementById(nx)||await gs(ex,t)},lx=async e=>{const t=await gs(ex,`${e}/bundle.js`,!0);((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(`${e}/bundle.css`);globalThis.document.getElementById(nx)?t?.chatOpen?.():(rx(),t?.render?.(nx,!0,"/webchat-api","@container fixed right-0 bottom-0 top-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},rx=()=>{const e=globalThis.document.createElement("div");e.id=nx,globalThis.document.body.appendChild(e)},sx=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:r="Чат",version:s,buttonSize:c="large"})=>{const{load:d,isLoading:m}=(e=>{const[t,n]=a(!1);i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const r=ax[e??""];return{load:l((t=>{r&&(n(!0),"business"===e?lx(r).finally((()=>n(!1))):ix(t,r).finally((()=>n(!1))))}),[r,e]),isLoading:t}})(e);return o(Zf,{className:n,image:{icon:"ChatBotIcon",iconVersion:t},ariaLabel:r,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),ox={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},cx=d((({version:e,text:t,mobileText:n,...a})=>{const i=Te()?n:t;return i?o(Ce,{className:u("py-s px-lg font-light whitespace-nowrap",ox["transparent"===e?"transparent":"default"]),...a,children:i}):null})),dx=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:r})=>{const s=D(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:h,...p}=t??{},g=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Ed,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):mx(g,r),c("div",{className:"flex gap-lg items-center",children:[A.CHAT_BOT?o(sx,{version:i,iconVersion:m,chat:A.CHAT_BOT,buttonSize:"medium"}):null,o(cx,{version:i,...a})]})]})})),mx=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(G,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,ux={"bg-white":"primary",transparent:"transparent"},hx=Wt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=ux[e],portal:a,logo:i={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(dx,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),px=Wt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",$f[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Q(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:E({...c,extraProps:{className:u("w-full",Pm(r)),...Lf(a)}})})}),{childrenTypes:[]}),gx=Wt((e=>o(px,{...e})),{childrenTypes:[]}),fx=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Iu[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),xx=["байт","Кб","Мб","Гб","Тб","Пб"],yx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...ye(l),children:[e,t?c(ze,{size:"text-l",font:"font-light",children:[t," ",bx(d,m),o(ze,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),bx=(e,t)=>e||t?o("span",{children:", "}):"",vx=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${xx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?wx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(yx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:Nx(t),data:n?.data}),o(Me,{__html:n?.__html})]},String(a))},Nx=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,wx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},Cx=d((({href:e,__html:t,target:n,onClose:a})=>c(Pl,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Me,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ll,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Tl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),kx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=bn(Cx),s=l((()=>r({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Nx(i),o(ze,{font:"font-light",children:e})]}):null})),Sx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Ix=Wt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Sx[r]),role:"list",children:i.map(Tx(d,l))}):null]})})),Tx=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Rx(t)(n,a):vx(e,t)(n,a)},Rx=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(kx,{...a,icon:e,href:Px(t)?t?.href:t?.attachment?.src}),o(Me,{__html:t?.__html})]},String(n)):null},Px=e=>"href"in e,Bx=Wt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ie,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:We(a,{className:"flex-wrap"}),children:[i?o(ze,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Me,{__html:r,itemSize:"list-m"}):null,o(ze,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ie,{className:"w-fit",image:d})}):null,l?.src?o(ie,{className:"lg:hidden",image:l}):null]})]})})})),Ex=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Dx=(e=[],t={})=>e.filter((({content:e={}})=>uu(t,e))).length,_x=(e,t)=>e===t;const Ax=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,a])=>e(a,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(_x,((e=_x)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),Mx=[],Ox={},zx={primary:"bg-white/30",secondary:"bg-main-divider"},Vx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Fx=d((({count:e,version:t="secondary"})=>{const n=Te(),a=n?"bg-main-divider":zx[t],i=Vx[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(ze,{size:"text-xs",color:i,children:e})})})),Lx=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},$x={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},jx={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Ux={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},qx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Wx=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",$x[a],n?qx[a]:Ux[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?jx[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Lx({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Fx,{count:m,version:Ex(n,a)})}):null]})})})),Hx=d((e=>o(e?.item?.href?Yx:Gx,{...e}))),Yx=d((e=>{const t=fe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Wx,{...e,tag:"a",item:i,onClick:a})})),Gx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Wx,{item:e,onClick:a,...n})})),Kx=(e,t,n)=>(a,i)=>o(Hx,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Xx=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Kx(a,i,t))}))),Jx={categories:[],extraOptions:[],propertyType:[],stage:[]},Zx=Wt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=pu(Jx,{block:i.block,page:i.options?.page}),f=l(((e=Jx)=>p(e)),[]),x=(({hotFilters:e=Mx,filtrationState:t=Ox,blocks:n=Mx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Ax(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Dx(n,t.filter),version:Ex(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Xx,{...x}),o(ru,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(nu,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Qx="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",ey=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(ri,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]],[m,{toggle:u}]=dn(!1);return o("div",{children:e?.length?o("div",{children:c(Rr,{children:[c("div",{children:[o("div",{className:Qx,children:s}),o(Pr,{className:Qx,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(Tr,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Tl,{embedded:!0,onClick:n,children:[o(Sr,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),ty=(e,t,n)=>{const a=Ex("all"===t),i=Ex("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Tl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(Tl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},ny=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ie,{image:e.image}):null,e?.text?o(ze,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,ay=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(ze,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),iy=()=>{},ly=e=>"all"===e?"block":"hidden",ry=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=iy,renderRemoteWorkplaceCard:r=iy,getBalloon:s=iy,getBalloonRemoteWorkplaces:d=iy,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=xn(Zr),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=as({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[ay(h,N),m?ny(m):null,p&&ty(t,w,C),o("div",{className:u("pb-3xl",ly(w)),children:o(ey,{filters:sy([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:Qr})})]}),o("div",{className:"h-[600px]",children:o(ls,{children:o(vs,{points:b,isLoad:n,className:"h-full"})})})]}),c(ls,{children:[y.map(l),v.map(r)]})]})})),sy=e=>Object.keys(Zr).filter((t=>e.filter((e=>es[t](e))).length)),oy=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",cy=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:oy(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:oy(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o($r,{color:"green",children:oy(s)})})]}),o(Br,{children:o(kr,{className:"flex-wrap",children:m?.map(((e,t)=>o(vr,{...e},String(t))))})})]},String(d))},dy=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${oy(t)} №${n}`,body:e.toUpperCase()}),my=[];const uy=async e=>{const t=await zt(e,{method:"GET"});return Array.isArray(t)?t:my},hy={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},py={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},gy=d((({descriptionData:e,className:t})=>{const n=Yg(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=Jn(`${Jt}/atms?regionCode=${e}`,uy);return{data:t||my,isLoad:!t&&!n}}(a);return o(ry,{className:t,filterItems:fy,data:i,isLoad:l,initFilterState:hy,renderCard:cy,getBalloon:dy,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),fy=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>py[t](e))),n=!a.length||a.some((t=>py[t](e)));return t&&n}))},xy=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(ze,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e})]}):null]})}),o(Br,{children:yy(t)})]},String(n)):null,yy=e=>c("div",{children:[c(kr,{className:"flex",children:[o(vr,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(vr,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание банковских карт"})}),o(vr,{label:"Операции для физических лиц",children:o(ze,{children:"Инвестиционное и накопительное страхование"})}),o(vr,{label:"Операции для физических лиц",children:o(ze,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(vr,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]}),by=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),vy={branches:[],remoteWorkplaces:[]};const Ny=async e=>await zt(e,{method:"GET"})||vy,wy=d((({className:e})=>{const t=Yg(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Jn(`${Jt}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Ny);return{data:t||vy,isLoad:!t&&!n}}(n);return o(ry,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:Kr,renderRemoteWorkplaceCard:xy,getBalloon:Jr,getBalloonRemoteWorkplaces:by,title:`Офисы филиала ${t?.name}`})})),Cy=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(wy,{}):o(gy,{descriptionData:e})})})),ky=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Sy=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(eu,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(tt,{className:"px-5 h-full",headlineVersion:"L",...e,...a})},String(t))))})}))),Iy=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[qe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ie,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?Ty({__html:l,richVersion:r}):null,Ry({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Ry({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Ry({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?We([a]):null]})]}))),Ty=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Me,{...e,itemSize:"list-s"})}),Ry=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(G,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(ze,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(ze,{size:"text-xl",color:a,children:t})]})]}):null,Py=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Me,{__html:t,richVersion:n})})})),By=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Ey=Wt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:l,role:r,...s})=>{const d=Te(),[m,{toggle:h}]=dn(t),p=o(Pr,{className:u("gap-lg",By(d)),isUnfolded:m,children:E({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,x=o(Tr,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:r,...s,children:c(Rr,{children:[n?x:p,n?p:x]})})}),{childrenTypes:{exclude:["RollupItem"]}}),Dy=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(kn.split(" ").filter((e=>"rounded"!==e)),ii,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(ze,{color:"text-primary-text",children:t}):null]})}))),_y=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Dy,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(Dy,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Ay=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(zn,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),My=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ay,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Ay,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Oy=["От 1 дня","До 365 дней"],zy=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(ze,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ma,{min:1,max:365,value:e,items:Oy,onChange:t})]}))),Vy=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ay,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Ay,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Fy=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(My,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Ly(m)}),o(zy,{days:i,setDays:e=>m({days:e})}),o(Vy,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:$y(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(_y,{}),o(Tl,{className:"order-6",version:"primary",onClick:u,children:"Офисы на карте"})]})]}))),Ly=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},$y=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},jy=d((({days:e,tariffs:t=[]})=>{const n=qy(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[Uy("Аренда за",e),Uy("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(G,{className:"@xl:h-60",name:"PackA4Icon"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),Uy=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),qy=(e,t)=>{const n=Wy(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Wy=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},Hy=(e,t)=>e.find((e=>e.branchCode===t)),Yy=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Hy(a,n.selectedBranch),d=Gy(s?.safeBoxCaseVolumes),m=Ky(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Xy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Fy,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(jy,{days:n.days,tariffs:u})]})})),Gy=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Ky=(e,t)=>e?.find((e=>e.volume===t)),Xy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Jy=`${Jt}/safeboxes`,Zy=[];const Qy=async e=>await zt(e,{method:"GET"})||Zy,eb=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Vi(),p=tb(m.selectedRegion,h),f=function(e){const{data:t}=Jn(e?`${Jy}?regionCode=${e}`:null,Qy);return t||Zy}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Hy(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Yy,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(vs,{points:y,className:"h-[640px]"}):null]})})),tb=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,nb={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},ab=(e,t,n)=>(a,i)=>{const{button:l}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:ib(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[lb(a),l?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},ib=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=rb(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:sb({step:n,iconVersion:i,i:a,stepVersion:t})})})},lb=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",nb.description),children:e.description}):null,o(Me,{__html:e.__html})]}),rb=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",sb=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return qe(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?nb.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},ob=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:l="gray",version:r="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(ab(d,r,l))}):null,We(i,{isVertical:!0})]})})),cb=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(G,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),db=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Rl,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function mb(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const ub=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}();return mb(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},hb=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const pb=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(gb,{...e},String(t))))})]}):null,gb=d((({icon:e,...t})=>{const n=fe(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),fb=(e,t)=>n=>n.name?o(Qh,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:mm(e,n.name),children:o(ze,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,xb=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(kn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),yb=d((({defaultLocation:e})=>{const t=Yg(e),n=fe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Qh,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),bb=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Gg(t?.default),[s,d]=a(""),m=Vi(),u=r((()=>Nb(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,vb)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Pl,{className:"pb-20",head:c("div",{children:[o(ze,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(yb,{defaultLocation:t?.default}),o(xb,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&hb(e.toLowerCase())(s.toLowerCase())>=.8)).map(fb(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(ze,{size:"text-h6",children:e})}),t.map(fb(f,g))]},e)))}),pb(e)]});var g,f})),vb=e=>e.name?.charAt(0)??"",Nb=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),wb=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=bn(bb,n),{name:r}=Yg(),s=e?.current?.getBoundingClientRect(),c=Z(J.SITE_URL);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(db,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Cb="burgerMenuDialog",kb=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Cn})=>{const{open:i}=bn(wb),[r]=ub(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Cb,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:Cb})),[e,n,t,a]);return[s,{toggle:s?a:o}]},Sb=[],Ib=Wt((({sticky:e,...t})=>{const{menuItems:n=Sb}=e??{},i=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=a(-1),[f,x]=a(""),{closeAll:y}=ge(),b=l((()=>{p(-1),x(""),y()}),[y]),v=Nn(b),N=s(null),[C,{toggle:k}]=kb({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),S=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:r,close:s}=ge(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:a[l].title,dialog:o(db,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),k()}),[b,k]),T=l(((e,t)=>{x(t),p(e),y(),S(e,t)}),[y,S]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Tb(T,"left",{activeIndex:h,currentItemPosition:f})),o(cb,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Tb(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Tb=(e,t,n)=>(a,i,l)=>o(cb,{item:a,isActive:l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||r.stopPropagation(),e(i,t)}},a.title||String(i)),Rb="hidden sm:flex absolute z-40",Pb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Bb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=Um({itemCount:t?.length||0});return i((()=>Eb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Mm,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Pb[l].item,gap:Pb[l].gap,children:t.map(Kx(n,a,l))}),s.canScrollLeft?o(Gm,{wcmsIgnore:!0,className:u("left-6",Rb,Pb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Km,{wcmsIgnore:!0,className:u("right-6",Rb,Pb[l].buttonTop),onClick:s.scrollRight}):null]})})),Eb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},Db={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},_b=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Db[t].wrapper,e),children:o(Bb,{className:Db[t].component,tabsType:t,...n})}):null,Ab=Wt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Mb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=a(Vb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=zb(x[b],b),k=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[_b({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Ob(t,x),activeItem:N,tabsType:r,onChange:k}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>B(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(zb)?.filter(Boolean)||[]}),Mb=({__id:e,anchor:t})=>t??e??"tabs",Ob=(e,t)=>t?.length?t:e,zb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Vb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Fb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Lb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Fb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),$b=d((({className:e="",isOpen:t,onClick:n})=>o(Tr,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),jb={Buttons:({buttons:e})=>We(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ie,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Me,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(ze,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(ze,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o($b,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Ub=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return qb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),qb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in jb))return null;return o(jb[n],{...t,...a})},Wb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Ub,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Hb=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Yb=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(ze,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Gb=d((({rows:e})=>{return o(Mm,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(ze,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Hb(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(ze,{size:"text-xl",children:e.data}):null,e?.cols?Yb(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Kb=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(ze,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Gb,{rows:t.rowsData})})})]},a)}))}))),Xb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Jb=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(ze,{size:"text-xl",font:"font-light",color:Xb(t===n),children:e||t+1})},e)))}):null,t?o(Ce,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Zb=Wt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Jb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Kb,{activeTabIndex:r,items:m}),o($b,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(ze,{size:"text-h6",children:"Данных нет"}),o($b,{onClick:n,isOpen:!0})]})})),Qb=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Zb,{...t,onClick:n})}):null]}))),ev=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Qb,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ie,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Lb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Wb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),tv=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:l})=>n||a?c("div",{children:[n?o(Gm,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(Km,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:l}):null]}):null,nv=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,tv({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),av=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(ev,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]],[N,{toggle:w}]=dn(!1);return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?c(Rr,{children:[c(nv,{controls:x,children:[b,o(Pr,{isUnfolded:N,children:v})]}),o(Tr,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(nv,{controls:x,children:y})})]})})),iv=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?lv():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(ze,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?rv(n):null,i?o(Me,{richVersion:l,__html:i}):null]})]}))),lv=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),rv=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),sv=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(ze,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(ze,{size:"text-h2",children:n})}):null]}))),ov=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(sv,{prefix:t,unit:n,suffix:a})})})),cv={AdTile:Yt,ApplicationForm:Wl,BankAccountFiltration:xu,BenefitsBlock:wu,BonusBenefitsBlock:Su,ButtonsBlock:Tu,CalculatorBonus:Au,CalculatorBusinessDeposit:qu,CalculatorCredit:$o,CalculatorDeposit:hh,CalculatorRefinancing:Ch,CardTransfer:Ah,Carousel:jh,CarouselCard:Hh,CarouselCatalogCard:Gh,CarouselLinks:Jh,CarouselRecommendationCard:ip,CarouselTariffsCard:op,DepositFiltration:Tg,Depository:Ug,ErrorBlock:Wg,ExchangeRateTile:Cf,Footer:Ff,GalleryLayout:qf,GrantSupport:Xf,Header:hx,Headline:S,HorizontalLayout:gx,ImgBlock:fx,LinkDocs:Ix,MobileAppTile:Bx,MortgageFiltration:Zx,OfficesAtmsMap:Cy,Placeholder:ky,ProductBlock:Ht,ProductGallery:Sy,RepresentativeOfficeInfo:Iy,RichTextBlock:Py,RollupItem:Ey,SafeDepositRental:eb,StepsBlock:ob,StickyBottomMenu:Ib,TabsLayout:Ab,TariffsTable:av,TextBlock:iv,UnitBlock:ov,VerticalLayout:px,ApplicationLeadForm:km,CreditCardForm:ag,CreditForm:wg},dv=me((()=>{i((()=>{sn()}),[]);const e=cn();vn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");an({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const mv="cookie",uv=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=dn();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(mv)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(mv,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Me,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Rl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function hv(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);vn(globalThis.document,"keydown",t)}const pv=d((()=>{const[e,{close:t}]=ub(),n=Boolean(e.length);return hv(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),gv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return mb(pe.observable,"popup",{open:t,close:n}),hv(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),fv="header",xv="footer",yv="sticky-footer",bv={},vv=d((({className:e,data:t=bv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Ut(s,r);dv(),Gg();const m={key:"",page:{slots:i,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[fv]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:B(i?.[fv],{...m,slotName:fv})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[E({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),B(i?.[xv],{...m,slotName:xv})]})]}),i?.[yv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:B(i?.[yv],{...m,slotName:yv})}):null,o(pv,{}),o(gv,{}),o(uv,{__html:d?.cookieContent?.__html})]})}));Object.assign(vv,{childrenTypes:[],slots:()=>[fv,xv,yv]});e.Blocks=cv,e.ContentPage=vv,e.handlerDecorator=me,e.joinList=iu,e.locationNavigator=ln,e.packageVersion="0.14.820",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));
|