@redneckz/wildless-cms-uni-blocks 0.14.813 → 0.14.815
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/UniBlock/UniBlock.d.ts +3 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +257 -149
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- 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 -2
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/bundle/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/bundle/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/bundle/retail/api/checkCode.d.ts +1 -0
- package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
- package/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/bundle/retail/api/uploadFile.d.ts +1 -1
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/BlockRenderer/renderBlock.js +1 -1
- package/dist/BlockRenderer/renderBlock.js.map +1 -1
- package/dist/UniBlock/UniBlock.d.ts +3 -1
- package/dist/UniBlock/UniBlock.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/dist/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/dist/components/GalleryLayout/GalleryLayout.js +71 -0
- package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/dist/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/dist/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/dist/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/dist/retail/api/checkCode.d.ts +1 -0
- package/dist/retail/api/checkCode.js +3 -2
- package/dist/retail/api/checkCode.js.map +1 -1
- package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/dist/retail/api/esiaRequestProfile.js +10 -0
- package/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/dist/retail/api/updateUserTask.d.ts +1 -0
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/uploadFile.d.ts +1 -1
- package/dist/retail/api/uploadFile.js +2 -3
- package/dist/retail/api/uploadFile.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/content.js +10 -1
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/utils/mainFormStateMap.js +1 -0
- package/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js +8 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js +3 -3
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- 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/BlockRenderer/renderBlock.js +1 -1
- package/lib/BlockRenderer/renderBlock.js.map +1 -1
- package/lib/UniBlock/UniBlock.d.ts +3 -1
- package/lib/UniBlock/UniBlock.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/lib/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/lib/{retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts → components/GalleryLayout/GalleryLayout.fixture.d.ts} +1 -1
- package/lib/components/GalleryLayout/GalleryLayout.js +69 -0
- package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/lib/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/lib/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/lib/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/lib/retail/api/checkCode.d.ts +1 -0
- package/lib/retail/api/checkCode.js +1 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/lib/retail/api/esiaRequestProfile.js +7 -0
- package/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/lib/retail/api/updateUserTask.d.ts +1 -0
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/uploadFile.d.ts +1 -1
- package/lib/retail/api/uploadFile.js +2 -3
- package/lib/retail/api/uploadFile.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/content.js +10 -1
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/utils/mainFormStateMap.js +1 -0
- package/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js +9 -2
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js +3 -3
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- 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/UniBlock/UniBlock.d.ts +3 -1
- package/mobile/bundle/bundle.umd.js +257 -149
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- 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 -2
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/bundle/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/mobile/bundle/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
- package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/BlockRenderer/renderBlock.js +1 -1
- package/mobile/dist/BlockRenderer/renderBlock.js.map +1 -1
- package/mobile/dist/UniBlock/UniBlock.d.ts +3 -1
- package/mobile/dist/UniBlock/UniBlock.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- 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 +8 -2
- 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 +54 -19
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayout.js +71 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +1 -0
- package/mobile/dist/retail/api/checkCode.js +3 -2
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
- 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 +2 -3
- package/mobile/dist/retail/api/uploadFile.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/content.js +10 -1
- 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 +1 -0
- package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +8 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +3 -3
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- 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/BlockRenderer/renderBlock.js +1 -1
- package/mobile/lib/BlockRenderer/renderBlock.js.map +1 -1
- package/mobile/lib/UniBlock/UniBlock.d.ts +3 -1
- package/mobile/lib/UniBlock/UniBlock.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- 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 +8 -2
- 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 +54 -19
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayout.js +69 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +1 -0
- package/mobile/lib/retail/api/checkCode.js +1 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
- 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 +2 -3
- package/mobile/lib/retail/api/uploadFile.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/content.js +10 -1
- 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 +1 -0
- package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +9 -2
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +3 -3
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- 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/BlockRenderer/renderBlock.tsx +3 -3
- package/mobile/src/UniBlock/UniBlock.tsx +3 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -0
- package/mobile/src/components/GalleryLayout/GalleryLayout.example.json +102 -0
- package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +140 -0
- package/mobile/src/components/GalleryLayout/GalleryLayout.ui.json +1 -0
- package/mobile/src/components/GalleryLayout/GalleryLayoutContent.ts +16 -0
- package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
- package/mobile/src/retail/api/checkCode.ts +1 -1
- package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/mobile/src/retail/api/updateUserTask.ts +1 -0
- package/mobile/src/retail/api/uploadFile.ts +2 -3
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- package/mobile/src/retail/content.tsx +10 -1
- package/mobile/src/retail/model/NameFieldDef.ts +1 -0
- package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +60 -23
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +11 -7
- package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/package.json +2 -2
- package/src/BlockRenderer/renderBlock.tsx +3 -3
- package/src/UniBlock/UniBlock.tsx +3 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -0
- package/src/components/GalleryLayout/GalleryLayout.example.json +102 -0
- package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +61 -0
- package/src/components/GalleryLayout/GalleryLayout.tsx +140 -0
- package/src/components/GalleryLayout/GalleryLayout.ui.json +1 -0
- package/src/components/GalleryLayout/GalleryLayoutContent.ts +16 -0
- package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
- package/src/retail/api/checkCode.ts +1 -1
- package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/src/retail/api/updateUserTask.ts +1 -0
- package/src/retail/api/uploadFile.ts +2 -3
- package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- package/src/retail/content.tsx +10 -1
- package/src/retail/model/NameFieldDef.ts +1 -0
- package/src/retail/utils/mainFormStateMap.ts +1 -0
- package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +60 -23
- package/src/ui-kit/BaseTile/BaseTile.tsx +11 -7
- package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/api/updateProfileEsia.js +0 -6
- package/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/lib/retail/api/updateProfileEsia.js +0 -3
- package/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
- package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
- package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
|
@@ -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}))),S={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"}},k=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=S[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,{className:l,block:e,options:t,...r,...a},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 _(){return _._impl()}_._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),_.setup=e=>{_._impl=e};const D=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return D.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=_(),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=_();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=_(),{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?ke:Se,{...s,children:c})})),Se=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}))),ke=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=_(),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 h-full",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-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),_e(E({...y,extraProps:{className:"@container-normal"}})),Pe(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Ee(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=>u(e?"row-span-2":"@xl:row-span-2"),_e=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(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,Ae=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)),Me=(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,Oe=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?o(Oe,{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:Me(e.description,t)},String(t)):null,"__html"in e?o(Ae,{...e},`rte-${t}`):null],Fe=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?De(n.icon,t):null,o("div",{children:Ve(n)})]}))),Le=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(Fe,{benefitsVersion:t,...e},String(n))))}):null)),$e=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)),je=d((({isTabularBenefits:e,...t})=>o(e?$e:Le,{...t}))),Ue=e=>Boolean(e?.src||e?.icon),qe=(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(We(n))}):null,We=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=He(i,r),d=He(l,r);return a||i?.icon?o(Ce,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ye({...i,iconVersion:c}),appendRight:Ye({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},He=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ye=e=>Ue(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ge=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ke=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(Xe)}):null)),Xe=({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(Oe,{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:[Ge(2)(t)," ",n||"₽"]}):null]},String(a)),Je=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ze)}):null)),Ze=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Oe,{size:"text-m",font:"font-light",children:e})},String(t)),Qe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},et=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const R=b?.src?o(ie,{image:b}):null,P=o(k,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),B=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...tt(R,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:qe(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[B?.length?o(je,{benefitsVersion:s,isTabularBenefits:d,benefits:B}):null,h?o(Ae,{richVersion:p,__html:h,isDotted:m,itemSize:Qe[l]}):null,I,f?.length?o(Ke,{priceList:f}):null,nt(x)]})})})),tt=(e,t)=>t?{rightImage:e}:{leftImage:e},nt=e=>e?.length?o(Je,{tags:e}):null;class at{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof at?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 it=()=>!0,lt=(e,t)=>(...n)=>e(...n)&&t(...n),rt=(...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 st=e=>Boolean(e&&Array.isArray(e)),ot=e=>Boolean(e&&"object"==typeof e&&!st(e)),ct=e=>e;function dt(e){return e instanceof at?e._:e}class mt extends at{from(e){return this.of(e.map(((e=ct)=>([,t])=>e(t))(dt)))}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(st(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 ut extends at{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 ht extends at{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,dt(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 pt extends at{proto=rt([e=>st(this._)||"number"==typeof e,()=>mt.prototype],[e=>ot(this._)||"string"==typeof e,()=>ht.prototype],[it,()=>ut.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 gt=e=>e instanceof at?e:new pt(e),ft=e=>{const t=(t,...n)=>dt(e(gt(t),...n));return t.fn=e,t},xt=[],yt=e=>e instanceof Function?e:t=>e===t,bt=e=>(t,n,a=xt)=>gt(t).entries().reduce(((t,[n,i])=>bt(e)(i,t,a.concat(n))),e(n,[a,gt(t)])),vt=ft(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?vt(e.get(a),[i,n]):n)})),Nt=ft(((e,t)=>t.reduce(vt.fn,e))),wt=e=>bt(((e,[t,n])=>Ct(n)?[...e,[t,dt(n)]]:e))(e,[]),Ct=e=>0===e.size();ft(((e,t=xt)=>t.reduce(((e,t)=>e.get(t)),e)));const St=ft(((e,[t,...n])=>n.length?e.set(t,St(e.get(t),n)):e.filter((([e])=>e!==t)))),kt=(It=["$ref"]).map(((e,t)=>n=>yt(e)(n[t+n.length-It.length]))).reduceRight(lt,it);var It;const Tt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Rt,e),Rt=rt([st,(e,t)=>e[parseInt(t,10)]],[ot,(e,t)=>e[t]],[it,ct]),Pt=(e,t)=>((e,t={})=>n=>Nt(t,wt(n).map((t=>e(t)))))((([e,n])=>{return kt(e)?[(a=e,a.slice(0,-1)),Tt(t(n),n)]:[e,n];var a}))(e),Bt=e=>wt(e).filter(((e=ct)=>([t])=>e(t))(kt)),Et=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function _t(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),At=e=>[...new Set(e)],Mt={},Ot=["/portal-resources"],zt=(e,t)=>Pt(e,(e=>t?.[e])),Vt=(e,t)=>{const n=Et(e),[l,r]=a({});return i((()=>{Ft(n).then(r)}),[n.join()]),n.length?zt(e,{...t,...l}):e},Ft=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(At(e).filter((e=>!Ot.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Et(e)));return i.length?Ft(i,a):a}return t};function Lt(e,t={}){const n=d((t=>{const n=Vt((({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 $t=Lt((({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(et,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),jt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Ut(0,t?.length)),[t]),a=t?.[n];return a?o($t,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Ut=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),qt=(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}`}},Wt=e=>e?.replace(/[^+\d]/g,""),Ht="/api/v1";const Yt=e=>e?{phone:Wt(e)}:{},Gt=(e,t="birthday")=>e?{[t]:qt(e)}:{},Kt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Xt=(e,t=!0)=>({[t?"email":"mail"]:e}),Jt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Wt(e)}:{},Zt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[])t[a??""]?.(n,i)};function Qt(){return Qt._impl()}Qt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Qt.setup=e=>{Qt._impl=e};const en="rshb-query-params";function tn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(en)||"";return e&&globalThis.sessionStorage?.setItem(en,e),e}const nn=e=>{const t=e.target?.closest("a"),n=Qt();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=tn();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 an(){return an._impl()}function ln(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}]}an._impl=()=>({forwardQuery:nn}),an.setup=e=>{an._impl=e};const rn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],sn=e=>!e?.length,on=e=>t=>n=>e(n)?[]:[t],cn={},dn=[];const mn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function un(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=mn(i,l)?i:l;return!mn(a,r)&&n?.(r),r}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[r,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=ln(!1),f=s({}),[x,{isValid:y,errors:b}]=function(e,t){const n=r((()=>t?.(e)??cn),[t,e]),a=r((()=>rn(n)(e)??dn),[n,e]),i=sn(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 hn=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 pn(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 gn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function fn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return gn(globalThis.document,"click",n),t}const xn=({label:e,errors:t})=>e&&t?`${e}*`:e,yn=()=>{},bn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",vn=e=>e?bn:"border-error",Nn=e=>e?o(Oe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,wn=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),S=l((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=b?"pr-3xl":"",I=vn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Nn(d),x?o("textarea",{className:u("block resize-y min-h-24",Cn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:y,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Cn,k,I),id:n,type:r,value:h,name:a||n,placeholder:m,pattern:g,disabled:y,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),b]})})),Cn="w-full border rounded-md text-primary-text outline-none p-m",Sn=e=>o("div",{className:"h-6",children:e?o(Oe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),kn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=yn,onBlur:m,isTextarea:h,type:p,isInteger:g=!1,maxLength:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=ln(),N=fn(b),w=l((e=>{!y&&v(),f?e.length<=f&&d(e):d(e)}),[y,d]);return i((()=>{g&&n&&d(In(n))}),[n]),c("div",{className:u("shrink-0 w-full",e),ref:N,onBlur:b,onFocus:v,children:[o("div",{children:o(wn,{disabled:x,type:p||"text","aria-label":t,label:xn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:w,onBlur:m,isTextarea:h,placeholder:Tn(a,s,t)})}),Sn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Rn=e=>e?.text||e?.key||"",Pn=()=>ue(pe.emitter,"popup"),Bn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,En=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:Bn(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:Rn(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 _n=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}]=ln(),[N,w]=a(""),C=Mn(g,n.length),S=y&&!C,k=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=Pn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=fn(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(En,{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:[Nn(t),c("div",{className:u("relative",S?"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",An(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Rn(r)||h}),Dn(S,f)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(wn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),Dn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(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"),Mn=(e,t)=>e||0===t,On=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(_n,{...i,valid:!n,label:xn({label:t,errors:a})}),Sn(n)]}))),zn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Vn=d((({field:e,input:t})=>o(On,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:zn,...e(t?.name??"")}))),Fn=(e="")=>Boolean("trade"===e||"all"===e),Ln=e=>null!=e,$n=new Map,jn=(e,t=$n)=>n=>{const a=qn(n),i=t.get(a);if(a&&Ln(i))return i;const l=e(...n);return a&&Ln(l)&&t.set(a,Promise.resolve(l)),l},Un=e=>Boolean(e?.every((e=>Array.isArray(e)?Un(e):!e||"string"==typeof e))),qn=e=>Un(e)?e.toString():"",Wn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Hn(e,t,{fallback:n,cache:l}={}){const s=r((()=>Yn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Ln))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await jn(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&Wn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Yn(e){return Array.isArray(e)?e:e instanceof Function?Yn(e()):[e]}const Gn=`${Ht}/branches`,Kn=[];const Xn=async e=>await _t(e,{method:"GET"})||Kn;function Jn(e=!1){const{data:t}=Hn(`${Ht}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Zn=(e="")=>"ULTRASERVICE"===e,Qn=d((({field:e,input:t,params:n})=>{const a=Zn(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?Jn(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Hn(e?`${Gn}?regionCode=${e}`:null,Xn);return t||Kn}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(On,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),ea=(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}},ta=(e,t,n)=>Math.max(t,Math.min(e,n));function na(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function aa({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=na(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const ia=1,la=100,ra=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:ia),max:s=(i.length?i.length-1:la),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=ea(e,{normalize:(e=0)=>i.length?sa(i)(e):ta(e,r,s),format:Ge()}),f=l((e=>{p&&p(na(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Oe,{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",bn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),aa({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),oa(a)]})})),sa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),oa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Oe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ca=["От 1 000 ₽","До 1 000 000 000 ₽"],da=d((({field:e,input:t})=>o(ra,{title:"Сумма, ₽",items:ca,min:1e3,max:1e9,...e(t?.name??"")}))),ma=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),ua="client",ha=[{key:ua,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],pa=d((({field:e,input:t})=>o(On,{label:"Тип обратившегося",...t,options:ha,...e("applierType")}))),ga=d((({field:e,input:t})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),fa=({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=xa(t,e),c=ya(t,l,r);u.push(o("td",{children:o("div",{className:ba(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},xa=(e,t)=>t&&e.toDateString()===t.toDateString(),ya=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),ba=(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"),va=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Na=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:l=yn})=>{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:va.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:fa({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:l})})]})})),wa=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ca(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Sa),l=a.map(((e,t)=>Ia(e)?a.slice(0,t).filter(Ia).length:-1)),r=a.map(((e,t)=>ka(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Sa=e=>"_"===e,ka=e=>/\d/.test(e),Ia=e=>Sa(e)||ka(e),Ta=1940,Ra={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Pa=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((()=>{Ea({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(Ca(t,"__.__.____"))},onBlur:()=>{Ba(p)?Ea({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(l||"")},disabled:r}),r?null:o(G,{className:"mr-s",...Ra})]})})),Ba=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Ta&&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},Ea=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Ba(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))}},_a=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Pa,{onChange:a,disabled:r,onClick:e,value:t&&qt(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")}),Da=wa.map((e=>({key:e}))),Aa=Array.from({length:(new Date).getFullYear()-Ta+1},((e,t)=>Ta+t)).reverse().map((e=>({key:String(e)}))),Ma=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Oa=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},za={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Va={className:"min-w-32",iconVersion:"black",isBorder:!1},Fa=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=ln(!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:S,handleSelectYear:k,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=fn(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(wa.indexOf(e));const t=Ma(r,wa.indexOf(e));Oa({maxDateOfMonth:t,selectedYear:r,selectedMonth:wa.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:Da,yearsOptions:Aa,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:[Nn(t),c("div",{className:"relative",children:[_a({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,{...za,className:"-rotate-90 cursor-pointer"})}),o(_n,{onChange:S,value:{key:wa[x]},options:I,...Va}),o(_n,{onChange:k,value:{key:String(b)},options:T,...Va}),o("div",{className:"my-auto",onClick:C,children:o(G,{...za,className:"rotate-90 cursor-pointer"})})]}),o(Na,{today:n,currentMonth:x,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),La=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Fa,{label:xn({label:t,errors:a}),valid:Boolean(!n),...i}),Sn(n)]}))),$a=d((({field:e,input:t})=>o(La,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),ja=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Ua=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),qa=d((({field:e,input:t})=>o(La,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Wa=d((({field:e,input:t})=>o(kn,{label:"Электронная почта",...e(t?.name??""),...t}))),Ha=[{key:"ULTRASERVICE",text:"Ультра"}],Ya=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Ga=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ka=d((({field:e,input:t})=>o(On,{label:"Способ получения ответа",options:Ga,...e(t?.name??"")}))),Xa=d((({field:e,input:t})=>o(kn,{label:"ФИО",...e(t?.name??""),...t}))),Ja=d((({field:e,input:t})=>o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),Za=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)}))}))),Qa="appearance-none w-5 h-5 border-solid flex-none",ei=[{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"}],ti=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(Za,{paths:ei,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",ai(a)),onClick:s,children:[o("div",{className:u(Qa,"m-0",i?"rounded-full border-2":li(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ii(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ni(n)]})})})),ni=e=>e?o("div",{className:"ml-s",children:o(Oe,{size:"text-l",font:"font-light",children:e})}):null,ai=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ii=(e=!1)=>e?"radio":"checkbox",li=(e=!1)=>u("rounded border",{"bg-primary-main":e}),ri=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ti,{text:t,value:n,disabled:i,onChange:r},a),Sn(l)]}))),si=d((({field:e,input:t})=>o(ri,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),oi=`${Ht}/outservice`,ci=[];async function di(){const e=await _t(`${oi}/outserviceregions`);return e&&Array.isArray(e)?e:ci}const mi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=Hn("outServiceRegions",di),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(On,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),ui=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,hi=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),pi=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),gi=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(Oe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),fi=d((({field:e,input:t})=>Fn(e("acquiringType")?.value?.key)?o(gi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),xi=d((({field:e,input:t})=>o(kn,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),yi=e=>"_"===e,bi=e=>/\d/.test(e),vi=e=>yi(e)||bi(e),Ni=[..."+7 (___) ___-__-__"],wi=Ni.findIndex(yi),Ci=Ni.map(((e,t)=>vi(e)?Ni.slice(0,t).filter(vi).length:-1));function Si(e){const t=e.replace(/\D/g,""),n=Ni.map(((e,n)=>bi(e)?e:t.charAt(Ci[n])||e)),a=Ci.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(wi,a)):n).join("")}const ki=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Si(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(wn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Ii=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ki,{"aria-label":t,label:xn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Sn(a)]}))),Ti=d((({field:e,input:t})=>o(Ii,{label:"Телефон",...e(t?.name||"phone"),...t}))),Ri=d((({field:e})=>Fn(e("acquiringType")?.value?.key)?o(gi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Pi=Lt((({field:e,input:t,source:n})=>o(On,{placeholder:"Выберите продукт",label:"Продукт",options:Bi(n?.productList),...e(t?.name??"")}))),Bi=e=>(e??[]).map((e=>({key:e,value:e}))),Ei=`${Ht}/regions`,_i=[];function Di(e=Ei){const{data:t}=Hn(e,Dt);return Array.isArray(t)?t:_i}const Ai=`${Ht}/outservice/outserviceregions`,Mi=d((({field:e,input:t,params:n})=>{var a;const i=Di((a=n?.typeForm,"OUTSERVICE"===a?Ai:void 0));return o(On,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),Oi=d((({field:e,input:t})=>{const n=Jn(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(On,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),zi=d((({field:e,input:t})=>o(kn,{label:"ФИО представителя",...t,...e("representativeName")}))),Vi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Fi=/^[\u0400-\u04FF\d\s]+$/u,Li=(e="")=>Fi.test(e),$i=on((e=>null!=e&&""!==e)),ji="Некорректно заполненное поле",Ui=e=>$i(e??ji),qi=e=>on((e=>e?.key&&""!==e?.key))(e??ji),Wi=e=>on((e=>"string"==typeof e&&e.length>1&&Li(e)))(e??ji),Hi=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Yi=e=>on(Hi)(e),Gi=on((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Ki={fullName:Ui(),addressBranch:qi(),desiredMeetingDate:Ui(),product:Ui(),localities:Ui(),partnerComments:Ui(),collectionCount:Ui(),acquiringType:qi(),serviceType:qi(),annualRevenue:Ui(),feedbackMethod:qi(),serviceDirection:qi(),secondaryPhone:Yi("Укажите номер телефона"),region:qi(),situationDescription:Ui(),sufferedFrom:Ui(),applierType:Ui(),surname:Wi("Укажите свою фамилию на кириллице"),name:Wi("Укажите своё имя на кириллице"),middleName:Wi("Укажите своё отчество на кириллице"),birthday:Ui("Укажите дату рождения"),phone:Yi("Укажите номер телефона"),email:(Xi="Укажите электронную почту",on((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(Xi)),inn:(e=>on((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Ui(),typeForm:Ui(),consentToReceiveMaterials:Gi,consentDataProcessing:Gi};var Xi;const Ji=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...Ki,...t},i=n.some((e=>e.condition?.values)),l=Object.fromEntries(n.filter(Zi(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(Zi(a)).filter(Qi(e)).map((({name:e})=>[e,a[e??""]]))):l},Zi=(e={})=>({name:t})=>Boolean(e[t??""]),Qi=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),el=d((({field:e})=>{const t=e("secondaryPhone");return o(Ii,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Vi(t,Ki.secondaryPhone):t})})),tl=d((({field:e,input:t})=>o(On,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Ya,...e(t?.name??"")}))),nl=d((({field:e,input:t})=>o(kn,{label:"Описание ситуации",...t,...e("situationDescription")}))),al=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],il=d((({field:e,input:t})=>o(On,{label:"Пострадал в",...t,options:al,...e("sufferedFrom")}))),ll=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),rl=["От 1 мес","До 15 лет"],sl=d((({field:e})=>o(ra,{title:"Срок, месяцев",items:rl,min:1,max:180,...e("term")}))),ol=d((({field:e,input:t})=>o(On,{label:"Тип обслуживания",options:Ha,...e(t?.name??"")}))),cl={horizontal:"@lg:flex-row",vertical:""},dl=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(Oe,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",cl[l],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ti,{isRadio:!0,text:t,value:n===e,onChange:()=>r?.(e),disabled:i},String(e))))})]}))),ml=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],ul=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(dl,{className:"whitespace-normal",orientation:"horizontal",items:ml,...e(t?.name??"",{onChange:n})})})})),hl=d((({field:e,input:t})=>o(ti,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const pl={$ref:"/wcms-resources/outservice-productlist.json"},gl={fullName:Xa,addressBranch:Qn,desiredMeetingDate:qa,product:e=>o(Pi,{...e,source:pl}),localities:mi,isClient:si,partnerComments:xi,collectionCount:ja,acquiringType:Vn,onlineCheckout:fi,posTerminal:Ri,serviceType:ol,term:sl,amount:da,annualRevenue:ma,vedTypes:ul,feedbackMethod:Ka,serviceDirection:tl,bankEmpolee:ga,secondaryPhone:el,applicationDate:e=>o(kn,{label:"Дата и время обращения в Банк",...e}),region:e=>Zn(e?.params?.typeForm)?o(Oi,{...e}):o(Mi,{...e}),consentToReceiveMaterials:hl,sufferedFrom:il,situationDescription:nl,representativeName:zi,applierType:pa,surname:ll,name:pi,middleName:hi,birthday:$a,phone:Ti,email:Wa,inn:Ja,comment:Ua},fl=(e,t,n={})=>(a,i)=>{const l={...gl,...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},xl=e=>2===e?"@xl:grid-cols-2":"",yl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Oe,{size:"text-h6",children:e})}):null,bl={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")},vl=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Nl=u("bg-main-gray text-main-disabled cursor-not-allowed"),wl=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=yn})=>{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",{[bl[n]]:!s&&!i,[vl]:i,[Nl]: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})})),Cl=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"})}))),Sl=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(Cl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),kl=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Sl,{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(k,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(wl,{type:"button",onClick:n,children:"Хорошо"})]})})})),Il=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||""}${Fn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,f={...p,...Bl(o),...Pl(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},...Rl(m?.text,u),...Tl(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Tl=e=>e?.key?{isClient:e?.key===ua}:{},Rl=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Pl=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Bl=e=>e?{vedTypes:Object.fromEntries(ml.map((({id:t})=>[t,t===e])))}:{},El={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:Ha[0],feedbackMethod:Ga[0],serviceDirection:Ya[0],vedTypes:ml[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},_l=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"})}))),Dl=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(wl,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(_l,{blur:!0,size:"small"}):null,n]}))),Al={primary:bl.primary,secondary:bl.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:bl.secondary,transparent:"","":""},Ml=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",{[Al[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??Ol(l,r)})})),Ol=(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,zl=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Oe,{children:e}):null,t?o(Ml,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),Vl=(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(ti,{...e}),o(zl,{link:t})]}),Sn(Vi(e,Gi).error)]}):o(zl,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(Dl,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),Fl={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=`${Ht}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Kt(a,g),...Xt(l,g),...Yt(i),...Gt(s,"desiredMeetingDate"),...g?Gt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Jt(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}}},Ll=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||El[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),y=r((()=>Ji(f)),[f]),b=pn(kl),v=an(),N=l((async(e,t)=>{const a=Il({...e,...m}),i=Boolean(await Fl.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&Zt({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:S}]=un(x,{resetOnSubmit:!0,formValidator:y,onSubmit:N}),k=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(hn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:S,children:[a.map(((e,t)=>c("div",{className:u(xl(e.columns),"grid gap-x-m"),children:[yl(e.title),(e?.inputs||[])?.map(fl(C,{typeForm:n}))]},`section-${t}`))),Vl(k?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]})})),$l="Некорректно заполненное поле",jl="Укажите регион, город/населенный пункт, улицу, дом",Ul=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),ql=()=>on(Ul)(jl),Wl=e=>on((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??$l),Hl=(e,t)=>on((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??$l),Yl=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)},Gl=e=>on((e=>"string"==typeof e&&6===e.length))(e),Kl=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},Xl={processPersonalDataFlg:Gi,consentProviderFlg:Gi,consentInformFlg:Gi,consentPfrFlg:Gi,consentOthersFlg:Gi,consentFATCA:Gi},Jl={addressCourier:ql(),paymentSystem:Ui("Укажите тип платежной системы"),currency:Ui("Укажите валюту"),cardCategory:Ui("Укажите категорию карты"),codeWord:(e=>on((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Li(e)))(e??$l))("Необходимо ввести кодовое слово"),confirmationIncome:qi(),methodObtain:Ui(),deliveryDate:Ui("Укажите дату доставки")},Zl={organization:qi("Выберите тип организации"),organizationAddress:on((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(jl),organizationPhone:Yi("Укажите номер телефона"),organizationName:Ui("Укажите наименование организации"),legalForm:Ui("Укажите ОПФ"),generalSeniority:Wl("Укажите количество лет стажа"),lastJobExperience:Wl("Укажите стаж на последнем месте работы"),experience5Years:Wl("Укажите общий стаж за последние 5 лет"),jobsNumber:Wl("Укажите количество мест работы за последние 5 лет"),beginDate:Ui("Укажите дату заключения трудового договора"),addressFact:ql(),addressRegistration:ql(),addressRetail:qi("Выберите адрес банка"),addressMatch:Ui(),sex:Ui("Укажите свой пол"),limitedBirthday:on(Yl)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:Ui("Укажите место рождения"),education:qi("Выберите ваше образование"),housing:qi("Выберите тип жилья"),amountWorkers:qi("Выберите информацию о количестве сотрудников"),employment:qi("Выберите информацию о трудоустройстве"),employerActivities:qi("Выберите вид деятельности организации"),employerOrganization:qi("Выберите вид организации"),positionOrganization:qi("Выберите вашу должность"),familyStatus:qi("Выберите семейное положение"),familyMembers:Hl(2,"Укажите количество членов семьи"),children:Hl(2,"Укажите количество детей"),dependents:Hl(2,"Укажите количество иждивенцев"),totalIncome:Hl(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Hl(10,"Укажите сумму обязательных выплат"),snils:(e=>on(Kl)(e))("Некорректный номер СНИЛС"),conscription:Ui(),armyIdFlg:Gi,dulSerie:(e=>on((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:Gl("Укажите номер паспорта"),dulIssueDate:Ui("Укажите дату выдачи паспорта"),dulSubdivisionCode:Gl("Укажите код подразделения"),dulIssuedBy:Ui("Укажите организацию, выдавшую паспорт"),participantDateRegistration:Ui("Укажите дату регистрации"),retirementIncome:Ui(),otherIncome:Ui(),wages:Ui(),mandatoryPayments:Ui(),bankruptcyFlg:Ui(),shareholderFlg:Ui(),legalEntityName:Ui(),bankEmployeeCode:Ui(),partInBusiness:Ui(),regionRetail:qi("Выберите регион"),latinSurname:Ui("Укажите фамилию")},Ql={...Zl,...Jl,...Xl},er={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}}},tr=e=>e?.value||"",nr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=tr}=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},ar={url:"suggest/address"},ir={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:ar,addressFact:ar,organizationAddress:ar,addressCourier:ar},lr=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 rr({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=Pn(),x=ir[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 nr({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(lr,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const sr=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=yn,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:S}]=ln(),k=fn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[w,d]);i((()=>{y&&n&&d(or(n))}),[n]);const T=rr({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(wn,{disabled:N,type:g||"text","aria-label":t,label:xn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:cr(a,s,t)})}),Sn(r)]})})),or=(e="")=>e.replace(/[^\d]+/g,""),cr=(e,t,n)=>t&&!n?`${e}*`:e,dr=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(mr(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(sr,{disabled:t?.filledByEsia&&ui(e,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:r,...t,onDaDataChange:i})})),mr=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}),ur=Lt((({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?.(mr(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(sr,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:r||e("addressCourier")?.error,onDaDataChange:u})})),hr=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(sr,{label:"Адрес",disabled:r,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),pr=d((({field:e,input:t})=>o(ri,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),gr=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:fr({textItems:l,subText:t,children:n,isPhone:a,...i})})),fr=({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(Oe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||xr(n,s),i?o(Oe,{color:a,size:"text-m",children:i}):null]}),xr=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Oe,{size:"text-l",children:t?o("a",{href:`tel:${yr(e)}`,children:e.trim()}):e.trim()},String(n)))),yr=e=>e.replace(/\D/g,""),br=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}))),vr=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}))),Nr=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),wr=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...l})=>c(wl,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...l,children:[o(vr,{children:a}),o(Nr,{isUnfolded:t,iconVersion:i?"color":""})]}))),Cr=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const Sr=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})})})),kr=d((({children:e})=>{const[t,{toggle:n}]=ln(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Cr,{className:"block sm:hidden",children:[o(Sr,{isUnfolded:t,children:e}),o(wr,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),Ir=e=>{const t=Rr(e);return o(gr,{label:"Режим работы",value:t,className:"max-w-none"})},Tr=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Rr=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[Tr({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Tr({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Pr=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Br=e=>Pr.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??"")}}))),Er=e=>{if(!e)return null;const t=_r(e);return c(br,{className:"border-none",children:[o(gr,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Dr)})}),o(gr,{label:"Режим работы",className:"max-w-none",children:o(Oe,{children:e})})]})},_r=e=>{const t=Pr.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},Dr=({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(Oe,{size:"text-xs",children:e})},String(n)),Ar=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(gr,{label:"Валюта",value:e.currency}):null,t?o(gr,{label:"Купить",value:String(t)}):null,n?o(gr,{label:"Продать",value:String(n)}):null]},String(a)),Mr={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"}},Or=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",Mr[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(Oe,{size:"text-m",color:Mr[n].text,children:t})]}))),zr=(new Date).getDay(),Vr=e=>{const[t]=e?.slice(zr-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(Or,{color:"green",children:i}):null,n&&l?o(Or,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Or,{color:"red",children:"Выходной"})},Fr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Lr=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(gr,{label:e,value:t&&n?n:"",subText:Fr({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),$r=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,jr=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ur=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,qr=(e,t)=>{if(!e.workSchedule)return null;const n=Br(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(Oe,{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(Oe,{size:"text-l",children:e.address})]}):null]}),Vr(n)]}),o(kr,{children:Wr(e)})]},String(t))},Wr=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=Br(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(br,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(gr,{label:"Факс",value:t,isPhone:!0}),o(gr,{label:"Телефон филиала",value:e,isPhone:!0}),o(gr,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(gr,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(gr,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(gr,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(br,{children:o(gr,{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(Lr)})})}):c(br,{children:[o(gr,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Dr)})}),Ir(d)]}),r?.businessScheduleVisibleTag?Er(r?.businessScheduleDescription):null,s?.currencies?.length?o(br,{className:"flex-wrap",children:s?.currencies?.map(Ar)}):null]})},Hr=({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=Br(e),n=e?Rr(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?$r(n):Ur(n,a):jr(n):""})(n)}`;return{header:a,body:l}},Yr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Gr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Kr={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)},Xr=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Kr[t](e)))))},Jr=()=>{},Zr=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Jr,getBalloonRemoteWorkplaces:i=Jr})=>{const[l,s,o,c]=r((()=>{const l=Xr(e,n),r=Xr(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}},Qr=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),es=d((({children:e})=>Qr?e:null)),ts="/icons/MapMarkerClusterIcon.svg",ns="/icons/MapMarkerClusterYellowIcon.svg";function as({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=is("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=is("workplaces",e,i),r=ls(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ls(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=ls(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 is=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?ts:ns,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ls=(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?ts:ns,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),rs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},ss={...rs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},os=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ss).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"})}),cs=e=>globalThis[e],ds=(e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=cs(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(cs(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(cs(e))})),l.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(l)}))};const ms=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return ds(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),us={...rs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},hs=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(us).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),ps=[55.753995,37.614069],gs=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=ms();if(i((()=>{r.current?as({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:fs(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),as({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(_l,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(hs,{yandexMaps:r}),o(hs,{yandexMaps:r,direction:"out"})]}),os(r,m,u("right-2 top-80",h))]})})),fs=e=>{const t=[ys(xs(e,0)),ys(xs(e,1))];return t.every((e=>e))?t:ps},xs=(e,t)=>e.map((e=>e.coords?.[t])),ys=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,bs=async(e,t,n)=>{try{return(await vs(e,t,n)).json()}catch(e){return console.error(e),null}};async function vs(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,...Ns()},credentials:"include",body:n?JSON.stringify(n):null})}const Ns=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ws=e=>Number(e.toString().replace(",",".")),Cs=e=>{const{data:t,error:n}=Hn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Ss);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Ss=async e=>await _t(e,{method:"POST"})||[],ks=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=Cs("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await bs("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:ws(e.latitude??ps[0]),gpsLongitude:ws(e.longitude??ps[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=Zr({data:n,filtrationState:{},getBalloon:Hr});return c("div",{children:[o(On,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(es,{children:o(gs,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Is(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Ts(e,t){return Is(e,t),Is(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Rs{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 Ps{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 Bs={};function Es(e,t=Bs){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 _s=new Ps;function Ds(e){return Es(_s,e)}Ts(_s,new Rs(globalThis?.localStorage));const As=()=>Ds(),Ms=Lt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...l})=>{const r=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(On,{placeholder:a,options:r,...e(n),...l})})),Os=d((({field:e,input:t})=>{const{data:n}=Cs("EMPLOYEES_NUMBER"),a=As();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(Ms,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),zs=d((({field:e,input:t})=>o(ri,{text:"Наличие военного билета",...e(t?.name??"")}))),Vs=d((({field:e,input:t})=>o(sr,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),Fs=d((({field:e,input:t})=>o(ri,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Ls=d((({field:e,input:t})=>o(La,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t}))),$s=d((({field:e,input:t})=>o(sr,{label:"Место рождения",...e(t?.name??""),...t,disabled:t?.filledByEsia&&ui(e,"birthPlace")}))),js=e=>{try{return JSON.parse(String(e))}catch(e){return null}};const Us=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(Ae,{__html:e})})]}))),qs=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=function(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?js(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 bs("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(h,d);s(e),Ws(e,m)||u&&u(null)})()}),[h]);const p=r((()=>n?.find((e=>e.key===m?.key))?.description),[n,m]);return c("div",{children:[o(Ms,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),p?o(Us,{__html:p}):null]})})),Ws=(e,t)=>e.some((e=>e.key===t?.key)),Hs=d((({field:e,input:t})=>o(sr,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Ys=d((({field:e,input:t})=>o(sr,{label:"Кодовое слово",...e(t?.name??""),...t}))),Gs=d((({field:e,input:t})=>{const{data:n}=Cs("INCOME_CERT_UNITED");return o(Ms,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Ks=d((({field:e,input:t})=>{const{data:n}=Cs("MILITARY_STATUS");return o(Ms,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Xs=()=>Ds(),Js=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Te();return c(Sl,{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(wl,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),Zs=(e,t)=>{const{open:n}=pn(Js),a=Te();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await vs(`/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])},Qs=d((({className:e,error:t,docId:n,...a})=>{const i=Zs(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ti,{...a}),n?o(wl,{embedded:!0,onClick:i,children:o(vr,{children:"Ознакомиться"})}):null]}),Sn(t)]})})),eo=d((({field:e,input:t})=>{const{productType:n}=Xs(),a=er[n??""];return t&&t.name?o(Qs,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),to=Math.round(29.5),no=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]}))),ao="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",io="flex flex-col lg:w-1/2 gap-2xl",lo="flex flex-col gap-y-xl min-w-52",ro=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Oe,{size:"text-h3",children:"number"==typeof e?[a,Ge(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),so=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(Oe,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(ro,{value:n,...i}):o(Oe,{size:"text-h3",children:"-"})]}))),oo=e=>mo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),co=(e=[],t=!1,n=[])=>({...mo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),mo=(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]},uo=(e,t=0)=>e?.sum?e.sum:t,ho=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,po=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,go=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ra,{items:[`От ${fo(e)}`,`До ${fo(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),fo=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,xo=({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(Oe,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(dl,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...l})]}),yo=e=>xo({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),bo=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ra,{items:e?[`От ${Ge(1)(a.min||0)} ${n}`,`До ${Ge(1)(a.max||0)} ${n}`]:[],step:t,...a}),vo=({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?.(ta(t?.[i],n.minMonths,n.maxMonths))},No=(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)},wo=e=>e,Co=(e=wo)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),So=Co(),ko=(e=wo)=>Co((t=>-e(t))),Io=ko(),To=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Ro([e,t],a),Ro=([e,t],n=[])=>({[e]:n.length?Io(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?So(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Po=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Bo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Eo=e=>_o({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&_o({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&_o({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&_o({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),_o=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Do=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Bo],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Eo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=To(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=To(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Eo({row:e,userInputParams:t,paramsViewSettings:n})&&Po(a,["minSum","maxSum"],e)&&Po(i,["minMonths","maxMonths"],e)))||Bo)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=No(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Ao=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Mo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Oo=Lt((({className:e,title:t,calcSource:n,buttons:a,footnote:r,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=oo(n?.rateRows),g=l((e=>{const t=Do(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:x}]=un({moneyValue:uo(d,2e5),monthsValue:ho(d,to),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=Do(f,n,s),b=yo({...x("isAnnuity")}),{onChange:v}=x("moneyValue"),{onChange:N}=x("monthsValue");return i((()=>{v&&v(ta(f.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),i((()=>{N&&N(ta(f.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),i((()=>{!Ao(d)&&p&&vo({field:x,defParams:p,calcParams:y,map:Mo,monthsValue:"minMonths"})}),[n,d]),o(no,{className:e,title:t,...h,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...x("moneyValue"),value:y.moneyValue}),go({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...x("monthsValue"),value:y.monthsValue}),zo({...y,...s},x),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(lo,"@4xl:w-1/2"),children:[o(so,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(so,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(so,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),qe(a,{isVertical:!0}),po(r)]})]})})})),zo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ti,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ti,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Vo="calculator",Fo=d((({field:e,params:t})=>{const n=l((t=>{e(Vo).onChange?.(t)}),[]);return o(Oo,{...t?.calcData,padding:"p-0",defaultParams:$o(e(Vo).value),onChange:n})})),Lo={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},$o=(e,t=!1)=>{const n=t?jo(Lo):Lo;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},jo=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Uo=d((({field:e,input:t})=>{const{data:n}=Cs("CREDIT_IN_RSHB");return o(Ms,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),qo={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"},Wo=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(dl,{label:xn({label:t,errors:a?.errors}),...a}),Sn(n)]}))),Ho=[{id:"810",text:"Рубли"}],Yo=d((({field:e,input:t})=>{const{data:n}=Cs("CURRENCY"),{programId:a}=Xs(),i=r((()=>!Object.keys(qo).includes(a||"")||"38"===a),[]),l=r((()=>i?Ho:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(Wo,{label:"Валюта",orientation:"horizontal",items:l,...e(t?.name??"")})})),Go=(e,t)=>{if(!t)return null;const n=Zo(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")}},Ko=(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},Xo=(e,t)=>{const n=Zo(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},Jo=(e,t,n)=>{const a=Zo(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},Zo=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Qo=(e,t,n)=>{const{okved:a,okopf:i,inn:l,organizationName:r}=ec(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(mr(n.data?.address));const s={amountWorkers:Ko(e?.amountWorkers,n.data?.employee_count),employerActivities:Go(e?.employerActivities??[],a),organization:Jo(e?.organization??[],i,l),employerOrganization:Xo(e?.employerOrganization??[],i),organizationName:r};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},ec=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),tc=d((({field:e,input:t})=>{const n=As(),{employerActivities:a,employerOrganization:r,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=l((t=>{Qo(n,e,t)}),[]);return i((()=>{d&&m&&a&&r&&s&&c&&(async()=>{const t=await(async e=>{const t=await nr({url:"suggest/party",query:e});return t?.[0]})(m);t&&Qo(n,e,t)})()}),[a,r,s,c]),o(sr,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u})})),nc=d((({field:e,input:t})=>o(La,{label:"Дата доставки",...e(t?.name??"")}))),ac=d((({field:e,input:t})=>{const{data:n}=Cs("COURIER_DELIVERY_TIME"),a=r((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(Wo,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),ic=d((({field:e,input:t})=>o(sr,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),lc=d((({field:e,input:t})=>o(La,{label:"Дата выдачи",...e(t?.name??""),disabled:t?.filledByEsia&&ui(e,t?.name??"")}))),rc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,t?.name??""),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),sc=d((({field:e,input:t})=>o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),oc=d((({field:e,input:t})=>o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),cc=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),dc=d((({field:e,input:t})=>{const{data:n}=Cs("EDUCATION_LEVEL");return o(Ms,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),mc=d((({field:e,input:t})=>o(sr,{label:"Электронная почта",...e(t?.name??""),...t}))),uc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_ACTIVITY_TYPE"),a=As();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(Ms,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),hc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_KIND"),a=As();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(Ms,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),pc=d((({field:e,input:t})=>{const{data:n}=Cs("EMPLOYMENT_INFO_UNITED");return o(Ms,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),gc=d((({field:e,input:t})=>o(sr,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),fc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ta(Number(n),0,5)))),[]);return o(sr,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n})})),xc=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(sr,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),yc=d((({field:e,input:t})=>{const{data:n}=Cs("MARITAL_STATUS");return o(Ms,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),bc=d((({field:e,input:t})=>o(sr,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t}))),vc=d((({field:e,input:t})=>{const{data:n}=Cs("HOUSE_TYPE");return o(Ms,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Nc=d((({input:e})=>o(Us,{__html:e?.label}))),wc=d((({field:e,input:t})=>o(sr,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),Cc=d((({field:e,input:t})=>o(sr,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t}))),Sc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,kc=(e="")=>Sc.test(e),Ic=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()||""))},Tc=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,r=e("latinName")?.onChange;i((()=>{r?.(Ic(a))}),[]);const s=l((e=>{(kc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(kn,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Rc=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,r=e("latinSurname")?.onChange;i((()=>{r?.(Ic(a))}),[]);const s=l((e=>{(kc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(kn,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Pc=d((({field:e,input:t})=>o(sr,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),Bc=d((({field:e,input:t})=>o(sr,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),Ec=d((({field:e,input:t})=>o(La,{label:"Дата рождения",...e(t?.name??""),disabled:t?.filledByEsia&&ui(e,t.name??"")}))),_c=d((({field:e,input:t})=>o(sr,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Dc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Ac=d((({field:e,input:t})=>o(Wo,{orientation:"horizontal",items:Dc,...e(t?.name??"")}))),Mc=d((({field:e,input:t})=>o(sr,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&ui(e,t?.name??""),...e(t?.name??""),...t}))),Oc=d((({field:e,input:t})=>o(sr,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),zc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_TYPE"),a=As();return i((()=>{n&&(a.organization=n)}),[n]),o(Ms,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Vc=d((({field:e,input:t})=>{const n=As(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),Qo(n,e,t)}),[]);return o(sr,{label:"Наименование организации",...t,...e(t?.name??""),onDaDataChange:a})})),Fc=d((({field:e,input:t})=>o(sr,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Lc=d((({field:e,input:t})=>o(La,{label:"Дата регистрации по месту жительства",...e(t?.name??"")}))),$c=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ta(Number(n),0,100)))),[]);return o(sr,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const jc=e=>e.map((e=>({key:e.type,text:e.name}))),Uc=e=>e?.key,qc=d((({field:e,input:t})=>{const[n,l]=a([]),s=Ds();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await bs("/public-data/creditProgramConditions","POST",{creditProgramId:e});return jc(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(Wo,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:Uc,parse:e=>n?.find((t=>t.key===e))})})})),Wc=d((({field:e,input:t})=>{const{data:n}=Cs("POSITION");return o(Ms,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Hc=async()=>await bs("/public-data/regionsCardDelivery","GET")||void 0,Yc=d((({field:e,input:t})=>{const{data:n}=Cs("REGION_RF"),{data:a}=Hn("regionsDelivery",Hc),{programId:i}=As(),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(On,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:s,...e(t?.name??""),onChange:u})})),Gc=d((({field:e,input:t})=>o(sr,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Kc=["male","female"],Xc=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Jc=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 nr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return Kc.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Wo,{label:"Пол",orientation:"horizontal",items:Xc,...e(t?.name??"")})})),Zc=d((({field:e,input:t})=>o(ri,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),Qc=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Ca(e,"___-___-___ __")):t?.(Ca(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(wn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),ed=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(Qc,{"aria-label":t,label:xn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),Sn(a)]}))),td=d((({field:e,input:t})=>o(ed,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),nd=d((({field:e,input:t})=>o(sr,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&ui(e,"surname"),...e(t?.name??""),...t}))),ad=d((({field:e,input:t})=>o(sr,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),id=d((({field:e,input:t})=>o(sr,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),ld={$ref:"/wcms-resources/delivery-cities-data.json"},rd={limitedBirthday:Ec,name:Oc,surname:nd,middleName:Mc,email:mc},sd={processPersonalDataFlg:eo,consentProviderFlg:eo,consentOthersFlg:eo,consentInformFlg:eo,consentPfrFlg:eo,consentInformMaterialsFlg:eo,consentPhotoFlg:eo,consentFATCA:eo},od={organization:zc,organizationAddress:dr,organizationPhone:Ti,organizationName:Vc,legalForm:Bc,generalSeniority:bc,lastJobExperience:Cc,experience5Years:fc,jobsNumber:wc,beginDate:Ls,addressFact:hr,addressRegistration:dr,addressRetail:ks,addressMatch:pr,sex:Jc,limitedBirthday:Ec,birthPlace:$s,education:dc,housing:vc,amountWorkers:Os,employment:pc,employerActivities:uc,employerOrganization:hc,positionOrganization:Wc,familyStatus:yc,familyMembers:xc,children:Hs,dependents:ic,totalIncome:ad,expenses:gc,snils:td,conscription:Ks,armyIdFlg:zs,dulSerie:oc,dulNumber:sc,dulIssueDate:lc,dulSubdivisionCode:cc,dulIssuedBy:rc,participantDateRegistration:Lc,retirementIncome:Gc,otherIncome:Fc,wages:id,mandatoryPayments:_c,bankruptcyFlg:Fs,shareholderFlg:Zc,legalEntityName:Pc,creditInRshbCd:Uo,bankEmployeeCode:Vs,partInBusiness:$c,regionRetail:Yc,infoCard:Nc,calculator:Fo,confirmationIncome:Gs,inn:tc},cd={addressCourier:e=>o(ur,{...e,source:ld}),paymentSystem:qc,currency:Yo,cardCategory:qs,codeWord:Ys,methodObtain:Ac,deliveryDate:nc,latinName:Tc,latinSurname:Rc,deliveryTime:ac},dd="Согласие на все документы",md=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(Vi(t(e?.name),Gi).error)))),[e]),[d,{toggle:m}]=ln(!0);return o("div",{className:"w-fit",children:c(Cr,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ti,{text:dd,value:a,onChange:i},n),Sn(s?"Отметьте все обязательные соглашения":"")]}),o(wl,{embedded:!0,ariaLabel:dd,onClick:m,children:o(Nr,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(Sr,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(fl(t,{},sd))})]})})})),ud=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=hd(t||[],n);return a.length>2?c("div",{children:[i.map(fl(e,{},{...rd})),o(md,{inputs:a,field:e})]}):(t||[])?.map(fl(e,{},{...rd}))},hd=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(er[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(er[t]).includes(String(e))))}),pd=(e,t=!1)=>o(Dl,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),gd=e=>vs("/user-data/updateUserProfile","PUT",e),fd=e=>vs("/user-data/updateUserTask","PUT",e),xd=d((({className:e,seconds:t})=>o("span",{className:e,children:yd(t)}))),yd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),bd=(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 vd({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}=bd(r,t);return l((e=>{i.current=e,o()}),[])}const Nd={width:"103",height:"21"},wd={"bg-white":"color",transparent:"white"},Cd={"bg-white":"text-primary-main",transparent:"text-white"},Sd=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:wd[e]},className:Cd[e],width:n?.width,height:n?.height}),kd={"bg-white":"text-primary-text",transparent:"text-white"},Id=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:[Sd(l,n?.image,Nd),r?a??o("div",{className:"ml-s",children:o(Oe,{font:"font-medium",color:kd[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Td=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=ln(!1),x=l((async()=>{g();var e;await(e={captchaText:d},vs("/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=>vs(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(y,[]),o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Id,{}),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(wl,{className:"w-8",embedded:!0,onClick:y,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(wn,{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(wl,{version:"secondary",onClick:close,children:"Вернуться"}),o(Dl,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),p?o(_l,{blur:!1}):null]})})})),Rd=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:Pd(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Pd=(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 ${vn(!n||!a)} rounded-md caret-transparent outline-none`},Bd=d((({isDisabled:e,onClick:t,text:n})=>o(wl,{type:"button",onClick:t,disabled:e,children:o(Oe,{font:"font-normal",children:n})}))),Ed=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},_d=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,{setTrue:o,setFalse:c}]=ln(!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=>bs("/sms/checkCode","POST",e).then(Ed))({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}},Dd=d((({phone:e,code:t=!0,withDescription:n=!0,codeLength:r=4,consents:s,onSuccess:d=yn,onClose:m=yn})=>{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}=_d({values:u,onSuccess:d}),C=pn(Td),S=Wt(e),I=vd({seconds:y,onTick:v}),T=l((async()=>{var e;await(e={phoneNumber:S,smsCodesSetName:{key:"AUTHENTICATION"}},vs("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(w(0),v(180),I(180),N(!0)):C.open({phoneNumber:S,sendCode:T})}),[S,I,m]);return i((()=>{T()}),[]),o(Sl,{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(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Rd,{values:u,setValues:h,errorText:f,hasError:g}):null,Md(y,T),n?c(Ae,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:s?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Ad(b,p),x?o(_l,{blur:!1}):null]})})})),Ad=(e,t)=>o(Bd,{text:"Далее",isDisabled:e,onClick:t}),Md=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(xd,{className:"ml-1",seconds:e})]}):o(wl,{embedded:!0,onClick:t,children:o(vr,{children:"Получить новый код"})}),Od={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},zd={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Vd=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Fd=d((({onSubmit:e=yn,onClose:t=yn})=>{const[n,i]=a(""),[r,s]=a(!1),d=Zs(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),s("REFUSE"===e)}),[]),h=r?zd:Od;return o(Sl,{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(dl,{className:"whitespace-normal",orientation:"horizontal",items:Vd,value:n,onChange:u}),o(wl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Ld=d((({title:e,icon:t,description:n,onClick:a=yn})=>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(Oe,{font:"font-medium",size:"text-s",children:e}),n?o(Oe,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),$d={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},jd={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Ud={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},qd=e=>Object.entries(e).reduce(((e,[t,n])=>t in $d?[...e,{contactTypeCd:{key:$d[t]},value:n}]:e),[]),Wd=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in jd){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:jd[t]},...a}]}return e}),[]),Hd=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:Yd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(f).reduce(((e,[t,n])=>t in Ud?[...e,{incomeTypeCd:{key:Ud[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p};var f},Yd=(e,t)=>(Number(e??0)+Number(t??0)).toString(),Gd={WORK:"Работаю",RETIREE:"Пенсионер"},Kd={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},Xd={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"},Jd={...Xd,amur_card:"14",owner_card:"13",travel_card:"15"},Zd=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:Yd(t,s),additionalIncome:a,otherIncome:i,otherPayments:l,rentalIncome:r,retirementIncome:s}},Qd=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}},em=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}},tm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,nm=d((function({task:e,isFromLead:t=!1,sendAspects:n=yn,onClose:a=yn}){const i=As(),r=Qt(),{participants:s,creditProgram:d,createdDate:m="",id:u}=e,h=Jd[d.code],p=Boolean(Xd[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:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:P,organizationTypeCd:B,organizationKindCd:E,employeesNumberCd:_,opf:D,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:tm(i),cardCategory:tm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:tm(b),participantDateRegistration:v,housing:tm(N),beginDate:k,employment:tm(I,Gd),organizationName:T,inn:R,employerActivities:tm(P),organization:tm(B),employerOrganization:tm(E),amountWorkers:tm(_),legalForm:D,generalSeniority:A?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:z?.toString(),positionOrganization:tm(V),familyStatus:tm(F),children:L?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:tm(U),confirmationIncome:tm(Q,Kd),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:tm(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:r,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...Zd(q),...Qd(S),...em(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(Sl,{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(Ld,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:m?`Черновик от ${qt(new Date(m))}`:"",onClick:y}),o(Ld,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?a:b})]})]})})})),am=d((function({onClose:e=yn}){const t=Qt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(Sl,{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(wl,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(wl,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),im=d((({onClose:e})=>{const t=Qt(),n=As(),a=l((async()=>{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},bs("/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(Sl,{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(wl,{type:"button",onClick:a,className:"w-full md:w-auto",children:"Заполнить через Госуслуги"}),o(wl,{type:"button",version:"secondary",onClick:i,className:"w-full md:w-auto",children:"Пропустить"})]})]})})})),lm=()=>{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")}},rm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),sm=({programId:e,nextStepLink:t,productType:n,esiaError:i,data:r})=>{const[s,{setTrue:o,setFalse:c}]=ln(!1),[d,m]=a(),u=(()=>{const e=Xs();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=an();return l(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});Zt({aspectsAttributes:rm(e,i),aspects:t,ev:{}})}),[e])})({data:r}),p=Qt(),g=(e=>{const{open:t}=pn(im),n=Qt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(t),f=(e=>{const{open:t}=pn(Fd),n=pn(Dd),a=t=>async n=>{try{t&&await gd({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=pn(Dd),y=(()=>{const{open:e}=pn(nm),{open:t}=pn(am);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:Wt(a.phone)}},bs("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(t&&a?.phone){const i=async()=>{await cm({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 bs("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:t,programId:e});if(n){const e=await(async e=>await bs("/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=om(a,n);x.open({phone:a?.phone,consents:r,onSuccess:l}),c()}}catch{m(!1)}}),[i])}},om=(e,t)=>{const n=er[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},cm=async({programId:e,profileId:t,formData:n,productType:a,saveUserData:i,sendAspects:l})=>{let r,s;const o=dm(n,a);await gd(((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&&qt(r,!0),email:o,phone:Wt(s),...n}}})(t,n,o));try{if("debitCard"===a){const t=await(async e=>await bs("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t)=>{const{name:n,surname:a,middleName:i,limitedBirthday:l,phone:r,email:s}=e;return{task:{taskSource:Qt().origin,creditProgram:{code:qo[t]},participants:[{birthDate:l&&qt(l,!0),midname:i,name:n,surname:a,participantContacts:qd({phone:r&&Wt(r),email:s})}]}}})(n,e));r=t.taskId,s=t.participantId}else{const a=await(async e=>await bs("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});r=a.taskId,s=a.participantId,await fd((({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:Qt().origin,id:t,participants:[{birthDate:s&&qt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:qd({phone:o&&Wt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:lm()}}})({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)}},dm=(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}},mm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},um=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,mm[e.name||""]])))}},hm=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}},pm=e=>Math.floor(e/12),gm=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:{...Ns()},credentials:"include",body:a}).then((e=>e.json())))})(e,t,n))).then((e=>a.push(e)))},fm=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},xm=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},ym=({inputs:e,nextStepLink:t,productType:n,setEsiaError:a})=>{const s=Qt(),[o,{setTrue:c,setFalse:d}]=ln(!1),m=Xs(),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((()=>um(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},bs("/esia/updateProfileEsia","POST",r));if(a&&m?.taskId){const e=await(async(e,t,n)=>{n?xm(e):fm(e);const{profile:a,addInfo:i,document:l,addressRegistration:r,addressFact:s,esiaAdditionalDocument:o}=e,c=[];return n||(await gm({document:o.pdfFileWorkbook,taskId:t,category:"CONFIRMING_INCOME_DOC",files:c}),await gm({document:o.pdfFilePayout,taskId:t,category:"CONFIRMING_EMPLOYMENT_DOC",files:c})),{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Si(a.phone),email:a.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:hm(r),addressFact:hm(s),esiaAccountTypeCd:a.esiaAccountType,...!n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:pm(o.workLengthInFiveYears).toString(),generalSeniority:pm(o.workLength).toString(),lastJobExperience:pm(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=js(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}]},bm=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,productType:s="credit",data:d,...m})=>{const[h,{setTrue:p}]=ln(!1),g=r((()=>(e=>{const t=er[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((()=>Ji(f,Ql)),[f]),[y,{isLoading:b}]=ym({inputs:f,nextStepLink:a,productType:s,setEsiaError:p}),{isSending:v,ok:N,handleSubmit:w}=sm({programId:n,nextStepLink:a,productType:s,esiaError:h,data:d}),[,{field:C,onSubmit:S}]=un(y,{formValidator:x,onSubmit:w}),k=pn(kl);return i((()=>{void 0!==N&&k.open({ok:N})}),[N]),o(hn,{className:u("container space-y-m",e),title:t,...m,children:c("form",{onSubmit:S,className:"space-y-m relative",children:[b?o(_l,{blur:!1}):null,g.map(((e,t)=>c("div",{className:u(xl(e.columns),"grid gap-x-m"),children:[yl(e.title),ud({field:C,inputs:e?.inputs},s)]},`section-${t}`))),pd(l,v),h?o(Oe,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})})})),vm=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(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Nm=e=>e%2!=0,wm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Cm=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}]=ln(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(wm),children:[B(l,{...i.options,parent:n}),Nm(l.length)?o(jt,{className:"col-span-6",...i}):null]}),c(Cr,{children:[c(Sr,{className:u(wm),isUnfolded:s,children:[B(r,{...i.options,parent:n}),Nm(r.length)?o(jt,{className:"col-span-6",...i}):null]}),o(wr,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!r?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Sm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",km=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Im=10;function Tm(e=0){const t=Math.round(e*Im);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Rm=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:Tm(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})})),Pm=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Bm=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(_m(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Em(c,v):{},...N?km(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(Rm,{className:u(m,i?Pm[i-1]:"",{"h-full":N},t),style:w?Em(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),Em=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),_m=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Dm={"horizontal-list":"w-6","vertical-list":"h-6"},Am=({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?Dm[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Mm=({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))},Om=e=>t=>e.scrollWidth/t,zm=e=>(t,n)=>{e.scrollBy({left:n*Om(e)(t),behavior:"smooth"})},Vm=({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?[ko()(i),Co()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?zm(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?zm(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}]},Fm={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Lm=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]=Vm({itemCount:s.length}),g=$m(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(Bm,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Mm({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Fm[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Am({activeIndex:t,onClick:f,listType:a}))}):null})),$m=(e=!1)=>({behavior:e?"auto":"smooth"}),jm=d((({className:e,name:t,...n})=>o(wl,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),Um=d((e=>o(jm,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),qm=d((e=>o(jm,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Wm="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Hm=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?Ym(t):null,l?o(Um,{wcmsIgnore:!0,className:u(Gm(i),m?"left-1":"left-0"),onClick:s}):null,r?o(qm,{wcmsIgnore:!0,className:u(Gm(i),m?"right-1":"right-0"),onClick:d}):null]})})),Ym=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Wm,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Wm,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Gm=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Km=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]=Vm({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Bm,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Hm,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Lm,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Xm=({blocksToRender:e,...t})=>o(Km,{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",Sm(!0)),children:R(e,t)},String(n))})}),Jm=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Zm(n,t),o(Cm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Zm(n,t),Xm({...a,blocksToRender:t})]});default:return null}})),Zm=(e,t)=>e&&!t.length?o(vm,{...e}):null,Qm=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),eu=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(gi,{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))))),tu=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,Qm(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(nu(a)).filter(Boolean))]}),n?o("div",{children:o(wl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),nu=e=>([t,n])=>{const a=n?.type;return"array"===a?au(t,e)(n):null},au=(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(Oe,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(eu,{items:a,multiple:!n?.single,...t(e)})]},e)},iu=e=>e;function lu(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const ru=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,su=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>ru(t[e])||ru(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>ru(t[e])||ru(n[e])||ou(t[e])<=ou(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>ru(t[e])||ru(n[e])||ou(t[e]?.min)>=ou(n[e]?.min)&&ou(t[e]?.min)<=ou(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>ru(t[e])||ru(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>ru(t[e])||ru(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),ou=e=>Number(e||0),cu=(e,{block:t,page:n,normalize:a=iu})=>{const i=t?.blocks||[],[l,s]=un(e),o=r((()=>lu(i,i.map((e=>zt(e.content,n?.fallback))))),[i,n?.fallback]),c=l===e?i:((e,t)=>(n=iu)=>e?.filter((([,e])=>su(t,n(e)||{}))).map((([e])=>e)))(o,l)(a);return[l,{blocksToRender:c,blocksWithProps:o},s]},du={},mu={},uu=Lt((({className:e,filtrationSchema:t=du,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=cu(mu,{block:i.block,page:i.options?.page}),d=o(_n,{className:"w-64",label:n?.title,options:hu(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>hu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(tu,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(wl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Jm,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),hu=e=>lu(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pu=(e=!1)=>e?"text-left":"text-center",gu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},fu=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",gu[t],e),style:{width:l,height:l},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),xu=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:pu(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(yu)}):null]})})),yu=({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(fu,{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(Oe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Ae,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),bu=(e,t,n)=>{return o(Km,{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(Oe,{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(Oe,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},vu=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(k,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?bu(e,0,t):null]}))),Nu={start:"justify-start",center:"justify-center",end:"justify-end"},wu=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Nu[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:qe(e)})})),Cu=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Oe,{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:Ge(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]})]}))),Su=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Oe,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),ku=({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(Cu,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(so,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Su,{title:e,...r}),Iu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Tu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ru=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Iu.prefMonthsNum,prefTravelBonusRate:l=Iu.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||Tu,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Pu=Lt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=un({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Ru(r,n);return o(no,{className:e,title:t,...l,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),bo({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?ku({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:lo,children:[f>=0?o(so,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(a,{isVertical:!0}),po(i)]})]})})})),Bu=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Eu=e=>xo({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),_u=" (c капитализацией)",Du=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:lo,children:[o(so,{title:`Доход в конце срока${l?_u:""}`,value:e,postfix:n,prefix:"+"}),o(so,{title:`Сумма в конце срока${l?_u:""}`,value:t,postfix:n}),qe(a,{isVertical:!0}),i?.map(po)]}),Au={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Mu={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ou=(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?Au[e?.rateType]:"",{data:n}=Hn(t?`${Ht}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&zu(s,e)&&Po(a,["minSum","maxSum"],e)&&Po(n,["minDays","maxDays"],e)))||Mu,{rate:m}=d,u=Vu(m,e),h=a+u,p=c||[Mu];return{...d,...Ro(["minSum","maxSum"],p),...Ro(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},zu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Vu=(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)},Fu=Lt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=un({moneyValue:uo(r,1e5),daysValue:ho(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Ou(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(no,{className:e,title:t,...d,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({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(ra,{items:[`От ${Bu(b.min||0)}`,`До ${Bu(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Lu(p,h),Eu({...h("isMonthlyInterestPayment")})]})]}),ku({rate:x,depositeName:y,isShowDepositeName:l}),Du({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Lu=(e,t)=>c("div",{className:"space-y-s",children:[o(Oe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ti,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ti,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),$u=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},ju={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Uu=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Hu(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=>[Wu({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Wu({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Wu({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Wu({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Po(a,["minSum","maxSum"],t),Po(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||ju,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=qu(p,e),f=a+g,x=t||[ju];return{...m,...Ro(["minSum","maxSum"],x),...Ro(["minMonths","maxMonths"],x),availableMonths:$u(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}},qu=(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)},Wu=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Hu=(e,t)=>e+Math.round((t-e)/2),Yu=(e="rub")=>"rub"===e,Gu=(e,t)=>{const{minMonths:n,maxMonths:a}=Ro(["minMonths","maxMonths"],Zu(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ta(i,n,a)}},Ku=(e,t)=>{const{minSum:n,maxSum:a}=Ro(["minSum","maxSum"],Zu(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ta(i,n,a)}},Xu=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Ju=e=>{const t=Yu(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Zu=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Qu=(e,t=!1)=>t?xo({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,eh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[th(t("isReplenish"),e,a),nh(t("isWithdrawn"),e,a),ah(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Eu(t("isMonthlyInterestPayment")):null,Qu(t("isRemoteRegistration"),e.isShowRemoteRegistration),ih(t("extraPercent"),n),e.isShowNewClient?o(ti,{text:"Новый сберегатель",...t("isNewClient")}):null]})},th=(e,t,n=!1)=>t.isShowReplenish?xo({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,nh=(e,t,n=!1)=>t.isShowWithdrawn?xo({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,ah=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,ih=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Oe,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(_n,{options:t,...e})]}):null,lh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},rh={text:"₽",key:"rub"},sh={text:"Без учета надбавки",key:"0"},oh=Lt((({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))??[rh],g=l((e=>t=>e?{...t,...Ju(t),...Ku(t,e),...Gu(t,e),...Xu(t,e)}:t)(h),[h]),[f,{field:x}]=un({moneyValue:uo(d,2e4),monthsValue:ho(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:rh,extraPercent:d?.extraPercent??sh},{normalizer:g}),y=hh(x),b=Boolean(x?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=Zu(h,y),w=Uu(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=l((()=>{vo({field:x,defParams:co(N,b,v),calcParams:w,monthsValue:"minMonths",map:lh})}),[x,h,v]);i((()=>{!Ao(d)&&N&&T()}),[d,h]);const R=x?.("extraPercent")?.value?.key,P=uh(C,R),B=C===co(N,b)?.rate&&R===v?.at(-1)?.key;return o(no,{className:e,title:t,...m,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[c("div",{className:"flex gap-m",children:[bo({className:"w-full",title:`Сумма, ${y?.text}`,min:w.minSum,max:w.maxSum,...x("moneyValue"),value:w.moneyValue,postfix:y?.text,step:ch(y?.key)}),h&&h?.length>1?o(On,{label:"Валюта",options:p,...x("currency")}):null]}),go({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...x("monthsValue"),value:w.monthsValue}),eh({...w,...s},x,v)]}),ku({rate:P,children:mh(T,B)}),Du({income:S,finalSum:k,buttons:[...a,dh(n?.buttons,I)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),ch=(e="")=>Yu(e)?1e3:100,dh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},mh=(e,t=!1)=>t?null:o(wl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),uh=(e,t)=>Number(e)+Number(t??0),hh=e=>e?.("currency")?.value??rh,ph=e=>gh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&gh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),gh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],fh={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},xh=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[fh],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ph({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=To(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=To(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>ph({row:e,userInputParams:t,paramsViewSettings:n})&&Po(a+r,["minSum","maxSum"],e)&&Po(l,["minSumOld","maxSumOld"],e)&&Po(r,["minSumExtra","maxSumExtra"],e)&&Po(i,["minMonths","maxMonths"],e)))||fh)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=No(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}},yh=Lt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...s})=>{const[d,{field:m}]=un({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=xh(d,n,l),p=r((()=>oo(n?.rateRows)?.rate),[n?.rateRows]),g=yo({...m("isAnnuity")});return o(no,{className:e,title:t,...s,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),bo({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),go({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),bh({...h,...l},m),h.isExtraMoney?bo({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(lo,"@4xl:w-1/2"),children:[o(so,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(so,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(so,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(so,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),qe(a,{isVertical:!0}),po(i)]})]})})})),bh=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ti,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),vh=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=ea(e,{normalize:(e=i)=>n&&a?String(ta(Number(Nh(e)),n,a)):Nh(e),format:Ge(r)}),d=l((e=>t&&t(Nh(e))),[t]);return o(wn,{onChange:d,...s,...c})})),Nh=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),wh=d((e=>o(vh,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Oe,{size:"text-xl",font:"font-light",children:"₽"})})}))),Ch=new Ps;function Sh(){return Es(Ch)}Ts(Ch,new Rs(globalThis?.sessionStorage));const kh={private:"p2p/registerP2P",business:"b2c/registerB2C"},Ih=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Sl,{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(k,{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]})})},Th=e=>{const t=pn(Ih),n=Sh(),a=Qt(),i="private"===e?"p2p":"b2c";return l((async({amount:l})=>{const r=await(async(e,t)=>{const n=Qt(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Ht}/payment/${kh[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])},Rh={amount:1500},Ph=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:l="private",...r})=>{const[s,{setValue:d}]=ln(!1),m=Th(l),[{amount:h},{field:p,onSubmit:f}]=un(Rh,{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(wh,{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(Dl,{className:"w-full mt-lg",disabled:s,children:a.text}):null]})]})})),Bh=({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})]}),Eh="relative h-full",_h={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Dh=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Oh),r=n?{defaultPadding:"p-6xl pb-m"}:{};return E({...a,renderProps:(n,a,i)=>c("div",{className:Ah(n,{someCardsHighlighted:l}),children:[R(n,a,{className:Mh(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Oh(n)?Bh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Ah=(e,{someCardsHighlighted:t})=>u(Eh,t&&(Oh(e)?"pt-3xl":"pt-3xl sm:pt-16")),Mh=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Eh,"min-w-80",_h[a],t&&(Oh(e)?"pt-3xl sm:pt-16":"pt-3xl"),Sm(n),n&&"h-full"),Oh=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,zh=Lt((({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(Km,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Vh(s?.block?.blocks):[],hasBlur:!0,children:Dh({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Vh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Fh="z-10 border border-solid w-full h-full",Lh=u(Fh,"absolute hidden @xl:block border-transparent"),$h=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(Lh,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Lh,"top-6 right-8 bg-green")}),o("div",{className:u(Lh,"top-3 right-4 bg-green-light")}),c("div",{className:u(Fh,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),qe([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),jh={black:"bg-black",white:"bg-white"},Uh=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(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:qe([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(Oe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(qh)]}):null,i?c(Oe,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),qh=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${jh[e]}`},String(t)),Wh=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})),Hh=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(k,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Yh(a):null]})}))),Yh=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(Wh,{...e},String(t))))}),Gh=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})})),Kh=[{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"}}],Xh=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=>Kh.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ue(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},Jh(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:qe(m,{className:Zh(s??!1,i??!1,n),buttonClassName:h})}),r?o(Oe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Jh=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Zh=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Qh=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(Gh,{href:i,target:m,className:"h-full",data:rm(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...tt(Ue(l)?o(ie,{image:l}):null,x),buttons:d.length?o(Xh,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(je,{benefits:f}),s?o(Ae,{__html:s,isDotted:r,itemSize:"list-s"}):null,ep(a,p)]})})}))),ep=(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,tp=new he,np=(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(Oe,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Oe,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:qe(i)}):null]},String(t))},ap=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(np)),[h]),[b,v]=r((()=>m>0?[y.slice(0,m),y.slice(m)]:[y,[]]),[m,y]),[N,C]=a(!1);i((()=>tp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=l((()=>{tp.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(Cr,{children:[c("div",{children:[b,o(Sr,{isUnfolded:N,children:v})]}),h.length>=m?o(wr,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:b})]})})),ip=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=Qt();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await vs("/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)},lp=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]})]}))),rp=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(lp,{step:a,showPercentage:!1})]})})}));var sp;!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"}(sp||(sp={}));const op=e=>bs("/user-data/getTaskStatus","POST",e),cp=async e=>{const t=await bs("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},dp=d((({title:e,interval:t=0,onEnd:n=yn})=>{const[i,l]=a(t);vd({seconds:t,onTick:l,onEnd:n});const r=100-(t-i)/t*100;return c("div",{children:[e?o(k,{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(xd,{seconds:i})})]})]})})),mp=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:l,buttonText:r,interval:s,onExpire:d=yn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(dp,{interval:s,onEnd:d}):null]}),o(up,{title:n,items:a}),o(up,{title:i,items:l,countColumns:!0}),r?o(Ml,{href:"/natural",text:r,version:"primary",className:"w-full mt-lg"}):null]}))),up=({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(Oe,{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",xl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:hp(e)},t)))}):null]})]}):null},hp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Oe,{color:"text-secondary-text",size:"text-l",children:e}),o(Oe,{color:"text-primary-text",size:"text-xl",children:t})]}),pp=d((()=>o(mp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),gp=d((({onExpire:e})=>{const{statusInfo:t}=As();return o(mp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),fp=d((()=>{const{statusInfo:e}=As(),t="courier"===e?.methodObtain;return o(mp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),xp=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:yp(e),buttonText:"Вернуться на главную"})})),yp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:qt(e?.deliveryDate)}]):t},bp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],vp=d((()=>{const[e,t]=a(sp.process),{taskId:n}=As();i((()=>{(async()=>{for(const e of bp)await cp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await op({taskId:n});a&&a?.statusCd!==sp.process&&(e(),t(a.statusCd))}),[n]);bd(r,3e4);const s=l((()=>t(sp.rework)),[]);return Np(e,s)})),Np=(e,t)=>({IN_PROCESS:o(gp,{onExpire:t}),CANCELLED:o(pp,{}),FAILED:o(pp,{}),DRAFT:o(pp,{}),APPROVED:o(xp,{}),PRE_DECISION:o(xp,{}),REVISION:o(fp,{})}[e]||o(fp,{})),wp=e=>(t,n)=>t.filter((e=>e)).map((t=>[Cp(n,e),Sp(t,e),Rp(t,e),kp(t,e),Ip(t,e),Tp(t,e)].some(Boolean)?{...t,required:!1}:t)),Cp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Sp=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,kp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ip=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Tp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Rp=({name:e},t)=>"snils"===e&&Pp(t),Pp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Bp={...od,...cd},Ep=({field:e,inputs:t,params:n})=>t.map(fl(e,n,Bp)),_p=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l,condition:r},s)=>{const o=wp(Dp(t))(e,n);return c("div",{className:u(xl(i),"grid gap-x-m"),children:[Tp({condition:r},Dp(t))?null:yl(l),Ep({field:t,inputs:o,params:a})]},`section-${s}`)})),Dp=e=>t=>e(t)?.value,Ap=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(wl,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(Dl,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Mp=(e,t,n)=>({...n[e],...t,limitedBirthday:Op(t?.limitedBirthday),dulIssueDate:Op(t?.dulIssueDate),participantDateRegistration:Op(t?.participantDateRegistration),beginDate:Op(t?.beginDate),deliveryDate:Op(t?.deliveryDate)}),Op=e=>{try{return e?new Date(e):void 0}catch(e){return}},zp=[{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}],Vp=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...zp,{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Fp=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Lp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},$p=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:qt(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:qd({organizationPhone:p&&Wt(p)}),participantAddresses:Wd({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?x:""}},jp=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:qt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:qt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:qt(g,!0),homeMatchFlg:b,houseTypeCd:f,participantContacts:qd({phone:Wt(l),email:r}),participantAddresses:Wd({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Up=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},qp=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Wp=(e,t)=>{switch(e){case 0:default:return{};case 1:return jp(t);case 2:return $p(t);case 3:return Hd(t);case 4:return Fp(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Wd({addressCourier:t})}:{}})(t)}},Hp=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=ln(!1),o=5===e,c=As(),d=r((()=>Mp(e,c.leadForm,Vp)),[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 fd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Qt().origin,id:t,...qp(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Wp(i,a)}],...Lp(a),...Up(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]},Yp=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=r((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=l((t=>Ji(wp((e=>t[e]))(s,e),Ql)(t)),[s]),[m,u,h]=Hp({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=un(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[_p({sections:t,field:p,step:e}),o(Ap,{isSending:h,step:e,onPrevStep:n})]})})),Gp=[[{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"}]}]],Kp=[{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"]}}]}],Xp=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],...Gp,Kp],Jp=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Zp=d((({className:e,...t})=>{const[n,r]=a(0),d=s(null),m=l((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(ip,[]);const u=l((()=>{r((e=>Math.min(e+1,6))),m()}),[]),h=l((()=>{r((e=>Math.max(e-1,0))),m()}),[]),p=Xp[n],[f,{setTrue:x}]=ln(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(rp,{stepsTitles:Jp,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(vp,{}):o(Yp,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),Qp=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(lp,{step:a,showPercentage:!1})]})})})),eg=d((()=>o(mp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),tg=d((({onExpire:e})=>{const{statusInfo:t}=As();return o(mp,{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})})),ng=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ag=d((()=>{const{statusInfo:e}=As();return o(mp,{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:"Вернуться на главную"})})),ig=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],lg=d((()=>{const[e,t]=a(sp.process),{taskId:n}=As();i((()=>{(async()=>{for(const e of ig)await cp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await op({taskId:n});a&&a?.statusCd!==sp.process&&(e(),t(a.statusCd))}),[n]);bd(r,3e4);const s=l((()=>t(sp.rework)),[]);return rg(e,s)})),rg=(e,t)=>({IN_PROCESS:o(tg,{onExpire:t}),CANCELLED:o(eg,{}),FAILED:o(eg,{}),DRAFT:o(eg,{}),APPROVED:o(ag,{}),PRE_DECISION:o(ag,{}),REVISION:o(ng,{})}[e]||o(ng,{})),sg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(wl,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(Dl,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),og={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},cg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:og[a?"annuity":"differential"]}},dg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},mg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return jp(t);case 2:return $p(t);case 3:return Hd(t);case 4:return Fp(t);default:return{}}},ug=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...zp,{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],hg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=ln(!1),o=5===e,c=As(),d=r((()=>Mp(e,c.leadForm,ug)),[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 fd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Qt().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...mg(i,a)}],...cg(a),...dg(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]},pg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=As(),m=n?.[d??""],u=r((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=l((t=>Ji(wp((e=>t[e]))(u,e),Ql)(t)),[u]),[p,g,f]=hg({step:e,onNextStep:i,onFinish:s}),[,{field:x,onSubmit:y}]=un(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:y,className:"space-y-m",children:[_p({sections:t,field:x,step:e,params:{calcData:m}}),o(sg,{step:e,isSending:f,onPrevStep:a})]})})),gg=[[{columns:1,inputs:[{name:"calculator"}]}],...Gp,[{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"}]}]],fg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],xg=Lt((({className:e,programsSource:t,...n})=>{const[r,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(ip,[]);const h=l((()=>{d((e=>Math.min(e+1,5))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=gg[r],x=0===r,[y,{setTrue:b}]=ln(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x||y?null:o(Qp,{stepsTitles:fg,step:r,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(lg,{}):o(pg,{step:r,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(r))})]})})})),yg=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,bg=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),vg=1e9,Ng={sum:{min:1e4,max:vg},period:3},wg=Lt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=cu(Ng,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Cg(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Sg(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(tu,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(wh,{label:a?.title,min:500,max:vg,...d("sum",{parse:e=>({min:Number(e),max:vg}),format:({min:e})=>String(e)})}),o(ra,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Jm,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Cg=e=>At((e?.paramsSource?.rateRows||[]).filter(yg).flatMap((e=>bg(e.minMonths,e.maxMonths)))),Sg=e=>At(e.flatMap((e=>e||[])).filter(yg).flatMap((e=>bg(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],kg=[{key:"10"},{key:"50"},{key:"100"}],Ig=({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(_n,{className:"min-w-20",onChange:n,value:{key:String(e)},options:kg,iconVersion:"black"})]})},Tg="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",Rg=(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:Tg,"aria-label":`Страница ${l}`,children:l},String(t)):null},Pg={width:"24",height:"24"},Bg=({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:Eg(1===e),...Pg})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Tg,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Rg),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Tg,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(G,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Eg(e===n),...Pg})})]})},Eg=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",_g=({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(Bg,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Ig,{itemCount:a,onItemCountChange:i}):null]}),Dg=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",bn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Ag=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Dg,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Fa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Fa,{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(wl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Mg=d((({title:e,timestamp:t,publicId:n})=>{const a=fe(),{href:i}=a({href:`${Ht}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[o(fu,{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(Oe,{size:"text-m","font-weight":"font-light",children:qt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Og=`${Ht}/depository`,zg={startDate:void 0,endDate:void 0,query:""},Vg=Lt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=un(zg),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?qt(a,!0):"",r=i?qt(i,!0):"",s=new URLSearchParams(Og);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}=Hn(Og+o,Dt);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(Ag,{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(Oe,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Oe,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Mg,{...e},String(e.publicId)))):o(vm,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(_g,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Fg=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,Lg=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:Fg(a)}),o(k,{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]}))),$g=`${Ht}/region`;function jg(e="Москва"){return Ds().location??{name:e}}function Ug(e="Москва"){const t=Ds(),n=l((async()=>{if(!t.location){const n=await _t($g);t.location=n??{name:e}}}),[t,e]);return Hn($g,n),t}var qg;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(qg||(qg={}));const Wg=new Intl.NumberFormat("ru",{style:"currency",currency:qg.RUB}),Hg=e=>e?Wg.format(e):"",Yg="text-m font-light text-secondary-text ",Gg=`${Yg} text-left`,Kg=`${Yg} pl-5xl text-center`,Xg=`${Yg} pl-5xl text-right`,Jg={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Zg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Gg,children:o(Oe,{size:"text-m",children:"Валюта"})}),o("th",{className:Kg,children:o(Oe,{size:"text-m",children:"Купить"})}),o("th",{className:Xg,children:o(Oe,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Qg)})]}))),Qg=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:Jg[t]},width:"24",height:"24"}):null,o(Oe,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Oe,{size:"text-h6",children:Hg(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Oe,{size:"text-h6",children:Hg(e?.buyExchangeRate)})})]},t)},ef={icon:"GpsIcon"},tf=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(fu,{...ef,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:"Курс указан для заданного офиса"})]})]}))),nf=(e,t,n)=>{const a=Number(af(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)},af=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function lf(e){if(!e)throw new Error("Value should be fulfilled");return e}const rf=e=>t=>{const[,n]=lf(e.find((([e])=>e(t))));return n(t)},sf=e=>rf(e.map((([e,t])=>[e,()=>t])));sf.if=e=>new of(void 0,e);class of{parent;predicate;unit;get entry(){return[lf(this.predicate),lf(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new of(this,e)}then(e){return new of(this.parent,this.predicate,e)}else(e){return rf([...cf(this),[()=>!0,e]])}}const cf=e=>[...e?.parent?cf(e.parent):[],e.entry],df=e=>sf([[e=>e.value!==qg.RUB&&e.oppositeValue!==qg.RUB,()=>e.handleConvert(e.value,qg.RUB)],[e=>e.value===qg.RUB&&e.oppositeValue===qg.RUB,()=>e.handleConvert(e.value,qg.USD)],[e=>e.value===qg.RUB&&e.oppositeValue===qg.RUB,()=>e.handleConvert(e.value,qg.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function mf(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(wn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(_n,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const uf=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||qg.RUB,selectBuy:n?.[0]?.currency?.currency||qg.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:[mf({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:hf(r,d,n),value:r.inputSell,setValue:e=>gf(d,n)(e,r.selectSell,r.selectBuy)}),mf({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:pf(r,d,t),value:r.inputBuy,setValue:e=>ff(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ce,{text:i.text,version:i?.version,...i}):null]})})),hf=(e,t,n)=>a=>{t({selectSell:a}),df({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{gf(t,n)(e.inputSell,a,i)}})},pf=(e,t,n)=>a=>{t({selectBuy:a}),df({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>ff(t,n)(e.inputBuy,a,i)})},gf=(e,t)=>(n,a,i)=>{e({inputSell:af(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(nf(n,l,a===qg.RUB)||"")})},ff=(e,t)=>(n,a,i)=>{e({inputBuy:af(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(nf(n,l,a===qg.RUB)||"")})},xf=`${Ht}/exchangerates`;const yf=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=Hn(xf+`?regionCode=${t}`,Dt);return n||{}}(jg()),l=bf(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:qg.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:qg.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(Zg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(tf,{address:i?.address})]}),o(uf,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),bf=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],vf=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Nf(n))})})),Nf=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},wf=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Cf(e)}))),Cf=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Sf,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Sf=d((({className:e,item:t})=>{const[n,{toggle:a}]=ln(!1);return c(Cr,{className:e,role:"menuitem",children:[c(wl,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(vr,{children:[o(fu,{className:"shrink-0",...t.icon}),o(Oe,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Nr,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(Sr,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(vf,{items:t.items}):null})]})})),kf=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(If)}):null)),If=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Oe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Tf)})]},String(t)),Tf=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Rf(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Rf=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Pf(t)}`,children:o(Oe,{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})}},Pf=e=>e.replaceAll(/\D/g,""),Bf=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}`})})),Ef=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(Oe,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Bf,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),_f=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}`})})),Df=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Oe,{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(_f,{index:t,...e},String(t))))}):null]}))),Af=Lt((({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(wf,{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(kf,{items:r}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(Xh,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ml,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Ef,{title:d,links:l}),o(Df,{links:i,license:h})]})})),Mf=Lt((({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(On,{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(Ml,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:rm(l,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Of={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":`${Of[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...Vf(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"})}))),Vf=e=>e?{"data-test-id":e}:null,Ff="chatbot",Lf="text-page__btn-chat",$f="webchat-js-container:webchat_rshb",jf={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},Uf=async(e,t)=>{const n=e.target;n?.classList.contains(Lf)||n?.classList.add(Lf);globalThis.document.getElementById($f)||await ds(Ff,t)},qf=async e=>{const t=await ds(Ff,`${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($f)?t?.chatOpen?.():(Wf(),t?.render?.($f,!0,"/webchat-api","@container fixed right-0 bottom-0 top-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},Wf=()=>{const e=globalThis.document.createElement("div");e.id=$f,globalThis.document.body.appendChild(e)},Hf=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=jf[e??""];return{load:l((t=>{r&&(n(!0),"business"===e?qf(r).finally((()=>n(!1))):Uf(t,r).finally((()=>n(!1))))}),[r,e]),isLoading:t}})(e);return o(zf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:r,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),Yf={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"},Gf=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",Yf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Kf=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:r})=>{const s=_(),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(Id,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):Xf(g,r),c("div",{className:"flex gap-lg items-center",children:[A.CHAT_BOT?o(Hf,{version:i,iconVersion:m,chat:A.CHAT_BOT,buttonSize:"medium"}):null,o(Gf,{version:i,...a})]})]})})),Xf=(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,Jf={"bg-white":"primary",transparent:"transparent"},Zf=Lt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Jf[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(Kf,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),Qf=(e=!1)=>e?{}:{padding:"p-0"},ex={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},tx=Lt((({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=_();return o(g,{className:u("relative flex flex-col",ex[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",Sm(r)),...Qf(a)}})})}),{childrenTypes:[]}),nx=Lt((e=>o(tx,{...e})),{childrenTypes:[]}),ax=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Nu[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),ix=["байт","Кб","Мб","Гб","Тб","Пб"],lx=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(Oe,{size:"text-l",font:"font-light",children:[t," ",rx(d,m),o(Oe,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),rx=(e,t)=>e||t?o("span",{children:", "}):"",sx=(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))} ${ix[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?cx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(lx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:ox(t),data:n?.data}),o(Ae,{__html:n?.__html})]},String(a))},ox=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,cx=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},dx=d((({href:e,__html:t,target:n,onClose:a})=>c(Sl,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Ae,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ml,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(wl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),mx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=pn(dx),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:[ox(i),o(Oe,{font:"font-light",children:e})]}):null})),ux={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},hx=Lt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=_();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{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",ux[r]),role:"list",children:i.map(px(d,l))}):null]})})),px=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?gx(t)(n,a):sx(e,t)(n,a)},gx=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(mx,{...a,icon:e,href:fx(t)?t?.href:t?.attachment?.src}),o(Ae,{__html:t?.__html})]},String(n)):null},fx=e=>"href"in e,xx=Lt((({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:qe(a,{className:"flex-wrap"}),children:[i?o(Oe,{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(Ae,{__html:r,itemSize:"list-m"}):null,o(Oe,{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]})]})})})),yx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",bx=(e=[],t={})=>e.filter((({content:e={}})=>su(t,e))).length,vx=(e,t)=>e===t;const Nx=(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)))}(vx,((e=vx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),wx=[],Cx={},Sx={primary:"bg-white/30",secondary:"bg-main-divider"},kx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Ix=d((({count:e,version:t="secondary"})=>{const n=Te(),a=n?"bg-main-divider":Sx[t],i=kx[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(Oe,{size:"text-xs",color:i,children:e})})})),Tx=({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})]})]})},Rx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Px={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Bx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Ex={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},_x=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",Rx[a],n?Ex[a]:Bx[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Px[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Tx({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(Ix,{count:m,version:yx(n,a)})}):null]})})})),Dx=d((e=>o(e?.item?.href?Ax:Mx,{...e}))),Ax=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(_x,{...e,tag:"a",item:i,onClick:a})})),Mx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(_x,{item:e,onClick:a,...n})})),Ox=(e,t,n)=>(a,i)=>o(Dx,{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(Ox(a,i,t))}))),Vx={categories:[],extraOptions:[],propertyType:[],stage:[]},Fx=Lt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=cu(Vx,{block:i.block,page:i.options?.page}),f=l(((e=Vx)=>p(e)),[]),x=(({hotFilters:e=wx,filtrationState:t=Cx,blocks:n=wx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Nx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:bx(n,t.filter),version:yx(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(tu,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(Jm,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Lx="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",$x=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(ti,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]],[m,{toggle:u}]=ln(!1);return o("div",{children:e?.length?o("div",{children:c(Cr,{children:[c("div",{children:[o("div",{className:Lx,children:s}),o(Sr,{className:Lx,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(wr,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(wl,{embedded:!0,onClick:n,children:[o(vr,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),jx=(e,t,n)=>{const a=yx("all"===t),i=yx("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(wl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(wl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},Ux=({__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(Ae,{__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(Oe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,qx=(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(Oe,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Wx=()=>{},Hx=e=>"all"===e?"block":"hidden",Yx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=Wx,renderRemoteWorkplaceCard:r=Wx,getBalloon:s=Wx,getBalloonRemoteWorkplaces:d=Wx,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=un(Yr),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=Zr({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:[qx(h,N),m?Ux(m):null,p&&jx(t,w,C),o("div",{className:u("pb-3xl",Hx(w)),children:o($x,{filters:Gx([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:Gr})})]}),o("div",{className:"h-[600px]",children:o(es,{children:o(gs,{points:b,isLoad:n,className:"h-full"})})})]}),c(es,{children:[y.map(l),v.map(r)]})]})})),Gx=e=>Object.keys(Yr).filter((t=>e.filter((e=>Kr[t](e))).length)),Kx=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Xx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Kx(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(Oe,{size:"text-h4",children:Kx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Oe,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Or,{color:"green",children:Kx(s)})})]}),o(kr,{children:o(br,{className:"flex-wrap",children:m?.map(((e,t)=>o(gr,{...e},String(t))))})})]},String(d))},Jx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Kx(t)} №${n}`,body:e.toUpperCase()}),Zx=[];const Qx=async e=>{const t=await _t(e,{method:"GET"});return Array.isArray(t)?t:Zx},ey={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ty={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)},ny=d((({descriptionData:e,className:t})=>{const n=jg(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=Hn(`${Ht}/atms?regionCode=${e}`,Qx);return{data:t||Zx,isLoad:!t&&!n}}(a);return o(Yx,{className:t,filterItems:ay,data:i,isLoad:l,initFilterState:ey,renderCard:Xx,getBalloon:Jx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),ay=(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=>ty[t](e))),n=!a.length||a.some((t=>ty[t](e)));return t&&n}))},iy=({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(Oe,{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(Oe,{size:"text-l",children:e})]}):null]})}),o(kr,{children:ly(t)})]},String(n)):null,ly=e=>c("div",{children:[c(br,{className:"flex",children:[o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Оформление и обслуживание банковских карт"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Инвестиционное и накопительное страхование"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(gr,{label:"Режим работы",className:"max-w-none",children:o(Oe,{children:e})})]}),ry=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),sy={branches:[],remoteWorkplaces:[]};const oy=async e=>await _t(e,{method:"GET"})||sy,cy=d((({className:e})=>{const t=jg(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Hn(`${Ht}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,oy);return{data:t||sy,isLoad:!t&&!n}}(n);return o(Yx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:qr,renderRemoteWorkplaceCard:iy,getBalloon:Hr,getBalloonRemoteWorkplaces:ry,title:`Офисы филиала ${t?.name}`})})),dy=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(cy,{}):o(ny,{descriptionData:e})})})),my=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),uy=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(Km,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(et,{className:"px-5 h-full",headlineVersion:"L",...e,...a})},String(t))))})}))),hy=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:[Ue(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?py({__html:l,richVersion:r}):null,gy({label:"Адрес",data:e,iconName:"GeolocationIcon"}),gy({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),gy({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?qe([a]):null]})]}))),py=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ae,{...e,itemSize:"list-s"})}),gy=({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(Oe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Oe,{size:"text-xl",color:a,children:t})]})]}):null,fy=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Ae,{__html:t,richVersion:n})})})),xy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",yy=Lt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:l,role:r,...s})=>{const d=Te(),[m,{toggle:h}]=ln(t),p=o(Sr,{className:u("gap-lg",xy(d)),isUnfolded:m,children:E({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,x=o(wr,{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(Cr,{children:[n?x:p,n?p:x]})})}),{childrenTypes:{exclude:["RollupItem"]}}),by=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(bn.split(" ").filter((e=>"rounded"!==e)),Qa,"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(Oe,{color:"text-primary-text",children:t}):null]})}))),vy=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(by,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(by,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Ny=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(_n,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),wy=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(Ny,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Cy=["От 1 дня","До 365 дней"],Sy=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Oe,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ra,{min:1,max:365,value:e,items:Cy,onChange:t})]}))),ky=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(Ny,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Iy=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(wy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Ty(m)}),o(Sy,{days:i,setDays:e=>m({days:e})}),o(ky,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Ry(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Oe,{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(vy,{}),o(wl,{className:"order-6",version:"primary",onClick:u,children:"Офисы на карте"})]})]}))),Ty=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ry=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Py=d((({days:e,tariffs:t=[]})=>{const n=Ey(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:[By("Аренда за",e),By("Цена",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})})]})]})})),By=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Oe,{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})]}),Ey=(e,t)=>{const n=_y(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},_y=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},Dy=(e,t)=>e.find((e=>e.branchCode===t)),Ay=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Dy(a,n.selectedBranch),d=My(s?.safeBoxCaseVolumes),m=Oy(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(Iy,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Py,{days:n.days,tariffs:u})]})})),My=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Oy=(e,t)=>e?.find((e=>e.volume===t)),zy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Vy=`${Ht}/safeboxes`,Fy=[];const Ly=async e=>await _t(e,{method:"GET"})||Fy,$y=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=Di(),p=jy(m.selectedRegion,h),f=function(e){const{data:t}=Hn(e?`${Vy}?regionCode=${e}`:null,Ly);return t||Fy}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Dy(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(Ay,{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(gs,{points:y,className:"h-[640px]"}):null]})})),jy=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Uy={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"},qy=(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:Wy(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Hy(a),l?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},Wy=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=Yy(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:Gy({step:n,iconVersion:i,i:a,stepVersion:t})})})},Hy=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",Uy.description),children:e.description}):null,o(Ae,{__html:e.__html})]}),Yy=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Gy=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return Ue(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?Uy.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Ky=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(k,{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(qy(d,r,l))}):null,qe(i,{isVertical:!0})]})})),Xy=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||""]}))),Jy=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(Cl,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Zy(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 Qy=()=>{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 Zy(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},eb=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 tb=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(Oe,{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(nb,{...e},String(t))))})]}):null,nb=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(Oe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),ab=(e,t)=>n=>n.name?o(Gh,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:rm(e,n.name),children:o(Oe,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,ib=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(bn,"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"})]}))),lb=d((({defaultLocation:e})=>{const t=jg(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(Gh,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),rb=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Ug(t?.default),[s,d]=a(""),m=Di(),u=r((()=>ob(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,sb)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Sl,{className:"pb-20",head:c("div",{children:[o(Oe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(lb,{defaultLocation:t?.default}),o(ib,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&eb(e.toLowerCase())(s.toLowerCase())>=.8)).map(ab(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(Oe,{size:"text-h6",children:e})}),t.map(ab(f,g))]},e)))}),tb(e)]});var g,f})),sb=e=>e.name?.charAt(0)??"",ob=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),cb=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=pn(rb,n),{name:r}=jg(),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(Jy,{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})})})})),db="burgerMenuDialog",mb=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=yn})=>{const{open:i}=pn(cb),[r]=Qy(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(db,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:db})),[e,n,t,a]);return[s,{toggle:s?a:o}]},ub=[],hb=Lt((({sticky:e,...t})=>{const{menuItems:n=ub}=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=fn(b),N=s(null),[C,{toggle:S}]=mb({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),k=(({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(Jy,{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(),S()}),[b,S]),T=l(((e,t)=>{x(t),p(e),y(),k(e,t)}),[y,k]);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(pb(T,"left",{activeIndex:h,currentItemPosition:f})),o(Xy,{item:i,isActive:C,onClick:e=>I(e)}),u.map(pb(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),pb=(e,t,n)=>(a,i,l)=>o(Xy,{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)),gb="hidden sm:flex absolute z-40",fb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},xb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=Vm({itemCount:t?.length||0});return i((()=>yb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Bm,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:fb[l].item,gap:fb[l].gap,children:t.map(Ox(n,a,l))}),s.canScrollLeft?o(Um,{wcmsIgnore:!0,className:u("left-6",gb,fb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(qm,{wcmsIgnore:!0,className:u("right-6",gb,fb[l].buttonTop),onClick:s.scrollRight}):null]})})),yb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},bb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},vb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(bb[t].wrapper,e),children:o(xb,{className:bb[t].component,tabsType:t,...n})}):null,Nb=Lt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=wb(n??{}),p=_(),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(kb(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=Sb(x[b],b),S=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:[vb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Cb(t,x),activeItem:N,tabsType:r,onChange:S}),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(Sb)?.filter(Boolean)||[]}),wb=({__id:e,anchor:t})=>t??e??"tabs",Cb=(e,t)=>t?.length?t:e,Sb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",kb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Ib={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Tb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ib[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),Rb=d((({className:e="",isOpen:t,onClick:n})=>o(wr,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),Pb={Buttons:({buttons:e})=>qe(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(Ae,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Oe,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Oe,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(Rb,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Bb=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 Eb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Eb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in Pb))return null;return o(Pb[n],{...t,...a})},_b=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(Bb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Db=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Ab=(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(Oe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Mb=d((({rows:e})=>{return o(Bm,{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(Oe,{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(-${Db(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(Oe,{size:"text-xl",children:e.data}):null,e?.cols?Ab(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Ob=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(Oe,{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(Mb,{rows:t.rowsData})})})]},a)}))}))),zb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Vb=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(Oe,{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]}))),Fb=Lt((({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(Vb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Ob,{activeTabIndex:r,items:m}),o(Rb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Oe,{size:"text-h6",children:"Данных нет"}),o(Rb,{onClick:n,isOpen:!0})]})})),Lb=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(Fb,{...t,onClick:n})}):null]}))),$b=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(Lb,{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(Oe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Tb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(_b,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),jb=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:l})=>n||a?c("div",{children:[n?o(Um,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(qm,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:l}):null]}):null,Ub=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,jb({...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]})})),qb=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($b,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]],[N,{toggle:w}]=ln(!1);return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?c(Cr,{children:[c(Ub,{controls:x,children:[b,o(Sr,{isUnfolded:N,children:v})]}),o(wr,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(Ub,{controls:x,children:y})})]})})),Wb=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?Hb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Oe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Yb(n):null,i?o(Ae,{richVersion:l,__html:i}):null]})]}))),Hb=()=>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"}),Yb=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Gb=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(Oe,{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(Oe,{size:"text-h2",children:n})}):null]}))),Kb=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Gb,{prefix:t,unit:n,suffix:a})})})),Xb={AdTile:jt,ApplicationForm:Ll,BankAccountFiltration:uu,BenefitsBlock:xu,BonusBenefitsBlock:vu,ButtonsBlock:wu,CalculatorBonus:Pu,CalculatorBusinessDeposit:Fu,CalculatorCredit:Oo,CalculatorDeposit:oh,CalculatorRefinancing:yh,CardTransfer:Ph,Carousel:zh,CarouselCard:$h,CarouselCatalogCard:Uh,CarouselLinks:Hh,CarouselRecommendationCard:Qh,CarouselTariffsCard:ap,DepositFiltration:wg,Depository:Vg,ErrorBlock:Lg,ExchangeRateTile:yf,Footer:Af,GrantSupport:Mf,Header:Zf,Headline:k,HorizontalLayout:nx,ImgBlock:ax,LinkDocs:hx,MobileAppTile:xx,MortgageFiltration:Fx,OfficesAtmsMap:dy,Placeholder:my,ProductBlock:$t,ProductGallery:uy,RepresentativeOfficeInfo:hy,RichTextBlock:fy,RollupItem:yy,SafeDepositRental:$y,StepsBlock:Ky,StickyBottomMenu:hb,TabsLayout:Nb,TariffsTable:qb,TextBlock:Wb,UnitBlock:Kb,VerticalLayout:tx,ApplicationLeadForm:bm,CreditCardForm:Zp,CreditForm:xg},Jb=me((()=>{i((()=>{tn()}),[]);const e=an();gn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Zt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Zb="cookie",Qb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=ln();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(Zb)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(Zb,"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(Ae,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Cl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function ev(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);gn(globalThis.document,"keydown",t)}const tv=d((()=>{const[e,{close:t}]=Qy(),n=Boolean(e.length);return ev(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})),nv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return Zy(pe.observable,"popup",{open:t,close:n}),ev(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})),av="header",iv="footer",lv="sticky-footer",rv={},sv=d((({className:e,data:t=rv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Vt(s,r);Jb(),Ug();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?.[av]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:B(i?.[av],{...m,slotName:av})}):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?.[iv],{...m,slotName:iv})]})]}),i?.[lv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:B(i?.[lv],{...m,slotName:lv})}):null,o(tv,{}),o(nv,{}),o(Qb,{__html:d?.cookieContent?.__html})]})}));Object.assign(sv,{childrenTypes:[],slots:()=>[av,iv,lv]});e.Blocks=Xb,e.ContentPage=sv,e.handlerDecorator=me,e.joinList=Qm,e.locationNavigator=Qt,e.packageVersion="0.14.812",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=_,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 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}={},backwardButton:C,children:k,...I})=>{const T=y?.src?o(ie,{image:y}):null,P=o(S,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),R=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(T,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:We(x),backwardButton:C,...I,children:lt(nt(R,{benefitsVersion:s,isTabularBenefits:c}),at(u,{richVersion:h,isDotted:d,headlineVersion:l}),k,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),globalThis.location.href=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}))),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");return o($s,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),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})})),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})})),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}))),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}))),Rc=d((({field:e,input:t})=>o(fr,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t}))),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??""),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}))),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,esiaAccountTypeCd:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:f?.key?{key:"SFR_CERTIFICATE"}:l,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(x={wages:r,mandatoryPayments:s,incomeAverage:Qd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(x).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 x},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=[];for(const n of e){const e=n.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${e},${n.file}`).then((e=>e.blob())).then((e=>ym(e,n.category,n.isPDF))).then((e=>t.push(e)))}return t},wm=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,i.pdfFileSigPayout,i.xmlFilePayout,i.xmlFileSigPayout,i.xmlFileWorkbook].every((e=>Boolean(e))))throw new Error},Cm=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},km=({inputs:e,productType:t,setEsiaError:n,setEsiaAuthSuccess:a,esiaAuthSuccess:s})=>{const[o,{setTrue:c,setFalse:d}]=dn(!1),m=no(),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,s)),[e,m.leadForm]),f=l((async(e,i)=>{c();try{const n=await(l={code:e,state:i,redirectUri:globalThis.location?.href,authorize:!0},rr("/esia/requestProfile","POST",l).then((e=>(Fd(e),e))));if(n){const e=await(async(e,t)=>{t?Cm(e):wm(e);const{profile:n,addInfo:a,document:i,addressRegistration:l,addressFact:r,esiaAdditionalDocument:s}=e;let o=[];return t||(o=await Nm([{file:s.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:s.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:s.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:s.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:s.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:s.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}])),{name:n.name,surname:n.surname,middleName:n.midname,limitedBirthday:n.birthDate,phone:Ri(n.phone),email:n.email,dulIssueDate:i.dulIssueDate,dulIssuedBy:i.dulIssuedBy,dulNumber:i.dulNumber,dulSerie:i.dulSerie,dulSubdivisionCode:i.dulSubdivisionCode,birthPlace:a.birthPlace,addressRegistration:bm(l),addressFact:bm(r),esiaAccountTypeCd:n.esiaAccountType,...!t&&{snils:a.snils,inn:s.inn,wages:Math.floor(s.averageMonthlyIncome)?.toString(),beginDate:s.startWorkDate,experience5Years:vm(s.workLengthInFiveYears).toString(),generalSeniority:vm(s.workLength).toString(),lastJobExperience:vm(s.workLengthLastJob).toString(),jobsNumber:s.jobsNumberInFiveYears.toString(),files:o}}})(n,"debitCard"===t);u((t=>({...t,...e}))),a()}}catch{n()}finally{d()}var l}),[]);return i((()=>{m.productType=t;const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=e.get("code"),a=e.get("state");n&&a?f(n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[g,{isLoading:o}]},Sm=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,{setTrue:f}]=dn(!1),x=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)))}]})(s)),[s]),y=r((()=>x?.flatMap((e=>e?.inputs))||[]),[x]),b=r((()=>nl(y,ir)),[y]),[v,{isLoading:N}]=km({inputs:y,nextStepLink:a,productType:s,setEsiaError:p,setEsiaAuthSuccess:f,esiaAuthSuccess:g}),{isSending:w,ok:C,handleSubmit:k}=um({programId:n,nextStepLink:a,productType:s,esiaAuthSuccess:g,data:d}),[,{field:S,onSubmit:I,reset:T}]=xn(v,{formValidator:b,onSubmit:k}),P=bn(Bl);return i((()=>{void 0!==C&&P.open({ok:C})}),[C]),i((()=>{v?.esiaAccountTypeCd&&T()}),[v]),c(yn,{className:u("container space-y-m",e),title:t,...m,children:[g||h?null:o(cr,{}),c("form",{onSubmit:I,className:"space-y-m relative",children:[N?o(Fl,{blur:!1}):null,x.map(((e,t)=>c("div",{className:u(wl(e.columns),"grid gap-x-m"),children:[Cl(e.title),yd({field:S,inputs:e?.inputs},s)]},`section-${t}`))),vd(l,w),h?o(Fe,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),Im=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"})]})})),Tm=e=>e%2!=0,Pm="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(Pm),children:[B(l,{...i.options,parent:n}),Tm(l.length)?o(Yt,{className:"col-span-6",...i}):null]}),c(Dr,{children:[c(_r,{className:u(Pm),isUnfolded:s,children:[B(r,{...i.options,parent:n}),Tm(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})]})]})})),Bm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Em=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Dm=10;function _m(e=0){const t=Math.round(e*Dm);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Am=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:_m(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})})),Mm=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Om=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?Fm(c,v):{},...N?Em(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(Am,{className:u(m,i?Mm[i-1]:"",{"h-full":N},t),style:w?Fm(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})),Fm=(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"},Lm=({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)),$m=({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))},jm=e=>t=>e.scrollWidth/t,Um=e=>(t,n)=>{e.scrollBy({left:n*jm(e)(t),behavior:"smooth"})},qm=({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?Um(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Um(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}]},Wm={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Hm=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]=qm({itemCount:s.length}),g=Ym(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(Om,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map($m({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Wm[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Lm({activeIndex:t,onClick:f,listType:a}))}):null})),Ym=(e=!1)=>({behavior:e?"auto":"smooth"}),Gm=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"})}))),Km=d((e=>o(Gm,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),Xm=d((e=>o(Gm,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Jm="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Zm=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?Qm(t):null,l?o(Km,{wcmsIgnore:!0,className:u(eu(i),m?"left-1":"left-0"),onClick:s}):null,r?o(Xm,{wcmsIgnore:!0,className:u(eu(i),m?"right-1":"right-0"),onClick:d}):null]})})),Qm=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Jm,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Jm,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),eu=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),tu=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]=qm({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Om,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Zm,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Hm,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),nu=({blocksToRender:e,...t})=>o(tu,{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",Bm(!0)),children:P(e,t)},String(n))})}),au=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[iu(n,t),o(Rm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[iu(n,t),nu({...a,blocksToRender:t})]});default:return null}})),iu=(e,t)=>e&&!t.length?o(Im,{...e}):null,lu=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),ru=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))))),su=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,lu(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(ou(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]}))),ou=e=>([t,n])=>{const a=n?.type;return"array"===a?cu(t,e)(n):null},cu=(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(ru,{items:a,multiple:!n?.single,...t(e)})]},e)},du=e=>e;function mu(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const uu=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,hu=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>uu(t[e])||uu(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>uu(t[e])||uu(n[e])||pu(t[e])<=pu(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>uu(t[e])||uu(n[e])||pu(t[e]?.min)>=pu(n[e]?.min)&&pu(t[e]?.min)<=pu(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>uu(t[e])||uu(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>uu(t[e])||uu(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),pu=e=>Number(e||0),gu=(e,{block:t,page:n,normalize:a=du})=>{const i=t?.blocks||[],[l,s]=xn(e),o=r((()=>mu(i,i.map((e=>jt(e.content,n?.fallback))))),[i,n?.fallback]),c=l===e?i:((e,t)=>(n=du)=>e?.filter((([,e])=>hu(t,n(e)||{}))).map((([e])=>e)))(o,l)(a);return[l,{blocksToRender:c,blocksWithProps:o},s]},fu={},xu={},yu=Wt((({className:e,filtrationSchema:t=fu,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=gu(xu,{block:i.block,page:i.options?.page}),d=o(Fn,{className:"w-64",label:n?.title,options:bu(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>bu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(su,{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(au,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),bu=e=>mu(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),vu=(e=!1)=>e?"text-left":"text-center",Nu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},wu=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",Nu[t],e),style:{width:l,height:l},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),Cu=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:vu(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(ku)}):null]})})),ku=({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(wu,{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)),Su=(e,t,n)=>{return o(tu,{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},Iu=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?Su(e,0,t):null]}))),Tu={start:"justify-start",center:"justify-center",end:"justify-end"},Pu=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Tu[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(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]})]}))),Bu=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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Eu=({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(po,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Bu,{title:e,...r}),Du={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},_u={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Au=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Du.prefMonthsNum,prefTravelBonusRate:l=Du.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||_u,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Mu=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}=Au(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?Eu({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)]})]})})})),Ou=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Fu=e=>Co({...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:uo,children:[o(po,{title:`Доход в конце срока${l?zu:""}`,value:e,postfix:n,prefix:"+"}),o(po,{title:`Сумма в конце срока${l?zu:""}`,value:t,postfix:n}),We(a,{isVertical:!0}),i?.map(vo)]}),Lu={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const $u={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},ju=(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?Lu[e?.rateType]:"",{data:n}=Jn(t?`${Jt}/depositrates/${t}`:null,zt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Uu(s,e)&&Mo(a,["minSum","maxSum"],e)&&Mo(n,["minDays","maxDays"],e)))||$u,{rate:m}=d,u=qu(m,e),h=a+u,p=c||[$u];return{...d,...Ao(["minSum","maxSum"],p),...Ao(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Uu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,qu=(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)},Wu=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=ju(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:[`От ${Ou(b.min||0)}`,`До ${Ou(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Hu(p,h),Fu({...h("isMonthlyInterestPayment")})]})]}),Eu({rate:x,depositeName:y,isShowDepositeName:l}),Vu({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Hu=(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})]})]}),Yu=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},Gu={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Ku=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Zu(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=>[Ju({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Ju({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Ju({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Ju({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)))||Gu,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=Xu(p,e),f=a+g,x=t||[Gu];return{...m,...Ao(["minSum","maxSum"],x),...Ao(["minMonths","maxMonths"],x),availableMonths:Yu(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}},Xu=(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)},Ju=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Zu=(e,t)=>e+Math.round((t-e)/2),Qu=(e="rub")=>"rub"===e,eh=(e,t)=>{const{minMonths:n,maxMonths:a}=Ao(["minMonths","maxMonths"],ih(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ra(i,n,a)}},th=(e,t)=>{const{minSum:n,maxSum:a}=Ao(["minSum","maxSum"],ih(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ra(i,n,a)}},nh=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),ah=e=>{const t=Qu(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},ih=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},lh=(e,t=!1)=>t?Co({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,rh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[sh(t("isReplenish"),e,a),oh(t("isWithdrawn"),e,a),ch(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Fu(t("isMonthlyInterestPayment")):null,lh(t("isRemoteRegistration"),e.isShowRemoteRegistration),dh(t("extraPercent"),n),e.isShowNewClient?o(ri,{text:"Новый сберегатель",...t("isNewClient")}):null]})},sh=(e,t,n=!1)=>t.isShowReplenish?Co({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,oh=(e,t,n=!1)=>t.isShowWithdrawn?Co({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,ch=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,dh=(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,mh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},uh={text:"₽",key:"rub"},hh={text:"Без учета надбавки",key:"0"},ph=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))??[uh],g=l((e=>t=>e?{...t,...ah(t),...th(t,e),...eh(t,e),...nh(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:uh,extraPercent:d?.extraPercent??hh},{normalizer:g}),y=bh(x),b=Boolean(x?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=ih(h,y),w=Ku(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:mh})}),[x,h,v]);i((()=>{!Lo(d)&&N&&T()}),[d,h]);const P=x?.("extraPercent")?.value?.key,R=yh(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:gh(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}),rh({...w,...s},x,v)]}),Eu({rate:R,children:xh(T,B)}),Vu({income:k,finalSum:S,buttons:[...a,fh(n?.buttons,I)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),gh=(e="")=>Qu(e)?1e3:100,fh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},xh=(e,t=!1)=>t?null:o(Tl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),yh=(e,t)=>Number(e)+Number(t??0),bh=e=>e?.("currency")?.value??uh,vh=e=>Nh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Nh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Nh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],wh={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ch=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[wh],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>vh({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=>vh({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)))||wh)({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}},kh=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=Ch(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}),Sh({...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)]})]})})})),Sh=(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})]}),Ih=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(Th(e)),n,a)):Th(e),format:Ke(r)}),d=l((e=>t&&t(Th(e))),[t]);return o(Tn,{onChange:d,...s,...c})})),Th=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Ph=d((e=>o(Ih,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Fe,{size:"text-xl",font:"font-light",children:"₽"})})}))),Rh=new Ms;function Bh(){return Fs(Rh)}_s(Rh,new As(globalThis?.sessionStorage));const Eh={private:"p2p/registerP2P",business:"b2c/registerB2C"},Dh=({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]})})},_h=e=>{const t=bn(Dh),n=Bh(),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/${Eh[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])},Ah={amount:1500},Mh=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:l="private",...r})=>{const[s,{setValue:d}]=dn(!1),m=_h(l),[{amount:h},{field:p,onSubmit:f}]=xn(Ah,{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(Ph,{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]})]})})),Oh=({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})]}),Fh="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(jh),r=n?{defaultPadding:"p-6xl pb-m"}:{};return E({...a,renderProps:(n,a,i)=>c("div",{className:Lh(n,{someCardsHighlighted:l}),children:[P(n,a,{className:$h(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),jh(n)?Oh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Lh=(e,{someCardsHighlighted:t})=>u(Fh,t&&(jh(e)?"pt-3xl":"pt-3xl sm:pt-16")),$h=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Fh,"min-w-80",zh[a],t&&(jh(e)?"pt-3xl sm:pt-16":"pt-3xl"),Bm(n),n&&"h-full"),jh=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Uh=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(tu,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?qh(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"}})}),qh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Wh="z-10 border border-solid w-full h-full",Hh=u(Wh,"absolute hidden @xl:block border-transparent"),Yh=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(Hh,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Hh,"top-6 right-8 bg-green")}),o("div",{className:u(Hh,"top-3 right-4 bg-green-light")}),c("div",{className:u(Wh,"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})]})]})}))),Gh={black:"bg-black",white:"bg-white"},Kh=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(Xh)]}):null,i?c(Fe,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Xh=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Gh[e]}`},String(t)),Jh=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})),Zh=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?Qh(a):null]})}))),Qh=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(Jh,{...e},String(t))))}),ep=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})})),tp=[{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"}}],np=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=>tp.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},ap(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:ip(s??!1,i??!1,n),buttonClassName:h})}),r?o(Fe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),ap=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",ip=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),lp=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(ep,{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(np,{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,rp(a,p)]})})}))),rp=(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,sp=new he,op=(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))},cp=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(op)),[h]),[b,v]=r((()=>m>0?[y.slice(0,m),y.slice(m)]:[y,[]]),[m,y]),[N,C]=a(!1);i((()=>sp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const k=l((()=>{sp.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})]})})),dp=()=>{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)},mp=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]})]}))),up=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(mp,{step:a,showPercentage:!1})]})})}));var hp;!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"}(hp||(hp={}));const pp=e=>rr("/user-data/getTaskStatus","POST",e),gp=async e=>{const t=await rr("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},fp=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})})]})]})})),xp=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(fp,{interval:s,onEnd:d}):null]}),o(yp,{title:n,items:a}),o(yp,{title:i,items:l,countColumns:!0}),r?o(Ll,{href:"/natural",text:r,version:"primary",className:"w-full mt-lg"}):null]}))),yp=({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:bp(e)},t)))}):null]})]}):null},bp=({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})]}),vp=d((()=>o(xp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Np=d((({onExpire:e})=>{const{statusInfo:t}=Ls();return o(xp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),wp=d((()=>{const{statusInfo:e}=Ls(),t="courier"===e?.methodObtain;return o(xp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Cp=d((()=>{const{statusInfo:e}=Ls();return o(xp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:kp(e),buttonText:"Вернуться на главную"})})),kp=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},Sp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ip=d((()=>{const[e,t]=a(hp.process),{taskId:n}=Ls();i((()=>{(async()=>{for(const e of Sp)await gp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await pp({taskId:n});a&&a?.statusCd!==hp.process&&(e(),t(a.statusCd))}),[n]);Sd(r,3e4);const s=l((()=>t(hp.rework)),[]);return Tp(e,s)})),Tp=(e,t)=>({IN_PROCESS:o(Np,{onExpire:t}),CANCELLED:o(vp,{}),FAILED:o(vp,{}),DRAFT:o(vp,{}),APPROVED:o(Cp,{}),PRE_DECISION:o(Cp,{}),REVISION:o(wp,{})}[e]||o(wp,{})),Pp=e=>(t,n)=>t.filter((e=>e)).map((t=>[Rp(n,e),Bp(t,e),Ap(t,e),Ep(t,e),Dp(t,e),_p(t,e)].some(Boolean)?{...t,required:!1}:t)),Rp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Bp=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Ep=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Dp=({name:e},t)=>"addressFact"===e&&t("addressMatch"),_p=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Ap=({name:e},t)=>"snils"===e&&Mp(t),Mp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Op={...pd,...gd},Fp=({field:e,inputs:t,params:n})=>t.map(Nl(e,n,Op)),zp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l,condition:r},s)=>{const o=Pp(Vp(t))(e,n);return c("div",{className:u(wl(i),"grid gap-x-m"),children:[_p({condition:r},Vp(t))?null:Cl(l),Fp({field:t,inputs:o,params:a})]},`section-${s}`)})),Vp=e=>t=>e(t)?.value,Lp=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?"Отправить заявку":"Далее"})]})})),$p=(e,t,n)=>({...n[e],...t,limitedBirthday:jp(t?.limitedBirthday),dulIssueDate:jp(t?.dulIssueDate),participantDateRegistration:jp(t?.participantDateRegistration),beginDate:jp(t?.beginDate),deliveryDate:jp(t?.deliveryDate)}),jp=e=>{try{return e?new Date(e):void 0}catch(e){return}},Up=[{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}],qp=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...Up,{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Wp=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Hp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Yp=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:""}},Gp=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}},Kp=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},Xp=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Jp=(e,t)=>{switch(e){case 0:default:return{};case 1:return Gp(t);case 2:return Yp(t);case 3:return Zd(t);case 4:return Wp(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Jd({addressCourier:t})}:{}})(t)}},Zp=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=Ls(),d=r((()=>$p(e,c.leadForm,qp)),[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,...Xp(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Jp(i,a)}],...Hp(a),...Kp(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]},Qp=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=r((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=l((t=>nl(Pp((e=>t[e]))(s,e),ir)(t)),[s]),[m,u,h]=Zp({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(Lp,{isSending:h,step:e,onPrevStep:n})]})})),eg=[[{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,condition:{name:"esiaAccountTypeCd",values:[""]}}]},{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"}]}]],tg=[{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"]}}]}],ng=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],...eg,tg],ag=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],ig=d((({className:e,...t})=>{const[n,r]=a(0),d=s(null),m=l((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(dp,[]);const u=l((()=>{r((e=>Math.min(e+1,6))),m()}),[]),h=l((()=>{r((e=>Math.max(e-1,0))),m()}),[]),p=ng[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(up,{stepsTitles:ag,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Ip,{}):o(Qp,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),lg=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(mp,{step:a,showPercentage:!1})]})})})),rg=d((()=>o(xp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),sg=d((({onExpire:e})=>{const{statusInfo:t}=Ls();return o(xp,{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})})),og=d((()=>{const{statusInfo:e}=Ls();return o(xp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),cg=d((()=>{const{statusInfo:e}=Ls();return o(xp,{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:"Вернуться на главную"})})),dg=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],mg=d((()=>{const[e,t]=a(hp.process),{taskId:n}=Ls();i((()=>{(async()=>{for(const e of dg)await gp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await pp({taskId:n});a&&a?.statusCd!==hp.process&&(e(),t(a.statusCd))}),[n]);Sd(r,3e4);const s=l((()=>t(hp.rework)),[]);return ug(e,s)})),ug=(e,t)=>({IN_PROCESS:o(sg,{onExpire:t}),CANCELLED:o(rg,{}),FAILED:o(rg,{}),DRAFT:o(rg,{}),APPROVED:o(cg,{}),PRE_DECISION:o(cg,{}),REVISION:o(og,{})}[e]||o(og,{})),hg=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?"Отправить заявку":"Далее"})]})})),pg={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},gg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:pg[a?"annuity":"differential"]}},fg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},xg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Gp(t);case 2:return Yp(t);case 3:return Zd(t);case 4:return Wp(t);default:return{}}},yg=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...Up,{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],bg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=Ls(),d=r((()=>$p(e,c.leadForm,yg)),[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:"Заемщик"},...xg(i,a)}],...gg(a),...fg(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]},vg=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(Pp((e=>t[e]))(u,e),ir)(t)),[u]),[p,g,f]=bg({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(hg,{step:e,isSending:f,onPrevStep:a})]})})),Ng=[[{columns:1,inputs:[{name:"calculator"}]}],...eg,[{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"}]}]],wg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Cg=Wt((({className:e,programsSource:t,...n})=>{const[r,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(dp,[]);const h=l((()=>{d((e=>Math.min(e+1,5))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=Ng[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(lg,{stepsTitles:wg,step:r,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(mg,{}):o(vg,{step:r,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(r))})]})})})),kg=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Sg=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Ig=1e9,Tg={sum:{min:1e4,max:Ig},period:3},Pg=Wt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=gu(Tg,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Rg(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Bg(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(su,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Ph,{label:a?.title,min:500,max:Ig,...d("sum",{parse:e=>({min:Number(e),max:Ig}),format:({min:e})=>String(e)})}),o(ma,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(au,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Rg=e=>Vt((e?.paramsSource?.rateRows||[]).filter(kg).flatMap((e=>Sg(e.minMonths,e.maxMonths)))),Bg=e=>Vt(e.flatMap((e=>e||[])).filter(kg).flatMap((e=>Sg(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Eg=[{key:"10"},{key:"50"},{key:"100"}],Dg=({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:Eg,iconVersion:"black"})]})},_g="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",Ag=(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:_g,"aria-label":`Страница ${l}`,children:l},String(t)):null},Mg={width:"24",height:"24"},Og=({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:Fg(1===e),...Mg})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:_g,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Ag),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:_g,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(G,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Fg(e===n),...Mg})})]})},Fg=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(Og,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Dg,{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})]})})),Lg=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:"Очистить"})})]}))),$g=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(wu,{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)})),jg=`${Jt}/depository`,Ug={startDate:void 0,endDate:void 0,query:""},qg=Wt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=xn(Ug),{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(jg);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(jg+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(Lg,{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($g,{...e},String(e.publicId)))):o(Im,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(zg,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Wg=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,Hg=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:Wg(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]}))),Yg=`${Jt}/region`;function Gg(e="Москва"){return Vs().location??{name:e}}function Kg(e="Москва"){const t=Vs(),n=l((async()=>{if(!t.location){const n=await Ft(Yg);t.location=n??{name:e}}}),[t,e]);return Jn(Yg,n),t}var Xg;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Xg||(Xg={}));const Jg=new Intl.NumberFormat("ru",{style:"currency",currency:Xg.RUB}),Zg=e=>e?Jg.format(e):"",Qg="text-m font-light text-secondary-text ",ef=`${Qg} text-left`,tf=`${Qg} pl-5xl text-center`,nf=`${Qg} pl-5xl text-right`,af={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},lf=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:ef,children:o(Fe,{size:"text-m",children:"Валюта"})}),o("th",{className:tf,children:o(Fe,{size:"text-m",children:"Купить"})}),o("th",{className:nf,children:o(Fe,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(rf)})]}))),rf=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:af[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:Zg(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Fe,{size:"text-h6",children:Zg(e?.buyExchangeRate)})})]},t)},sf={icon:"GpsIcon"},of=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(wu,{...sf,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:"Курс указан для заданного офиса"})]})]}))),cf=(e,t,n)=>{const a=Number(df(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)},df=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function mf(e){if(!e)throw new Error("Value should be fulfilled");return e}const uf=e=>t=>{const[,n]=mf(e.find((([e])=>e(t))));return n(t)},hf=e=>uf(e.map((([e,t])=>[e,()=>t])));hf.if=e=>new pf(void 0,e);class pf{parent;predicate;unit;get entry(){return[mf(this.predicate),mf(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new pf(this,e)}then(e){return new pf(this.parent,this.predicate,e)}else(e){return uf([...gf(this),[()=>!0,e]])}}const gf=e=>[...e?.parent?gf(e.parent):[],e.entry],ff=e=>hf([[e=>e.value!==Xg.RUB&&e.oppositeValue!==Xg.RUB,()=>e.handleConvert(e.value,Xg.RUB)],[e=>e.value===Xg.RUB&&e.oppositeValue===Xg.RUB,()=>e.handleConvert(e.value,Xg.USD)],[e=>e.value===Xg.RUB&&e.oppositeValue===Xg.RUB,()=>e.handleConvert(e.value,Xg.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function xf(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 yf=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Xg.RUB,selectBuy:n?.[0]?.currency?.currency||Xg.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:[xf({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:bf(r,d,n),value:r.inputSell,setValue:e=>Nf(d,n)(e,r.selectSell,r.selectBuy)}),xf({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:vf(r,d,t),value:r.inputBuy,setValue:e=>wf(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ce,{text:i.text,version:i?.version,...i}):null]})})),bf=(e,t,n)=>a=>{t({selectSell:a}),ff({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{Nf(t,n)(e.inputSell,a,i)}})},vf=(e,t,n)=>a=>{t({selectBuy:a}),ff({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>wf(t,n)(e.inputBuy,a,i)})},Nf=(e,t)=>(n,a,i)=>{e({inputSell:df(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(cf(n,l,a===Xg.RUB)||"")})},wf=(e,t)=>(n,a,i)=>{e({inputBuy:df(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(cf(n,l,a===Xg.RUB)||"")})},Cf=`${Jt}/exchangerates`;const kf=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=Jn(Cf+`?regionCode=${t}`,zt);return n||{}}(Gg()),l=Sf(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Xg.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Xg.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(lf,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(of,{address:i?.address})]}),o(yf,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Sf=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],If=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Tf(n))})})),Tf=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},Pf=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(Bf,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Bf=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(wu,{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(If,{items:t.items}):null})]})})),Ef=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Df)}):null)),Df=(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(_f)})]},String(t)),_f=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Af(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Af=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Mf(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})}},Mf=e=>e.replaceAll(/\D/g,""),Of=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}`})})),Ff=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(Of,{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(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(zf,{index:t,...e},String(t))))}):null]}))),Lf=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(Pf,{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(Ef,{items:r}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(np,{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(Ff,{title:d,links:l}),o(Vf,{links:i,license:h})]})})),$f=(e=!1)=>e?{}:{padding:"p-0"},jf={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Uf=[1,2,3,4],qf={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка",required:["href"]}},Wf=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",jf[n],e),padding:t,version:i,isTheme:l,...s,children:E({...s,renderProps:Hf({isInnerPadding:a,isCardBorder:r})})})),{childrenTypes:["ProductBlock"],childSchema:()=>qf,allowRemoveChild:e=>(e?.blocks??[]).length>5}),Hf=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>P(n,{...a,blockDecorator:Yf(a.blockDecorator,i)},{className:u("w-full",Bm(t)),...$f(e)}),Yf=(e,t=0)=>(n,a)=>e?.({...n,render:e=>Gf(t)({...n,...e},a)},`wrap_${a}`)??Gf(t)(n,a),Gf=e=>({blockClassName:t,block:n,render:a},i)=>o(ep,{...n.content?.link,className:Kf(e),children:a({blockClassName:u(t,"h-full"),block:Xf(n,e)})},i),Kf=e=>Uf.includes(e)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2",Xf=(e,t)=>{const n={...e.content};return Uf.includes(t)&&(delete n.description,delete n.benefits),n.link?.href&&delete n.buttons,{...e,content:n}},Jf=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]})})})),Zf={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},Qf=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":`${Zf[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...ex(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"})}))),ex=e=>e?{"data-test-id":e}:null,tx="chatbot",nx="text-page__btn-chat",ax="webchat-js-container:webchat_rshb",ix={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},lx=async(e,t)=>{const n=e.target;n?.classList.contains(nx)||n?.classList.add(nx);globalThis.document.getElementById(ax)||await bs(tx,t)},rx=async e=>{const t=await bs(tx,`${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(ax)?t?.chatOpen?.():(sx(),t?.render?.(ax,!0,"/webchat-api","@container fixed right-0 bottom-0 top-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},sx=()=>{const e=globalThis.document.createElement("div");e.id=ax,globalThis.document.body.appendChild(e)},ox=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=ix[e??""];return{load:l((t=>{r&&(n(!0),"business"===e?rx(r).finally((()=>n(!1))):lx(t,r).finally((()=>n(!1))))}),[r,e]),isLoading:t}})(e);return o(Qf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:r,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),cx={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"},dx=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",cx["transparent"===e?"transparent":"default"]),...a,children:i}):null})),mx=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})}):ux(g,r),c("div",{className:"flex gap-lg items-center",children:[A.CHAT_BOT?o(ox,{version:i,iconVersion:m,chat:A.CHAT_BOT,buttonSize:"medium"}):null,o(dx,{version:i,...a})]})]})})),ux=(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,hx={"bg-white":"primary",transparent:"transparent"},px=Wt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=hx[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(mx,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),gx=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",jf[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",Bm(r)),...$f(a)}})})}),{childrenTypes:[]}),fx=Wt((e=>o(gx,{...e})),{childrenTypes:[]}),xx=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Tu[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),yx=["байт","Кб","Мб","Гб","Тб","Пб"],bx=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," ",vx(d,m),o(Fe,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),vx=(e,t)=>e||t?o("span",{children:", "}):"",Nx=(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))} ${yx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Cx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(bx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:wx(t),data:n?.data}),o(Me,{__html:n?.__html})]},String(a))},wx=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,Cx=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},kx=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:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),Sx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=bn(kx),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:[wx(i),o(Fe,{font:"font-light",children:e})]}):null})),Ix={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Tx=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",Ix[r]),role:"list",children:i.map(Px(d,l))}):null]})})),Px=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Rx(t)(n,a):Nx(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(Sx,{...a,icon:e,href:Bx(t)?t?.href:t?.attachment?.src}),o(Me,{__html:t?.__html})]},String(n)):null},Bx=e=>"href"in e,Ex=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]})]})})})),Dx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",_x=(e=[],t={})=>e.filter((({content:e={}})=>hu(t,e))).length,Ax=(e,t)=>e===t;const Mx=(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)))}(Ax,((e=Ax)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),Ox=[],Fx={},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"}},Lx=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(Fe,{size:"text-xs",color:i,children:e})})})),$x=({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})]})]})},jx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Ux={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},qx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Wx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Hx=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",jx[a],n?Wx[a]:qx[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Ux[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[$x({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(Lx,{count:m,version:Dx(n,a)})}):null]})})})),Yx=d((e=>o(e?.item?.href?Gx:Kx,{...e}))),Gx=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(Hx,{...e,tag:"a",item:i,onClick:a})})),Kx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Hx,{item:e,onClick:a,...n})})),Xx=(e,t,n)=>(a,i)=>o(Yx,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Jx=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(Xx(a,i,t))}))),Zx={categories:[],extraOptions:[],propertyType:[],stage:[]},Qx=Wt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=gu(Zx,{block:i.block,page:i.options?.page}),f=l(((e=Zx)=>p(e)),[]),x=(({hotFilters:e=Ox,filtrationState:t=Fx,blocks:n=Ox,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Mx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:_x(n,t.filter),version:Dx(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(Jx,{...x}),o(su,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(au,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),ey="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",ty=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:ey,children:s}),o(_r,{className:ey,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})})),ny=(e,t,n)=>{const a=Dx("all"===t),i=Dx("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:"Для юридических лиц"})]})},ay=({__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,iy=(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]})}),ly=()=>{},ry=e=>"all"===e?"block":"hidden",sy=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=ly,renderRemoteWorkplaceCard:r=ly,getBalloon:s=ly,getBalloonRemoteWorkplaces:d=ly,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:[iy(h,N),m?ay(m):null,p&&ny(t,w,C),o("div",{className:u("pb-3xl",ry(w)),children:o(ty,{filters:oy([...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)]})]})})),oy=e=>Object.keys(ns).filter((t=>e.filter((e=>is[t](e))).length)),cy=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",dy=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:cy(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:cy(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:cy(s)})})]}),o(Ar,{children:o(Pr,{className:"flex-wrap",children:m?.map(((e,t)=>o(kr,{...e},String(t))))})})]},String(d))},my=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${cy(t)} №${n}`,body:e.toUpperCase()}),uy=[];const hy=async e=>{const t=await Ft(e,{method:"GET"});return Array.isArray(t)?t:uy},py={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},gy={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)},fy=d((({descriptionData:e,className:t})=>{const n=Gg(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=Jn(`${Jt}/atms?regionCode=${e}`,hy);return{data:t||uy,isLoad:!t&&!n}}(a);return o(sy,{className:t,filterItems:xy,data:i,isLoad:l,initFilterState:py,renderCard:dy,getBalloon:my,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),xy=(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=>gy[t](e))),n=!a.length||a.some((t=>gy[t](e)));return t&&n}))},yy=({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:by(t)})]},String(n)):null,by=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})})]}),vy=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Ny={branches:[],remoteWorkplaces:[]};const wy=async e=>await Ft(e,{method:"GET"})||Ny,Cy=d((({className:e})=>{const t=Gg(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Jn(`${Jt}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,wy);return{data:t||Ny,isLoad:!t&&!n}}(n);return o(sy,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:Qr,renderRemoteWorkplaceCard:yy,getBalloon:ts,getBalloonRemoteWorkplaces:vy,title:`Офисы филиала ${t?.name}`})})),ky=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(Cy,{}):o(fy,{descriptionData:e})})})),Sy=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,{})]}))),Iy=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(tu,{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))))})}))),Ty=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?Py({__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]})]}))),Py=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(Fe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Fe,{size:"text-xl",color:a,children:t})]})]}):null,By=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Me,{__html:t,richVersion:n})})})),Ey=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Dy=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",Ey(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"]}}),_y=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]})}))),Ay=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(_y,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(_y,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),My=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})})),Oy=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(My,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(My,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Fy=["От 1 дня","До 365 дней"],zy=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:Fy,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(My,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(My,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Ly=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(Oy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:$y(m)}),o(zy,{days:i,setDays:e=>m({days:e})}),o(Vy,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:jy(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(Ay,{}),o(Tl,{className:"order-6",version:"primary",onClick:u,children:"Офисы на карте"})]})]}))),$y=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},jy=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Uy=d((({days:e,tariffs:t=[]})=>{const n=Wy(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:[qy("Аренда за",e),qy("Цена",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})})]})]})})),qy=(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})]}),Wy=(e,t)=>{const n=Hy(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Hy=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},Yy=(e,t)=>e.find((e=>e.branchCode===t)),Gy=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Yy(a,n.selectedBranch),d=Ky(s?.safeBoxCaseVolumes),m=Xy(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Jy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Ly,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Uy,{days:n.days,tariffs:u})]})})),Ky=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Xy=(e,t)=>e?.find((e=>e.volume===t)),Jy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Zy=`${Jt}/safeboxes`,Qy=[];const eb=async e=>await Ft(e,{method:"GET"})||Qy,tb=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=nb(m.selectedRegion,h),f=function(e){const{data:t}=Jn(e?`${Zy}?regionCode=${e}`:null,eb);return t||Qy}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Yy(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(Gy,{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]})})),nb=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,ab={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"},ib=(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:lb(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[rb(a),l?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},lb=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=sb(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:ob({step:n,iconVersion:i,i:a,stepVersion:t})})})},rb=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",ab.description),children:e.description}):null,o(Me,{__html:e.__html})]}),sb=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",ob=({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?ab.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},cb=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(ib(d,r,l))}):null,We(i,{isVertical:!0})]})})),db=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||""]}))),mb=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 ub(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 hb=()=>{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 ub(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},pb=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 gb=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(fb,{...e},String(t))))})]}):null,fb=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]})})),xb=(e,t)=>n=>n.name?o(ep,{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,yb=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"})]}))),bb=d((({defaultLocation:e})=>{const t=Gg(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(ep,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),vb=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Kg(t?.default),[s,d]=a(""),m=zi(),u=r((()=>wb(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,Nb)),[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(bb,{defaultLocation:t?.default}),o(yb,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&pb(e.toLowerCase())(s.toLowerCase())>=.8)).map(xb(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(xb(f,g))]},e)))}),gb(e)]});var g,f})),Nb=e=>e.name?.charAt(0)??"",wb=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Cb=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=bn(vb,n),{name:r}=Gg(),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(mb,{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})})})})),kb="burgerMenuDialog",Sb=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Cn})=>{const{open:i}=bn(Cb),[r]=hb(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(kb,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:kb})),[e,n,t,a]);return[s,{toggle:s?a:o}]},Ib=[],Tb=Wt((({sticky:e,...t})=>{const{menuItems:n=Ib}=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}]=Sb({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(mb,{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(Pb(T,"left",{activeIndex:h,currentItemPosition:f})),o(db,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Pb(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Pb=(e,t,n)=>(a,i,l)=>o(db,{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",Bb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Eb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=qm({itemCount:t?.length||0});return i((()=>Db(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Om,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Bb[l].item,gap:Bb[l].gap,children:t.map(Xx(n,a,l))}),s.canScrollLeft?o(Km,{wcmsIgnore:!0,className:u("left-6",Rb,Bb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Xm,{wcmsIgnore:!0,className:u("right-6",Rb,Bb[l].buttonTop),onClick:s.scrollRight}):null]})})),Db=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},_b={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Ab=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(_b[t].wrapper,e),children:o(Eb,{className:_b[t].component,tabsType:t,...n})}):null,Mb=Wt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Ob(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:[Ab({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Fb(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)||[]}),Ob=({__id:e,anchor:t})=>t??e??"tabs",Fb=(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),Lb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},$b=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Lb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),jb=d((({className:e="",isOpen:t,onClick:n})=>o(Er,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),Ub={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(jb,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},qb=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 Wb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Wb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in Ub))return null;return o(Ub[n],{...t,...a})},Hb=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(qb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Yb=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Gb=(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,Kb=d((({rows:e})=>{return o(Om,{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(-${Yb(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?Gb(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Xb=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(Kb,{rows:t.rowsData})})})]},a)}))}))),Jb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Zb=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:Jb(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]}))),Qb=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(Zb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Xb,{activeTabIndex:r,items:m}),o(jb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Fe,{size:"text-h6",children:"Данных нет"}),o(jb,{onClick:n,isOpen:!0})]})})),ev=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(Qb,{...t,onClick:n})}):null]}))),tv=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(ev,{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($b,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Hb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),nv=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:l})=>n||a?c("div",{children:[n?o(Km,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(Xm,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:l}):null]}):null,av=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,nv({...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]})})),iv=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(tv,{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(av,{controls:x,children:[b,o(_r,{isUnfolded:N,children:v})]}),o(Er,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(av,{controls:x,children:y})})]})})),lv=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?rv():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?sv(n):null,i?o(Me,{richVersion:l,__html:i}):null]})]}))),rv=()=>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"}),sv=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),ov=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]}))),cv=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(ov,{prefix:t,unit:n,suffix:a})})})),dv={AdTile:Yt,ApplicationForm:Wl,BankAccountFiltration:yu,BenefitsBlock:Cu,BonusBenefitsBlock:Iu,ButtonsBlock:Pu,CalculatorBonus:Mu,CalculatorBusinessDeposit:Wu,CalculatorCredit:jo,CalculatorDeposit:ph,CalculatorRefinancing:kh,CardTransfer:Mh,Carousel:Uh,CarouselCard:Yh,CarouselCatalogCard:Kh,CarouselLinks:Zh,CarouselRecommendationCard:lp,CarouselTariffsCard:cp,DepositFiltration:Pg,Depository:qg,ErrorBlock:Hg,ExchangeRateTile:kf,Footer:Lf,GalleryLayout:Wf,GrantSupport:Jf,Header:px,Headline:S,HorizontalLayout:fx,ImgBlock:xx,LinkDocs:Tx,MobileAppTile:Ex,MortgageFiltration:Qx,OfficesAtmsMap:ky,Placeholder:Sy,ProductBlock:Ht,ProductGallery:Iy,RepresentativeOfficeInfo:Ty,RichTextBlock:By,RollupItem:Dy,SafeDepositRental:tb,StepsBlock:cb,StickyBottomMenu:Tb,TabsLayout:Mb,TariffsTable:iv,TextBlock:lv,UnitBlock:cv,VerticalLayout:gx,ApplicationLeadForm:Sm,CreditCardForm:ig,CreditForm:Cg},mv=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 uv="cookie",hv=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(uv)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(uv,"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 pv(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);vn(globalThis.document,"keydown",t)}const gv=d((()=>{const[e,{close:t}]=hb(),n=Boolean(e.length);return pv(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})),fv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return ub(pe.observable,"popup",{open:t,close:n}),pv(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})),xv="header",yv="footer",bv="sticky-footer",vv={},Nv=d((({className:e,data:t=vv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Ut(s,r);mv(),Kg();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?.[xv]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:B(i?.[xv],{...m,slotName:xv})}):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?.[yv],{...m,slotName:yv})]})]}),i?.[bv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:B(i?.[bv],{...m,slotName:bv})}):null,o(gv,{}),o(fv,{}),o(hv,{__html:d?.cookieContent?.__html})]})}));Object.assign(Nv,{childrenTypes:[],slots:()=>[xv,yv,bv]});e.Blocks=dv,e.ContentPage=Nv,e.handlerDecorator=me,e.joinList=lu,e.locationNavigator=ln,e.packageVersion="0.14.814",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})}));
|