@redneckz/wildless-cms-uni-blocks 0.14.951 → 0.14.953
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/api/apiBaseUrl.d.ts +0 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +492 -185
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +6 -4
- package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -2
- package/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +2 -1
- package/bundle/components/Header/DropdownMenu.d.ts +2 -2
- package/bundle/components/Header/HeaderQuickActionsMenu.d.ts +1 -1
- package/bundle/retail/adaptors/getCreditFormTaskData.d.ts +3 -2
- package/bundle/retail/api/apiBaseUrl.d.ts +2 -1
- package/bundle/retail/api/checkCaptcha.d.ts +1 -0
- package/bundle/retail/api/checkCode.d.ts +1 -0
- package/bundle/retail/api/createDraftTask.d.ts +2 -1
- package/bundle/retail/api/createParticipant.d.ts +6 -0
- package/bundle/retail/api/sendMessage.d.ts +7 -0
- package/bundle/retail/api/updateUserTask.d.ts +14 -8
- package/bundle/retail/components/ConsentBkiDialog/useConsentBkiDialog.d.ts +9 -1
- package/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +2 -1
- package/bundle/retail/hooks/useRetailFormStore.d.ts +1 -1
- package/bundle/retail/model/LeadFormState.d.ts +2 -4
- package/bundle/retail/utils/calculateInputs.d.ts +1 -1
- package/bundle/retail/utils/checkNewMicroservice.d.ts +1 -0
- package/bundle/retail/utils/renderStep.d.ts +1 -2
- package/bundle/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/bundle/ui-kit/SearchBar/SearchBar.d.ts +1 -2
- package/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +0 -2
- package/dist/api/apiBaseUrl.d.ts +0 -1
- package/dist/api/apiBaseUrl.js +1 -2
- package/dist/api/apiBaseUrl.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +6 -4
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +35 -24
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +13 -11
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +98 -4
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +3 -2
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -2
- package/dist/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStatusTracker.js +16 -2
- package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.js +1 -2
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +52 -8
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/components/DebitForm/DebitFormStep.js +1 -2
- package/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/dist/components/Footer/Footer.js +1 -1
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/renderLogoSearchBar.js +2 -2
- package/dist/components/Footer/renderLogoSearchBar.js.map +1 -1
- package/dist/components/Header/DropdownMenu.d.ts +2 -2
- package/dist/components/Header/HeaderQuickActionsMenu.d.ts +1 -1
- package/dist/components/Header/HeaderQuickActionsMenu.js +5 -7
- package/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/dist/retail/adaptors/getCreditFormTaskData.d.ts +3 -2
- package/dist/retail/adaptors/getCreditFormTaskData.js +36 -25
- package/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/dist/retail/adaptors/getEmploymentData.js +25 -21
- package/dist/retail/adaptors/getEmploymentData.js.map +1 -1
- package/dist/retail/adaptors/utils.js +1 -1
- package/dist/retail/adaptors/utils.js.map +1 -1
- package/dist/retail/api/apiBaseUrl.d.ts +2 -1
- package/dist/retail/api/apiBaseUrl.js +3 -2
- package/dist/retail/api/apiBaseUrl.js.map +1 -1
- package/dist/retail/api/checkCaptcha.d.ts +1 -0
- package/dist/retail/api/checkCaptcha.js +10 -3
- package/dist/retail/api/checkCaptcha.js.map +1 -1
- package/dist/retail/api/checkCode.d.ts +1 -0
- package/dist/retail/api/checkCode.js +9 -1
- package/dist/retail/api/checkCode.js.map +1 -1
- package/dist/retail/api/createCaptcha.js +5 -1
- package/dist/retail/api/createCaptcha.js.map +1 -1
- package/dist/retail/api/createDraftTask.d.ts +2 -1
- package/dist/retail/api/createDraftTask.js.map +1 -1
- package/dist/retail/api/createParticipant.d.ts +6 -0
- package/dist/retail/api/createParticipant.js +6 -0
- package/dist/retail/api/createParticipant.js.map +1 -0
- package/dist/retail/api/doRequest.js +4 -2
- package/dist/retail/api/doRequest.js.map +1 -1
- package/dist/retail/api/esiaRequestProfile.js +11 -7
- package/dist/retail/api/esiaRequestProfile.js.map +1 -1
- package/dist/retail/api/getDictionaries.js +3 -1
- package/dist/retail/api/getDictionaries.js.map +1 -1
- package/dist/retail/api/getLink.js +5 -1
- package/dist/retail/api/getLink.js.map +1 -1
- package/dist/retail/api/sendCode.js +8 -1
- package/dist/retail/api/sendCode.js.map +1 -1
- package/dist/retail/api/sendMessage.d.ts +7 -0
- package/dist/retail/api/sendMessage.js +8 -0
- package/dist/retail/api/sendMessage.js.map +1 -0
- package/dist/retail/api/updateUserTask.d.ts +14 -8
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/dist/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/dist/retail/components/ConsentBkiDialog/useConsentBkiDialog.d.ts +9 -1
- package/dist/retail/components/ConsentBkiDialog/useConsentBkiDialog.js +28 -4
- package/dist/retail/components/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +2 -1
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +2 -1
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +2 -1
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/dist/retail/hooks/useLeadFormData.js +3 -1
- package/dist/retail/hooks/useLeadFormData.js.map +1 -1
- package/dist/retail/hooks/useRetailFormStore.d.ts +1 -1
- package/dist/retail/model/LeadFormState.d.ts +2 -4
- package/dist/retail/utils/calculateInputs.d.ts +1 -1
- package/dist/retail/utils/calculateInputs.js +2 -6
- package/dist/retail/utils/calculateInputs.js.map +1 -1
- package/dist/retail/utils/checkNewMicroservice.d.ts +1 -0
- package/dist/retail/utils/checkNewMicroservice.js +8 -0
- package/dist/retail/utils/checkNewMicroservice.js.map +1 -0
- package/dist/retail/utils/renderStep.d.ts +1 -2
- package/dist/retail/utils/renderStep.js +2 -2
- package/dist/retail/utils/renderStep.js.map +1 -1
- package/dist/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/dist/retail/validator/getRetailFormValidator.js +1 -1
- package/dist/retail/validator/getRetailFormValidator.js.map +1 -1
- package/dist/ui-kit/SearchBar/SearchBar.d.ts +1 -2
- package/dist/ui-kit/SearchBar/SearchBar.js +1 -1
- package/dist/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/dist/ui-kit/SearchDialog/SearchDialog.d.ts +0 -2
- package/dist/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/dist/ui-kit/YandexMap/useYandexMaps.js +1 -2
- package/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -1
- package/dist/wlc.json +1 -2
- package/lib/api/apiBaseUrl.d.ts +0 -1
- package/lib/api/apiBaseUrl.js +0 -1
- package/lib/api/apiBaseUrl.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +6 -4
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +33 -23
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +13 -11
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +98 -4
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +3 -2
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -2
- package/lib/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStatusTracker.js +16 -2
- package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.js +1 -2
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +52 -8
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/components/DebitForm/DebitFormStep.js +1 -2
- package/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/lib/components/Footer/Footer.js +1 -1
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/renderLogoSearchBar.js +2 -2
- package/lib/components/Footer/renderLogoSearchBar.js.map +1 -1
- package/lib/components/Header/DropdownMenu.d.ts +2 -2
- package/lib/components/Header/HeaderQuickActionsMenu.d.ts +1 -1
- package/lib/components/Header/HeaderQuickActionsMenu.js +5 -7
- package/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/lib/retail/adaptors/getCreditFormTaskData.d.ts +3 -2
- package/lib/retail/adaptors/getCreditFormTaskData.js +36 -25
- package/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/lib/retail/adaptors/getEmploymentData.js +25 -21
- package/lib/retail/adaptors/getEmploymentData.js.map +1 -1
- package/lib/retail/adaptors/utils.js +1 -1
- package/lib/retail/adaptors/utils.js.map +1 -1
- package/lib/retail/api/apiBaseUrl.d.ts +2 -1
- package/lib/retail/api/apiBaseUrl.js +2 -1
- package/lib/retail/api/apiBaseUrl.js.map +1 -1
- package/lib/retail/api/checkCaptcha.d.ts +1 -0
- package/lib/retail/api/checkCaptcha.js +10 -3
- package/lib/retail/api/checkCaptcha.js.map +1 -1
- package/lib/retail/api/checkCode.d.ts +1 -0
- package/lib/retail/api/checkCode.js +9 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/lib/retail/api/createCaptcha.js +5 -1
- package/lib/retail/api/createCaptcha.js.map +1 -1
- package/lib/retail/api/createDraftTask.d.ts +2 -1
- package/lib/retail/api/createDraftTask.js.map +1 -1
- package/lib/retail/api/createParticipant.d.ts +6 -0
- package/lib/retail/api/createParticipant.js +3 -0
- package/lib/retail/api/createParticipant.js.map +1 -0
- package/lib/retail/api/doRequest.js +4 -2
- package/lib/retail/api/doRequest.js.map +1 -1
- package/lib/retail/api/esiaRequestProfile.js +11 -7
- package/lib/retail/api/esiaRequestProfile.js.map +1 -1
- package/lib/retail/api/getDictionaries.js +3 -1
- package/lib/retail/api/getDictionaries.js.map +1 -1
- package/lib/retail/api/getLink.js +5 -1
- package/lib/retail/api/getLink.js.map +1 -1
- package/lib/retail/api/sendCode.js +8 -1
- package/lib/retail/api/sendCode.js.map +1 -1
- package/lib/retail/api/sendMessage.d.ts +7 -0
- package/lib/retail/api/sendMessage.js +5 -0
- package/lib/retail/api/sendMessage.js.map +1 -0
- package/lib/retail/api/updateUserTask.d.ts +14 -8
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/lib/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/lib/retail/components/ConsentBkiDialog/useConsentBkiDialog.d.ts +9 -1
- package/lib/retail/components/ConsentBkiDialog/useConsentBkiDialog.js +28 -4
- package/lib/retail/components/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +2 -1
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +2 -1
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +2 -1
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/retail/hooks/useLeadFormData.js +4 -2
- package/lib/retail/hooks/useLeadFormData.js.map +1 -1
- package/lib/retail/hooks/useRetailFormStore.d.ts +1 -1
- package/lib/retail/model/LeadFormState.d.ts +2 -4
- package/lib/retail/utils/calculateInputs.d.ts +1 -1
- package/lib/retail/utils/calculateInputs.js +2 -6
- package/lib/retail/utils/calculateInputs.js.map +1 -1
- package/lib/retail/utils/checkNewMicroservice.d.ts +1 -0
- package/lib/retail/utils/checkNewMicroservice.js +5 -0
- package/lib/retail/utils/checkNewMicroservice.js.map +1 -0
- package/lib/retail/utils/renderStep.d.ts +1 -2
- package/lib/retail/utils/renderStep.js +2 -2
- package/lib/retail/utils/renderStep.js.map +1 -1
- package/lib/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/lib/retail/validator/getRetailFormValidator.js +1 -1
- package/lib/retail/validator/getRetailFormValidator.js.map +1 -1
- package/lib/ui-kit/SearchBar/SearchBar.d.ts +1 -2
- package/lib/ui-kit/SearchBar/SearchBar.js +1 -1
- package/lib/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/lib/ui-kit/SearchDialog/SearchDialog.d.ts +0 -2
- package/lib/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/lib/ui-kit/YandexMap/useYandexMaps.js +1 -2
- package/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -1
- package/lib/wlc.json +1 -2
- package/mobile/bundle/api/apiBaseUrl.d.ts +0 -1
- package/mobile/bundle/bundle.umd.js +487 -180
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +6 -4
- package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -2
- package/mobile/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +2 -1
- package/mobile/bundle/components/Header/DropdownMenu.d.ts +2 -2
- package/mobile/bundle/components/Header/HeaderQuickActionsMenu.d.ts +1 -1
- package/mobile/bundle/retail/adaptors/getCreditFormTaskData.d.ts +3 -2
- package/mobile/bundle/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/bundle/retail/api/checkCaptcha.d.ts +1 -0
- package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
- package/mobile/bundle/retail/api/createDraftTask.d.ts +2 -1
- package/mobile/bundle/retail/api/createParticipant.d.ts +6 -0
- package/mobile/bundle/retail/api/sendMessage.d.ts +7 -0
- package/mobile/bundle/retail/api/updateUserTask.d.ts +14 -8
- package/mobile/bundle/retail/components/ConsentBkiDialog/useConsentBkiDialog.d.ts +9 -1
- package/mobile/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +2 -1
- package/mobile/bundle/retail/hooks/useRetailFormStore.d.ts +1 -1
- package/mobile/bundle/retail/model/LeadFormState.d.ts +2 -4
- package/mobile/bundle/retail/utils/calculateInputs.d.ts +1 -1
- package/mobile/bundle/retail/utils/checkNewMicroservice.d.ts +1 -0
- package/mobile/bundle/retail/utils/renderStep.d.ts +1 -2
- package/mobile/bundle/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/mobile/bundle/ui-kit/SearchBar/SearchBar.d.ts +1 -2
- package/mobile/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +0 -2
- package/mobile/dist/api/apiBaseUrl.d.ts +0 -1
- package/mobile/dist/api/apiBaseUrl.js +1 -2
- package/mobile/dist/api/apiBaseUrl.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +6 -4
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +35 -24
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +13 -11
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +98 -4
- 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 +3 -2
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -2
- package/mobile/dist/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +16 -2
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +1 -2
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +52 -8
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/components/DebitForm/DebitFormStep.js +1 -2
- package/mobile/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/dist/components/Footer/Footer.js +1 -1
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/Header/DropdownMenu.d.ts +2 -2
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.d.ts +1 -1
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.js +5 -7
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.d.ts +3 -2
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js +36 -25
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/dist/retail/adaptors/getEmploymentData.js +25 -21
- package/mobile/dist/retail/adaptors/getEmploymentData.js.map +1 -1
- package/mobile/dist/retail/adaptors/utils.js +1 -1
- package/mobile/dist/retail/adaptors/utils.js.map +1 -1
- package/mobile/dist/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/dist/retail/api/apiBaseUrl.js +3 -2
- package/mobile/dist/retail/api/apiBaseUrl.js.map +1 -1
- package/mobile/dist/retail/api/checkCaptcha.d.ts +1 -0
- package/mobile/dist/retail/api/checkCaptcha.js +10 -3
- package/mobile/dist/retail/api/checkCaptcha.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +1 -0
- package/mobile/dist/retail/api/checkCode.js +9 -1
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/createCaptcha.js +5 -1
- package/mobile/dist/retail/api/createCaptcha.js.map +1 -1
- package/mobile/dist/retail/api/createDraftTask.d.ts +2 -1
- package/mobile/dist/retail/api/createDraftTask.js.map +1 -1
- package/mobile/dist/retail/api/createParticipant.d.ts +6 -0
- package/mobile/dist/retail/api/createParticipant.js +6 -0
- package/mobile/dist/retail/api/createParticipant.js.map +1 -0
- package/mobile/dist/retail/api/doRequest.js +4 -2
- package/mobile/dist/retail/api/doRequest.js.map +1 -1
- package/mobile/dist/retail/api/esiaRequestProfile.js +11 -7
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -1
- package/mobile/dist/retail/api/getDictionaries.js +3 -1
- package/mobile/dist/retail/api/getDictionaries.js.map +1 -1
- package/mobile/dist/retail/api/getLink.js +5 -1
- package/mobile/dist/retail/api/getLink.js.map +1 -1
- package/mobile/dist/retail/api/sendCode.js +8 -1
- package/mobile/dist/retail/api/sendCode.js.map +1 -1
- package/mobile/dist/retail/api/sendMessage.d.ts +7 -0
- package/mobile/dist/retail/api/sendMessage.js +8 -0
- package/mobile/dist/retail/api/sendMessage.js.map +1 -0
- package/mobile/dist/retail/api/updateUserTask.d.ts +14 -8
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/mobile/dist/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/mobile/dist/retail/components/ConsentBkiDialog/useConsentBkiDialog.d.ts +9 -1
- package/mobile/dist/retail/components/ConsentBkiDialog/useConsentBkiDialog.js +28 -4
- package/mobile/dist/retail/components/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +2 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +2 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +2 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/dist/retail/hooks/useLeadFormData.js +3 -1
- package/mobile/dist/retail/hooks/useLeadFormData.js.map +1 -1
- package/mobile/dist/retail/hooks/useRetailFormStore.d.ts +1 -1
- package/mobile/dist/retail/model/LeadFormState.d.ts +2 -4
- package/mobile/dist/retail/utils/calculateInputs.d.ts +1 -1
- package/mobile/dist/retail/utils/calculateInputs.js +2 -6
- package/mobile/dist/retail/utils/calculateInputs.js.map +1 -1
- package/mobile/dist/retail/utils/checkNewMicroservice.d.ts +1 -0
- package/mobile/dist/retail/utils/checkNewMicroservice.js +8 -0
- package/mobile/dist/retail/utils/checkNewMicroservice.js.map +1 -0
- package/mobile/dist/retail/utils/renderStep.d.ts +1 -2
- package/mobile/dist/retail/utils/renderStep.js +2 -2
- package/mobile/dist/retail/utils/renderStep.js.map +1 -1
- package/mobile/dist/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/mobile/dist/retail/validator/getRetailFormValidator.js +1 -1
- package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -1
- package/mobile/dist/ui-kit/SearchBar/SearchBar.d.ts +1 -2
- package/mobile/dist/ui-kit/SearchBar/SearchBar.js +1 -1
- package/mobile/dist/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.d.ts +0 -2
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js +1 -2
- package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -1
- package/mobile/dist/wlc.json +1 -2
- package/mobile/lib/api/apiBaseUrl.d.ts +0 -1
- package/mobile/lib/api/apiBaseUrl.js +0 -1
- package/mobile/lib/api/apiBaseUrl.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +6 -4
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +33 -23
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +13 -11
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +98 -4
- 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 +3 -2
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -2
- package/mobile/lib/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +1 -2
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +84 -13
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +16 -2
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +1 -2
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +52 -8
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/components/DebitForm/DebitFormStep.js +1 -2
- package/mobile/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/lib/components/Footer/Footer.js +1 -1
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/Header/DropdownMenu.d.ts +2 -2
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.d.ts +1 -1
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.js +5 -7
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.d.ts +3 -2
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js +36 -25
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/lib/retail/adaptors/getEmploymentData.js +25 -21
- package/mobile/lib/retail/adaptors/getEmploymentData.js.map +1 -1
- package/mobile/lib/retail/adaptors/utils.js +1 -1
- package/mobile/lib/retail/adaptors/utils.js.map +1 -1
- package/mobile/lib/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/lib/retail/api/apiBaseUrl.js +2 -1
- package/mobile/lib/retail/api/apiBaseUrl.js.map +1 -1
- package/mobile/lib/retail/api/checkCaptcha.d.ts +1 -0
- package/mobile/lib/retail/api/checkCaptcha.js +10 -3
- package/mobile/lib/retail/api/checkCaptcha.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +1 -0
- package/mobile/lib/retail/api/checkCode.js +9 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/createCaptcha.js +5 -1
- package/mobile/lib/retail/api/createCaptcha.js.map +1 -1
- package/mobile/lib/retail/api/createDraftTask.d.ts +2 -1
- package/mobile/lib/retail/api/createDraftTask.js.map +1 -1
- package/mobile/lib/retail/api/createParticipant.d.ts +6 -0
- package/mobile/lib/retail/api/createParticipant.js +3 -0
- package/mobile/lib/retail/api/createParticipant.js.map +1 -0
- package/mobile/lib/retail/api/doRequest.js +4 -2
- package/mobile/lib/retail/api/doRequest.js.map +1 -1
- package/mobile/lib/retail/api/esiaRequestProfile.js +11 -7
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -1
- package/mobile/lib/retail/api/getDictionaries.js +3 -1
- package/mobile/lib/retail/api/getDictionaries.js.map +1 -1
- package/mobile/lib/retail/api/getLink.js +5 -1
- package/mobile/lib/retail/api/getLink.js.map +1 -1
- package/mobile/lib/retail/api/sendCode.js +8 -1
- package/mobile/lib/retail/api/sendCode.js.map +1 -1
- package/mobile/lib/retail/api/sendMessage.d.ts +7 -0
- package/mobile/lib/retail/api/sendMessage.js +5 -0
- package/mobile/lib/retail/api/sendMessage.js.map +1 -0
- package/mobile/lib/retail/api/updateUserTask.d.ts +14 -8
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/mobile/lib/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/mobile/lib/retail/components/ConsentBkiDialog/useConsentBkiDialog.d.ts +9 -1
- package/mobile/lib/retail/components/ConsentBkiDialog/useConsentBkiDialog.js +28 -4
- package/mobile/lib/retail/components/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +2 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +2 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +2 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/retail/hooks/useLeadFormData.js +4 -2
- package/mobile/lib/retail/hooks/useLeadFormData.js.map +1 -1
- package/mobile/lib/retail/hooks/useRetailFormStore.d.ts +1 -1
- package/mobile/lib/retail/model/LeadFormState.d.ts +2 -4
- package/mobile/lib/retail/utils/calculateInputs.d.ts +1 -1
- package/mobile/lib/retail/utils/calculateInputs.js +2 -6
- package/mobile/lib/retail/utils/calculateInputs.js.map +1 -1
- package/mobile/lib/retail/utils/checkNewMicroservice.d.ts +1 -0
- package/mobile/lib/retail/utils/checkNewMicroservice.js +5 -0
- package/mobile/lib/retail/utils/checkNewMicroservice.js.map +1 -0
- package/mobile/lib/retail/utils/renderStep.d.ts +1 -2
- package/mobile/lib/retail/utils/renderStep.js +2 -2
- package/mobile/lib/retail/utils/renderStep.js.map +1 -1
- package/mobile/lib/retail/validator/getRetailFormValidator.d.ts +1 -2
- package/mobile/lib/retail/validator/getRetailFormValidator.js +1 -1
- package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -1
- package/mobile/lib/ui-kit/SearchBar/SearchBar.d.ts +1 -2
- package/mobile/lib/ui-kit/SearchBar/SearchBar.js +1 -1
- package/mobile/lib/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.d.ts +0 -2
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js +1 -2
- package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -1
- package/mobile/lib/wlc.json +1 -2
- package/mobile/src/api/apiBaseUrl.ts +0 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -0
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -0
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +50 -24
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +17 -11
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +129 -3
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +9 -1
- package/mobile/src/components/ApplicationLeadForm/useLeadFormStore.ts +2 -1
- package/mobile/src/components/ApplicationLeadForm/useSaveUserData.ts +2 -1
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +1 -2
- package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +84 -13
- package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +16 -2
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +1 -2
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +52 -8
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +1 -1
- package/mobile/src/components/DebitForm/DebitFormStep.tsx +1 -2
- package/mobile/src/components/Footer/Footer.tsx +3 -5
- package/mobile/src/components/Header/DropdownMenu.tsx +2 -2
- package/mobile/src/components/Header/HeaderQuickActionsMenu.tsx +7 -9
- package/mobile/src/retail/adaptors/getCreditFormTaskData.ts +42 -28
- package/mobile/src/retail/adaptors/getEmploymentData.tsx +25 -21
- package/mobile/src/retail/adaptors/utils.ts +1 -1
- package/mobile/src/retail/api/apiBaseUrl.ts +2 -1
- package/mobile/src/retail/api/checkCaptcha.ts +10 -2
- package/mobile/src/retail/api/checkCode.ts +11 -2
- package/mobile/src/retail/api/createCaptcha.ts +11 -4
- package/mobile/src/retail/api/createDraftTask.ts +2 -1
- package/mobile/src/retail/api/createParticipant.ts +17 -0
- package/mobile/src/retail/api/doRequest.ts +17 -12
- package/mobile/src/retail/api/esiaRequestProfile.ts +10 -2
- package/mobile/src/retail/api/getDictionaries.ts +6 -1
- package/mobile/src/retail/api/getLink.ts +10 -2
- package/mobile/src/retail/api/sendCode.ts +9 -1
- package/mobile/src/retail/api/sendMessage.ts +12 -0
- package/mobile/src/retail/api/updateUserTask.ts +14 -9
- package/mobile/src/retail/components/CaptchaDialog/CaptchaDialog.tsx +1 -1
- package/mobile/src/retail/components/ConsentBkiDialog/useConsentBkiDialog.tsx +54 -21
- package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +2 -1
- package/mobile/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +3 -0
- package/mobile/src/retail/hooks/useLeadFormData.ts +7 -2
- package/mobile/src/retail/model/LeadFormState.ts +2 -4
- package/mobile/src/retail/utils/calculateInputs.ts +2 -10
- package/mobile/src/retail/utils/checkNewMicroservice.ts +5 -0
- package/mobile/src/retail/utils/renderStep.tsx +1 -3
- package/mobile/src/retail/validator/getRetailFormValidator.ts +1 -3
- package/mobile/src/ui-kit/SearchBar/SearchBar.tsx +1 -3
- package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +28 -39
- package/mobile/src/ui-kit/YandexMap/useYandexMaps.ts +1 -4
- package/mobile/src/wlc.json +2 -2
- package/package.json +1 -1
- package/src/api/apiBaseUrl.ts +0 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +15 -0
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -0
- package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -0
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +50 -24
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +17 -11
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +129 -3
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +9 -1
- package/src/components/ApplicationLeadForm/useLeadFormStore.ts +2 -1
- package/src/components/ApplicationLeadForm/useSaveUserData.ts +2 -1
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +1 -2
- package/src/components/CreditCardForm/creditCardFormStepsData.tsx +84 -13
- package/src/components/CreditForm/CreditForm.fixture.tsx +12 -18
- package/src/components/CreditForm/CreditFormStatusTracker.tsx +16 -2
- package/src/components/CreditForm/CreditFormStep.tsx +1 -2
- package/src/components/CreditForm/creditFormStepsData.tsx +52 -8
- package/src/components/CreditForm/useCreditFormAPI.tsx +1 -1
- package/src/components/DebitForm/DebitFormStep.tsx +1 -2
- package/src/components/Footer/Footer.tsx +3 -5
- package/src/components/Footer/renderLogoSearchBar.tsx +2 -7
- package/src/components/Header/DropdownMenu.tsx +2 -2
- package/src/components/Header/HeaderQuickActionsMenu.tsx +7 -9
- package/src/retail/adaptors/getCreditFormTaskData.ts +42 -28
- package/src/retail/adaptors/getEmploymentData.tsx +25 -21
- package/src/retail/adaptors/utils.ts +1 -1
- package/src/retail/api/apiBaseUrl.ts +2 -1
- package/src/retail/api/checkCaptcha.ts +10 -2
- package/src/retail/api/checkCode.ts +11 -2
- package/src/retail/api/createCaptcha.ts +11 -4
- package/src/retail/api/createDraftTask.ts +2 -1
- package/src/retail/api/createParticipant.ts +17 -0
- package/src/retail/api/doRequest.ts +17 -12
- package/src/retail/api/esiaRequestProfile.ts +10 -2
- package/src/retail/api/getDictionaries.ts +6 -1
- package/src/retail/api/getLink.ts +10 -2
- package/src/retail/api/sendCode.ts +9 -1
- package/src/retail/api/sendMessage.ts +12 -0
- package/src/retail/api/updateUserTask.ts +14 -9
- package/src/retail/components/CaptchaDialog/CaptchaDialog.tsx +1 -1
- package/src/retail/components/ConsentBkiDialog/useConsentBkiDialog.tsx +54 -21
- package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +2 -1
- package/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +3 -0
- package/src/retail/hooks/useLeadFormData.ts +7 -2
- package/src/retail/model/LeadFormState.ts +2 -4
- package/src/retail/utils/calculateInputs.ts +2 -10
- package/src/retail/utils/checkNewMicroservice.ts +5 -0
- package/src/retail/utils/renderStep.tsx +1 -3
- package/src/retail/validator/getRetailFormValidator.ts +1 -3
- package/src/ui-kit/SearchBar/SearchBar.tsx +1 -3
- package/src/ui-kit/SearchDialog/SearchDialog.tsx +28 -39
- package/src/ui-kit/YandexMap/useYandexMaps.ts +1 -4
- package/src/wlc.json +2 -2
- package/bundle/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +0 -8
- package/dist/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +0 -8
- package/dist/components/ApplicationLeadForm/renderAgreementSubmit.js +0 -14
- package/dist/components/ApplicationLeadForm/renderAgreementSubmit.js.map +0 -1
- package/lib/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +0 -8
- package/lib/components/ApplicationLeadForm/renderAgreementSubmit.js +0 -11
- package/lib/components/ApplicationLeadForm/renderAgreementSubmit.js.map +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +0 -8
- package/mobile/dist/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +0 -8
- package/mobile/dist/components/ApplicationLeadForm/renderAgreementSubmit.js +0 -14
- package/mobile/dist/components/ApplicationLeadForm/renderAgreementSubmit.js.map +0 -1
- package/mobile/lib/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +0 -8
- package/mobile/lib/components/ApplicationLeadForm/renderAgreementSubmit.js +0 -11
- package/mobile/lib/components/ApplicationLeadForm/renderAgreementSubmit.js.map +0 -1
- package/mobile/src/components/ApplicationLeadForm/renderAgreementSubmit.tsx +0 -32
- package/src/components/ApplicationLeadForm/renderAgreementSubmit.tsx +0 -32
package/bundle/bundle.umd.min.js
CHANGED
|
@@ -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).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=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||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),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:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.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:y(t)}))),y=(e=3)=>x(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),x=(e,t)=>[e].concat(t>0?x(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||i}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={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:r="text-center",as:l,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[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(N,{className:u("whitespace-normal",r),...h?.title,as:l||h?.title.as,title:a}):null,i?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...p,children:i}):null]})})),k=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=k,blocksRegistry:l={},ancestors:s=I}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const R=[],D=(e,{key:t,ancestors:n=R,slotName:a=null,extraProps:i,renderProps:r=T,...l})=>{const s=i?(e,t)=>T(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||R,[l.parent,a]]:n},i)))};function P({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?D(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function E(){return E._impl()}E._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),E.setup=e=>{E._impl=e};const _=["CDN","BASE_PATH"],B=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}}),O=e=>Boolean(e?.includes(":")),A=(e,t)=>Boolean(e&&!O(e)&&(!t||"_self"===t)),M=e=>Boolean(e?.startsWith("#")),F=e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),L=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),z=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:O,isLocalURL:A,isHash:M,withoutQuery:F,joinPath:L,hasPrefix:z});const $="/api/",j=`${$}v1/storage`,q=[B.CDN,$],U=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 L(z(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||O(e)||M(e)||q.some(z(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:r="color",size:l,width:s=l&&Y[l],height:d=s})=>{const m=E(),h="normal"===r?`${n}.svg`:`sprites.svg#${n}`,p=U(m)(L(B.CDN,"/icons/",h));return"normal"===r?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[r],{"w-full h-full":!s,invert:"white"===r},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 Q(e=""){try{return new URL(e).pathname}catch(e){return""}}const Z=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Q(J.SITE_URL);return t&&!O(t)?U(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=E();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},r)=>o("source",{srcSet:Z(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Z(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)),re={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","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},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?re[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return l((()=>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"),fe="/",ye=["/api"];function be(){const e=E(),{closeAll:t}=ge();return n=>{const a=U(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const r=Q(J.SITE_URL);xe(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=fe,t=fe)=>[e,t].some((e=>e===fe))?e:e.replace(t,"")||fe)(a,r)))}))}}}const xe=(e,t,n)=>A(e,t)&&![...ye,...J.SUB_PORTALS?.split(",")??[]].some(z(e))&&z(e)(n||"/"),ve=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ne=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ce(e)&&"hidden lg:block";return c("div",{className:u(we(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ce(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":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),we=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",Ce(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ce=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Se=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ke=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:a}),s=be()({onClick:l,href:a,...i}),c=t??o(Ne,{...s});return o(e?Te:Ie,{...s,children:c})})),Ie=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ve(d),children:m}))),Te=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Se({className:e,rounded:a,version:n}),children:i})));function Re({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="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}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(ke,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const De=()=>{const[e,t]=a(false);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"},Ee=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Pe[n],t),children:e}):null,_e=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...b})=>{const x=De(),v=E(),N=r((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!x;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Re({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:[Ee(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:[Be(h,y),Ae(P({...b,extraProps:{className:"@container-normal"}})),Ee(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Oe(p)]:l,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),Be=(e,t)=>e||t?c("div",{className:"space-y-lg",children:[e,t]}):null,Oe=e=>u(e?"row-span-2":"@xl:row-span-2"),Ae=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Me=(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,Fe=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)),Le=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,ze=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ve=(e,t)=>e?o(ze,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>["label"in e?Ve(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Le(e.description,t)},String(t)):null,"__html"in e?o(Fe,{...e},`rte-${t}`):null],je=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?Me(n.icon,t):null,o("div",{children:$e(n)})]}))),qe=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(je,{benefitsVersion:t,...e},String(n))))}):null)),Ue=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($e)}):null)),We=d((({isTabularBenefits:e,...t})=>o(e?Ue:qe,{...t}))),He=e=>Boolean(e?.src||e?.icon),Ye=(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(Ge(n))}):null,Ge=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ke(i,l),d=Ke(r,l);return a||i?.icon?o(ke,{className:u("basis-full @lg:basis-auto",e),appendLeft:Xe({...i,iconVersion:c}),appendRight:Xe({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ke=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Xe=e=>He(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Je=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Qe=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(Ze)}):null)),Ze=({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 rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(ze,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Je(2)(t)," ",n||"₽"]}):null]},String(a)),et=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(ze,{size:"text-m",font:"font-light",children:e})},String(t)),nt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},at=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:y,image:b,imageOptions:{imageAlign:x="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const R=b?.src?o(ie,{image:b,imageClassName:C}):null,D=o(S,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),P=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(_e,{className:e,padding:t,defaultPadding:n,...p?{title:D}:{insetTitle:D},...ot(R,v),isImageSecondary:w,imageAlign:x,isImageAlwaysOnRight:N,buttons:Ye(y),backwardButton:k,...T,children:st(it(P,{benefitsVersion:s,isTabularBenefits:c}),rt(u,{richVersion:h,isDotted:d,headlineVersion:r}),I,lt(g),ct(f))})})),it=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(We,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,rt=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Fe,{__html:e,richVersion:t,isDotted:n,itemSize:nt[a??"L"]}):null,lt=e=>e?.length?o(Qe,{priceList:e}):null,st=(...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},ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(et,{tags:e}):null;class dt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof dt?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 mt=()=>!0,ut=(e,t)=>(...n)=>e(...n)&&t(...n),ht=(...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 pt=e=>Boolean(e&&Array.isArray(e)),gt=e=>Boolean(e&&"object"==typeof e&&!pt(e)),ft=e=>e;function yt(e){return e instanceof dt?e._:e}class bt extends dt{from(e){return this.of(e.map(((e=ft)=>([,t])=>e(t))(yt)))}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(pt(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 dt{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 vt extends dt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,yt(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 Nt extends dt{proto=ht([e=>pt(this._)||"number"==typeof e,()=>bt.prototype],[e=>gt(this._)||"string"==typeof e,()=>vt.prototype],[mt,()=>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 wt=e=>e instanceof dt?e:new Nt(e),Ct=e=>{const t=(t,...n)=>yt(e(wt(t),...n));return t.fn=e,t},St=[],kt=e=>e instanceof Function?e:t=>e===t,It=e=>(t,n,a=St)=>wt(t).entries().reduce(((t,[n,i])=>It(e)(i,t,a.concat(n))),e(n,[a,wt(t)])),Tt=Ct(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Tt(e.get(a),[i,n]):n)})),Rt=Ct(((e,t)=>t.reduce(Tt.fn,e))),Dt=e=>It(((e,[t,n])=>Pt(n)?[...e,[t,yt(n)]]:e))(e,[]),Pt=e=>0===e.size();Ct(((e,t=St)=>t.reduce(((e,t)=>e.get(t)),e)));const Et=Ct(((e,[t,...n])=>n.length?e.set(t,Et(e.get(t),n)):e.filter((([e])=>e!==t)))),_t=(Bt=["$ref"]).map(((e,t)=>n=>kt(e)(n[t+n.length-Bt.length]))).reduceRight(ut,mt);var Bt;const Ot=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(At,e),At=ht([pt,(e,t)=>e[parseInt(t,10)]],[gt,(e,t)=>e[t]],[mt,ft]),Mt=(e,t)=>((e,t={})=>n=>Rt(t,Dt(n).map((t=>e(t)))))((([e,n])=>{return _t(e)?[(a=e,a.slice(0,-1)),Ot(t(n),n)]:[e,n];var a}))(e),Ft=e=>Dt(e).filter(((e=ft)=>([t])=>e(t))(_t)),Lt=e=>{return t=Ft(e).map((([,e])=>e)),[...new Set(t)];var t};async function zt(e,t){try{return e?await Vt(e,t):null}catch(e){console.error(e)}return null}const Vt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),$t=e=>[...new Set(e)],jt={},qt=["/portal-resources"],Ut=(e,t)=>Mt(e,(e=>t?.[e])),Wt=(e,t)=>{const n=Lt(e),[r,l]=a({});return i((()=>{Ht(n).then(l)}),[n.join()]),n.length?Ut(e,{...t,...r}):e},Ht=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled($t(e).filter((e=>!qt.some((t=>e.startsWith(t))))).map((async e=>(jt[e]||=await Vt(e),[e,jt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Lt(e)));return i.length?Ht(i,a):a}return t};function Yt(e,t={}){const n=d((t=>{const n=Wt((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Gt=Yt((({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(at,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})}))),Kt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Xt(0,t?.length)),[t]),a=t?.[n];return a?o(Gt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Xt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e);function Jt(){return Jt._impl()}Jt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Jt.setup=e=>{Jt._impl=e};const Qt="rshb-query-params";function Zt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Qt)||"";return e&&globalThis.sessionStorage?.setItem(Qt,e),e}const en=async e=>{const t=e.target?.closest("a"),n=Jt();if(O(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=Zt();if(!O(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 tn(){return tn._impl()}function nn(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const an=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],rn=e=>!e?.length,ln=e=>t=>n=>e(n)?[]:[t],sn={},on=[];const cn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function dn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=cn(i,r)?i:r;return!cn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),h=s(mn(e)),[p,{setTrue:g,setFalse:f}]=nn(!1),y=s({}),[b,{isValid:x,errors:v}]=function(e,t){const n=l((()=>t?.(e)??sn),[t,e]),a=l((()=>an(n)(e)??on),[n,e]),i=rn(a);return[n,{isValid:i,errors:a}]}(m,n),N=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=p||y.current?.[String(e)],s=t?.validator??b[e],o=l&&s?s(r):[];return{setFieldRef:t=>{h.current&&(h.current[e]=t)},fieldRef:h.current?.[e],value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{y.current||={},y.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,p,b,u]),w=r((e=>{y.current=e,u(e)}),[u]),C=r((()=>{y.current={},f(),u(e)}),[e,u]),S=r((e=>{if(e.preventDefault(),x)t&&C(),d?.(m,e);else{const e=un(m,b);g(),N(e).fieldRef?.scrollIntoView({behavior:"smooth"})}}),[t,m,x,C,d]);return[m,{errors:v,field:N,update:w,reset:C,onSubmit:S}]}const mn=e=>Object.keys(e).reduce(((e,t)=>({...e,[t]:null})),{}),un=(e,t={})=>{const[n=""]=Object.entries(e).find((([e,n])=>t[e]?.(n)?.length))??[];return n},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(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function pn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const gn=/^[а-яё-]*$/i,fn=ln((e=>null!=e&&""!==e)),yn="Некорректно заполненное поле",bn=e=>fn(e??yn),xn=e=>ln((e=>e?.key&&""!==e?.key))(e??yn),vn=e=>ln((e=>"string"==typeof e&&e.length>1&&((e="")=>gn.test(e))(e)))(e??yn),Nn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),wn=e=>/^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Cn=e=>ln(Nn)(e),Sn=ln((e=>"boolean"==typeof e&&e))("Согласие обязательно"),kn=e=>"string"==typeof e&&(10===e.length||12===e.length),In={fullName:bn(),addressBranch:xn(),desiredMeetingDate:bn(),product:bn(),localities:bn(),partnerComments:bn(),collectionCount:bn(),acquiringType:xn(),serviceType:xn(),annualRevenue:bn(),feedbackMethod:xn(),serviceDirection:xn(),secondaryPhone:Cn("Укажите номер телефона"),region:xn(),situationDescription:bn(),sufferedFrom:bn(),applierType:bn(),surname:vn("Укажите свою фамилию на кириллице"),name:vn("Укажите своё имя на кириллице (без сокращений)"),middleName:vn("Укажите своё отчество на кириллице"),birthday:bn("Укажите дату рождения"),phone:Cn("Укажите номер телефона"),email:(Tn="Укажите электронную почту",ln((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(Tn)),inn:(e=>ln((e=>kn(e)))(e))("Укажите ИНН"),comment:bn(),typeForm:bn(),consentToReceiveMaterials:Sn,consentDataProcessing:Sn,partnerSymbolCode:bn("Укажите идентификатор партнёра"),dadataPartyInnSelect:(e=>ln((e=>Boolean(e?.text)&&kn(e.text)))(e))("Укажите ИНН"),dadataPartyNameSelect:bn("Укажите наименование организации"),callbackTime:bn(),questionProduct:bn(),russianPhone:(e=>ln(wn)(e))("Укажите номер телефона")};var Tn;const Rn=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...In,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(Dn(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(Dn(a)).filter(Pn(e)).map((({name:e})=>[e,a[e??""]]))):r},Dn=(e={})=>({name:t})=>Boolean(e[t??""]),Pn=e=>t=>!t?.condition||t.condition.values.some((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),En=()=>{},_n={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")},Bn=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),On=u("bg-main-gray text-main-disabled cursor-not-allowed"),An=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=En})=>{const y=r("tab"!==c?me(f):f,[c,f]),b=l((()=>ve(m)),[m]),x="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[_n[n]]:!s&&!i,[Bn]:i,[On]:s},i?"justify-between":"justify-center",i||x?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":x},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...b,onClick:y,children:p})})),Mn=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"})}))),Fn={sm:"max-w-sm top-1/3",lg:"max-w-lg","4xl":"max-w-4xl",none:"mt-0"},Ln={center:"relative mx-auto",corner:"absolute bottom-0 right-0"},zn=d((({head:e,maxWidth:t="4xl",children:n,onClose:a,onClick:i,position:r="center"})=>{const l=De();return c("div",{className:u("bg-white p-lg pb-6xl my-6xl rounded-lg w-full",Fn[t],Ln[r],{"mr-3xl":!l&&"corner"===r},{"mb-12":l}),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Mn,{className:"absolute top-0 right-0 z-10",onClose:a}),o("div",{className:"container",children:e})]}),o("div",{className:"container",children:n})]})})),Vn=d((({ok:e,typeForm:t,onClose:n,errorMessage:a})=>{const i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся",r=a||"Пожалуйста, повторите позднее";return o(zn,{maxWidth:"lg",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?i:r,headlineVersion:"XS",isEmbedded:!0}),o(An,{type:"button",onClick:n,children:"Хорошо"})]})})})),$n=({label:e,errors:t})=>e&&t?`${e}*`:e,jn=e=>o("div",{className:"min-h-6",children:e?o(ze,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),qn=(e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a},Un=e=>e?o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null;function Wn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Hn(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return Wn(globalThis.document,"click",n),t}const Yn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Gn=e=>e?Yn:"border-error",Kn=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:b=!1,children:x,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),S=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=x?"pr-3xl":"",I=Gn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Un(d),y?o("textarea",{className:u("block resize-y min-h-24",Xn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:b,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Xn,k,I),id:n,type:l,value:h,name:a||n,placeholder:m,pattern:g,disabled:b,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),x]})})),Xn="w-full border rounded-md text-primary-text outline-none p-m",Jn=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:h,isOpen:p,onOpen:g,onClose:f,onChange:y=En,...b})=>{const x=Hn(f),v=r((e=>{const t=m&&e.length>m;!p&&g(),t||y(Qn(e,s))}),[p,y]);return c("div",{className:u("shrink-0 w-full",e),ref:x,onBlur:f,onFocus:g,children:[o("div",{ref:h,children:o(Kn,{type:l||"text","aria-label":t,label:$n({label:t,errors:i}),valid:Boolean(!a),onChange:v,placeholder:Zn({placeholder:d,errors:i,label:t}),value:n,...b})}),jn(a)]})})),Qn=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,Zn=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,ea=d((e=>{const[t,{setFalse:n,setTrue:a}]=nn();return o(Jn,{isOpen:t,onOpen:a,onClose:n,...e})})),ta=({query:e,isDisabled:t,onChangeQuery:n,inputProps:a})=>o("div",{className:"absolute top-0 w-full z-20",children:o(ea,{type:"text",value:e,autoFocus:!0,disabled:t,onChange:e=>n(e),maxLength:a?.maxLength,isInteger:a?.isInteger??!1})}),na=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),aa=e=>e?.text||e?.key||"",ia=({isManualInput:e,query:t,value:n,placeholder:a})=>e&&t?t:aa(n)||a,ra=({isBorder:e=!0,valid:t=!0,isDisabled:n=!1,isOpen:a=!1,onOpen:i=En,onClose:r,isManualInput:l=!1,query:s="",value:d,placeholder:m="",iconVersion:h="black",options:p=[]})=>{const g=la(l,p,s);return c("div",{className:u({"border rounded-md":e},{"hover:border-primary-hover":e&&!n},n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error","h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden"),onClick:a?r:i,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:ia({isManualInput:l,query:s,value:d,placeholder:m})}),g?"":na(a,h)]})},la=(e,t,n)=>!(!e||!n?.length)||e&&!t.length,sa=()=>ue(pe.emitter,"popup"),oa=(e,t,n=!1)=>e?.length&&t?.trim()&&!n?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,ca=d((({popupRef:e,options:t,value:n,iconVersion:a,onChange:i,renderOptions:r=da,query:l,onChangeQuery:s,disableFilterOptions:d})=>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:oa(t,l,d).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&&(s?.(""),i(e))},children:[r(e),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:a,className:u("absolute right-2 pt-2xs",{hidden:e.key!==n?.key})})]},e.key)))}):null)),da=e=>o("span",{className:"min-h-6",children:aa(e)});const ma=d((({className:e,label:t,options:n=[],value:d,isSearch:m=!1,isManualInput:h=!1,disabled:p=!1,iconVersion:g="black",onChange:f,onSearchQuery:y=En,inputProps:b,disableFilterOptions:x=!1,renderOptions:v,...N})=>{const[w,{setFalse:C,setTrue:S}]=nn(),[k,I]=a(""),T=p||!h&&0===n.length,R=l((()=>qn((e=>y(e)),300)),[y]),D=r((()=>{T||S()}),[T]),P=r((()=>{!m&&I(""),C()}),[h]),E=r((e=>{I(e),h&&f?.({key:e,text:e}),R?.(e)}),[h,f,R]),_={query:k,value:d,options:n,isOpen:w,iconVersion:g,renderOptions:v,isSearch:m},B=function({isOpen:e,options:t,value:n,query:a,onChange:l=En,onClose:c=En,iconVersion:d,disableFilterOptions:m=!1,onChangeQuery:u=En,renderOptions:h,isSearch:p=!1}){const g=sa(),f=r((()=>{g.close(),c()}),[c]),y=r((e=>{f(),l(e),u(p&&e?.text?e.text:"")}),[f,l]);i((()=>{u(p&&n?.text?n.text:"")}),[n]);const b=s(null),x=Hn(f);return i((()=>{if(!e||!b.current)return;const i=b.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();g.open({popup:o(ca,{popupRef:x,options:t,value:n,query:a,iconVersion:d,disableFilterOptions:m,onChange:y,onChangeQuery:u,renderOptions:h}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,y]),b}({onChange:f,onClose:P,disableFilterOptions:x,onChangeQuery:I,..._});return c("div",{className:u("space-y-xs",e),children:[Un(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:B,children:[ra({isDisabled:T,onClose:P,onOpen:D,isManualInput:h,..._,...N}),m&&w?ta({query:k,isDisabled:T,inputProps:b,onChangeQuery:E}):null]})]})})),ua=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(ma,{...i,valid:!n,label:$n({label:t,errors:a})}),jn(n)]}))),ha="client",pa=[{key:ha,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],ga=d((({field:e,input:t})=>o(ua,{label:"Тип обратившегося",...t,options:pa,...e("applierType")}))),fa=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...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)}))}))),ya=[{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"}],ba=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(fa,{paths:ya,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",va(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":wa(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Na(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,xa(n)]})})})),xa=e=>e?o("div",{className:"ml-s",children:o(ze,{size:"text-l",font:"font-light",children:e})}):null,va=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Na=(e=!1)=>e?"radio":"checkbox",wa=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ca={horizontal:"@lg:flex-row",vertical:""},Sa=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(ze,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Ca[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ba,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),ka=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ia=d((({field:e,input:t})=>{const n=r((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(Sa,{className:"whitespace-normal",orientation:"horizontal",items:ka,...e(t?.name??"",{onChange:n})})})})),Ta=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Ra=d((({field:e,input:t})=>o(ua,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Ta,...e(t?.name??"")}))),Da=(e="")=>Boolean("trade"===e||"all"===e),Pa=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,isPremium:p,dadataPartyNameSelect:g,dadataPartyInnSelect:f,...y}=e,b=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${Da(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,x={...y,...Oa(o),...Ba(c),...d&&{inn:d},...b?{partnerComments:b}:{},...s?{typeForm:s}:{},..._a(m?.text,u),...Ea(h),...Aa([[f,"inn"],[g,"fullName"]])};return Object.fromEntries(Object.entries(x)?.map((([e,t])=>[e,t?.key||t])))},Ea=e=>e?.key?{isClient:e?.key===ha}:{},_a=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Ba=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Oa=e=>e?{vedTypes:Object.fromEntries(ka.map((({id:t})=>[t,t===e])))}:{},Aa=e=>e.reduce(((e,[t,n])=>(t?.text&&n&&(e[n]=t.text),e)),{}),Ma=[{key:"ULTRASERVICE",text:"Ультра"}],Fa=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],La=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],za={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:Ta[0],serviceType:Ma[0],feedbackMethod:La[0],serviceDirection:Fa[0],vedTypes:ka[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Va=()=>{const e=(new Date).getTimezoneOffset(),t=Math.abs(e),n=t%60;return`GMT${e<0?"+":"-"}${Math.floor(t/60).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},$a="/api/v1",ja=(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}`}},qa=e=>e?.replace(/[^+\d]/g,""),Ua=(e,t,n)=>{const{typeForm:a,region:i,phone:r="",email:l,birthday:s,desiredMeetingDate:o,inn:c,fullRegion:d,addressBranch:m,secondaryPhone:u="",bankEmpolee:h,applicationDate:p,partnerName:g,russianPhone:f,partnerSymbolCode:y,...b}=e;return{typeForm:a,...Ya(i,t),...Ga(l,t),...Wa(r),...Wa(f),...Ha(o,"desiredMeetingDate"),...t?Ha(s):{inn:c},..."FEEDBACK"===a?{}:{addressBranch:m,bankEmpolee:h,applicationDate:p,...Ka(u)},...Ja(a,n),...Xa(a,{fullRegion:d,partnerName:g,partnerSymbolCode:y}),...b}},Wa=e=>e?{phone:qa(e)}:{},Ha=(e,t="birthday")=>e?{[t]:ja(e)}:{},Ya=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Ga=(e,t=!0)=>({[t?"email":"mail"]:e}),Ka=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:qa(e)}:{},Xa=(e,t)=>"PF"===e?{region:t?.fullRegion,partner:t?.partnerName,partnerId:t?.partnerSymbolCode}:{},Ja=(e,t)=>"UNIVERSAL"===e?{typeForm:t?.pathname?.split("/")?.at(-1)||"/"}:{};function Qa(){return{send:async function(e,t,n=!1){const{serviceDirection:a}=e,i=n&&"Юридическое лицо / ИП"!==a,r=`${$a}${i?"/lead":"/sendcorporatelead"}`,l=Ua(e,i,t);try{const e=await Za(r,l);return e?.ok?await e.json():null}catch(e){return null}},sendCode:async function({phone:e}){const t=(e=>({...Wa(e)}))(e);try{const e=Za(`${$a}/initCorporateLead`,t).then((async e=>{if(!e.ok)throw new Error(`Ошибка HTTP: ${e.status}`);return await e.text()}));return await e}catch(e){return null}},checkCode:async function({reqId:e,code:t,body:n}){const a={requestId:e,confimationCode:t,leadRequest:Ua(n,!1)};try{const e=await Za(`${$a}/confirmCorporateLead`,a);return await e.json()}catch(e){return null}},sendPhoneCallRequest:async function(e,t=!1){const n=Ua(e,t),a=ei(n);try{const e=await Za(`${$a}/callback`,a);return e?.ok?await e.json():null}catch(e){return null}}}}const Za=(e,t)=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(t)}),ei=e=>{const{typeForm:t,consentDataProcessing:n,phone:a,...i}=e;return{...i,phone:a?.startsWith("+")?a.slice(1):a,clientTimezone:Va()}},ti=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}},ni=Qa(),ai=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","extraSmall"===a&&"border-2 h-4 w-4","small"===a&&"border-4 h-8 w-8","big"===a&&"border-8 h-28 w-28",e),role:"status"})}))),ii=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(An,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(ai,{blur:!0,size:"small"}):null,n]}))),ri=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},li={primary:_n.primary,secondary:_n.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:_n.secondary,transparent:"","":""},si=d((e=>{const t=be(),{className:n,href:a,target:i,text:r,aboveText:l,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",{[li[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:p,...ve(m),children:h??oi(r,l)})})),oi=(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,ci=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(ze,{children:e}):null,t?o(si,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),di=({consentDataProcessing:e,link:t,button:n,typeForm:a})=>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(ba,{...e}),o(ci,{link:t})]}),jn(ri(e,Sn).error)]}):o(ci,{text:"PF"===a?"Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ":"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(ii,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),mi=e=>null!=e,ui=new Map,hi=(e,t=ui)=>n=>{const a=gi(n),i=t.get(a);if(a&&mi(i))return i;const r=e(...n);return a&&mi(r)&&t.set(a,Promise.resolve(r)),r},pi=e=>Boolean(e?.every((e=>Array.isArray(e)?pi(e):!e||"string"==typeof e))),gi=e=>pi(e)?e.toString():"",fi=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function yi(e,t,{fallback:n,cache:r}={}){const s=l((()=>bi(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(mi))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await hi(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&fi(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function bi(e){return Array.isArray(e)?e:e instanceof Function?bi(e()):[e]}const xi=`${$a}/branches`,vi=[];const Ni=async e=>await zt(e,{method:"GET"})||vi;function wi(e=!1){const{data:t}=yi(`${$a}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Vt);return Array.isArray(t)?t:[]}const Ci=(e="")=>"ULTRASERVICE"===e,Si=d((({field:e,input:t,params:n})=>{const a=Ci(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?wi(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=yi(e?`${xi}?regionCode=${e}`:null,Ni);return t||vi}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(ua,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),ki=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Ii=(e,t,n)=>Math.max(t,Math.min(e,n));function Ti(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ri({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){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||r?"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:r,onChange:t=>{const n=Ti(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const Di=1,Pi=100,Ei=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:Di),max:s=(i.length?i.length-1:Pi),step:d=1,value:m=i[0]||l,disabled:h=!1,onChange:p}=e,g=ki(e,{normalize:(e=0)=>i.length?_i(i)(e):Ii(e,l,s),format:Je()}),f=r((e=>{p&&p(Ti(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m box-border","text-primary-text",Yn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Ri({list:i,min:l,max:s,step:d,disabled:h,value:m,onChange:p})]}),Bi(a)]})})),_i=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),Bi=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Oi=["От 1 000 ₽","До 1 000 000 000 ₽"],Ai=d((({field:e,input:t})=>o(Ei,{title:"Сумма, ₽",items:Oi,min:1e3,max:1e9,...e(t?.name??"")}))),Mi=d((({field:e,input:t})=>o(ea,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),Fi=d((({field:e,input:t})=>o(ea,{label:"Дата и время обращения в Банк",...e(t?.name??"")}))),Li=d((({field:e,input:t})=>o(ea,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),zi=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,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=Vi(t,e),c=$i(t,r,l);u.push(o("td",{children:o("div",{className:ji(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Vi=(e,t)=>t&&e.toDateString()===t.toDateString(),$i=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),ji=(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"),qi=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ui=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:r=En})=>{const{firstDayOfWeek:s,totalDays:d}=l((()=>({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:qi.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:zi({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:r})})]})})),Wi=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Hi(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Yi),r=a.map(((e,t)=>Ki(e)?a.slice(0,t).filter(Ki).length:-1)),l=a.map(((e,t)=>Gi(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Yi=e=>"_"===e,Gi=e=>/\d/.test(e),Ki=e=>Yi(e)||Gi(e),Xi=1940,Ji={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Qi=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{er({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 rounded-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Hi(t,"__.__.____"))},onBlur:()=>{Zi(p)?er({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(G,{className:"mr-s",...Ji})]})})),Zi=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Xi&&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},er=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Zi(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},tr=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(Qi,{onChange:a,disabled:l,onClick:e,value:t&&ja(t),setSelectedMonth:i,setSelectedYear:r,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")}),nr=Wi.map((e=>({key:e}))),ar=Array.from({length:(new Date).getFullYear()-Xi+1},((e,t)=>Xi+t)).reverse().map((e=>({key:String(e)}))),ir=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},rr=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},lr={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},sr={className:"min-w-32",iconVersion:"black",isBorder:!1},or=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=nn(!1),[y,b]=a(n?.getMonth()||(new Date).getMonth()),[x,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=r((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:S,handleSelectYear:k,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:R,ref:D}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=Hn(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(Wi.indexOf(e));const t=ir(l,Wi.indexOf(e));rr({maxDateOfMonth:t,selectedYear:l,selectedMonth:Wi.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:nr,yearsOptions:ar,ref:c}})({onYearSelect:v,onMonthSelect:b,onShowCalendar:g,selectedYear:x,selectedMonth:y,showCalendar:p,onChange:h,value:n}),P=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(D,370);return c("div",{className:u("space-y-xs",e),ref:D,children:[Un(t),c("div",{className:"relative",children:[tr({handleChangeVisibleCalendar:R,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:b,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":P}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...lr,className:"-rotate-90 cursor-pointer"})}),o(ma,{onChange:S,value:{key:Wi[y]},options:I,...sr}),o(ma,{onChange:k,value:{key:String(x)},options:T,...sr}),o("div",{className:"my-auto",onClick:C,children:o(G,{...lr,className:"rotate-90 cursor-pointer"})})]}),o(Ui,{today:n,currentMonth:y,currentYear:x,min:s,max:d,onDateSelect:N})]}):null]})]})})),cr=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(or,{label:$n({label:t,errors:a}),valid:Boolean(!n),...i}),jn(n)]}))),dr=d((({field:e,input:t})=>o(cr,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),mr=[{key:"Перезвонить сейчас",text:"Перезвонить сейчас"},{key:"Перезвонить через час",text:"Перезвонить через час"},{key:"Перезвонить через два часа",text:"Перезвонить через два часа"},{key:"Перезвонить завтра",text:"Перезвонить завтра"}],ur=d((({field:e,input:t})=>o(ua,{label:"Когда перезвонить?",...t,options:mr,...e(t?.name??"")}))),hr=d((({field:e,input:t})=>o(ea,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),pr=d((({field:e,input:t})=>o(ea,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0})));function gr(e,t){i((()=>{const t=e();return()=>{t.then((e=>{e instanceof Function&&e()}))}}),t)}const fr=e=>({value:e?.value||""}),yr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=fr,responseFilter:l}=e,s=((e,t)=>n=>{const a=n?.suggestions||[];return(t?a.filter(t):a).map((t=>{const n=e(t);return{...t,processedValue:n.value,additionalValue:n.additionalValue}}))})(r,l),o=`${a?`${a}, `:""}${n}`;return 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(s)},br=async e=>(await yr({url:"suggest/party",query:e})).map((e=>({fullName:e?.value,address:e?.data?.address?.value,inn:e?.data?.inn}))),xr={dadataPartyInnSelect:{fieldValue:"inn",linkedFieldName:"dadataPartyNameSelect",linkedFieldValue:"fullName"},dadataPartyNameSelect:{fieldValue:"fullName",linkedFieldName:"dadataPartyInnSelect",linkedFieldValue:"inn"}},vr={dadataPartyInnSelect:{label:"ИНН",inputProps:{isInteger:!0,maxLength:12}},dadataPartyNameSelect:{label:"Полное наименование"}},Nr=d((({field:e,input:t={}})=>{const n=t.name??"",i=xr[n].linkedFieldName,r=e(i).value,s=r?.data;gr((async()=>{if(s?.fullName&&s?.fullName!==e(n)?.value?.data?.fullName){const t=wr(r),{fullName:a,address:l,inn:s}=t,o=Sr(t,i),c=br(o);u(o),d(await c),e(n)?.onChange?.({key:s,text:o,data:{fullName:a,address:l}})}}),[s]);const[c,d]=a([]),[m,u]=a("");gr((async()=>{const e=br(m);return d(await e),c}),[m]);const h=l((()=>(c||[]).map(((e={})=>({key:e.inn??"",text:e[xr[n].fieldValue],data:{fullName:e.fullName,address:e.address}})))),[c]);return o(ua,{...vr[n],options:h,...e(t.name??""),isSearch:!0,isManualInput:!0,disableFilterOptions:!0,onSearchQuery:u,renderOptions:Cr})})),wr=e=>({inn:e?.key,fullName:e?.data?.fullName,address:e?.data?.address}),Cr=e=>c("span",{children:[o(ze,{size:"text-s",children:e?.data?.fullName}),c("div",{className:"space-x-2",children:[o(ze,{size:"text-s",font:"font-light",children:e?.key}),o(ze,{size:"text-s",font:"font-light",children:e?.data?.address})]})]}),Sr=(e,t)=>e?.[xr[t].linkedFieldValue],kr=d((({field:e,input:t})=>o(cr,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Ir=d((({field:e,input:t})=>o(ea,{label:"Электронная почта",...e(t?.name??""),...t}))),Tr=d((({field:e,input:t})=>o(ua,{label:"Способ получения ответа",options:La,...e(t?.name??"")}))),Rr=d((({field:e,input:t})=>o(ea,{label:"ФИО",...e(t?.name??""),...t}))),Dr=d((({field:e,input:t,params:n})=>{const a=n?.isPremium,i=wi(a),r=l((()=>i?.map((({region:e})=>({key:e,text:e})))),[i]);return o(ua,{label:"Регион",placeholder:"Выберите регион",options:r,...e(t?.name??"")})})),Pr=d((({field:e,input:t})=>o(ea,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),Er=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(ba,{text:t,value:n,disabled:i,onChange:l},a),jn(r)]}))),_r=d((({field:e,input:t})=>o(Er,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Br=`${$a}/outservice`,Or=[];async function Ar(){const e=await zt(`${Br}/outserviceregions`);return e&&Array.isArray(e)?e:Or}const Mr=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=yi("outServiceRegions",Ar),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(ua,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),Fr=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,Lr=d((({field:e,input:t})=>o(ea,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:Fr(e,t),...e(t?.name??""),...t}))),zr=d((({field:e,input:t})=>o(ea,{label:"Имя",maxLength:60,disabled:Fr(e,t),...e(t?.name??""),...t}))),Vr=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),$r=d((({field:e,input:t})=>Da(e("acquiringType")?.value?.key)?o(Vr,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),jr=d((({field:e,input:t})=>o(ea,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),qr=Yt((({field:e,input:t={},source:n})=>{const a=e("partnerSymbolCode")?.value;return i((()=>{const t=Ur(n?.agentsList,a)||"Неизвестный партнёр";t&&e("partnerName")?.onChange?.(t)}),[a]),o(ea,{...e(t.name??""),...t,type:"hidden"})})),Ur=(e=[],t="")=>e.find((({symbolCode:e})=>e===t))?.agentName??"",Wr=Yt((({field:e,input:t,source:n})=>{const i=n?.agentsList??[],[r,l]=a(""),[s,c]=a("");return o(ea,{label:"Идентификатор партнёра",...e(t?.name??""),...t,isInteger:!0,value:s,error:r??e("partnerSymbolCode")?.error,errors:[r??e("partnerSymbolCode")?.error],onChange:t=>{var n;c(t),e("partnerSymbolCode")?.onChange?.(t),l(t&&(n=t,!i.some((({symbolCode:e})=>e===n)))?"ID партнера не найден. Обратитесь к своему менеджеру":"")}})})),Hr=e=>"_"===e,Yr=e=>/\d/.test(e),Gr=e=>Hr(e)||Yr(e),Kr=[..."+7 (___) ___-__-__"],Xr=Kr.findIndex(Hr),Jr=Kr.map(((e,t)=>Gr(e)?Kr.slice(0,t).filter(Gr).length:-1));function Qr(e){const t=e.replace(/\D/g,""),n=Kr.map(((e,n)=>Yr(e)?e:t.charAt(Jr[n])||e)),a=Jr.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Xr,a)):n).join("")}const Zr=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(Qr(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Kn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),el=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Zr,{"aria-label":t,label:$n({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),jn(a)]}))),tl=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(el,{label:"Телефон",disabled:Fr(e,t,n),...e(n),...t})})),nl=d((({field:e})=>Da(e("acquiringType")?.value?.key)?o(Vr,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),al=Yt((({field:e,input:t,source:n})=>o(ua,{placeholder:"Выберите продукт",label:"Продукт",options:il(n?.productList),...e(t?.name??"")}))),il=e=>(e??[]).map((e=>({key:e,value:e}))),rl=[{key:"Вопрос по действующему продукту",text:"Вопрос по действующему продукту"},{key:"Оформление нового продукта",text:"Оформление нового продукта"}],ll=d((({field:e,input:t})=>o(ua,{label:"Какой у вас вопрос?",options:rl,...e(t?.name??"")}))),sl=`${$a}/regions`,ol=[];function cl(e=sl){const{data:t}=yi(e,Vt);return Array.isArray(t)?t:ol}const dl=`${$a}/outservice/outserviceregions`,ml=d((({field:e,input:t,params:n})=>{var a;const i=cl((a=n?.typeForm,"OUTSERVICE"===a?dl:void 0));return o(ua,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),ul=d((({field:e,input:t})=>o(ea,{label:"ФИО представителя",...t,...e("representativeName")}))),hl=d((({field:e})=>{const t=e("secondaryPhone");return o(el,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ri(t,In.secondaryPhone):t})})),pl=d((({field:e,input:t})=>o(ua,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Fa,...e(t?.name??"")}))),gl=d((({field:e,input:t})=>o(ea,{label:"Описание ситуации",...t,...e("situationDescription")}))),fl=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],yl=d((({field:e,input:t})=>o(ua,{label:"Пострадал в",...t,options:fl,...e("sufferedFrom")}))),bl=d((({field:e,input:t})=>o(ea,{label:"Фамилия",maxLength:60,disabled:Fr(e,t),...e(t?.name??""),...t}))),xl=["От 1 мес","До 15 лет"],vl=d((({field:e})=>o(Ei,{title:"Срок, месяцев",items:xl,min:1,max:180,...e("term")}))),Nl=d((({field:e,input:t})=>o(ua,{label:"Тип обслуживания",options:Ma,...e(t?.name??"")}))),wl=d((({field:e,input:t})=>o(ba,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")}))),Cl=d((({onFieldRef:e=En,children:t})=>{const n=s(null);return i((()=>{n.current&&e(n.current)}),[]),o("div",{ref:n,children:t})}));const Sl={$ref:"/wcms-resources/outservice-productlist.json"},kl={$ref:"/wcms-resources/agenty-dlya-rko.json"},Il={fullName:Rr,addressBranch:Si,desiredMeetingDate:kr,product:e=>o(al,{...e,source:Sl}),localities:Mr,isClient:_r,partnerComments:jr,collectionCount:hr,acquiringType:Ra,onlineCheckout:$r,posTerminal:nl,serviceType:Nl,term:vl,amount:Ai,annualRevenue:Mi,vedTypes:Ia,feedbackMethod:Tr,serviceDirection:pl,bankEmpolee:Li,secondaryPhone:hl,applicationDate:Fi,region:e=>Ci(e?.params?.typeForm)?o(Dr,{...e}):o(ml,{...e}),consentToReceiveMaterials:wl,sufferedFrom:yl,situationDescription:gl,representativeName:ul,applierType:ga,surname:bl,name:zr,middleName:Lr,birthday:dr,phone:tl,email:Ir,inn:Pr,comment:pr,fullRegion:Dr,partnerSymbolCode:e=>o(Wr,{...e,source:kl}),partnerName:e=>o(qr,{...e,source:kl}),dadataPartyNameSelect:Nr,dadataPartyInnSelect:Nr,questionProduct:ll,callbackTime:ur,russianPhone:tl},Tl=(e,t,n={})=>(a,i)=>{const r={...Il,...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})&&r?o(Cl,{onFieldRef:e(a.name??"").setFieldRef,children:o(r,{field:e,input:a,params:t})},String(i)):null},Rl=e=>2===e?"@xl:grid-cols-2 gap-x-m":"@xl:grid-cols-1 gap-x-0",Dl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(ze,{size:"text-h6",children:e})}):null,Pl=(e,t,{typeForm:n,additionalParams:a})=>e.map(((e,i)=>c("div",{className:u(Rl(e.columns),"grid"),children:[Dl(e.title),(e?.inputs||[])?.map(Tl(t,{typeForm:n,...a}))]},`section-${i}`))),El=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function _l({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((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}=El(l,t);return r((e=>{i.current=e,o()}),[])}const Bl=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),p=r((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=r((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:Ol(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),Ol=(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 ${Gn(!n||!a)} rounded-md caret-transparent outline-none`},Al=d((({disabled:e=!1,onClick:t,text:n})=>o(An,{type:"button",onClick:t,disabled:e,children:o(ze,{font:"font-normal",children:n})}))),Ml=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}))),Fl=d((({className:e,seconds:t})=>o("span",{className:e,children:Ll(t)}))),Ll=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),zl=d((({children:e,isLoading:t,isSubmitButtonDisabled:n,timeNextReq:a,onSubmit:i,onSendCode:r,values:l,onChange:s,errorText:d,hasError:m,phone:u,onClose:h})=>o(zn,{maxWidth:"lg",onClose:h,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[Vl(u),o(Bl,{values:l,setValues:s,errorText:d,hasError:m}),jl(a,r),e,$l(n,i),t?o(ai,{blur:!1}):null]})}))),Vl=e=>o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),$l=(e,t)=>o(Al,{text:"Далее",disabled:e,onClick:t}),jl=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base gap-2xs",children:[o("span",{children:" Получить новый код можно через"}),o(Fl,{seconds:e})]}):o(An,{embedded:!0,onClick:t,children:o(Ml,{children:"Получить новый код"})}),ql=e=>180-Math.floor((Date.now()-e)/1e3),Ul=Qa(),Wl=Qa(),Hl=d((({phone:e,onSuccess:t=En,onClose:n=En,formatData:i={},reqId:l})=>{const[s,c]=a(Array(4).fill("")),[d,m]=a(l),{handleSubmit:u,hasError:h,errorText:p,isLoading:g,timeNextReq:f,isSubmitButtonDisabled:y,setTimeNextReq:b,setErrorText:x}=(({values:e,onSuccess:t,formatData:n,reqId:i})=>{const l=Math.max(ql(Date.now()),0),[s,o]=a(""),[c,{setTrue:d,setFalse:m}]=nn(!1),[u,h]=a(l),p=r((()=>o("")),[]),g=!e.every(Boolean);return{handleSubmit:r((async()=>{try{d();const a=await Ul.checkCode({code:e.join(""),body:n,reqId:i});if(a?.errorDesc)return void o(a?.errorDesc);h(0),p(),t?.(e.join(""))}catch{o("Неверный код")}finally{m()}}),[e]),hasError:Boolean(s),errorText:s,isLoading:c,timeNextReq:u,isSubmitButtonDisabled:g,setTimeNextReq:h,setErrorText:o}})({values:s,onSuccess:t,formatData:i,reqId:d??""}),v=qa(e),N=_l({seconds:f,onTick:b}),w=r((async()=>{const e=await Wl.sendCode({phone:v});e&&(b(180),N(180),x(""),m(String(e)))}),[v,N,n]);return o(zl,{isSubmitButtonDisabled:y,onSubmit:u,onSendCode:w,timeNextReq:f,values:s,onChange:c,phone:e,isLoading:g,errorText:p,hasError:h,onClose:n})})),Yl={initcorporatelead:async({formatData:e={},typeForm:t,responseTypeDialog:n,verifyPhoneDialog:a,data:i=[],aspects:r={},ev:l})=>{const{phone:s}=e,o=await ni.sendCode({phone:String(s)});o?a.open({phone:s,formatData:e,reqId:String(o),onSuccess:()=>{a.close(),n.open({ok:!0,typeForm:t}),ti({aspectsAttributes:i,aspects:r,ev:l})}}):n.open({ok:Boolean(o),typeForm:t})},callback:async({formatData:e,data:t,aspects:n={},ev:a,typeForm:i,responseTypeDialog:r,onSuccess:l=En})=>{const s=await ni.sendPhoneCallRequest(e);l(),"success"===s?.status?(r.open({ok:!0,typeForm:i}),ti({aspectsAttributes:t,aspects:n,ev:a})):"error"===s?.status?r.open({ok:!1,errorMessage:"Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка"}):(r.open({ok:Boolean(s)}),s&&ti({aspectsAttributes:t,aspects:n,ev:a}))},default:async({formatData:e,data:t,aspects:n={},ev:a,router:i,responseTypeDialog:r,endpoint:l})=>{const s=Boolean(await ni.send(e,i,"lead"===l));r.open({ok:s}),s&&ti({aspectsAttributes:t,aspects:n,ev:a})}},Gl=Yt((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,onSuccess:g,...f})=>{const y=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),b=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||za[e.name||""]]))),typeForm:{key:t,text:""}}))(y,n)),[y,n]),x=E(),v=tn(),w=l((()=>Rn(y)),[y]),C=pn(Vn),S=pn(Hl),k=r((async(e,t)=>{const a=Pa({...e,...m});await Kl(d??"default",{formatData:a,ev:t,typeForm:n,data:p,aspects:v,router:x,responseTypeDialog:C,verifyPhoneDialog:S,onSuccess:g,endpoint:d})}),[n]),[,{field:I,onSubmit:T}]=dn(b,{resetOnSubmit:!0,formValidator:w,onSubmit:k}),R=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(y)?.name,D=R?I("consentDataProcessing"):void 0;return c(hn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:T,children:[Pl(a,I,{typeForm:n,additionalParams:m}),di({consentDataProcessing:D,link:s,button:i,typeForm:n})]}),h?c("div",{className:"space-y-m",children:[o(N,{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]})})),Kl=async(e,t)=>{const n=Yl[e]||Yl.default;await n(t)},Xl=d((({attempts:e,onClose:t=En})=>{const n=Jt(),a=e>1,i=r((()=>{n.assign("/natural")}),[]),l=r((()=>{a?i():t()}),[a]);return o(zn,{onClose:l,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{align:"text-center",children:"Уважаемый клиент!"}),o(w,{align:"text-center",children:"Для получения кредита Вам необходимо обратиться в офис Банка"}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(An,{type:"button",version:"secondary",onClick:i,children:"Завершить"}),a?null:o(An,{type:"button",onClick:t,children:"Продолжить"})]})]})})}));function Jl(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Ql(e,t){return Jl(e,t),Jl(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Zl{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 es{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 ts={};function ns(e,t=ts){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>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 as=new es;function is(){return ns(as)}Ql(as,new Zl(globalThis?.sessionStorage));const rs=e=>globalThis[e];function ls(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=rs(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(rs(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(rs(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(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),l(void 0)}}}),[e,t,n]),r}const ss=()=>globalThis.location!==globalThis?.top?.location,os=()=>{const e=ss(),t=globalThis.document?.body?.scrollHeight,n=is(),a=new URLSearchParams(decodeURIComponent(globalThis.location?.search)).get("styles");a&&((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)}})(a),i((()=>{e&&globalThis.parent.postMessage({height:document.body.scrollHeight},"*")}),[t,e]),i((()=>{const t=e=>{e.data?.location&&(n.frameLocation=e.data?.location)};return e&&globalThis.addEventListener("message",t),()=>{e&&globalThis.removeEventListener("message",t)}}),[e])},cs="Некорректно заполненное поле",ds="Укажите регион, город/населенный пункт, улицу, дом",ms=/^[0-9а-яё]*$/i,us=/^[\u0400-\u04FF-\s]+$/u,hs=/^(?!\s*$)[^\p{Script=Cyrillic}]+$/u,ps=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),gs=()=>ln(ps)(ds),fs=e=>ln((e=>"string"==typeof e&&e.length>1&&us.test(e)))(e??cs),ys=e=>ln((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??cs),bs=(e,t,n=!1)=>ln((t=>"string"==typeof t&&t.length>=1&&(n?t.length===e:t.length<=e)))(t??cs),xs=e=>ln((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),vs=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length&&"00000000000"!==t){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},Ns=e=>Cs(18,e)("Укажите дату заключения трудового договора"),ws=e=>Cs(0,e)("Укажите дату регистрации"),Cs=(e,t)=>ln((n=>{if(n&&t){const a=n.getTime(),i=new Date(t?.getFullYear()+e,t?.getMonth(),t?.getDate()).getTime(),r=(new Date).getTime();return a>=i&&a<=r}return!1})),Ss=(e=!1)=>ln((t=>Boolean(t)&&Boolean(e)))("Укажите наименование организации"),ks=(e=!1)=>ln((t=>kn(t)&&Boolean(e)))("Укажите ИНН"),Is={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,maxAge:73,errorMessage:"Допустимый возраст заёмщика - от 21 до 73 лет"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},Ts=e=>xs(Is[e]),Rs={processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentInformFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentFATCA:Sn},Ds={addressCourier:gs(),paymentSystem:bn("Укажите тип платежной системы"),currency:bn("Укажите валюту"),cardCategory:bn("Укажите категорию карты"),codeWord:(e=>ln((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ms.test(e)))(e??cs))("Необходимо ввести кодовое слово"),confirmationIncome:xn(),methodObtain:bn(),deliveryDate:(e=>ln((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},Ps={organization:xn("Выберите тип организации"),organizationAddress:ln((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(ds),organizationPhone:Cn("Укажите номер телефона"),organizationName:bn("Укажите наименование организации"),legalForm:bn("Укажите ОПФ"),lastJobExperience:ys("Укажите стаж на последнем месте работы"),experience5Years:ys("Укажите общий стаж за последние 5 лет"),jobsNumber:ys("Укажите количество мест работы за последние 5 лет"),addressFact:gs(),addressRegistration:gs(),addressRetail:xn("Выберите адрес банка"),addressMatch:bn(),sex:bn("Укажите свой пол"),birthPlace:bn("Укажите место рождения"),education:xn("Выберите ваше образование"),housing:xn("Выберите тип жилья"),amountWorkers:xn("Выберите информацию о количестве сотрудников"),employment:xn("Выберите информацию о трудоустройстве"),employerActivities:xn("Выберите вид деятельности организации"),employerOrganization:xn("Выберите вид организации"),positionOrganization:xn("Выберите вашу должность"),familyStatus:xn("Выберите семейное положение"),familyMembers:bs(2,"Укажите количество членов семьи"),children:bs(2,"Укажите количество детей"),dependents:bs(2,"Укажите количество иждивенцев"),snils:(e=>ln(vs)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,dulSerie:bs(4,"Укажите серию паспорта",!0),dulNumber:bs(6,"Укажите номер паспорта",!0),dulSubdivisionCode:bs(7,"Укажите код подразделения",!0),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),retirementIncome:bn(),otherIncome:bn(),wages:bn(),mandatoryPayments:bs(10,"Укажите сумму обязательных выплат"),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),regionRetail:xn("Выберите регион"),latinSurname:bn("Укажите фамилию"),surname:fs("Укажите свою фамилию на кириллице"),name:fs("Укажите своё имя на кириллице"),middleName:fs("Укажите своё отчество на кириллице")},Es={...Ps,...Ds,...Rs},_s={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в CФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var Bs;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(Bs||(Bs={}));const Os=async(e,t,n)=>{try{return(await As(e,t,n)).json()}catch(e){return console.error(e),null}};async function As(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,...Ms()},credentials:"include",body:n?JSON.stringify(n):null})}const Ms=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Fs=d((({onChangeEsiaStatus:e,productType:t})=>{const n=Jt(),a=is().frameLocation,i=r((async()=>{try{const e=await(t={redirectUri:a||globalThis.location.origin+globalThis.location.pathname},Os("/esia/getLink","POST",t));e?.link&&(a?window.parent.postMessage({redirectUri:e?.link},"*"):n.assign(e.link))}catch{e(Bs.Error)}var t}),[a]);return c("div",{className:"flex items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex gap-m flex-col justify-around w-full",children:[o("p",{className:"text-xl",children:"Заполните данные через Госуслуги"+("debitCard"===t?" - это значительно сократит время оформления заявки":"")}),"debitCard"===t?null:c("ul",{className:"list-disc list-inside",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(An,{type:"button",onClick:i,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),Ls={url:"suggest/address",responseFilter:e=>Boolean(e?.data?.postal_code)},zs={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=>({value:e?.data?.code||"",additionalValue:e?.data?.name})},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party",responseItemHandler:e=>{const t=e?.data?.inn,n=e?.data?.address?.value||"",a=n?`${t} ${n}`:t;return{value:e?.value||"",additionalValue:a}}},inn:{url:"suggest/party",responseItemHandler:e=>({value:e?.data?.inn||""})},addressRegistration:Ls,addressFact:Ls,organizationAddress:Ls,addressCourier:Ls},Vs=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>c("div",{className:u("px-m py-xs cursor-pointer hover:bg-main-divider relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:[o("p",{children:e.processedValue}),e.additionalValue?o("p",{className:"text-xs text-secondary-text",children:e.additionalValue}):null]},t.toString())))})}));const $s=d((({value:e="",onChange:t=En,onDaDataChange:n,name:c="",daDataQueryPrefix:d,dadata:m=!1,type:u,...h})=>{const[p,{setFalse:g,setTrue:f}]=nn(),y=function({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=sa(),y=zs[n],b=r((()=>{h.current=t,f.close()}),[t]),x=r((e=>{b(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[b,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await yr({url:y.url,responseItemHandler:y.responseItemHandler,responseFilter:y.responseFilter,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>qn(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Vs,{options:p,container:n,value:t,onChange:x}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,p,t,x]),v}({isOpen:p&&m,name:c,value:e,daDataQueryPrefix:d,onChange:t,onDaDataChange:n}),b=r((e=>{let n=e??"";"number"===u&&(n=n.replace(/^0+(?=\d)/,"")),t?.(n)}),[t]);return o(Jn,{value:e,onChange:b,inputRef:y,isOpen:p,onOpen:f,onClose:g,...h})})),js=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(qs(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o($s,{disabled:Fr(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),qs=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,...Us(e)}),Us=e=>{const t=e?.data?.block,n=e?.data?.block_type;if(!t)return{building:null,block:null};switch(n){case"литера":case"стр":return{building:t,block:null};case"к":{const e=Ws(t),[n,a]=t.split(e);return e?{building:a,block:n}:{building:null,block:n}}default:return{building:null,block:null}}},Ws=e=>e.includes("стр")?" стр ":e.includes("литера")?" литера ":"",Hs=Yt((({field:e,input:t,source:n})=>{const[l,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=r((t=>{e?.("addressCourier")?.onChange?.(qs(t))}),[]),h=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o($s,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),Ys=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((t=>{e?.(n)?.onChange?.(qs(t))}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o($s,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Gs=d((({field:e,input:t})=>o(Er,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),Ks=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:Xs({textItems:r,subText:t,children:n,isPhone:a,...i})})),Xs=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(ze,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||Js(n,s),i?o(ze,{color:a,size:"text-m",children:i}):null]}),Js=(e,t)=>e.filter(Boolean).map(((e,n)=>o(ze,{size:"text-l",children:t?o("a",{href:`tel:${Qs(e)}`,children:e.trim()}):e.trim()},String(n)))),Qs=e=>e.replace(/\D/g,""),Zs=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}))),eo=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),to=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(An,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(Ml,{children:a}),o(eo,{isUnfolded:t,iconVersion:i?"color":""})]}))),no=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const ao=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=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=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),io=d((({children:e})=>{const[t,{toggle:n}]=nn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(no,{className:"block sm:hidden",children:[o(ao,{isUnfolded:t,children:e}),o(to,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),ro=e=>{const t=so(e);return o(Ks,{label:"Режим работы",value:t,className:"max-w-none"})},lo=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",so=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[lo({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),lo({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},oo=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],co=e=>oo.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??"")}}))),mo=e=>{if(!e)return null;const t=uo(e);return c(Zs,{className:"border-none",children:[o(Ks,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(ho)})}),o(Ks,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]})},uo=e=>{const t=oo.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},ho=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(ze,{size:"text-xs",children:e})},String(n)),po=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Ks,{label:"Валюта",value:e.currency}):null,t?o(Ks,{label:"Купить",value:String(t)}):null,n?o(Ks,{label:"Продать",value:String(n)}):null]},String(a)),go={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"}},fo=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",go[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(ze,{size:"text-m",color:go[n].text,children:t})]}))),yo=(new Date).getDay(),bo=e=>{const[t]=e?.slice(yo-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(fo,{color:"green",children:i}):null,n&&r?o(fo,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(fo,{color:"red",children:"Выходной"})},xo=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",vo=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(Ks,{label:e,value:t&&n?n:"",subText:xo({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),No=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,wo=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Co=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,So=(e,t)=>{if(!e.workSchedule)return null;const n=co(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e.address})]}):null]}),bo(n)]}),o(io,{children:ko(e)})]},String(t))},ko=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=co(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Zs,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Ks,{label:"Факс",value:t,isPhone:!0}),o(Ks,{label:"Телефон филиала",value:e,isPhone:!0}),o(Ks,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Ks,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Ks,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(Ks,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(Zs,{children:o(Ks,{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(vo)})})}):c(Zs,{children:[o(Ks,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(ho)})}),ro(d)]}),l?.businessScheduleVisibleTag?mo(l?.businessScheduleDescription):null,s?.currencies?.length?o(Zs,{className:"flex-wrap",children:s?.currencies?.map(po)}):null]})},Io=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=co(e),n=e?so(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?No(n):Co(n,a):wo(n):""})(n)}`;return{header:a,body:r}},To={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,barrierFree:!1,equippedWithRamp:!1,equippedWithLift:!1,equippedWithElevator:!1,equippedWithStairclimber:!1,hasHelpMeButton:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},Ro={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам",barrierFree:"Без барьеров",equippedWithRamp:"Есть пандус",equippedWithLift:"Есть подъёмник",equippedWithElevator:"Есть лифт",equippedWithStairclimber:"Есть лестницеход",hasHelpMeButton:"Есть кнопка «HELP ME»"},Do={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},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),barrierFree:e=>Boolean("barrierFree"in e&&e.barrierFree),equippedWithRamp:e=>Boolean("equippedWithRamp"in e&&e.equippedWithRamp),equippedWithLift:e=>Boolean("equippedWithLift"in e&&e.equippedWithLift),equippedWithElevator:e=>Boolean("equippedWithElevator"in e&&e.equippedWithElevator),equippedWithStairclimber:e=>Boolean("equippedWithStairclimber"in e&&e.equippedWithStairclimber),hasHelpMeButton:e=>Boolean("hasHelpMeButton"in e&&e.hasHelpMeButton)},Po=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Do[t](e)))))},Eo=()=>{},_o=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Eo,getBalloonRemoteWorkplaces:i=Eo})=>{const[r,s,o,c]=l((()=>{const r=Po(e,n),l=Po(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.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[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Bo=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Oo=d((({children:e})=>Bo?e:null)),Ao="/icons/MapMarkerClusterIcon.svg",Mo="/icons/MapMarkerClusterYellowIcon.svg";function Fo({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>'),r=Lo("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=Lo("workplaces",e,i),l=zo(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=zo(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=zo(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Lo=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Ao:Mo,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),zo=(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?Ao:Mo,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Vo={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},$o={...Vo,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},jo=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values($o).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"})}),qo={...Vo,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Uo=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(qo).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),Wo=[55.753995,37.614069],Ho=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=ls("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${B.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{l.current?Fo({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:Yo(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Fo({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(ai,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Uo,{yandexMaps:l}),o(Uo,{yandexMaps:l,direction:"out"})]}),jo(l,m,u("right-2 top-80",h))]})})),Yo=e=>{const t=[Ko(Go(e,0)),Ko(Go(e,1))];return t.every((e=>e))?t:Wo},Go=(e,t)=>e.map((e=>e.coords?.[t])),Ko=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Xo=e=>Number(e.toString().replace(",",".")),Jo=e=>{const{data:t,error:n}=yi(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Qo);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Qo=async e=>await zt(e,{method:"POST"})||[],Zo=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=Jo("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await Os("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Xo(e.latitude??Wo[0]),gpsLongitude:Xo(e.longitude??Wo[1])})))||[]})(s?.key??"");r(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=_o({data:n,filtrationState:{},getBalloon:Io});return c("div",{children:[o(ua,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(Oo,{children:o(Ho,{points:m,isLoad:!l,className:"h-full",selectedAddress:d?.value?.text})})})]})})),ec=new es;function tc(e){return ns(ec,e)}Ql(ec,new Zl(globalThis?.localStorage));const nc=()=>tc(),ac=Yt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...r})=>{const l=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(ua,{placeholder:a,options:l,...e(n),...r})})),ic=d((({field:e,input:t})=>{const n=nc();return o(ac,{field:e,source:n.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),rc=d((({field:e,input:t})=>o(Er,{text:"Наличие военного билета",...e(t?.name??"")}))),lc=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Sa,{label:$n({label:t,errors:a?.errors}),...a}),jn(n)]}))),sc=[{id:"true",text:"Да"},{id:"false",text:"Нет"}],oc=d((({field:e,input:t})=>{const[n,i]=a(""),l=r((t=>{i(t),"false"===t&&e("bankEmployeeCode")?.onChange?.(null)}),[]);return c("div",{className:"flex flex-col md:flex-row",children:[o(lc,{label:"Мне помог сотрудник Банка",orientation:"horizontal",items:sc,value:n,onChange:l}),"true"===n?o($s,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,maxLength:8,...e(t?.name??""),...t}):null]})})),cc=d((({field:e,input:t})=>o(Er,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),dc=d((({field:e,input:t})=>o(cr,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:Fr(e,t),maxDate:new Date}))),mc=d((({field:e,input:t})=>o($s,{label:"Место рождения",maxLength:100,...e(t?.name??""),...t,disabled:Fr(e,t)})));function uc(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,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const hc=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",image:a})=>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:a?o(ie,{image:a,className:"block w-max"}):o(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Fe,{__html:e})})]}))),pc=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=uc("programId"),{value:m,onChange:u}=e("cardCategory"),h=e("paymentSystem")?.value?.key,p=r((e=>1===e.length?{key:e[0].key,text:e[0].value}:null),[]);i((()=>{h&&d&&(async()=>{const e=await(async(e,t)=>{const n=await Os("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(h,d);s(e),gc(e,m)||u?.(p(e))})()}),[h,p]);const g=l((()=>n?.find((e=>e.key===m?.key))?.description),[n,m]);return c("div",{children:[o(ac,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),g?o(hc,{__html:g}):null]})})),gc=(e,t)=>e.some((e=>e.key===t?.key)),fc=d((({field:e,input:t})=>o($s,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,type:"number",...e(t?.name??""),...t}))),yc=d((({field:e,input:t})=>o($s,{label:"Кодовое слово",maxLength:20,...e(t?.name??""),...t}))),bc=d((({field:e,input:t})=>{const{data:n}=Jo("INCOME_CERT_UNITED"),a=Fr(e,t);return c("div",{className:"space-y-xl",children:[a?o(hc,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(ac,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t,disabled:a})]})})),xc=d((({field:e,input:t})=>{const{data:n}=Jo("MILITARY_STATUS");return o(ac,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),vc=()=>tc(),Nc=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=De();return c(zn,{onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(An,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),wc=(e,t)=>{const[n,{setTrue:a,setFalse:i}]=nn(!1),{open:l}=pn(Nc),s=De();return{openDocument:r((async()=>{if(e&&!n){a();const n=URL.createObjectURL(await(async(e,t=!1)=>{const n=await As(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?n.blob():new Blob})(e,s));l({src:n,onDocumentRead:t}),i()}}),[l,e,s,n]),isLoading:n}},Cc=d((({className:e,error:t,docId:n,...a})=>{const{openDocument:i,isLoading:r}=wc(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ba,{...a}),n?c(An,{embedded:!0,onClick:i,children:[o(Ml,{children:"Ознакомиться"}),r?o(ai,{blur:!1,size:"extraSmall",position:"static"}):null]}):null]}),jn(t)]})})),Sc=d((({field:e,input:t})=>{const{productType:n}=vc(),a=_s[n??""];return t&&t.name?o(Cc,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),kc=Math.round(29.5),Ic=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),Tc="flex flex-col justify-between lg:flex-row gap-4xl",Rc="flex flex-col lg:w-1/2 gap-2xl",Dc="flex flex-col gap-y-xl min-w-52",Pc=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(ze,{size:"text-h3",children:"number"==typeof e?[a,Je(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),Ec=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(ze,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Pc,{value:n,...i}):o(ze,{size:"text-h3",children:"-"})]}))),_c=e=>Oc([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),Bc=(e=[],t=!1,n=[])=>({...Oc([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),Oc=(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]},Ac=(e,t=0)=>e?.sum?e.sum:t,Mc=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Fc=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Lc=({min:e=0,max:t=0,availableMonths:n,...a})=>o(Ei,{items:[`От ${zc(e)}`,`До ${zc(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),zc=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Vc=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(ze,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(Sa,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),$c=e=>Vc({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),jc=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(Ei,{items:e?[`От ${Je(1)(a.min||0)} ${n}`,`До ${Je(1)(a.max||0)} ${n}`]:[],step:t,...a}),qc=({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?.(Ii(t?.[i],n.minMonths,n.maxMonths))},Uc=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(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)},Wc=e=>e,Hc=(e=Wc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Yc=Hc(),Gc=(e=Wc)=>Hc((t=>-e(t))),Kc=Gc(),Xc=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Jc([e,t],a),Jc=([e,t],n=[])=>({[e]:n.length?Kc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Yc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Qc=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Zc={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},ed=e=>td({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&td({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&td({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&td({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),td=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],nd=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[Zc],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ed({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Xc(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=Xc(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>ed({row:e,userInputParams:t,paramsViewSettings:n})&&Qc(a,["minSum","maxSum"],e)&&Qc(i,["minMonths","maxMonths"],e)))||Zc)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Uc(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},ad=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),id={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},rd=Yt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=_c(n?.rateRows),g=r((e=>{const t=nd(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:y}]=dn({moneyValue:Ac(d,2e5),monthsValue:Mc(d,kc),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}),b=nd(f,n,s),x=$c({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(Ii(f.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),i((()=>{N&&N(Ii(f.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),i((()=>{!ad(d)&&p&&qc({field:y,defParams:p,calcParams:b,map:id,monthsValue:"minMonths"})}),[n,d]),o(Ic,{className:e,title:t,...h,children:c("section",{className:u(Tc,e),children:[c("div",{className:Rc,children:[jc({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...y("moneyValue"),value:b.moneyValue}),Lc({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...y("monthsValue"),value:b.monthsValue}),ld({...b,...s},y),o("div",{className:"sm:hidden",children:x})]}),c("div",{className:u(Dc,"@4xl:w-1/2"),children:[o(Ec,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Ec,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(Ec,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:x}),Ye(a,{isVertical:!0}),Fc(l)]})]})})})),ld=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ba,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ba,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ba,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ba,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),sd="calculator",od=d((({field:e,params:t})=>{const n=r((t=>{e(sd).onChange?.(t)}),[]);return o(rd,{...t?.calcData,padding:"p-0",defaultParams:dd(e(sd).value),onChange:n})})),cd={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},dd=(e,t=!1)=>{const n=t?md(cd):cd;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},md=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),ud=d((({field:e,input:t})=>{const{data:n}=Jo("CREDIT_IN_RSHB");return o(ac,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),hd={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",46:"owner_debit_card_plus",47:"owner_debit_card_pens_plus"},pd=[{id:"810",text:"Рубли"}],gd=d((({field:e,input:t})=>{const{data:n}=Jo("CURRENCY"),{programId:a}=vc(),i=l((()=>!Object.keys(hd).includes(a||"")||"38"===a),[]),r=l((()=>i?pd:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(lc,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??"")})})),fd=(e,t)=>{if(!t)return null;const n=vd(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")}},yd=(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},bd=(e,t)=>{const n=vd(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},xd=(e,t,n)=>{const a=vd(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},vd=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Nd={amountWorkers:"EMPLOYEES_NUMBER",employerOrganization:"ORGANIZATION_KIND",employerActivities:"ORGANIZATION_ACTIVITY_TYPE",organization:"ORGANIZATION_TYPE"},wd=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=Cd(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(qs(n.data?.address));const s={amountWorkers:yd(e?.amountWorkers,n.data?.employee_count),employerActivities:fd(e?.employerActivities??[],a),organization:xd(e?.organization??[],i,r),employerOrganization:bd(e?.employerOrganization??[],i),organizationName:l,inn:r,isDadataOrganization:!0};for(const e in s)t?.(e)?.onChange?.(s[e])},Cd=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),Sd=d((({field:e,input:t})=>{const n=nc(),[l,s]=a(""),{employerActivities:c,employerOrganization:d,organization:m,amountWorkers:u}=n,h=e?.("esiaAccountTypeCd")?.value,p=e?.("inn")?.value,g=e?.("organizationName")?.error,f=e("isDadataOrganization")?.value;i((()=>{s(g&&!f?"Необходимо выбрать ИНН из выпадающего списка":"")}),[f,g]);const y=r((t=>{wd(n,e,t)}),[]);i((()=>{(async()=>{await(async(e,t)=>{await Promise.all(Object.entries(e).map((e=>{const[n,a]=e;Os(`/dictionary?dictionaryType=${encodeURIComponent(a)}`,"POST").then((e=>{t[n]=e}))})))})(Nd,n)})()}),[]),i((()=>{h&&p&&kd(n)&&(async()=>{const t=await(async e=>{const t=await yr({url:"suggest/party",query:e});return t?.[0]})(p);t&&wd(n,e,t)})()}),[c,d,m,u]);const b=r((t=>{e?.("inn")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o($s,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:y,disabled:Fr(e,t),onChange:b,error:l||e("inn")?.error})})),kd=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i}=e;return[n,a,i,t].every(Boolean)},Id=d((({field:e,input:t})=>o(cr,{label:"Дата доставки",...e(t?.name??""),minDate:new Date}))),Td=d((({field:e,input:t})=>{const{data:n}=Jo("COURIER_DELIVERY_TIME"),a=l((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(lc,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),Rd=d((({field:e,input:t})=>o($s,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,type:"number",...e(t?.name??""),...t}))),Dd=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(cr,{label:"Дата выдачи",...e(t?.name??""),disabled:Fr(e,t),minDate:a,maxDate:new Date})})),Pd=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code)}),[]);return o($s,{disabled:Fr(e,t),label:"Кем выдан",maxLength:200,...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),Ed=d((({field:e,input:t})=>o($s,{disabled:Fr(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),_d=d((({field:e,input:t})=>o($s,{disabled:Fr(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),Bd=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]),a=r((t=>{const n=t.replace(/[^\d-]/g,"");n.length<=7&&e?.("dulSubdivisionCode")?.onChange?.(Hi(n,"___-___"))}),[]);return i((()=>{const t=e?.("dulSubdivisionCode")?.value;t&&a(t)}),[]),o($s,{disabled:Fr(e,t),label:"Код подразделения",...t,...e(t?.name??""),placeholder:"___-___",onChange:a,onDaDataChange:n})})),Od=d((({field:e,input:t})=>{const{data:n}=Jo("EDUCATION_LEVEL");return o(ac,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Ad=d((({field:e,input:t})=>{const n=r((t=>{(hs.test(t)||0===t.length)&&e("email")?.onChange?.(t)}),[e]);return o($s,{label:"Электронная почта",maxLength:50,...e(t?.name??""),...t,onChange:n})})),Md=d((({field:e,input:t})=>{const n=nc();return o(ac,{field:e,source:n.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Fd=d((({field:e,input:t})=>{const n=nc();return o(ac,{field:e,source:n.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Ld=d((({field:e,input:t})=>{const{data:n}=Jo("EMPLOYMENT_INFO_UNITED");return o(ac,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),zd=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Ii(Number(n),0,5)))),[]);return o($s,{label:"Стаж за последние 5 лет",placeholder:"Количество лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:Fr(e,t)})})),Vd=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value||0),c=Number(e("dependents")?.value||0),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o($s,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),$d=d((({field:e,input:t})=>{const{data:n}=Jo("MARITAL_STATUS");return o(ac,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),jd=d((({field:e,input:t})=>{const[n,r]=a(""),l=Number(e("lastJobExperience")?.value),s=Number(e("generalSeniority")?.value);return i((()=>{r(s&&s<l?"Укажите не меньше, чем число в поле «Стаж на последнем рабочем месте»":"")}),[l,s]),o($s,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",isInteger:!0,...e(t?.name??""),...t,error:n||e("generalSeniority")?.error,disabled:Fr(e,t)})})),qd=d((({field:e,input:t})=>{const{data:n}=Jo("HOUSE_TYPE");return o(ac,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Ud=d((({input:e})=>o(hc,{__html:e?.label}))),Wd=d((({field:e,input:t})=>o(Er,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),Hd=d((({field:e,input:t})=>o($s,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:Fr(e,t)}))),Yd=d((({field:e,input:t})=>o($s,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,isInteger:!0,...e(t?.name??""),...t,disabled:Fr(e,t)}))),Gd=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Kd=(e="",t="")=>Gd.test(e)&&t.length<20&&e.length+t.length<=20,Xd={"А":"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",".":".",",":",","-":"-"," ":" "},Jd=e=>e.replace(/[А-ЯЁа-яё,. -]/g,(e=>Xd[e.toLowerCase()].toUpperCase()||"")),Qd=(e,t)=>{let n=Jd(e);const a=Jd(t).substring(0,20);return 20===a.length?n="":n.length+a.length>20&&(n=n.substring(0,1)),{translatedName:n,translatedSurame:a}},Zd=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinName")?.onChange;i((()=>{const{translatedName:e}=Qd(a,l);s?.(e)}),[]);const c=r((e=>{(Kd(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ea,{label:"Имя",placeholder:"Имя латинскими буквами",...e(t?.name??""),onChange:c,...t})})),em=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinSurname")?.onChange;i((()=>{const{translatedSurame:e}=Qd(a,l);s?.(e)}),[]);const c=r((e=>{(Kd(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ea,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",...e(t?.name??""),onChange:c,...t})})),tm=d((({field:e,input:t})=>o($s,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),nm=d((({field:e,input:t})=>o($s,{label:"ОПФ",maxLength:20,placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),am=d((({field:e,input:t})=>o(cr,{label:"Дата рождения",...e(t?.name??""),disabled:Fr(e,t)}))),im=d((({field:e,input:t})=>o($s,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),rm=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],lm=d((({field:e,input:t})=>o(lc,{orientation:"horizontal",items:rm,...e(t?.name??"")}))),sm=d((({field:e,input:t})=>{const n=r((t=>{(us.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o($s,{label:"Отчество (Обязательно, при наличии)",maxLength:40,disabled:Fr(e,t),...e(t?.name??""),...t,onChange:n})})),om=d((({field:e,input:t})=>{const n=r((t=>{(us.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o($s,{label:"Имя",maxLength:40,disabled:Fr(e,t),...e(t?.name??""),...t,onChange:n})})),cm=d((({field:e,input:t})=>{const n=nc();return o(ac,{field:e,source:n.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),dm=d((({field:e,input:t})=>{const n=nc(),[l,s]=a(""),c=e?.("organizationName")?.error,d=e("isDadataOrganization")?.value;i((()=>{s(c&&!d?"Необходимо выбрать организацию из выпадающего списка":"")}),[d,c]);const m=r((t=>{wd(n,e,t)}),[]),u=r((t=>{e?.("organizationName")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o($s,{label:"Наименование организации",...t,...e(t?.name??""),disabled:Fr(e,t),onDaDataChange:m,onChange:u,error:l||e("organizationName")?.error})})),mm=d((({field:e,input:t})=>o($s,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),um=d((({field:e,input:t})=>o(cr,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date}))),hm=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Ii(Number(n),0,100)))),[]);return o($s,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})})),pm=e=>e.map((e=>({key:e.type,text:e.name}))),gm=e=>e?.key,fm=d((({field:e,input:t})=>{const[n,i]=a([]),r=tc();gr((async()=>{const{programId:e}=r;if(e){const t=await(async e=>{const t=await Os("/public-data/creditProgramConditions","POST",{creditProgramId:e});return pm(t?.paymentSystems||[])})(e);i(t??[])}}),[]);const s=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(lc,{label:"Платежная система",orientation:"horizontal",items:s,...e(t?.name??"",{format:gm,parse:e=>n?.find((t=>t.key===e))})})})),ym=d((({field:e,input:t})=>{const{data:n}=Jo("POSITION");return o(ac,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),bm=async()=>await Os("/public-data/regionsCardDelivery","GET")||void 0,xm=d((({field:e,input:t})=>{const{programId:n,productType:a}=nc(),{data:i}=Jo("REGION_RF"),{data:l}=yi("regionsDelivery",bm),{data:s}=Jo(vm(a)),c="38"===n,d=i?.map((({key:e,value:t})=>({key:e,text:t}))),m="true"===s?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,u=e("regionRetail")?.onChange,h=e("regionHasDelivery")?.onChange,p=e("methodObtain")?.onChange,g=r((e=>{const t=m&&l?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!c;h?.(t),p?.(t?"courier":"office"),u?.(e)}),[l,m]);return o(ua,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:d,...e(t?.name??""),onChange:g})})),vm=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",Nm=d((({field:e,input:t})=>o($s,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),wm=["male","female"],Cm=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Sm=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await yr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return wm.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(lc,{label:"Пол",orientation:"horizontal",items:Cm,...e(t?.name??"")})})),km=d((({field:e,input:t})=>o(Er,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),Im=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(Hi(e,"___-___-___ __")):t?.(Hi(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Kn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),Tm=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:r,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Im,{"aria-label":t,label:$n({label:t,errors:l?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:r,placeholder:"___-___-___ __",...l}),jn(a)]}))),Rm=d((({field:e,input:t})=>o(Tm,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),Dm=d((({field:e,input:t})=>{const n=r((t=>{(us.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o($s,{label:"Фамилия",maxLength:40,disabled:Fr(e,t),...e(t?.name??""),...t,onChange:n})})),Pm=d((({field:e,input:t})=>o($s,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t,disabled:Fr(e,t)}))),Em={$ref:"/wcms-resources/delivery-cities-data.json"},_m={limitedBirthday:am,name:om,surname:Dm,middleName:sm,email:Ad},Bm={processPersonalDataFlg:Sc,consentProviderFlg:Sc,consentOthersFlg:Sc,consentInformFlg:Sc,consentPfrFlg:Sc,consentInformMaterialsFlg:Sc,consentFATCA:Sc},Om={organization:cm,organizationAddress:js,organizationPhone:tl,organizationName:dm,legalForm:nm,generalSeniority:jd,lastJobExperience:Yd,experience5Years:zd,jobsNumber:Hd,beginDate:dc,addressFact:Ys,addressRegistration:js,addressRetail:Zo,addressMatch:Gs,sex:Sm,birthPlace:mc,education:Od,housing:qd,amountWorkers:ic,employment:Ld,employerActivities:Md,employerOrganization:Fd,positionOrganization:ym,familyStatus:$d,familyMembers:Vd,children:fc,dependents:Rd,snils:Rm,conscription:xc,armyIdFlg:rc,dulSerie:_d,dulNumber:Ed,dulIssueDate:Dd,dulSubdivisionCode:Bd,dulIssuedBy:Pd,participantDateRegistration:um,retirementIncome:Nm,otherIncome:mm,wages:Pm,mandatoryPayments:im,bankruptcyFlg:cc,initiateBankruptcyFlg:Wd,shareholderFlg:km,legalEntityName:tm,creditInRshbCd:ud,bankEmployeeCode:oc,partInBusiness:hm,regionRetail:xm,infoCard:Ud,calculator:od,confirmationIncome:bc,inn:Sd,..._m},Am={addressCourier:e=>o(Hs,{...e,source:Em}),paymentSystem:fm,currency:gd,cardCategory:pc,codeWord:yc,methodObtain:lm,deliveryDate:Id,latinName:Zd,latinSurname:em,deliveryTime:Td},Mm="Согласие на все документы",Fm=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ri(t(e?.name),Sn).error)))),[e]),[d,{toggle:m}]=nn(!0);return o("div",{className:"w-fit",children:c(no,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ba,{text:Mm,value:a,onChange:i},n),jn(s?"Отметьте все обязательные соглашения":"")]}),o(An,{embedded:!0,ariaLabel:Mm,onClick:m,children:o(eo,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(ao,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(Tl(t,{},Bm))})]})})})),Lm=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=zm(t||[],n);return a.length>2?c("div",{children:[i.map(Tl(e,{},{..._m})),o(Fm,{inputs:a,field:e})]}):(t||[])?.map(Tl(e,{},{..._m}))},zm=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(_s[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(_s[t]).includes(String(e))))}),Vm=(e,t=!1)=>o(ii,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),$m=e=>As("/user-data/updateUserProfile","PUT",e),jm=e=>As("/user-data/updateUserTask","PUT",e),qm={width:"118",height:"24"},Um={"bg-white":"color",transparent:"white"},Wm={"bg-white":"text-primary-main",transparent:"text-white"},Hm=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Um[e]},className:Wm[e],width:n?.width,height:n?.height}),Ym={"bg-white":"text-primary-text",transparent:"text-white"},Gm=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!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??"Россельхозбанк",...ve(s),children:[Hm(r,n?.image,qm),l?a??o("div",{className:"ml-s",children:o(ze,{font:"font-medium",color:Ym[r],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),Km=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=nn(!1),{closeAll:y}=ge(),b=r((async()=>{g();var e;await(e={captchaText:d},As("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),x=r((()=>{(async()=>{s(URL.createObjectURL(await(e=>As(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob)))(e)))})()}),[]);return i(x,[]),o(zn,{head:o(Gm,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(An,{className:"w-8",embedded:!0,onClick:x,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Kn,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(An,{version:"secondary",onClick:y,children:"Вернуться"}),o(ii,{version:"secondary",disabled:!d,onClick:b,children:"Отправить"})]}),p?o(ai,{blur:!1}):null]})})})),Xm=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},Jm=({values:e,onSuccess:t,onFail:n})=>{const l=is(),s=l.smsCode?.attempts||0,o=Math.max(ql(l.smsCode?.sendTime||Date.now()),0),[c,d]=a(""),[m,{setTrue:u,setFalse:h}]=nn(!1),[p,g]=a(o),f=r((()=>d("")),[]),y=Boolean(0===p&&l.smsCode?.sendTime),b=s>2||y||!e.every(Boolean),x=r((async()=>{l.smsCode={...l.smsCode,attempts:s+1},u();const a=await(async e=>await As("/sms/checkCode","POST",e))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}});if(a.ok){const n=await a.json();Xm(n),g(0),f(),l.smsCode=null,t?.(e.join(""))}else 403===a.status?d(s>1?"Исчерпан лимит ввода смс-кода":"Неверный код"):n();h()}),[e,s]);return i((()=>{y?d("Код просрочен"):s>2&&d("Исчерпан лимит ввода смс-кода")}),[y]),{handleSubmit:x,hasError:Boolean(c),errorText:c,isLoading:m,timeNextReq:p,isSubmitButtonDisabled:b,setTimeNextReq:g,setErrorText:d}},Qm=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=En,onClose:s=En,onFail:c=En})=>{const[d,m]=a(Array(4).fill("")),u=is(),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:y,isSubmitButtonDisabled:b,setTimeNextReq:x,setErrorText:v}=Jm({values:d,onSuccess:l,onFail:c}),N=pn(Km),w=qa(e),C=_l({seconds:y,onTick:x}),S=r((async()=>{const e=await(t={phoneNumber:w,smsCodesSetName:{key:"AUTHENTICATION"}},As("/sms/sendCode","POST",t));var t;e.ok?(x(180),C(180),v(""),u.smsCode={sendTime:Date.now(),attempts:0}):429===e.status?N.open({phoneNumber:w,sendCode:S}):c()}),[w,C]);return i((()=>{u.smsCode?.sendTime||S()}),[]),o(zl,{isSubmitButtonDisabled:b,onSubmit:h,onSendCode:S,timeNextReq:y,values:d,onChange:m,phone:e,isLoading:f,errorText:g,hasError:p,onClose:s,children:Zm(n,t)})})),Zm=(e,t=!1)=>t?c(Fe,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:e?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,eu={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},tu={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},nu=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],au=d((({onSubmit:e=En,onClose:t=En})=>{const[n,i]=a(""),[l,s]=a(!1),{openDocument:d}=wc(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),h=l?tu:eu;return o(zn,{onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(N,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(w,{align:"text-center",children:h.description}),o(Sa,{className:"whitespace-normal",orientation:"horizontal",items:nu,value:n,onChange:u}),o(An,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),iu={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"},ru={...iu,amur_card:"14",owner_card:"13",travel_card:"15",amur_debit_card:"17",owner_debit_card:"16",pension_debit_card:"18",salary_debit_card:"38",vordi_debit_card:"40",eco_debit_card:"42",junior_debit_card:"43",appetit_debit_card:"44",owner_debit_card_plus:"46",owner_debit_card_pens_plus:"47"},lu=d((({title:e,icon:t,description:n,onClick:a=En})=>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:[e?o(ze,{font:"font-medium",size:"text-s",children:e}):null,n?o(ze,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),su={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},ou={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},cu={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},du=e=>Object.entries(e).reduce(((e,[t,n])=>t in su?[...e,{contactTypeCd:{key:su[t]},value:n}]:e),[]),mu=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in ou){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:ou[t]},...a}]}return e}),[]),uu=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:hu(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in cu?[...e,{incomeTypeCd:{key:cu[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p,initiateBankruptcyFlg:f};var y},hu=(e,t)=>(Number(e??0)+Number(t??0)).toString(),pu={WORK:"Работаю",RETIREE:"Пенсионер"},gu=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,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=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:hu(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},fu=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}},yu=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}},bu=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,xu=(e=!1,t=!1)=>e?{nextStepLink:"/debit-card-lead",newTaskLink:"/natural/debetcards",description:"На дебетовую карту"}:t?{nextStepLink:"/credit-lead",newTaskLink:"/natural/loans/all-goals",description:"На получение кредита"}:{nextStepLink:"/credit-card-lead",newTaskLink:"/natural/creditcards/svoya",description:"На получение кредитной карты"},vu=d((function({task:e,isFromLead:t=!1,isDebit:n=!1,sendAspects:a=En,onClose:i=En}){const l=nc(),s=Jt(),{participants:d,creditProgram:m,createdDate:u="",id:h}=e,p=ru[m.code],g=Boolean(iu[m.code]),f=xu(n,g),{id:y,profile:b}=d[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,educationLevelCd:x,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:D,organizationTypeCd:P,organizationKindCd:E,employeesNumberCd:_,opf:B,seniority:O,generalSeniority:A,jobsNumber:M,lastWorkDuration:F,positionCd:L,maritalStatusCd:z,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:q,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Q}=t;return{currency:r?.key,paymentSystem:bu(i),cardCategory:bu(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,education:bu(x),participantDateRegistration:v,housing:bu(N),beginDate:k,employment:bu(I,pu),organizationName:T,inn:R,isDadataOrganization:Boolean(R),employerActivities:bu(D),organization:bu(P),employerOrganization:bu(E),amountWorkers:bu(_),legalForm:B,generalSeniority:O?.toString(),experience5Years:A?.toString(),jobsNumber:M?.toString(),lastJobExperience:F?.toString(),positionOrganization:bu(L),familyStatus:bu(z),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:bu(q),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:bu(X),calculator:{isInsurance:J,isSalaryClient:Q,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...gu(U),...fu(S),...yu(C),...(Z=w,Z?.key?{sex:"MAN"===Z.key?"male":"female"}:null)};var Z})(e);l.participantId=y??null,l.taskId=h,l.profileId=b?.id??null,l.programId=p,l.leadForm=t,b?.id&&a(b.id,h),s.assign(f.nextStepLink)}),[]),v=r((()=>{s.assign(f.newTaskLink)}),[]);return o(zn,{onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(N,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(lu,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:u?`Черновик от ${ja(new Date(u))}`:"",onClick:x}),o(lu,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:f.description,onClick:t?i:v})]})]})})})),Nu=d((function({isDebit:e,onClose:t=En}){const n=Jt(),a=xu(e),i=r((()=>{n.assign(a.newTaskLink)}),[]),l=r((()=>{n.assign("/")}),[]);return o(zn,{onClose:t,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(w,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(An,{type:"button",className:"w-full",onClick:i,children:"Заполнить новую заявку"}),o(An,{type:"button",version:"secondary",className:"w-full",onClick:l,children:"Вернуться на главную"})]})})})),wu=e=>{switch(e){case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},Cu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),Su=({programId:e,nextStepLink:t,productType:n,data:a,changeSubmitFormStatus:i})=>{const[l,{setTrue:s,setFalse:o}]=nn(!1),c=(()=>{const e=vc();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),d=is(),m=vc(),u=(({data:e})=>{const t=tn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});ti({aspectsAttributes:Cu(e,i),aspects:t,ev:{}})}),[e])})({data:a}),h=Jt(),p=r((()=>{h.assign(t)}),[]),g=(e=>{const{open:t}=pn(au),n=pn(Qm),a=t=>async n=>{try{t&&await $m({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i,r)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i),onFail:r}):e()};return{open:(n,a,r)=>t({onSubmit:i(n,a,r),onClose:e})}})(p),f=pn(Qm),y=(()=>{const{open:e}=pn(vu),{open:t}=pn(Nu);return{open:({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l})=>{n?e({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l}):t({isDebit:i})}}})(),b=()=>{f.close(),i(!1)};return{isSending:l,handleSubmit:r((async t=>{try{s();const i=Ru(t),r=await(a={profile:{phone:qa(i.phone)}},Os("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=m.referalData,o=d.marketingInfo;if(!r)throw new Error;const h=async()=>{await Iu({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:o,saveUserData:c,sendAspects:u}),f.close(),"debitCard"===n?p():g.open(i.phone,r,b)},x=async()=>{try{const t=await(async e=>{const t=await Os("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await Os("/user-data/getTaskById","POST",e)||void 0)({taskId:t});f.close(),y.open({task:e,isFromLead:!0,isDebit:"debitCard"===n,sendAspects:u,onClose:h})}else await h()}catch{b()}},v=ku(i,n);f.open({phone:i.phone,consents:v,onSuccess:x,onFail:b})}catch{b()}finally{o()}var a}),[])}},ku=(e,t)=>{const n=_s[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},Iu=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=Tu(n,a);await $m(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&ja(l,!0),email:o,phone:qa(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async e=>await Os("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t,n)=>{const{name:a,surname:i,middleName:r,limitedBirthday:l,phone:s,email:o}=e;return{task:{taskSource:wu(n?.utm_source),creditProgram:{code:hd[t]},participants:[{birthDate:l&&ja(l,!0),midname:r,name:a,surname:i,participantContacts:du({phone:s&&qa(s),email:o})}],marketingInfo:n}}})(n,e,r));o=t.taskId,c=t.participantId}else{const a=await(async e=>await Os("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});o=a.taskId,c=a.participantId,await jm((({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i})=>{const{name:r,surname:l,middleName:s,limitedBirthday:o,phone:c,email:d}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:wu(i?.utm_source),id:t,participants:[{birthDate:o&&ja(o,!0),id:e,midname:s,name:r,surname:l,profile:{id:n},participantContacts:du({phone:c&&qa(c),email:d}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:i}}})({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await(m={taskId:o,...i},As("/referal/saveReferalInfo","POST",m)),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}var m},Tu=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentInformMaterialsFlg:s,consentFATCA:o}=e;let c;return c="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:!1}:{consentFATCA:o,consentPhotoFlg:n},{...c,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},Ru=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),Du=(e=!1)=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),a=globalThis.localStorage.getItem("taskId"),i=Jt();if(!n||!t||!a&&!e)return i.assign("/"),()=>{};const r=async()=>{const e=await As("/auth/refresh","POST",{refresh_token:t,access_token:n});if(401===Number(e?.status)&&i.assign("/"),e?.ok){const t=await e.json();globalThis.sessionStorage.setItem("refreshToken",t.refresh_token),globalThis.sessionStorage.setItem("accessToken",t.access_token)}};!e&&r();const l=setInterval(r,24e4);return()=>clearInterval(l)},Pu={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},Eu=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,Pu[e.name||""]])))}},_u=async(e,t,n=!1)=>{const a=new FormData;return a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml")),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...Ms()},credentials:"include",body:a}).then((e=>e.json())))},Bu=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||r,l?`ул ${l}`: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}},Ou=e=>Math.floor(e/12),Au=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>_u(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},Mu=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},Fu=e=>{const{esiaAdditionalDocument:t}=e;return[t?.inn,t?.averageMonthlyIncome?.toString(),t?.startWorkDate,t?.workLengthInFiveYears?.toString(),t?.workLength?.toString(),t?.workLengthLastJob?.toString(),t?.jobsNumberInFiveYears?.toString(),t?.pdfFilePayout,t?.pdfFileWorkbook,t?.pdfFileSigPayout,t?.xmlFilePayout,t?.xmlFileSigPayout,t?.xmlFileWorkbook].every(Boolean)},Lu=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a})=>{const s=vc(),o=r((e=>{const t=e instanceof Function?e(c[d]):e;null!=t?c[d]=t:delete c[d]}),[c=s,d="leadForm"]);var c,d;const m=is(),u=globalThis.sessionStorage?.getItem(Qt);(()=>{const e=vc(),t=tn();i((()=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("referalCode"),i=n.get("refererCode"),r=n.get("productId");if(a){e.referalData={refererCode:i,referalCode:a,productId:r};const n=JSON.stringify({refererCode:i,referalCode:a,productId:r});ti({aspectsAttributes:[{aspectName:"snowplowEvent",params:{eventAction:"ownfin_referal_link_attributes",eventJSON:n}}],aspects:t,ev:{}})}}),[])})();const h=l((()=>Eu(e,s.leadForm,a)),[e,s.leadForm]),p=r((async(e,a)=>{n(Bs.Pending);try{const r=await(i={code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0},Os("/esia/requestProfile","POST",i).then((e=>(e?.access_token&&e?.refresh_token&&(Xm(e),Du(!0)),e))));if(r){const e=await(async(e,t)=>{Mu(e);const n=!t&&Fu(e),{profile:a,addInfo:i,document:r,addressRegistration:l,addressFact:s,esiaAdditionalDocument:o}=e;let c=[];return n&&(c=await Au(o)),{...{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Qr(a.phone),email:a.email,dulIssueDate:r.dulIssueDate,dulIssuedBy:r.dulIssuedBy,dulNumber:r.dulNumber,dulSerie:r.dulSerie,dulSubdivisionCode:r.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:Bu(l),esiaAccountTypeCd:t?a.esiaAccountType:{key:""},...s&&{addressFact:Bu(s)}},...n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:Ou(o.workLengthInFiveYears).toString(),generalSeniority:Ou(o.workLength).toString(),lastJobExperience:Ou(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:a.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:c}}})(r,"debitCard"===t);o((t=>({...t,...e}))),n(Bs.Success)}}catch{n(Bs.Error)}var i}),[]);return i((()=>{s.productType=t,m.marketingInfo=zu(u,m)}),[u]),i((()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),t=e.get("code"),n=e.get("state");t&&n?p(t,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),h},zu=(e,t)=>{const n=t.marketingInfo,a=new URLSearchParams(decodeURIComponent(e||""));return a.get("code")?n:{utm_campaign:a.get("utm_campaign"),utm_medium:a.get("utm_medium"),utm_source:a.get("utm_source"),utm_content:a.get("utm_content"),utm_term:a.get("utm_term"),bannerId:a.get("bannerId"),userId:a.get("userId")}},Vu=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:h,...p})=>{const[g,f]=a(),[y,b]=a(),[x,v]=a(0),N=s(null),w=l((()=>(e=>{const t=_s[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:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),C=l((()=>$u(w)),[w]),S=pn(Xl),k=ss();os();const I=l((()=>ju(m)),[m]),T=l((()=>Rn(C,I)),[C,I]),R=(e=!1)=>{b(e)},D=Lu({inputs:C,nextStepLink:r,productType:m,setEsiaStatus:f,esiaAuthSuccess:g===Bs.Success}),{isSending:P,handleSubmit:E}=Su({programId:n,nextStepLink:r,productType:m,data:h,changeSubmitFormStatus:R}),[,{field:_,onSubmit:B,reset:O}]=dn(D,{formValidator:T,onSubmit:E}),A=pn(Vn);return i((()=>{!1===y&&A.open({ok:y,onClose:()=>R(!0)})}),[y]),i((()=>{g&&N?.current&&N.current.scrollIntoView({block:"start"}),g===Bs.Success&&O()}),[N?.current,g]),c(hn,{className:u("container space-y-m",e),title:t,...p,children:[g||k?null:o(Fs,{onChangeEsiaStatus:f,productType:m}),c("form",{onSubmit:e=>{_("processPersonalDataFlg")?.value||(v((e=>e+1)),x>0&&S.open({attempts:x})),B?.(e)},className:"space-y-m relative",ref:N,children:[g===Bs.Pending?o(ai,{blur:!1}):null,w.map(((e,t)=>c("div",{className:u(Rl(e.columns),"grid gap-x-m"),children:[Dl(e.title),Lm({field:_,inputs:e?.inputs},m)]},`section-${t}`))),Vm(d,P),g===Bs.Error?o(ze,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),$u=e=>e?.flatMap((e=>e?.inputs))||[],ju=e=>({...Es,limitedBirthday:Ts(e)}),qu=d((({title:e,description:t})=>{const n=De();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"})]})})),Uu=e=>e%2!=0,Wu="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Hu=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=nn(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Wu),children:[D(r,{...i.options,parent:n}),Uu(r.length)?o(Kt,{className:"col-span-6",...i}):null]}),c(no,{children:[c(ao,{className:u(Wu),isUnfolded:s,children:[D(l,{...i.options,parent:n}),Uu(l.length)?o(Kt,{className:"col-span-6",...i}):null]}),o(to,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Yu=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Gu=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Ku=10;function Xu(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:Ju(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}function Ju(e=0){const t=Math.round(e*Ku);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Qu=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:l,onIntersection:s})=>{const c=Xu(r((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),i);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:l})})),Zu=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],eh=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},b=s([]),x=r(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(nh(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?th(c,v):{},...N?Gu(h):{},gap:`${l}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(Qu,{className:u(m,i?Zu[i-1]:"",{"h-full":N},t),style:w?th(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:x,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),th=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),nh=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),ah={"horizontal-list":"w-6","vertical-list":"h-6"},ih=({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?ah[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),rh=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=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",l=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",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},lh=e=>t=>e.scrollWidth/t,sh=e=>(t,n)=>{e.scrollBy({left:n*lh(e)(t),behavior:"smooth"})},oh=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((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?[Gc()(i),Hc()(i)]:[-1,-1],m=c>0,u=d<e-1,h=r((()=>{var t;n.current&&(m?sh(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{n.current&&(u?sh(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((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}]},ch={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},dh=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=De(),[h,p]=oh({itemCount:s.length}),g=mh(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(eh,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(rh({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",ch[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(ih({activeIndex:t,onClick:f,listType:a}))}):null})),mh=(e=!1)=>({behavior:e?"auto":"smooth"}),uh=d((({className:e,name:t,...n})=>o(An,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),hh=d((e=>o(uh,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),ph=d((e=>o(uh,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),gh="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",fh=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?yh(t):null,r?o(hh,{wcmsIgnore:!0,className:u(bh(i),m?"left-1":"left-0"),onClick:s}):null,l?o(ph,{wcmsIgnore:!0,className:u(bh(i),m?"right-1":"right-0"),onClick:d}):null]})})),yh=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(gh,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(gh,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),bh=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),xh=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const b=Array.isArray(g)?g.length:0,[x,v]=oh({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(eh,{containerRef:x,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(fh,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(y?.length)}),o(dh,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:r,version:t,navButtons:y,containerRef:x,containerScroll:v})]})})),vh=({blocksToRender:e,...t})=>o(xh,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:D(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Yu(!0)),children:T(e,t)},String(n))})}),Nh=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[wh(n,t),o(Hu,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[wh(n,t),vh({...a,blocksToRender:t})]});default:return null}})),wh=(e,t)=>e&&!t.length?o(qu,{...e}):null,Ch=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Sh=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(Vr,{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))))),kh=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,Ch(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Ih(a)).filter(Boolean))]}),n?o("div",{children:o(An,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Ih=e=>([t,n])=>{const a=n?.type;return"array"===a?Th(t,e)(n):null},Th=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Sh,{items:a,multiple:!n?.single,...t(e)})]},e)},Rh=e=>e;function Dh(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Ph=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Eh=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Ph(t[e])||Ph(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Ph(t[e])||Ph(n[e])||_h(t[e])<=_h(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Ph(t[e])||Ph(n[e])||_h(t[e]?.min)>=_h(n[e]?.min)&&_h(t[e]?.min)<=_h(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Ph(t[e])||Ph(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Ph(t[e])||Ph(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),_h=e=>Number(e||0),Bh=(e,{block:t,page:n,normalize:a=Rh})=>{const i=t?.blocks||[],[r,s]=dn(e),o=l((()=>Dh(i,i.map((e=>Ut(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=Rh)=>e?.filter((([,e])=>Eh(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},Oh={},Ah={},Mh=Yt((({className:e,filtrationSchema:t=Oh,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=Bh(Ah,{block:i.block,page:i.options?.page}),d=o(ma,{className:"w-64",label:n?.title,options:Fh(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Fh(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(kh,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(An,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Nh,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Fh=e=>Dh(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Lh=(e=!1)=>e?"text-left":"text-center",zh={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Vh=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",zh[t],e),style:{width:r,height:r},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),$h=d((({className:e="",title:t,benefitList:n,...a})=>{const i=De();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Lh(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(jh)}):null]})})),jh=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o(Vh,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(ze,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Fe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),qh=e=>({icon:t,title:n,description:a},i)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(ze,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ie,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(ze,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(i)),Uh=(e,t,n)=>o("div",{className:`grid gap-2xs ${Wh(t)}`,children:e.map(qh(n))}),Wh=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Hh=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(S,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?Uh(e,a,t):null]}))),Yh={start:"justify-start",center:"justify-center",end:"justify-end"},Gh=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Yh[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Ye(e)})})),Kh=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(ze,{size:"text-l",font:"font-light",color:l,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:Je(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Xh=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Jh=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Kh,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(Ec,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(Xh,{title:e,...l}),Qh={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Zh={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},ep=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Qh.prefMonthsNum,prefTravelBonusRate:r=Qh.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Zh,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},tp=Yt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=dn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=ep(l,n);return o(Ic,{className:e,title:t,...r,children:c("section",{className:u(Tc,e),children:[c("div",{className:Rc,children:[jc({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),jc({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Jh({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Dc,children:[f>=0?o(Ec,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Ye(a,{isVertical:!0}),Fc(i)]})]})})})),np=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,ap=e=>Vc({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),ip=" (c капитализацией)",rp=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:Dc,children:[o(Ec,{title:`Доход в конце срока${r?ip:""}`,value:e,postfix:n,prefix:"+"}),o(Ec,{title:`Сумма в конце срока${r?ip:""}`,value:t,postfix:n}),Ye(a,{isVertical:!0}),i?.map(Fc)]}),lp={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const sp={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},op=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?lp[e?.rateType]:"",{data:n}=yi(t?`${$a}/depositrates/${t}`:null,Vt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&cp(s,e)&&Qc(a,["minSum","maxSum"],e)&&Qc(n,["minDays","maxDays"],e)))||sp,{rate:m}=d,u=dp(m,e),h=a+u,p=c||[sp];return{...d,...Jc(["minSum","maxSum"],p),...Jc(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},cp=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,dp=(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)},mp=Yt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:h}]=dn({moneyValue:Ac(l,1e5),daysValue:Mc(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),p=op(m,s),{income:g,finalSum:f,rate:y,depositeName:b}=p;return o(Ic,{className:e,title:t,...d,children:c("section",{className:u(Tc,e),children:[c("div",{className:Rc,children:[jc({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(x={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Ei,{items:[`От ${np(x.min||0)}`,`До ${np(x.max||0)}`],step:1,...x})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[up(p,h),ap({...h("isMonthlyInterestPayment")})]})]}),Jh({rate:y,depositeName:b,isShowDepositeName:r}),rp({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var x})),up=(e,t)=>c("div",{className:"space-y-s",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ba,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ba,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),hp=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},pp={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},gp=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?bp(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[yp({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),yp({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),yp({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),yp({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Qc(a,["minSum","maxSum"],t),Qc(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||pp,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=fp(p,e),f=a+g,y=t||[pp];return{...m,...Jc(["minSum","maxSum"],y),...Jc(["minMonths","maxMonths"],y),availableMonths:hp(y.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:r,income:g,finalSum:f}},fp=(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)},yp=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],bp=(e,t)=>e+Math.round((t-e)/2),xp=(e="rub")=>"rub"===e,vp=(e,t)=>{const{minMonths:n,maxMonths:a}=Jc(["minMonths","maxMonths"],Sp(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ii(i,n,a)}},Np=(e,t)=>{const{minSum:n,maxSum:a}=Jc(["minSum","maxSum"],Sp(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ii(i,n,a)}},wp=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Cp=e=>{const t=xp(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Sp=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},kp=(e,t=!1)=>t?Vc({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,Ip=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[Tp(t("isReplenish"),e,a),Rp(t("isWithdrawn"),e,a),Dp(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?ap(t("isMonthlyInterestPayment")):null,kp(t("isRemoteRegistration"),e.isShowRemoteRegistration),Pp(t("extraPercent"),n),e.isShowNewClient?o(ba,{text:"Новый сберегатель",...t("isNewClient")}):null]})},Tp=(e,t,n=!1)=>t.isShowReplenish?Vc({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,Rp=(e,t,n=!1)=>t.isShowWithdrawn?Vc({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,Dp=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,Pp=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(ma,{options:t,...e})]}):null,Ep={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},_p={text:"₽",key:"rub"},Bp={text:"Без учета надбавки",key:"0"},Op=Yt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[_p],g=r((e=>t=>e?{...t,...Cp(t),...Np(t,e),...vp(t,e),...wp(t,e)}:t)(h),[h]),[f,{field:y}]=dn({moneyValue:Ac(d,2e4),monthsValue:Mc(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:_p,extraPercent:d?.extraPercent??Bp},{normalizer:g}),b=zp(y),x=Boolean(y?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=Sp(h,b),w=gp(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=r((()=>{qc({field:y,defParams:Bc(N,x,v),calcParams:w,monthsValue:"minMonths",map:Ep})}),[y,h,v]);i((()=>{!ad(d)&&N&&T()}),[d,h]);const R=y?.("extraPercent")?.value?.key,D=Lp(C,R),P=C===Bc(N,x)?.rate&&R===v?.at(-1)?.key;return o(Ic,{className:e,title:t,...m,children:c("section",{className:u(Tc,e),children:[c("div",{className:Rc,children:[c("div",{className:"flex gap-m",children:[jc({className:"w-full",title:`Сумма, ${b?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:b?.text,step:Ap(b?.key)}),h&&h?.length>1?o(ua,{label:"Валюта",options:p,...y("currency")}):null]}),Lc({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),Ip({...w,...s},y,v)]}),Jh({rate:D,children:Fp(T,P)}),rp({income:S,finalSum:k,buttons:[...a,Mp(n?.buttons,I)],footnotes:[l],postfix:b?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),Ap=(e="")=>xp(e)?1e3:100,Mp=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},Fp=(e,t=!1)=>t?null:o(An,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Lp=(e,t)=>Number(e)+Number(t??0),zp=e=>e?.("currency")?.value??_p,Vp=e=>$p({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&$p({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),$p=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],jp={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},qp=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[jp],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Vp({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Xc(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Xc(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>Vp({row:e,userInputParams:t,paramsViewSettings:n})&&Qc(a+l,["minSum","maxSum"],e)&&Qc(r,["minSumOld","maxSumOld"],e)&&Qc(l,["minSumExtra","maxSumExtra"],e)&&Qc(i,["minMonths","maxMonths"],e)))||jp)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:p}=h,g=Uc(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},Up=Yt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=dn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=qp(d,n,r),p=l((()=>_c(n?.rateRows)?.rate),[n?.rateRows]),g=$c({...m("isAnnuity")});return o(Ic,{className:e,title:t,...s,children:c("section",{className:u(Tc,e),children:[c("div",{className:Rc,children:[jc({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),jc({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),Lc({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),Wp({...h,...r},m),h.isExtraMoney?jc({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(Dc,"@4xl:w-1/2"),children:[o(Ec,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Ec,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(Ec,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(Ec,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),Ye(a,{isVertical:!0}),Fc(i)]})]})})})),Wp=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ba,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ba,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ba,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Hp=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=ki(e,{normalize:(e=i)=>n&&a?String(Ii(Number(Yp(e)),n,a)):Yp(e),format:Je(l)}),d=r((e=>t&&t(Yp(e))),[t]);return o(Kn,{onChange:d,...s,...c})})),Yp=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Gp=d((e=>o(Hp,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(ze,{size:"text-xl",font:"font-light",children:"₽"})})}))),Kp={private:"p2p/registerP2P",business:"b2c/registerB2C"},Xp=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(zn,{maxWidth:"lg",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 p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Jp=e=>{const t=pn(Xp),n=is(),a=Jt(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=Jt(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${$a}/payment/${Kp[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,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},Qp={amount:1500},Zp=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=Jp(i),[{amount:s},{field:d,onSubmit:m}]=dn(Qp,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(Gp,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o(ii,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),eg=({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(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),tg="relative h-full",ng={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},ag=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(lg),l=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...a,renderProps:(n,a,i)=>c("div",{className:ig(n,{someCardsHighlighted:r}),children:[T(n,a,{className:rg(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),lg(n)?eg({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},ig=(e,{someCardsHighlighted:t})=>u(tg,t&&(lg(e)?"pt-3xl":"pt-16")),rg=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(tg,"min-w-80",ng[a],t&&(lg(e)?"pt-16":"pt-3xl"),Yu(n),n&&"h-full"),lg=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,sg=Yt((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(xh,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?og(s?.block?.blocks):[],hasBlur:!0,children:ag({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),og=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],cg={black:"bg-black",white:"bg-white"},dg=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(_e,{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:Ye([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(ze,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(mg)]}):null,i?c(ze,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),mg=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${cg[e]}`},String(t)),ug=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=be()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...ve(i),children:r})})),hg=[{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"}}],pg=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>hg.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=He(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),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},gg(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:Ye(m,{className:fg(s??!1,i??!1,n),buttonClassName:h})}),l?o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),gg=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",fg=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),yg=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:b=true,isImageSecondary:x=!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(ug,{href:i,target:m,className:"h-full",data:Cu(v),children:c(_e,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...ot(He(r)?o(ie,{image:r}):null,y),buttons:d.length?o(pg,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:x,imageAlign:"center",children:[o(We,{benefits:f}),s?o(Fe,{__html:s,isDotted:l,itemSize:"list-s"}):null,bg(a,p)]})})}))),bg=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,xg=new he,vg=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(ze,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(ze,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Ye(i)}):null]},String(t))},Ng=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...y})=>{const b=l((()=>h.map(vg)),[h]),[x,v]=l((()=>m>0?[b.slice(0,m),b.slice(m)]:[b,[]]),[m,b]),[w,C]=a(!1);i((()=>xg.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=r((()=>{xg.fire("fold",{type:"fold",isUnfolded:!w,parent:p?.parent})}),[w,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(ke,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(no,{children:[c("div",{children:[x,o(ao,{isUnfolded:w,children:v})]}),h.length>=m?o(to,{className:"mt-m",label:w?"Скрыть":"Подробнее о тарифе",isUnfolded:w,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:x})]})})),wg=d((({text:e,value:t})=>c("div",{className:"space-y-xs w-full",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}),o("div",{className:"w-full text-2xl bg-main-gray px-4 py-3 rounded-md",children:Je()(t)})]}))),Cg=d((({cashbacks:e})=>{const{mounth:t,year:n}=Sg(e);return c("div",{className:"w-full flex flex-col gap-lg",children:[o(N,{className:"text-left",headingType:"h5",as:"h2",title:"Результат расчета"}),o(Fe,{__html:'Категории покупок для расчета баллов предварительные.<br />Подробнее по условиям и начислениям можно узнать во вкладке <a href="#docs">документы</a>'}),c("div",{className:"flex flex-col @xs:flex-row gap-lg",children:[o(wg,{text:"Баллов в месяц",value:t}),o(wg,{text:"Баллов в год",value:n})]})]})})),Sg=e=>e.reduce(((e,t)=>{const n=Number(t.percent.key)/100*t.sum;return{mounth:Math.min(e.mounth+n,5e3),year:Math.min(e.year+12*n,6e4)}}),{mounth:0,year:0}),kg=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"},{text:"Категория 5%",key:"5"},{text:"Категория 10%",key:"10"},{text:"Категория 15%",key:"15"}],Ig=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"}],Tg=d((({categories:e,cashback:t,showIncreasedPercents:n,maxInputRange:i,deleteImage:r,onDelete:l,onChange:s})=>{const[d,m]=a(Rg(e)),u=0===t.id;return c("div",{className:"w-full space-y-m",children:[c("div",{className:"space-y-xs",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:"Выберите категорию"}),c("div",{className:"flex gap-m",children:[o(ma,{className:"w-full",isManualInput:u,placeholder:"Выберите категорию",options:Dg(u,n),value:t.percent,onChange:e=>{s({...t,percent:e})}}),u?null:o(An,{version:"secondary",onClick:()=>l(t.id),shape:"round",className:"px-4 rounded-md",children:o(ie,{image:r})})]})]}),e?.length&&!u?o(ma,{label:"Выберите категорию покупок",placeholder:"Выберите категорию покупок",options:e,value:d,onChange:m}):null,o(Ei,{step:500,title:"Сумма покупок в категории",min:0,max:i,value:t.sum,onChange:e=>{s({...t,sum:e})}})]})})),Rg=e=>e?.[(new Date).getTime().toString().slice(-1)],Dg=(e,t)=>e?[]:t?kg:Ig,Pg=[{id:0,percent:{text:'Категория 1% "На всё"',key:"1"},sum:5e3}],Eg={href:"/natural/debetcards/svoya-plus",text:"Оформить карту",target:"_self"},_g=["5","10","15"],Bg=d((({maxInputRange:e=3e5,image:t,deleteImage:n,infoImage:i,className:r="",button:l=Eg,...s})=>{const{cashbacks:d,categories:m,onAddNewCashback:h,onChangeCashback:p,onDeleteCashback:f,onResetCashback:y}=(()=>{const{data:e}=Jo("CASHBACK_CATEGORY"),[t,n]=a(Pg);return{cashbacks:t,categories:e?.map((e=>({key:e.key||"",text:e.value})))||[],onAddNewCashback:()=>n((e=>[...e,{id:e[e.length-1].id+1,percent:{text:"Категория 1,5%",key:"1.5"},sum:5e3}])),onChangeCashback:e=>n((t=>t.map((t=>t.id===e.id?e:t)))),onDeleteCashback:e=>n((t=>t.filter((t=>t.id!==e)))),onResetCashback:()=>n(Pg)}})(),b=t?.src?o(ie,{image:t,className:"hidden w-full @xl:block",imageClassName:"justify-self-center"}):null;return c(g,{className:u("flex flex-col justify-center items-center gap-lg",r),defaultPadding:u("p-6xl"),...s,children:[o(S,{title:"Калькулятор расчета баллов",description:"Можно выбрать не более 5 категорий, одна из них из повышенной категории",headlineVersion:"XL",isEmbedded:!0}),c("div",{className:"flex flex-row items-start gap-lg",children:[c("div",{className:"w-full flex flex-col justify-center items-center gap-lg",children:[d.map((t=>o(Tg,{categories:m,cashback:t,showIncreasedPercents:Ag(t,d),maxInputRange:e,deleteImage:n,onDelete:f,onChange:p},String(t.id)))),Og(d.length,h,y),o(Cg,{cashbacks:d}),o(hc,{__html:"<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров. Подробнее в <a href='#docs'>документах</a></p>",image:i}),o(ke,{className:"w-full @lg:w-auto self-start",href:l.href,text:l.text,target:l.target,version:"primary"})]}),b]})]})})),Og=(e,t,n)=>c("div",{className:"w-full flex flex-col gap-lg",children:[e<5?o(An,{className:"self-start text-primary-main",embedded:!0,version:"secondary",onClick:t,children:"Добавить еще"}):null,e>2?o(An,{className:"self-start",version:"secondary",onClick:n,children:"Сбросить все категории"}):null]}),Ag=(e,t)=>_g.includes(e.percent.key)||!t.some((e=>_g.includes(e.percent.key))),Mg=d((({className:e,contacts:t,info:n,version:a="secondary",...i})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...i,children:[n?.length?Fg(n):null,t?.length?Fg(t):null]}))),Fg=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Lg({column:e,i:t})))}),Lg=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:a},i)=>c("div",{children:[o(S,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(a?.text)}),children:Ye([a])})]},String(i))))},`col-${String(t)}`):null,zg=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 pr-m text-gray",children:t}):null]})]}))),Vg=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(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(zg,{step:a,showPercentage:!1})]})})}));var $g;!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"}($g||($g={}));const jg=e=>Os("/user-data/getTaskStatus","POST",e),qg=async e=>{const t=await Os("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},Ug=d((({title:e,interval:t=0,onEnd:n=En})=>{const[i,r]=a(t);_l({seconds:t,onTick:r,onEnd:n});const l=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) ${l}%, 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(Fl,{seconds:i})})]})]})})),Wg=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=En,...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(Ug,{interval:s,onEnd:d}):null]}),o(Hg,{title:n,items:a}),o(Hg,{title:i,items:r,countColumns:!0}),l?o(si,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),Hg=({title:e,items:t,countColumns:n=!1})=>{const a=De();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Rl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Yg(e)},t)))}):null]})]}):null},Yg=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),Gg=d((()=>o(Wg,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Kg=d((({onExpire:e})=>{const{statusInfo:t}=nc();return o(Wg,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),Xg=d((()=>{const{statusInfo:e}=nc(),t="courier"===e?.methodObtain;return o(Wg,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Jg=d((()=>{const{statusInfo:e}=nc();return o(Wg,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Qg(e),buttonText:"Вернуться на главную"})})),Qg=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:ja(e?.deliveryDate)}]):t},Zg=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ef=d((()=>{const[e,t]=a($g.process),{taskId:n}=nc();i((()=>{(async()=>{for(const e of Zg)await qg({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await jg({taskId:n});a&&a?.statusCd!==$g.process&&(e(),t(a.statusCd))}),[n]);El(l,3e4);const s=r((()=>t($g.rework)),[]);return tf(e,s)})),tf=(e,t)=>({IN_PROCESS:o(Kg,{onExpire:t}),CANCELLED:o(Gg,{}),FAILED:o(Gg,{}),DRAFT:o(Gg,{}),APPROVED:o(Jg,{}),PRE_DECISION:o(Jg,{}),REVISION:o(Xg,{})}[e]||o(Xg,{})),nf=e=>(t,n)=>t.filter((e=>e)).map((t=>[af(n,e),rf(t,e),lf(t,e),df(t,e),sf(t,e),of(t,e),cf(t,e)].some(Boolean)?{...t,required:!1}:t)),af=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,rf=({name:e},t)=>"wages"===e&&"RETIREE"===t("employment")?.key&&!t("inn"),lf=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,sf=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,of=({name:e},t)=>"addressFact"===e&&t("addressMatch"),cf=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),df=({name:e},t)=>"snils"===e&&!t("snils")&&mf(t),mf=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,uf={...Om,...Am},hf=({field:e,inputs:t,params:n})=>t.map(Tl(e,n,uf)),pf=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:r,condition:l},s)=>{const c=nf(gf(t))(e,n),d=[cf({condition:l},gf(t))?null:Dl(r),...hf({field:t,inputs:c,params:a})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return d.length?o("div",{className:u(Rl(i),"grid gap-x-m"),children:d},`section-${s}`):null})),gf=e=>t=>e(t)?.value,ff=({formState:e,inputs:t,step:n,productType:a})=>{return Rn(nf((t=>e[t]))(t,n),{...Es,limitedBirthday:Ts(a),dulIssueDate:(r=e.limitedBirthday,Cs(14,r)("Укажите дату выдачи паспорта")),generalSeniority:(i=e.lastJobExperience,ln((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)&&(!i||Number(e)>=Number(i))))("Укажите количество лет стажа")),beginDate:Ns(e.limitedBirthday),participantDateRegistration:ws(e.limitedBirthday),organizationName:Ss(e.isDadataOrganization),inn:ks(e.isDadataOrganization)})(e);var i,r},yf=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(An,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(ii,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),bf=(e,t,n)=>({...n[e],...t,limitedBirthday:xf(t?.limitedBirthday),dulIssueDate:xf(t?.dulIssueDate),participantDateRegistration:xf(t?.participantDateRegistration),beginDate:xf(t?.beginDate),deliveryDate:xf(t?.deliveryDate)}),xf=e=>{try{return e?new Date(e):void 0}catch(e){return}},vf=(e=!1)=>[{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:"",isDadataOrganization:!1,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:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0}],Nf=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...vf(),{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],wf=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Cf=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return{employmentContractDate:ja(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:du({organizationPhone:p&&qa(p)}),participantAddresses:mu({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},Sf=e=>{const{limitedBirthday:t="",sex:n,birthPlace:a,dulIssueDate:i="",dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o,education:c,participantDateRegistration:d,housing:m,addressRegistration:u,addressFact:h,addressMatch:p}=e;return{birthDate:ja(t,!0),birthPlace:a,dulIssueDate:ja(i,!0),dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o?.replace("-",""),educationLevelCd:c,registrationDate:d?ja(d,!0):void 0,homeMatchFlg:p,houseTypeCd:m,participantAddresses:mu({addressRegistration:u,addressFact:p?u:h}),genderCd:n?{key:"male"===n?"MAN":"WOMAN"}:void 0}},kf=e=>e?new Date(e).toISOString().split(".")[0]:"",If=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:kf(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},Tf=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Rf=(e,t)=>{switch(e){case 0:default:return{};case 1:return Sf(t);case 2:return Cf(t);case 3:return uu(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:mu({addressCourier:t})}:{}})(t)}},Df=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=nn(!1),o=5===e,c=nc(),d=l((()=>bf(e,c.leadForm,Nf)),[e,c.leadForm]),m=r((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=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await jm((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...Tf(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Rf(i,a)}],...wf(a),...If(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Pf=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{os();const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((t=>ff({formState:t,inputs:s,step:e,productType:"creditCard"})),[s]),[m,u,h]=Df({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=dn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[pf({sections:t,field:p,step:e}),o(yf,{isSending:h,step:e,onPrevStep:n})]})})),Ef=[{title:"Персональные данные",columns:2,inputs:[{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"sex",required:!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}]}],_f=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...Ef,{inputs:[{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}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0},{name:"inn",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"organizationPhone",label:"Телефон работодателя",required:!0}]},{columns:2,inputs:[{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:"beginDate",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE"]}}]},{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"}]}],[{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"]}}]},{columns:2,inputs:[{condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode"}]}]],Bf=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Of=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Du,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=_f[n],[f,{setTrue:y}]=nn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(Vg,{stepsTitles:Bf,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(ef,{}):o(Pf,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:y},String(n))})]})})})),Af=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>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(zg,{step:a,showPercentage:!1})]})})})),Mf=d((()=>o(Wg,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Ff=d((({onExpire:e})=>{const{statusInfo:t}=nc();return o(Wg,{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})})),Lf=d((()=>{const{statusInfo:e}=nc();return o(Wg,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),zf=d((()=>{const{statusInfo:e}=nc();return o(Wg,{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:"Вернуться на главную"})})),Vf=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],$f=d((()=>{const[e,t]=a($g.process),{taskId:n}=nc();i((()=>{(async()=>{for(const e of Vf)await qg({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await jg({taskId:n});a&&a?.statusCd!==$g.process&&(e(),t(a.statusCd))}),[n]);El(l,3e4);const s=r((()=>t($g.rework)),[]);return jf(e,s)})),jf=(e,t)=>({IN_PROCESS:o(Ff,{onExpire:t}),CANCELLED:o(Mf,{}),FAILED:o(Mf,{}),DRAFT:o(Mf,{}),APPROVED:o(zf,{}),PRE_DECISION:o(zf,{}),REVISION:o(Lf,{})}[e]||o(Lf,{})),qf=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(An,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(ii,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),Uf={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},Wf=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Uf[a?"annuity":"differential"]}},Hf=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Yf=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Sf(t);case 2:return Cf(t);case 3:return uu(t);default:return{}}},Gf=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...vf(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],Kf=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=nn(!1),o=4===e,c=nc(),d=l((()=>bf(e,c.leadForm,Gf)),[e,c.leadForm]),m=r((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=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await jm((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Yf(i,a)}],...Wf(a),...Hf(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Xf=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=nc();os();const m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=r((t=>ff({formState:t,inputs:u,step:e,productType:"credit"})),[u]),[p,g,f]=Kf({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:b}]=dn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:b,className:"space-y-m",children:[pf({sections:t,field:y,step:e,params:{calcData:m}}),o(qf,{step:e,isSending:f,onPrevStep:a})]})})),Jf=[[{columns:1,inputs:[{name:"calculator"}]}],[...Ef,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0},{name:"inn",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"amountWorkers",required:!0},{name:"organizationPhone",label:"Телефон работодателя",required:!0}]},{columns:2,inputs:[{name:"jobsNumber",required:!0,filledByEsia:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{columns:2,inputs:[{name:"bankEmployeeCode"}]}]],Qf=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],Zf=Yt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(Du,[]);const h=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),p=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=Jf[l],y=0===l,[b,{setTrue:x}]=nn(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o(Af,{stepsTitles:Qf,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:b?o($f,{}):o(Xf,{step:l,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:x},String(l))})]})})})),ey=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=e===t?100:85;return c("div",{className:"py-lg px-5xl bg-white col-span-12",children:[n[e]||null,o(zg,{step:a,showPercentage:!1})]})})),ty=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,...r})=>c(g,{...r,children:[o("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"})}),o(ny,{items:n}),a?o(ke,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(ke,{href:"/natural/debetcards",text:"Заполнить заново",version:"primary",className:"w-full mt-lg"}),o(ke,{href:"https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault",text:"Перейти в интернет банк",version:"primary",className:"w-full mt-lg"})]}):null]}))),ny=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:ay(e)},t)))}):null]})]}):null,ay=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),iy=d((()=>{const{leadForm:e}=nc();return o(ty,{title:`${e?.name} ${e?.middleName},`,description:"Информация о Вас уже есть в системах Банка, обратите внимание на корректность заполнения паспортных данных",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:ja(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),ry=d((()=>o(ty,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),ly=d((()=>o(ty,{title:"Не закрывайте заявку",description:"Идёт проверка данных"}))),sy=d((()=>o(ty,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),oy=d((({isOffice:e})=>o(ty,{title:"Заявка принята",description:e?"Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную"}))),cy=d((()=>{const[e,t]=a($g.process),{taskId:n,statusInfo:r,programId:l}=nc(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await qg({signalType:"FIND_PERSON_SIGNAL",taskId:n});o&&await qg({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||$g.notFound)})()}),[n]),dy(e,o,s)})),dy=(e,t,n)=>({IN_PROCESS:o(ly,{}),NOT_FOUND:o(ry,{}),CLIENT_NOT_OK:o(ry,{}),DBO_CLIENT:o(n?sy:iy,{}),PRE_DECISION:o(oy,{isOffice:t})}[e]||o(oy,{isOffice:t})),my=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(An,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(ii,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),uy=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressMatch:!0,addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},currency:"810",codeWord:"",latinName:"",latinSurname:""}],hy=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:kf(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},py=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},gy=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:mu({addressCourier:t})}:{}})(t);case 1:return Sf(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},fy=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=nn(!1),o=2===e,c=nc(),d=l((()=>bf(e,c.leadForm,uy)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:hd[a]},...py(n),participants:[{id:e,residentOtherCountry:!1,...gy(i,n)}],...wf(n),...hy(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),As("/user-data/updateUserTaskDebit","PUT",r)),o||"courier"===a.methodObtain?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},yy=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{os();const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((t=>ff({formState:t,inputs:s,step:e,productType:"debitCard"})),[s]),[m,u,h]=fy({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=dn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[pf({sections:t,field:p,step:e}),o(my,{step:e,isSending:h,onPrevStep:n})]})})),by=[[{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}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Ожидайте звонка для согласования даты и времени доставки карты"}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],[...Ef,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[],condition:{name:"addressMatch",values:[!1]}},{inputs:[{name:"addressFact",required:!0,dadata:!0,condition:{name:"addressMatch",values:[!1]}}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[]},{columns:2,inputs:[{name:"latinName"},{name:"latinSurname",required:!0}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения."}]},{inputs:[{name:"codeWord",required:!0}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию."}]}]],xy=["","Персональные данные","Платежная система"],vy=Yt((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Du,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=by[n],f=0===n,[y,{setTrue:b}]=nn(!1),x=r((()=>{b(),m()}),[]);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(ey,{stepsTitles:xy,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(cy,{}):o(yy,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),Ny=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,wy=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Cy=1e9,Sy={sum:{min:1e4,max:Cy},period:3},ky=Yt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=Bh(Sy,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:Iy(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Ty(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(kh,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Gp,{label:a?.title,min:500,max:Cy,...d("sum",{parse:e=>({min:Number(e),max:Cy}),format:({min:e})=>String(e)})}),o(Ei,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Nh,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Iy=e=>$t((e?.paramsSource?.rateRows||[]).filter(Ny).flatMap((e=>wy(e.minMonths,e.maxMonths)))),Ty=e=>$t(e.flatMap((e=>e||[])).filter(Ny).flatMap((e=>wy(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Ry=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,Dy=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:Ry(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(ke,{version:i?.version,text:i?.text,...i}):null]}))),Py=`${$a}/region`;function Ey(e="Москва"){return tc().location??{name:e}}function _y(e="Москва"){const t=tc(),n=r((async()=>{if(!t.location){const n=await zt(Py);t.location=n??{name:e}}}),[t,e]);return yi(Py,n),t}var By;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(By||(By={}));const Oy=new Intl.NumberFormat("ru",{style:"currency",currency:By.RUB}),Ay=e=>e?Oy.format(e):"",My="text-m font-light text-secondary-text ",Fy=`${My} text-left`,Ly=`${My} pl-5xl text-center`,zy=`${My} pl-5xl text-right`,Vy={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},$y=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Fy,children:o(ze,{size:"text-m",children:"Валюта"})}),o("th",{className:Ly,children:o(ze,{size:"text-m",children:"Купить"})}),o("th",{className:zy,children:o(ze,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(jy)})]}))),jy=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:Vy[t]},width:"24",height:"24"}):null,o(ze,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(ze,{size:"text-h6",children:Ay(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(ze,{size:"text-h6",children:Ay(e?.buyExchangeRate)})})]},t)},qy={icon:"GpsIcon"},Uy=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Vh,{...qy,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Wy=(e,t,n)=>{const a=Number(Hy(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)},Hy=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function Yy(e){if(!e)throw new Error("Value should be fulfilled");return e}const Gy=e=>t=>{const[,n]=Yy(e.find((([e])=>e(t))));return n(t)},Ky=e=>Gy(e.map((([e,t])=>[e,()=>t])));Ky.if=e=>new Xy(void 0,e);class Xy{parent;predicate;unit;get entry(){return[Yy(this.predicate),Yy(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Xy(this,e)}then(e){return new Xy(this.parent,this.predicate,e)}else(e){return Gy([...Jy(this),[()=>!0,e]])}}const Jy=e=>[...e?.parent?Jy(e.parent):[],e.entry],Qy=e=>Ky([[e=>e.value!==By.RUB&&e.oppositeValue!==By.RUB,()=>e.handleConvert(e.value,By.RUB)],[e=>e.value===By.RUB&&e.oppositeValue===By.RUB,()=>e.handleConvert(e.value,By.USD)],[e=>e.value===By.RUB&&e.oppositeValue===By.RUB,()=>e.handleConvert(e.value,By.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Zy(e){const{placeholder:t,rates:n,selected:a,value:i,onChange:r,setSelected:l}=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(Kn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:r}),s.length?o(ma,{className:"absolute right-0",isBorder:!1,onChange:e=>l(e.key),options:s,value:d}):null]})}const eb=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[l,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||By.RUB,selectBuy:n?.[0]?.currency?.currency||By.USD}),d=r((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:[Zy({placeholder:"Хочу продать",rates:n,selected:l.selectSell,setSelected:tb(l,d,n),value:l.inputSell,onChange:e=>ab(d,n)(e,l.selectSell,l.selectBuy)}),Zy({placeholder:"Получу",rates:t,selected:l.selectBuy,setSelected:nb(l,d,t),value:l.inputBuy,onChange:e=>ib(d,t)(e,l.selectBuy,l.selectSell)})]}):null,i?.text?o(ke,{text:i.text,version:i?.version,...i}):null]})})),tb=(e,t,n)=>a=>{t({selectSell:a}),Qy({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{ab(t,n)(e.inputSell,a,i)}})},nb=(e,t,n)=>a=>{t({selectBuy:a}),Qy({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>ib(t,n)(e.inputBuy,a,i)})},ab=(e,t)=>(n,a,i)=>{e({inputSell:Hy(n),selectBuy:i});const r=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;r&&e({inputBuy:String(Wy(n,r,a===By.RUB)||"")})},ib=(e,t)=>(n,a,i)=>{e({inputBuy:Hy(n),selectSell:i});const r=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;r&&e({inputSell:String(Wy(n,r,a===By.RUB)||"")})},rb=`${$a}/exchangerates`;const lb=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=yi(rb+`?regionCode=${t}`,Vt);return n||{}}(Ey()),r=i?.exchangeRate?.currencies?.filter((e=>0!==e.buyExchangeRate||0!==e.saleExchangeRate)),l=sb(r),s=l.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:By.RUB}});const d=l.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:By.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(_e,{className:"h-full",title:o(N,{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($y,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Uy,{address:i?.address})]}),o(eb,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),sb=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],ob=d((({className:e,items:t})=>{const n=be();return o("ul",{className:u("w-full",e),children:t?.map(cb(n))})})),cb=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...ve(t),children:i||null})},String(a)):null},db=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),mb=["all","footer"],ub=Boolean(J.SINGLE_SEARCH_INDEX),hb=d((({className:e,navigationItems:t,isSearchPanel:n=!1})=>{const a=be(),i=t?.filter(db(mb))?.map(a)??[],[r]=i;return o("div",{className:"space-y-2 lg:order-2",children:o("div",ub&&n?{children:o(ob,{className:"block columns-3 space-y-3 gap-x-6xl",items:r?.items})}:{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-m",e),children:i?.map(pb)})})})),pb=(e,t)=>{const{text:n,items:a=[],href:i,target:r="_self",onClick:l,dataFooter:s}=e,d=a.filter(db(mb));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:i,target:r,onClick:l,...ve(s),children:n}),d?o(ob,{className:"flex flex-col gap-s",items:d}):null]},String(t))},gb=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(fb)}):null)),fb=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(ze,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(yb)})]},String(t)),yb=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:bb(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),bb=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${xb(t)}`,children:o(ze,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},xb=e=>e.replaceAll(/\D/g,""),vb=d((({className:e="",index:t,text:n,...a})=>{const i=be(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),Nb=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(ze,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(vb,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),wb="w-full lg:w-52";function Cb(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Sb=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 r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const kb=(e,t)=>(n,a)=>{for(const[i,r]of a)n.set(i,e(n.get(i)||t,r));return n},Ib=(e=[])=>e.reduce(((e,t)=>e+t),0),Tb=J.SEARCH_LANG,Rb=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&("en"===Tb?!/[а-яА-ЯёЁ0-9]/.test(e):!/[0-9a-z]/.test(e)))),Db=e=>t=>e.map((([e,n])=>[Sb(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Eb(t,e))).reduce(kb(Math.max,0),new Map),Pb=e=>t=>{return Dh(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Rb(t||"");return n.length?Ib(e.map((e=>Yc(n.map(Sb(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},Eb=(e,t)=>new Map(e.map((e=>[e,t]))),_b=({basePathList:e,initialQuery:t=""})=>{const[n,r]=a(t||""),l=E();i((()=>{null!=t&&r(t)}),[t]);const{data:s}=yi(e?.length?e:null,Bb(l)),[o,c]=a(null);return Cb((()=>{s&&c(s.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Rb(e);if(!i.length)return[];const r=Object.entries(a),l=[...i.map(Db(r)).reduce(kb(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Pb(i)(l)})(n)))}),[s,n]),[o,{value:n,onChange:r}]},Bb=e=>async(...t)=>(await Promise.allSettled(t.map((async e=>[e,await zt(L(e,"search.index.json"))])))).map((e=>"fulfilled"===e.status?e.value:[])).map(Ob(e)),Ob=e=>([t,n])=>n?{...n,corpus:n.corpus?.map((n=>({...n,uri:"index"===n.uri?t:U(e)(n.uri,t)})))}:{},Ab=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:l="Поиск по сайту"})=>{const s=r((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",Yn),value:t,type:"text",name:"search-bar-input",placeholder:l,autoFocus:n,onChange:s,onFocus:i})]})})),Mb=Boolean(J.SINGLE_SEARCH_INDEX),Fb=d((({initialQuery:e,navigationItems:t,onClose:n,search:a})=>{const i=Q(J.SITE_URL),r=l((()=>Mb?[i]:t?.map((e=>e.href||"/"))),[t]),[s,c]=_b({basePathList:r,initialQuery:e}),d=l((()=>Lb(t)(s)),[t,s]);return o(zn,{maxWidth:"none",head:o(Ab,{className:"mt-s",autoFocus:!0,placeholder:a?.placeholder,...c}),onClose:n,children:o(hb,{navigationItems:d,isSearchPanel:!0})})})),Lb=e=>t=>e?.length&&t?.length?Dh(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:L("/",t)})))}))):[],zb=d((({className:e,search:t,...n})=>{const[i,l]=a(""),s=r((()=>l("")),[]),d=pn(Fb,n),m=r((e=>{l(e),Vb(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Ab,{value:i,placeholder:t?.placeholder,onChange:m,...n}),o(Mn,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),Vb=e=>e&&e.length>=3,$b=(e,t)=>{const{logo:n,search:a}=e??{},{dataHeader:i,dataFooter:r,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Gm,{className:wb,logo:l,data:r,showTitle:!1}),o(zb,{className:"grow",navigationItems:t,placeholder:a?.placeholder,...e})]})},jb=d((({className:e="",index:t,...n})=>{const a=be(),{href:i,target:r,text:l,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-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),qb=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(ze,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(jb,{index:t,...e},String(t))))}):null]}))),Ub=Yt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},i=n.options?.page?.common??{},{documents:r,relatedEnterprises:l,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[$b(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(hb,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(wb,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(gb,{items:s}),h?o(ke,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(pg,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),o("div",{className:"flex gap-m xl:gap-xs flex-wrap",children:f.map(((e,t)=>o(si,{className:"text-s font-light",...e},`${e.href}_${t}`)))})]})]}),o(Nb,{title:m,links:l}),o(qb,{links:r,license:p})]})})),Wb=(e=!1)=>e?{}:{padding:"p-0"},Hb={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Yb=[1,2,3,4],Gb={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},Kb=Yt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...h})=>{const p=(e=>{const[t,n]=a(e.blocks??[]),r=is(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",Hb[n],e),padding:t,version:s,isTheme:c,...h,children:P({...h,block:{...m,blocks:p},renderProps:Xb({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>Gb,allowRemoveChild:e=>(e?.blocks??[]).length>5}),Xb=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>T(n,{...a,blockDecorator:Jb(a.blockDecorator,i)},{className:u("w-full",Yu(t)),...Wb(e)}),Jb=(e,t=0)=>(n,a)=>e?.({...n,render:e=>Zb(t)({...n,...e},a)},`wrap_${a}`)??Zb(t)(n,a),Qb=e=>Number(e)<5?"":"hidden",Zb=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return Yb.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(ug,{...r.content?.link,className:u(Qb(e),(l=e,Yb.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},ex=Yt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{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",...l,children:c("div",{className:"container space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(ua,{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(si,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:Cu(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})}));function tx(e=[]){const t=E(),n=Array.from(e.entries()).filter((([,e])=>nx(t)(e)));return n.find((([,e])=>nx(t,!0)(e)))??n[n.length-1]??[]}const nx=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(ax(e)(n));return t?a===F(n):a.startsWith(F(n))},ax=e=>t=>{const n=Q(J.SITE_URL);return O(t)?globalThis?.location?.href:L(n,e.pathname)},ix={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},rx=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:h="",ref:p})=>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":`${ix[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...lx(h),...ve(s),ref:p,children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),lx=e=>e?{"data-test-id":e}:null,sx=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=nn(!1),d=tn(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(rx,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),ox=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a,renderDropdownItem:i=dx,handlers:r,onItemClick:l})=>{const s=De();return o("div",{ref:e,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{"max-w-max":s}),"aria-label":a,children:t?.map(((e,t)=>i({item:e,i:t,activeItem:n,handlers:r,closeDropdown:l})))})},cx=d((({isActive:e,...t})=>{const n=be(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...ve(t?.data),children:a})})),dx=({item:e,i:t,activeItem:n})=>o(cx,{isActive:e===n,...e},e?.text??String(t));function mx({items:e,activeItem:t,onClose:n,isOpen:a,onHover:l=!1,renderDropdownItem:c,handlers:d}){const m=sa();i((()=>{a&&(m.close(),n?.())}),[a]);const u=r((()=>{m.close(),n?.()}),[n]),h=s(null),p=s(null),g=Hn(u),f=l?p:g;return i((()=>{if(!a||!h.current||!e?.length)return;const n=h.current,{top:i,left:r,width:l,height:s}=n.getBoundingClientRect();m.open({popup:o(ox,{dropdownRef:f,items:e,activeItem:t,renderDropdownItem:c,handlers:d,onItemClick:u}),top:i+window.scrollY+s,left:r,width:l})}),[a,e,u]),i((()=>(l&&f.current?.addEventListener("mouseleave",u),()=>{f.current?.removeEventListener("mouseleave",u)})),[l,f.current,a]),h}const ux=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[i,{setFalse:r,toggle:l}]=nn(!1),s=mx({items:t,onClose:r,isOpen:i,activeItem:n});return o("div",{className:u(i?"rounded-md shadow-blue-gray":"",e),ref:s,role:"navigation",children:o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:l,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))})})})),hx={text:"Отправить заявку",version:"primary"},px={text:"Согласен на обработку персональных данных",href:"/privacy-policy",target:"_blank"},gx=({onClose:e=En})=>o(zn,{onClose:e,position:"corner",children:o("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:o("div",{className:"container grid grid-cols-12",children:o(Gl,{className:"col-span-12 pt-0",endpoint:"callback",title:"Заказать обратный звонок",sections:[{inputs:[{name:"questionProduct",required:!0},{name:"callbackTime",required:!0,label:"Когда перезвонить?"},{name:"russianPhone",required:!0},{name:"consentDataProcessing",required:!0}]}],button:hx,link:px,onSuccess:e})})})}),fx=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:r="large"})=>{const[l,{setFalse:s,toggle:c}]=nn(!1),d=bx(B.QUICK_ACTIONS??[]),m=xx(),h=De(),p=mx({items:d,onClose:s,isOpen:l,onHover:!h,renderDropdownItem:yx,handlers:m});return i((()=>{if(!h)return p.current?.addEventListener("mouseenter",c),p.current?.addEventListener("mouseleave",s),()=>{p.current?.removeEventListener("mouseenter",c),p.current?.removeEventListener("mouseleave",s)}}),[]),o("div",{ref:p,children:o(rx,{image:{icon:"CallbackIcon",iconVersion:e},ariaLabel:n,buttonSize:r,isGrayBg:!0,version:a,className:u(l?"shadow-blue-gray":"",t),onClick:c})})})),yx=({item:e,handlers:t,closeDropdown:n=En})=>{const a={call:{handler:e=>{t?.call(e),n()},text:"Заказать звонок"},chat:{handler:e=>{t?.chat(e),n()},text:"Написать в чат"}};return o("button",{className:u("text-l font-light pb-m hover:text-primary-main text-left"),role:"link",onClick:a[e?.text??""].handler,children:a[e?.text??""].text},e?.text??"")},bx=e=>e.map((e=>({text:e}))),xx=()=>{const e=pn(gx),t=r((()=>{e.open({onClose:()=>e.close()})}),[]),n=tn();return{call:t,chat:r((e=>{console.log("chat click");const t=n.openChatBot;console.log(t),t&&t(e).finally()}),[])}},vx=d((({className:e="",active:t,dataItemName:n,children:a,data:i,...r})=>{const l=be(),{href:s,target:d,text:m,onClick:h}=l(r);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...ve(i),children:[o("span",{className:Nx(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Nx=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),wx=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,items:l,activeItem:s,...c})=>{const[d,{setFalse:m,setTrue:u}]=nn(!1),h=Xu(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e),p=mx({items:l,onClose:m,isOpen:d,activeItem:s,onHover:!0});return i((()=>(p.current?.addEventListener("mouseenter",u),p.current?.addEventListener("mouseleave",m),()=>{p.current?.removeEventListener("mouseenter",u),p.current?.removeEventListener("mouseleave",m)})),[]),o("div",{className:"inline-block",ref:p,children:o("span",{ref:h,className:a,role:"menuitem",children:o(vx,{...c,children:n})})})})),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"},Sx=d((({version:e,text:t,mobileText:n,...a})=>{const i=De()?n:t;return i?o(ke,{className:u("py-s px-lg font-light whitespace-nowrap",Cx["transparent"===e?"transparent":"default"]),...a,children:i}):null})),kx=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:r})=>{const d="transparent"===t?"white":"black",[,m]=tx(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},y=l((()=>e.map(((e,t)=>e=>{h(e?Ix(t):Tx(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(wx,{className:u-1<t?"invisible":"",active:e===m,activeItem:m,observerOptions:f,onVisibilityChange:y[t],data:e.dataHeader,...e},String(t))))}),p.length?o(ux,{items:p,activeItem:m,ariaLabel:i}):null,o("div",{children:B.QUICK_ACTIONS?o(fx,{version:t,iconVersion:d,ariaLabel:r}):null}),B.CHAT_BOT&&!B.QUICK_ACTIONS?o(sx,{version:t,iconVersion:d,ariaLabel:r}):null,o(Sx,{version:t,...n})]})})),Ix=e=>t=>Math.max(t,e+1),Tx=e=>t=>Math.min(t,e),Rx=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(Dx,{...e},String(t))))})]}):null,Dx=d((({icon:e,...t})=>{const n=be(),{text:a,target:i,href:r,onClick:l}=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:r,target:i,onClick:l,children:o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Px=(e,t)=>n=>n.name?o(ug,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Cu(e,n.name),children:o(ze,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Ex=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(Yn,"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"})]}))),_x=d((({defaultLocation:e})=>{const t=Ey(e),n=be(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(ug,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Bx=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=_y(t?.default),[s,d]=a(""),m=cl(),u=l((()=>Mx(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=l((()=>((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,Ax)),[u]),p=r((e=>{i.location=e,n?.()}),[i,n]);return c(zn,{maxWidth:"none",head:Ox(s,d,t),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Sb(e.toLowerCase())(s.toLowerCase())>=.8)).map(Px(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(ze,{size:"text-h6",children:e})}),t.map(Px(f,g))]},e)))}),Rx(e)]});var g,f})),Ox=(e,t,n)=>c("div",{children:[o(ze,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(_x,{defaultLocation:n?.default}),o(Ex,{onSearch:t,searchTerm:e})]}),Ax=e=>e.name?.charAt(0)??"",Mx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Fx=d((({className:e="",active:t,flat:n,children:a,data:i,...r})=>{const l=be(),{href:s,target:c,text:d,onClick:m}=l(r);return o("a",{className:u(Lx(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...ve(i),children:o("span",{suppressHydrationWarning:!0,className:zx(t,n),children:d||a})})})),Lx=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),zx=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Vx=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",i=Ey(n?.branches?.default),l=pn(Fb,n),s=pn(Bx,n),d=r((()=>l.open({})),[l]),m=r((()=>s.open({})),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[i?.name&&n?.branches?.visible?o(Fx,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:Cu(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Fx,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(rx,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),$x=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const l=Xu(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:l,className:a,role:"menuitem",children:o(Fx,{...i,children:n})})})),jx=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:i,headerData:r,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),y={rootRef:f},b=l((()=>e.map(((e,t)=>e=>{p(e?qx(t):Ux(t))}))),[e]),{dataFooter:x,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Gm,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-40 pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o($x,{className:h-1<n?"invisible":"",active:e===t,observerOptions:y,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(ux,{className:"mx-xs rounded-md shadow-blue-gray",items:g,activeItem:t,ariaLabel:n}):null,o(Vx,{version:i,className:"ml-auto",search:d,navigationItems:e,...r})]})})),qx=e=>t=>Math.max(t,e+1),Ux=e=>t=>Math.min(t,e),Wx={"bg-white":"primary",transparent:"transparent"},Hx=["all","header"],Yx=Yt((({className:e,bgColor:t="bg-white",logo:n={},version:a=Wx[t],portal:i,header:r={},...l})=>{const{common:s,navigation:d}=Kx(l?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=tx(m),{internetBankButton:f}=i||{},y=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:a,...l,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(jx,{activeTopItem:p,navigationItems:m?.filter(db(Hx)),version:a,headerData:{...r,...d},search:s.search,bgColor:t,logo:y})}),o("div",{className:u("mt-s h-px bg-main-divider",Gx(a))}),p?.items?.length&&o(kx,{subItems:p?.items?.filter(db(Hx)),version:a,internetBankButton:f})]})})})),Gx=e=>"transparent"===e?"opacity-30":"",Kx=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Xx=Yt((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l,...s})=>o(g,{className:u("relative","grid grid-cols-12",Hb[n],e),padding:t,version:i,isTheme:r,...s,children:P({...s,extraProps:{...Wb(a),className:Yu(l)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Jx=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",Yh[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),Qx=["байт","Кб","Мб","Гб","Тб","Пб"],Zx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",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,...ve(r),children:[e,t?c(ze,{size:"text-l",font:"font-light",children:[t," ",ev(d,m),o(ze,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),ev=(e,t)=>e||t?o("span",{children:", "}):"",tv=(e,t)=>(n,a)=>{const i=U(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="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))} ${Qx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?av(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(Zx,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:nv(t),data:n?.data}),o(Fe,{__html:n?.__html})]},String(a))},nv=e=>e?o(ie,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,av=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},iv=d((({href:e,__html:t,target:n,onClose:a})=>c(zn,{maxWidth:"lg",onClose:a,children:[t?o(Fe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(si,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(An,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),rv=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=pn(iv),s=r((()=>l({__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:[nv(i),o(ze,{font:"font-light",children:e})]}):null})),lv={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},sv=Yt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=E();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"===l?"@md:grid-cols-2":"grid-cols-1",lv[l]),role:"list",children:i.map(ov(d,r))}):null]})})),ov=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?cv(t)(n,a):tv(e,t)(n,a)},cv=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(rv,{...a,icon:e,href:dv(t)?t?.href:t?.attachment?.src}),o(Fe,{__html:t?.__html})]},String(n)):null},dv=e=>"href"in e,mv=Yt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const y="secondary"===p?"p-m min-w-32":"min-w-24",b=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(_e,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Ye(a,{className:"flex-wrap"}),children:[i?o(ze,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Fe,{__html:l,itemSize:"list-m"}):null,o(ze,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),uv="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",hv=["workingSaturday","premiumService","privateBanking","remoteWorkplace","serviceDisabledPeople","transferringDataToBiometricSystem"],pv=["sellingCoins","buyingCoins","bullionOperations","preciousMetalsOperations"],gv=["barrierFree","equippedWithRamp","equippedWithLift","equippedWithElevator","equippedWithStairclimber","hasHelpMeButton"],fv=d((({filters:e=[],field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=e.map((e=>o(ba,{text:i[e],...t(e)},e))),[l,s,d]=yv({onlyOffice:a,filtersCheckbox:r}),[m,{toggle:u}]=nn(!1);return o("div",{children:e?.length?o("div",{children:c(no,{children:[o("div",{children:o("div",{className:uv,children:l})}),c("div",{className:"flex space-x-lg pb-2xl",children:[a?o(to,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(An,{embedded:!0,onClick:n,children:[o(Ml,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]}),o("div",{children:c(ao,{isUnfolded:m,children:[vv("Драгоценные металлы",s),vv("Специальные возможности",d)]})})]})}):null})})),yv=({onlyOffice:e=!1,filtersCheckbox:t=[]})=>e?bv(t):xv(t),bv=e=>{const t=[],n=[],a=[];for(const i of e)hv.includes(i.key)&&t.push(i),pv.includes(i.key)&&n.push(i),gv.includes(i.key)&&a.push(i);return[t,n,a]},xv=e=>[e.slice(0,6),e.slice(6)],vv=(e,t=[])=>o("div",{children:t.length>0?c("div",{className:"space-y-s",children:[o(ze,{children:e}),o("div",{className:uv,children:t})]}):null}),Nv=(e,t)=>e&&"underlined"!==t?"primary":"secondary",wv=(e,t,n)=>{const a=Nv("all"===t),i=Nv("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(An,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(An,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},Cv=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Fe,{__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(Sv)}):null]}):null,Sv=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(ze,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),kv=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(ze,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,Iv=()=>{},Tv=e=>"all"===e?"block":"hidden",Rv=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=Iv,renderRemoteWorkplaceCard:l=Iv,getBalloon:s=Iv,initFilterState:d=To,getBalloonRemoteWorkplaces:m=Iv,descriptionData:h,title:p})=>{const g=p?.includes("Офис"),[f,{field:y,reset:b}]=dn(d),{filteredItems:x,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=_o({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,S]=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 grid gap-xl",children:[kv(p,w),h?Cv(h):null,g&&wv(t,C,S),o("div",{className:u("pb-3xl",Tv(C)),children:o(fv,{filters:Dv([...t,...i]),field:{field:y,reset:b},onlyOffice:g,labels:Ro})})]}),o("div",{className:"h-[600px]",children:o(Oo,{children:o(Ho,{points:v,isLoad:n,className:"h-full"})})})]}),c(Oo,{children:[x.map(r),N.map(l)]})]})})),Dv=e=>Object.keys(To).filter((t=>e.filter((e=>Do[t](e))).length)),Pv=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Ev=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:Pv(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:Pv(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(fo,{color:"green",children:Pv(s)})})]}),o(io,{children:o(Zs,{className:"flex-wrap",children:m?.map(((e,t)=>o(Ks,{...e},String(t))))})})]},String(d))},_v=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Pv(t)} №${n}`,body:e.toUpperCase()}),Bv=[];const Ov=async e=>{const t=await zt(e,{method:"GET"});return Array.isArray(t)?t:Bv},Av={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Mv=d((({descriptionData:e,className:t})=>{const n=Ey(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=yi(`${$a}/atms?regionCode=${e}`,Ov);return{data:t||Bv,isLoad:!t&&!n}}(a);return o(Rv,{className:t,data:i,isLoad:r,initFilterState:Av,renderCard:Ev,getBalloon:_v,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Fv=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(ze,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e})]}):null]})}),o(io,{children:Lv(t)})]},String(n)):null,Lv=e=>c("div",{children:[c(Zs,{className:"flex",children:[o(Ks,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Ks,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание банковских карт"})}),o(Ks,{label:"Операции для физических лиц",children:o(ze,{children:"Инвестиционное и накопительное страхование"})}),o(Ks,{label:"Операции для физических лиц",children:o(ze,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Ks,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]}),zv=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Vv={branches:[],remoteWorkplaces:[]};const $v=async e=>await zt(e,{method:"GET"})||Vv,jv=d((({className:e})=>{const t=Ey(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=yi(`${$a}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,$v);return{data:t||Vv,isLoad:!t&&!n}}(n);return o(Rv,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:So,renderRemoteWorkplaceCard:Fv,getBalloon:Io,getBalloonRemoteWorkplaces:zv,title:`Офисы филиала ${t?.name}`})})),qv=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(jv,{}):o(Mv,{descriptionData:e})})})),Uv=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Fe,{__html:t,richVersion:n})})})),Wv=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Hv=Yt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=De(),[m,{toggle:h}]=nn(t),p=o(ao,{className:u("gap-lg",Wv(d)),isUnfolded:m,children:P({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(to,{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:l,...s,children:c(no,{children:[n?y:p,n?p:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),Yv=e=>e<4?"w-72":"w-52",Gv={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"},Kv=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:i=[],stepVersion:r="gray",title:l,version:s="primary",...d})=>{const m=i.length>3,h=Gv,p=(e=>e?"":"opacity-0")(a),f=De();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(S,{headlineVersion:"S",title:l,description:n,isEmbedded:!0,className:"w-full",align:Lh(f)}),i?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:Ch(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(Xv(h,m,r)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:i.map((y={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:i}=y,{label:r,description:l,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Yv(n.length)),children:[c("div",{className:"space-y-xs",children:[r?o(ze,{size:"text-h6",align:"text-center",children:r}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[l?o("div",{className:a.description,children:l}):null,o(Fe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ke,{className:"box-border py-s w-full mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,Ye(e)]});var y})),Xv=(e,t,n)=>({icon:a},i)=>{const r="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${Jv(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:He(a)?o(ie,{image:{...a,iconVersion:a?.iconVersion||r},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(l=n,"secondary"===l?"group-data-primary:text-white":"text-secondary-text")),children:i+1})},String(i));var l},Jv=e=>e?"h-16 w-16":"h-24 w-24",Qv=d((()=>o("div",{className:"hidden",role:"none"}))),Zv={primary:"bg-white/30",secondary:"bg-main-divider"},eN={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},tN=d((({count:e,version:t="secondary"})=>{const n=De(),a=n?"bg-main-divider":Zv[t],i=eN[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(ze,{size:"text-xs",color:i,children:e})})})),nN=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(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",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},aN={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},iN={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},rN={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},lN={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},sN=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:h,...p}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer","rounded-none",aN[a],n?lN[a]:rN[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?iN[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[nN({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(tN,{count:m,version:Nv(n,a)})}):null]})})})),oN=d((e=>o(e?.item?.href?cN:dN,{...e}))),cN=d((e=>{const t=be(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(sN,{...e,tag:"a",item:i,onClick:a})})),dN=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(sN,{item:e,onClick:a,...n})})),mN="hidden sm:flex absolute z-40",uN={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},hN=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=oh({itemCount:t?.length||0});return i((()=>pN(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(eh,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:uN[r].item,gap:uN[r].gap,children:t.map((d=n,m=a,h=r,(e,t)=>o(oN,{isActive:e===d,onClick:m,type:h,item:e},String(t))))}),s.canScrollLeft?o(hh,{wcmsIgnore:!0,className:u("left-6",mN,uN[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(ph,{wcmsIgnore:!0,className:u("right-6",mN,uN[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,h})),pN=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},gN={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},fN=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(gN[t].wrapper,e),children:o(hN,{className:gN[t].component,tabsType:t,...n})}):null,yN="sticky top-1 z-20",bN=Yt((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=vN(n||{}),h=E(),p=ss(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),b=CN(m),x=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,v=x.findIndex((e=>Boolean(e?.selected))),N=x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===b)),w=b?N:v,[C,S]=a(xN(w)),k=x[C],I=wN(x[C],C),T=r((e=>{const t=x.indexOf(e),n=x[t];S(t),"group"===n.type&&((e,t)=>{e.text?y.set(m,e?.tabName??String(t)):y.delete(m),h.replace(`${h.pathname}?${y}`,{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({[yN]:[s,f,!p].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[fN({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[yN]:[s,!f,!p].every(Boolean)}),items:NN(t,x),activeItem:k,tabsType:i,onChange:T}),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])=>D(t,{...d?.options,slotName:I,parent:n,extraProps:{className:e===I?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(wN)?.filter(Boolean)||[]}),xN=e=>e&&-1!==e?e:0,vN=({__id:e,anchor:t})=>t??e??"tabs",NN=(e,t)=>t?.length?t:e,wN=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",CN=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),SN=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),kN={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},IN=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:kN[t],children:e})}))),TN=d((({className:e="",isOpen:t,onClick:n})=>o(to,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),RN=e=>e?o("div",{children:o(ze,{size:"text-h6",children:e})}):null,DN=e=>e?o("div",{className:"text-l font-light",children:o(ze,{color:"text-secondary-text",children:e})}):null,PN=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Fe,{__html:e,isDotted:t,itemSize:"list-m"})}):null,EN=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(TN,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[RN(e),DN(t),PN({__html:n,isDotted:a}),Ye(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),_N=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:r})=>n||a?c("div",{children:[n?o(hh,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(ph,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:r}):null]}):null,BN=(e,t)=>140*Ib(e.slice(0,t).map((e=>e?.cols?.length??1))),ON=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(ze,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,AN=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,i]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[l,s]=a(t),o=r((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=r((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&l<n-i:l<n-1,m=l>0;return[l,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((l=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(ze,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${BN(a,l)}px)`},children:a?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(ze,{size:"text-xl",children:e.data}):null,e?.cols?ON(e.cols,l):null]},`row${t}`)))})})]},String(t))})),_N({...i,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var l})),MN=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 px-m bg-white @4xl:bg-gray relative",children:o(ze,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(AN,{rows:t.rowsData})})})]},a)}))}))),FN=(e=!1)=>""+(e?"text-white":"text-secondary-text"),LN=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(ze,{size:"text-xl",font:"font-light",color:FN(t===n),children:e||t+1})},e)))}):null,t?o(ke,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),zN=Yt((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(LN,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(MN,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(ze,{size:"text-h6",children:"Данных нет"})})})),VN=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl","border-main-divider lg:border-b w-full py-s lg:py-xl"),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(zN,{...t,onClick:n})}):null]}))),$N=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(VN,{tableInner:i,...n,children:[SN(e),t?.length?o(IN,{version:"tariff",children:t.map(((e,t)=>o(EN,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),jN=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),qN=Yt((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o($N,{row:e,...l},String(t)))),[h,p]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=nn(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(no,{children:[c(jN,{children:[h,o(ao,{isUnfolded:f,isOverflowVisible:!0,children:p})]}),o(to,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(jN,{children:m})})]})})),UN=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?WN():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(ze,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?HN(n):null,i?o(Fe,{richVersion:r,__html:i}):null]})]}))),WN=()=>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"}),HN=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),YN=Yt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!1,image:s,...c})=>{const d=E();return o(g,{className:u("relative flex flex-col",Hb[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:P({...c,extraProps:{className:u("w-full",Yu(l)),...Wb(a)}})})}),{childrenTypes:[]}),GN=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(9),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",KN=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const r=E();return c(g,{className:e,defaultPadding:GN(e),...i,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:U(r)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:U(r)(n)})}):null]})})),XN={AdTile:Kt,ApplicationForm:Gl,BankAccountFiltration:Mh,BenefitsBlock:$h,BonusBenefitsBlock:Hh,ButtonsBlock:Gh,CalculatorBonus:tp,CalculatorBusinessDeposit:mp,CalculatorCredit:rd,CalculatorDeposit:Op,CalculatorRefinancing:Up,CardTransfer:Zp,Carousel:sg,CarouselCatalogCard:dg,CarouselRecommendationCard:yg,CarouselTariffsCard:Ng,ContactsBlock:Mg,DepositFiltration:ky,ErrorBlock:Dy,Footer:Ub,GalleryLayout:Kb,ExchangeRateTile:lb,GrantSupport:ex,Header:Yx,Headline:S,HorizontalLayout:Xx,ImgBlock:Jx,LinkDocs:sv,MobileAppTile:mv,OfficesAtmsMap:qv,ProductBlock:Gt,RichTextBlock:Uv,RollupItem:Hv,StepsBlock:Kv,StickyBottomMenu:Qv,TabsLayout:bN,TariffsTable:qN,TextBlock:UN,VerticalLayout:YN,Video:KN,ApplicationLeadForm:Vu,CreditCardForm:Of,CreditForm:Zf,DebitForm:vy,CashbackCalculator:Bg},JN=me((()=>{i((()=>{Zt()}),[]);const e=tn();Wn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");ti({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),QN="cookie",ZN=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=nn();Cb((()=>{globalThis.localStorage?.getItem(QN)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(QN,"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(Fe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Mn,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function ew(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);Wn(globalThis.document,"keydown",t)}function tw(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 nw=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return tw(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},aw=d((()=>{const[e,{close:t}]=nw(),n=Boolean(e.length);return ew(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})),iw=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return tw(pe.observable,"popup",{open:t,close:n}),ew(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})),rw="header",lw="footer",sw="sticky-footer",ow={},cw=d((({className:e,data:t=ow,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=Wt(s,l),m=ss();JN(),_y();const h={key:"",page:{slots:i,blocks:r,fallback:l,...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?.[rw]?.length?o("div",{className:u({hidden:m},"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]"),children:D(i?.[rw],{...h,slotName:rw})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:h,extraProps:{className:"scroll-mt-12"}}),!m&&D(i?.[lw],{...h,slotName:lw})]})]}),i?.[sw]?.length?o("div",{className:u({hidden:m},"fixed w-full bottom-0 left-0 z-[100]"),children:D(i?.[sw],{...h,slotName:sw})}):null,o(aw,{}),o(iw,{}),m?null:o(ZN,{__html:d?.cookieContent?.__html})]})}));Object.assign(cw,{childrenTypes:[],slots:()=>[rw,lw,sw]});e.Blocks=XN,e.ContentPage=cw,e.handlerDecorator=me,e.joinList=Ch,e.locationNavigator=Jt,e.packageVersion="0.14.950",e.projectSettings=B,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=E,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).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=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||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),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:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.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:y(t)}))),y=(e=3)=>x(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),x=(e,t)=>[e].concat(t>0?x(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||i}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={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:r="text-center",as:l,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[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(N,{className:u("whitespace-normal",r),...h?.title,as:l||h?.title.as,title:a}):null,i?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...p,children:i}):null]})})),k=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=k,blocksRegistry:l={},ancestors:s=I}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const R=[],E=(e,{key:t,ancestors:n=R,slotName:a=null,extraProps:i,renderProps:r=T,...l})=>{const s=i?(e,t)=>T(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||R,[l.parent,a]]:n},i)))};function D({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?E(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function _(){return _._impl()}_._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),_.setup=e=>{_._impl=e};const O=["CDN","BASE_PATH"],P=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return O.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),B=e=>Boolean(e?.includes(":")),M=(e,t)=>Boolean(e&&!B(e)&&(!t||"_self"===t)),A=e=>Boolean(e?.startsWith("#")),F=e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),L=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),z=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:B,isLocalURL:M,isHash:A,withoutQuery:F,joinPath:L,hasPrefix:z});const $="/api/",j=`${$}v1/storage`,W=[P.CDN,$],q=e=>(t,n)=>{if(U(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 L(z(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U=e=>!e||B(e)||A(e)||W.some(z(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},K={small:"16",medium:"24",large:"48",xl:"78"},Y=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&K[l],height:d=s})=>{const m=_(),h="normal"===r?`${n}.svg`:`sprites.svg#${n}`,p=q(m)(L(P.CDN,"/icons/",h));return"normal"===r?o("img",{className:e,style:G(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[r],{"w-full h-full":!s,invert:"white"===r},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})]})})})),G=(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 Q(e=""){try{return new URL(e).pathname}catch(e){return""}}const Z=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Q(J.SITE_URL);return t&&!B(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},r)=>o("source",{srcSet:Z(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Z(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(Y,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),re={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","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},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?re[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return l((()=>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"),fe="/",ye=["/api"];function be(){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 r=Q(J.SITE_URL);xe(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=fe,t=fe)=>[e,t].some((e=>e===fe))?e:e.replace(t,"")||fe)(a,r)))}))}}}const xe=(e,t,n)=>M(e,t)&&![...ye,...J.SUB_PORTALS?.split(",")??[]].some(z(e))&&z(e)(n||"/"),ve=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ne=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ce(e)&&"hidden lg:block";return c("div",{className:u(we(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ce(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":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),we=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",Ce(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ce=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Se=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ke=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:a}),s=be()({onClick:l,href:a,...i}),c=t??o(Ne,{...s});return o(e?Te:Ie,{...s,children:c})})),Ie=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ve(d),children:m}))),Te=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Se({className:e,rounded:a,version:n}),children:i})));function Re({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="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}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(ke,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ee=()=>{const[e,t]=a(false);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},De={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},_e=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&De[n],t),children:e}):null,Oe=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...b})=>{const x=Ee(),v=_(),N=r((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!x;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Re({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:[_e(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:[Pe(h,y),Me(D({...b,extraProps:{className:"@container-normal"}})),_e(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:l,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),Pe=(e,t)=>e||t?c("div",{className:"space-y-lg",children:[e,t]}):null,Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Me=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,Fe=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)),Le=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,ze=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ve=(e,t)=>e?o(ze,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>["label"in e?Ve(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Le(e.description,t)},String(t)):null,"__html"in e?o(Fe,{...e},`rte-${t}`):null],je=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:$e(n)})]}))),We=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(je,{benefitsVersion:t,...e},String(n))))}):null)),qe=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($e)}):null)),Ue=d((({isTabularBenefits:e,...t})=>o(e?qe:We,{...t}))),He=e=>Boolean(e?.src||e?.icon),Ke=(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(Ye(n))}):null,Ye=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ge(i,l),d=Ge(r,l);return a||i?.icon?o(ke,{className:u("basis-full @lg:basis-auto",e),appendLeft:Xe({...i,iconVersion:c}),appendRight:Xe({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ge=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Xe=e=>He(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Je=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Qe=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(Ze)}):null)),Ze=({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 rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(ze,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Je(2)(t)," ",n||"₽"]}):null]},String(a)),et=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(ze,{size:"text-m",font:"font-light",children:e})},String(t)),nt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},at=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:y,image:b,imageOptions:{imageAlign:x="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const R=b?.src?o(ie,{image:b,imageClassName:C}):null,E=o(S,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),D=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Oe,{className:e,padding:t,defaultPadding:n,...p?{title:E}:{insetTitle:E},...ot(R,v),isImageSecondary:w,imageAlign:x,isImageAlwaysOnRight:N,buttons:Ke(y),backwardButton:k,...T,children:st(it(D,{benefitsVersion:s,isTabularBenefits:c}),rt(u,{richVersion:h,isDotted:d,headlineVersion:r}),I,lt(g),ct(f))})})),it=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(Ue,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,rt=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Fe,{__html:e,richVersion:t,isDotted:n,itemSize:nt[a??"L"]}):null,lt=e=>e?.length?o(Qe,{priceList:e}):null,st=(...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},ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(et,{tags:e}):null;class dt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof dt?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 mt=()=>!0,ut=(e,t)=>(...n)=>e(...n)&&t(...n),ht=(...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 pt=e=>Boolean(e&&Array.isArray(e)),gt=e=>Boolean(e&&"object"==typeof e&&!pt(e)),ft=e=>e;function yt(e){return e instanceof dt?e._:e}class bt extends dt{from(e){return this.of(e.map(((e=ft)=>([,t])=>e(t))(yt)))}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(pt(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 dt{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 vt extends dt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,yt(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 Nt extends dt{proto=ht([e=>pt(this._)||"number"==typeof e,()=>bt.prototype],[e=>gt(this._)||"string"==typeof e,()=>vt.prototype],[mt,()=>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 wt=e=>e instanceof dt?e:new Nt(e),Ct=e=>{const t=(t,...n)=>yt(e(wt(t),...n));return t.fn=e,t},St=[],kt=e=>e instanceof Function?e:t=>e===t,It=e=>(t,n,a=St)=>wt(t).entries().reduce(((t,[n,i])=>It(e)(i,t,a.concat(n))),e(n,[a,wt(t)])),Tt=Ct(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Tt(e.get(a),[i,n]):n)})),Rt=Ct(((e,t)=>t.reduce(Tt.fn,e))),Et=e=>It(((e,[t,n])=>Dt(n)?[...e,[t,yt(n)]]:e))(e,[]),Dt=e=>0===e.size();Ct(((e,t=St)=>t.reduce(((e,t)=>e.get(t)),e)));const _t=Ct(((e,[t,...n])=>n.length?e.set(t,_t(e.get(t),n)):e.filter((([e])=>e!==t)))),Ot=(Pt=["$ref"]).map(((e,t)=>n=>kt(e)(n[t+n.length-Pt.length]))).reduceRight(ut,mt);var Pt;const Bt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Mt,e),Mt=ht([pt,(e,t)=>e[parseInt(t,10)]],[gt,(e,t)=>e[t]],[mt,ft]),At=(e,t)=>((e,t={})=>n=>Rt(t,Et(n).map((t=>e(t)))))((([e,n])=>{return Ot(e)?[(a=e,a.slice(0,-1)),Bt(t(n),n)]:[e,n];var a}))(e),Ft=e=>Et(e).filter(((e=ft)=>([t])=>e(t))(Ot)),Lt=e=>{return t=Ft(e).map((([,e])=>e)),[...new Set(t)];var t};async function zt(e,t){try{return e?await Vt(e,t):null}catch(e){console.error(e)}return null}const Vt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),$t=e=>[...new Set(e)],jt={},Wt=["/portal-resources"],qt=(e,t)=>At(e,(e=>t?.[e])),Ut=(e,t)=>{const n=Lt(e),[r,l]=a({});return i((()=>{Ht(n).then(l)}),[n.join()]),n.length?qt(e,{...t,...r}):e},Ht=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled($t(e).filter((e=>!Wt.some((t=>e.startsWith(t))))).map((async e=>(jt[e]||=await Vt(e),[e,jt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Lt(e)));return i.length?Ht(i,a):a}return t};function Kt(e,t={}){const n=d((t=>{const n=Ut((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Yt=Kt((({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(at,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})}))),Gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Xt(0,t?.length)),[t]),a=t?.[n];return a?o(Yt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Xt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e);function Jt(){return Jt._impl()}Jt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Jt.setup=e=>{Jt._impl=e};const Qt="rshb-query-params";function Zt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Qt)||"";return e&&globalThis.sessionStorage?.setItem(Qt,e),e}const en=async e=>{const t=e.target?.closest("a"),n=Jt();if(B(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=Zt();if(!B(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 tn(){return tn._impl()}function nn(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const an=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],rn=e=>!e?.length,ln=e=>t=>n=>e(n)?[]:[t],sn={},on=[];const cn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function dn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=cn(i,r)?i:r;return!cn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),h=s(mn(e)),[p,{setTrue:g,setFalse:f}]=nn(!1),y=s({}),[b,{isValid:x,errors:v}]=function(e,t){const n=l((()=>t?.(e)??sn),[t,e]),a=l((()=>an(n)(e)??on),[n,e]),i=rn(a);return[n,{isValid:i,errors:a}]}(m,n),N=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=p||y.current?.[String(e)],s=t?.validator??b[e],o=l&&s?s(r):[];return{setFieldRef:t=>{h.current&&(h.current[e]=t)},fieldRef:h.current?.[e],value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{y.current||={},y.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,p,b,u]),w=r((e=>{y.current=e,u(e)}),[u]),C=r((()=>{y.current={},f(),u(e)}),[e,u]),S=r((e=>{if(e.preventDefault(),x)t&&C(),d?.(m,e);else{const e=un(m,b);g(),N(e).fieldRef?.scrollIntoView({behavior:"smooth"})}}),[t,m,x,C,d]);return[m,{errors:v,field:N,update:w,reset:C,onSubmit:S}]}const mn=e=>Object.keys(e).reduce(((e,t)=>({...e,[t]:null})),{}),un=(e,t={})=>{const[n=""]=Object.entries(e).find((([e,n])=>t[e]?.(n)?.length))??[];return n},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(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function pn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const gn=/^[а-яё-]*$/i,fn=ln((e=>null!=e&&""!==e)),yn="Некорректно заполненное поле",bn=e=>fn(e??yn),xn=e=>ln((e=>e?.key&&""!==e?.key))(e??yn),vn=e=>ln((e=>"string"==typeof e&&e.length>1&&((e="")=>gn.test(e))(e)))(e??yn),Nn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),wn=e=>/^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Cn=e=>ln(Nn)(e),Sn=ln((e=>"boolean"==typeof e&&e))("Согласие обязательно"),kn=e=>"string"==typeof e&&(10===e.length||12===e.length),In={fullName:bn(),addressBranch:xn(),desiredMeetingDate:bn(),product:bn(),localities:bn(),partnerComments:bn(),collectionCount:bn(),acquiringType:xn(),serviceType:xn(),annualRevenue:bn(),feedbackMethod:xn(),serviceDirection:xn(),secondaryPhone:Cn("Укажите номер телефона"),region:xn(),situationDescription:bn(),sufferedFrom:bn(),applierType:bn(),surname:vn("Укажите свою фамилию на кириллице"),name:vn("Укажите своё имя на кириллице (без сокращений)"),middleName:vn("Укажите своё отчество на кириллице"),birthday:bn("Укажите дату рождения"),phone:Cn("Укажите номер телефона"),email:(Tn="Укажите электронную почту",ln((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(Tn)),inn:(e=>ln((e=>kn(e)))(e))("Укажите ИНН"),comment:bn(),typeForm:bn(),consentToReceiveMaterials:Sn,consentDataProcessing:Sn,partnerSymbolCode:bn("Укажите идентификатор партнёра"),dadataPartyInnSelect:(e=>ln((e=>Boolean(e?.text)&&kn(e.text)))(e))("Укажите ИНН"),dadataPartyNameSelect:bn("Укажите наименование организации"),callbackTime:bn(),questionProduct:bn(),russianPhone:(e=>ln(wn)(e))("Укажите номер телефона")};var Tn;const Rn=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...In,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(En(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(En(a)).filter(Dn(e)).map((({name:e})=>[e,a[e??""]]))):r},En=(e={})=>({name:t})=>Boolean(e[t??""]),Dn=e=>t=>!t?.condition||t.condition.values.some((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),_n=()=>{},On={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")},Pn=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Bn=u("bg-main-gray text-main-disabled cursor-not-allowed"),Mn=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=_n})=>{const y=r("tab"!==c?me(f):f,[c,f]),b=l((()=>ve(m)),[m]),x="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[On[n]]:!s&&!i,[Pn]:i,[Bn]:s},i?"justify-between":"justify-center",i||x?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":x},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...b,onClick:y,children:p})})),An=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(Y,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Fn={sm:"max-w-sm top-1/3",lg:"max-w-lg","4xl":"max-w-4xl",none:"mt-0"},Ln={center:"relative mx-auto",corner:"absolute bottom-0 right-0"},zn=d((({head:e,maxWidth:t="4xl",children:n,onClose:a,onClick:i,position:r="center"})=>{const l=Ee();return c("div",{className:u("bg-white p-lg pb-6xl my-6xl rounded-lg w-full",Fn[t],Ln[r],{"mr-3xl":!l&&"corner"===r},{"mb-12":l}),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(An,{className:"absolute top-0 right-0 z-10",onClose:a}),o("div",{className:"container",children:e})]}),o("div",{className:"container",children:n})]})})),Vn=d((({ok:e,typeForm:t,onClose:n,errorMessage:a})=>{const i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся",r=a||"Пожалуйста, повторите позднее";return o(zn,{maxWidth:"lg",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?i:r,headlineVersion:"XS",isEmbedded:!0}),o(Mn,{type:"button",onClick:n,children:"Хорошо"})]})})})),$n=({label:e,errors:t})=>e&&t?`${e}*`:e,jn=e=>o("div",{className:"min-h-6",children:e?o(ze,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Wn=(e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a},qn=e=>e?o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null;function Un(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Hn(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return Un(globalThis.document,"click",n),t}const Kn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Yn=e=>e?Kn:"border-error",Gn=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:b=!1,children:x,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),S=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=x?"pr-3xl":"",I=Yn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[qn(d),y?o("textarea",{className:u("block resize-y min-h-24",Xn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:b,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Xn,k,I),id:n,type:l,value:h,name:a||n,placeholder:m,pattern:g,disabled:b,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),x]})})),Xn="w-full border rounded-md text-primary-text outline-none p-m",Jn=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:h,isOpen:p,onOpen:g,onClose:f,onChange:y=_n,...b})=>{const x=Hn(f),v=r((e=>{const t=m&&e.length>m;!p&&g(),t||y(Qn(e,s))}),[p,y]);return c("div",{className:u("shrink-0 w-full",e),ref:x,onBlur:f,onFocus:g,children:[o("div",{ref:h,children:o(Gn,{type:l||"text","aria-label":t,label:$n({label:t,errors:i}),valid:Boolean(!a),onChange:v,placeholder:Zn({placeholder:d,errors:i,label:t}),value:n,...b})}),jn(a)]})})),Qn=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,Zn=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,ea=d((e=>{const[t,{setFalse:n,setTrue:a}]=nn();return o(Jn,{isOpen:t,onOpen:a,onClose:n,...e})})),ta=({query:e,isDisabled:t,onChangeQuery:n,inputProps:a})=>o("div",{className:"absolute top-0 w-full z-20",children:o(ea,{type:"text",value:e,autoFocus:!0,disabled:t,onChange:e=>n(e),maxLength:a?.maxLength,isInteger:a?.isInteger??!1})}),na=(e,t)=>o(Y,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),aa=e=>e?.text||e?.key||"",ia=({isManualInput:e,query:t,value:n,placeholder:a})=>e&&t?t:aa(n)||a,ra=({isBorder:e=!0,valid:t=!0,isDisabled:n=!1,isOpen:a=!1,onOpen:i=_n,onClose:r,isManualInput:l=!1,query:s="",value:d,placeholder:m="",iconVersion:h="black",options:p=[]})=>{const g=la(l,p,s);return c("div",{className:u({"border rounded-md":e},{"hover:border-primary-hover":e&&!n},n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error","h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden"),onClick:a?r:i,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:ia({isManualInput:l,query:s,value:d,placeholder:m})}),g?"":na(a,h)]})},la=(e,t,n)=>!(!e||!n?.length)||e&&!t.length,sa=()=>ue(pe.emitter,"popup"),oa=(e,t,n=!1)=>e?.length&&t?.trim()&&!n?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,ca=d((({popupRef:e,options:t,value:n,iconVersion:a,onChange:i,renderOptions:r=da,query:l,onChangeQuery:s,disableFilterOptions:d})=>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:oa(t,l,d).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&&(s?.(""),i(e))},children:[r(e),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:a,className:u("absolute right-2 pt-2xs",{hidden:e.key!==n?.key})})]},e.key)))}):null)),da=e=>o("span",{className:"min-h-6",children:aa(e)});const ma=d((({className:e,label:t,options:n=[],value:d,isSearch:m=!1,isManualInput:h=!1,disabled:p=!1,iconVersion:g="black",onChange:f,onSearchQuery:y=_n,inputProps:b,disableFilterOptions:x=!1,renderOptions:v,...N})=>{const[w,{setFalse:C,setTrue:S}]=nn(),[k,I]=a(""),T=p||!h&&0===n.length,R=l((()=>Wn((e=>y(e)),300)),[y]),E=r((()=>{T||S()}),[T]),D=r((()=>{!m&&I(""),C()}),[h]),_=r((e=>{I(e),h&&f?.({key:e,text:e}),R?.(e)}),[h,f,R]),O={query:k,value:d,options:n,isOpen:w,iconVersion:g,renderOptions:v,isSearch:m},P=function({isOpen:e,options:t,value:n,query:a,onChange:l=_n,onClose:c=_n,iconVersion:d,disableFilterOptions:m=!1,onChangeQuery:u=_n,renderOptions:h,isSearch:p=!1}){const g=sa(),f=r((()=>{g.close(),c()}),[c]),y=r((e=>{f(),l(e),u(p&&e?.text?e.text:"")}),[f,l]);i((()=>{u(p&&n?.text?n.text:"")}),[n]);const b=s(null),x=Hn(f);return i((()=>{if(!e||!b.current)return;const i=b.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();g.open({popup:o(ca,{popupRef:x,options:t,value:n,query:a,iconVersion:d,disableFilterOptions:m,onChange:y,onChangeQuery:u,renderOptions:h}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,y]),b}({onChange:f,onClose:D,disableFilterOptions:x,onChangeQuery:I,...O});return c("div",{className:u("space-y-xs",e),children:[qn(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:P,children:[ra({isDisabled:T,onClose:D,onOpen:E,isManualInput:h,...O,...N}),m&&w?ta({query:k,isDisabled:T,inputProps:b,onChangeQuery:_}):null]})]})})),ua=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(ma,{...i,valid:!n,label:$n({label:t,errors:a})}),jn(n)]}))),ha="client",pa=[{key:ha,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],ga=d((({field:e,input:t})=>o(ua,{label:"Тип обратившегося",...t,options:pa,...e("applierType")}))),fa=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...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)}))}))),ya=[{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"}],ba=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(fa,{paths:ya,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",va(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":wa(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Na(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,xa(n)]})})})),xa=e=>e?o("div",{className:"ml-s",children:o(ze,{size:"text-l",font:"font-light",children:e})}):null,va=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Na=(e=!1)=>e?"radio":"checkbox",wa=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ca={horizontal:"@lg:flex-row",vertical:""},Sa=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(ze,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Ca[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ba,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),ka=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ia=d((({field:e,input:t})=>{const n=r((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(Sa,{className:"whitespace-normal",orientation:"horizontal",items:ka,...e(t?.name??"",{onChange:n})})})})),Ta=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Ra=d((({field:e,input:t})=>o(ua,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Ta,...e(t?.name??"")}))),Ea=(e="")=>Boolean("trade"===e||"all"===e),Da=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,isPremium:p,dadataPartyNameSelect:g,dadataPartyInnSelect:f,...y}=e,b=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${Ea(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,x={...y,...Ba(o),...Pa(c),...d&&{inn:d},...b?{partnerComments:b}:{},...s?{typeForm:s}:{},...Oa(m?.text,u),..._a(h),...Ma([[f,"inn"],[g,"fullName"]])};return Object.fromEntries(Object.entries(x)?.map((([e,t])=>[e,t?.key||t])))},_a=e=>e?.key?{isClient:e?.key===ha}:{},Oa=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Pa=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ba=e=>e?{vedTypes:Object.fromEntries(ka.map((({id:t})=>[t,t===e])))}:{},Ma=e=>e.reduce(((e,[t,n])=>(t?.text&&n&&(e[n]=t.text),e)),{}),Aa=[{key:"ULTRASERVICE",text:"Ультра"}],Fa=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],La=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],za={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:Ta[0],serviceType:Aa[0],feedbackMethod:La[0],serviceDirection:Fa[0],vedTypes:ka[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Va=()=>{const e=(new Date).getTimezoneOffset(),t=Math.abs(e),n=t%60;return`GMT${e<0?"+":"-"}${Math.floor(t/60).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},$a="/api/v1",ja=(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}`}},Wa=e=>e?.replace(/[^+\d]/g,""),qa=(e,t,n)=>{const{typeForm:a,region:i,phone:r="",email:l,birthday:s,desiredMeetingDate:o,inn:c,fullRegion:d,addressBranch:m,secondaryPhone:u="",bankEmpolee:h,applicationDate:p,partnerName:g,russianPhone:f,partnerSymbolCode:y,...b}=e;return{typeForm:a,...Ka(i,t),...Ya(l,t),...Ua(r),...Ua(f),...Ha(o,"desiredMeetingDate"),...t?Ha(s):{inn:c},..."FEEDBACK"===a?{}:{addressBranch:m,bankEmpolee:h,applicationDate:p,...Ga(u)},...Ja(a,n),...Xa(a,{fullRegion:d,partnerName:g,partnerSymbolCode:y}),...b}},Ua=e=>e?{phone:Wa(e)}:{},Ha=(e,t="birthday")=>e?{[t]:ja(e)}:{},Ka=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Ya=(e,t=!0)=>({[t?"email":"mail"]:e}),Ga=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Wa(e)}:{},Xa=(e,t)=>"PF"===e?{region:t?.fullRegion,partner:t?.partnerName,partnerId:t?.partnerSymbolCode}:{},Ja=(e,t)=>"UNIVERSAL"===e?{typeForm:t?.pathname?.split("/")?.at(-1)||"/"}:{};function Qa(){return{send:async function(e,t,n=!1){const{serviceDirection:a}=e,i=n&&"Юридическое лицо / ИП"!==a,r=`${$a}${i?"/lead":"/sendcorporatelead"}`,l=qa(e,i,t);try{const e=await Za(r,l);return e?.ok?await e.json():null}catch(e){return null}},sendCode:async function({phone:e}){const t=(e=>({...Ua(e)}))(e);try{const e=Za(`${$a}/initCorporateLead`,t).then((async e=>{if(!e.ok)throw new Error(`Ошибка HTTP: ${e.status}`);return await e.text()}));return await e}catch(e){return null}},checkCode:async function({reqId:e,code:t,body:n}){const a={requestId:e,confimationCode:t,leadRequest:qa(n,!1)};try{const e=await Za(`${$a}/confirmCorporateLead`,a);return await e.json()}catch(e){return null}},sendPhoneCallRequest:async function(e,t=!1){const n=qa(e,t),a=ei(n);try{const e=await Za(`${$a}/callback`,a);return e?.ok?await e.json():null}catch(e){return null}}}}const Za=(e,t)=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(t)}),ei=e=>{const{typeForm:t,consentDataProcessing:n,phone:a,...i}=e;return{...i,phone:a?.startsWith("+")?a.slice(1):a,clientTimezone:Va()}},ti=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}},ni=Qa(),ai=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","extraSmall"===a&&"border-2 h-4 w-4","small"===a&&"border-4 h-8 w-8","big"===a&&"border-8 h-28 w-28",e),role:"status"})}))),ii=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Mn,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(ai,{blur:!0,size:"small"}):null,n]}))),ri=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},li={primary:On.primary,secondary:On.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:On.secondary,transparent:"","":""},si=d((e=>{const t=be(),{className:n,href:a,target:i,text:r,aboveText:l,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",{[li[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:p,...ve(m),children:h??oi(r,l)})})),oi=(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,ci=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(ze,{children:e}):null,t?o(si,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),di=({consentDataProcessing:e,link:t,button:n,typeForm:a})=>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(ba,{...e}),o(ci,{link:t})]}),jn(ri(e,Sn).error)]}):o(ci,{text:"PF"===a?"Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ":"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(ii,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),mi=e=>null!=e,ui=new Map,hi=(e,t=ui)=>n=>{const a=gi(n),i=t.get(a);if(a&&mi(i))return i;const r=e(...n);return a&&mi(r)&&t.set(a,Promise.resolve(r)),r},pi=e=>Boolean(e?.every((e=>Array.isArray(e)?pi(e):!e||"string"==typeof e))),gi=e=>pi(e)?e.toString():"",fi=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function yi(e,t,{fallback:n,cache:r}={}){const s=l((()=>bi(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(mi))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await hi(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&fi(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function bi(e){return Array.isArray(e)?e:e instanceof Function?bi(e()):[e]}const xi=`${$a}/branches`,vi=[];const Ni=async e=>await zt(e,{method:"GET"})||vi;function wi(e=!1){const{data:t}=yi(`${$a}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Vt);return Array.isArray(t)?t:[]}const Ci=(e="")=>"ULTRASERVICE"===e,Si=d((({field:e,input:t,params:n})=>{const a=Ci(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?wi(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=yi(e?`${xi}?regionCode=${e}`:null,Ni);return t||vi}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(ua,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),ki=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Ii=(e,t,n)=>Math.max(t,Math.min(e,n));function Ti(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ri({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){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||r?"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:r,onChange:t=>{const n=Ti(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const Ei=1,Di=100,_i=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:Ei),max:s=(i.length?i.length-1:Di),step:d=1,value:m=i[0]||l,disabled:h=!1,onChange:p}=e,g=ki(e,{normalize:(e=0)=>i.length?Oi(i)(e):Ii(e,l,s),format:Je()}),f=r((e=>{p&&p(Ti(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m box-border","text-primary-text",Kn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Ri({list:i,min:l,max:s,step:d,disabled:h,value:m,onChange:p})]}),Pi(a)]})})),Oi=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),Pi=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Bi=["От 1 000 ₽","До 1 000 000 000 ₽"],Mi=d((({field:e,input:t})=>o(_i,{title:"Сумма, ₽",items:Bi,min:1e3,max:1e9,...e(t?.name??"")}))),Ai=d((({field:e,input:t})=>o(ea,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),Fi=d((({field:e,input:t})=>o(ea,{label:"Дата и время обращения в Банк",...e(t?.name??"")}))),Li=d((({field:e,input:t})=>o(ea,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),zi=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,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=Vi(t,e),c=$i(t,r,l);u.push(o("td",{children:o("div",{className:ji(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Vi=(e,t)=>t&&e.toDateString()===t.toDateString(),$i=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),ji=(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"),Wi=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],qi=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:r=_n})=>{const{firstDayOfWeek:s,totalDays:d}=l((()=>({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:Wi.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:zi({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:r})})]})})),Ui=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Hi(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Ki),r=a.map(((e,t)=>Gi(e)?a.slice(0,t).filter(Gi).length:-1)),l=a.map(((e,t)=>Yi(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Ki=e=>"_"===e,Yi=e=>/\d/.test(e),Gi=e=>Ki(e)||Yi(e),Xi=1940,Ji={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Qi=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{er({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 rounded-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Hi(t,"__.__.____"))},onBlur:()=>{Zi(p)?er({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(Y,{className:"mr-s",...Ji})]})})),Zi=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Xi&&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},er=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Zi(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},tr=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(Qi,{onChange:a,disabled:l,onClick:e,value:t&&ja(t),setSelectedMonth:i,setSelectedYear:r,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")}),nr=Ui.map((e=>({key:e}))),ar=Array.from({length:(new Date).getFullYear()-Xi+1},((e,t)=>Xi+t)).reverse().map((e=>({key:String(e)}))),ir=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},rr=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},lr={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},sr={className:"min-w-32",iconVersion:"black",isBorder:!1},or=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=nn(!1),[y,b]=a(n?.getMonth()||(new Date).getMonth()),[x,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=r((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:S,handleSelectYear:k,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:R,ref:E}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=Hn(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(Ui.indexOf(e));const t=ir(l,Ui.indexOf(e));rr({maxDateOfMonth:t,selectedYear:l,selectedMonth:Ui.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:nr,yearsOptions:ar,ref:c}})({onYearSelect:v,onMonthSelect:b,onShowCalendar:g,selectedYear:x,selectedMonth:y,showCalendar:p,onChange:h,value:n}),D=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(E,370);return c("div",{className:u("space-y-xs",e),ref:E,children:[qn(t),c("div",{className:"relative",children:[tr({handleChangeVisibleCalendar:R,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:b,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":D}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(Y,{...lr,className:"-rotate-90 cursor-pointer"})}),o(ma,{onChange:S,value:{key:Ui[y]},options:I,...sr}),o(ma,{onChange:k,value:{key:String(x)},options:T,...sr}),o("div",{className:"my-auto",onClick:C,children:o(Y,{...lr,className:"rotate-90 cursor-pointer"})})]}),o(qi,{today:n,currentMonth:y,currentYear:x,min:s,max:d,onDateSelect:N})]}):null]})]})})),cr=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(or,{label:$n({label:t,errors:a}),valid:Boolean(!n),...i}),jn(n)]}))),dr=d((({field:e,input:t})=>o(cr,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),mr=[{key:"Перезвонить сейчас",text:"Перезвонить сейчас"},{key:"Перезвонить через час",text:"Перезвонить через час"},{key:"Перезвонить через два часа",text:"Перезвонить через два часа"},{key:"Перезвонить завтра",text:"Перезвонить завтра"}],ur=d((({field:e,input:t})=>o(ua,{label:"Когда перезвонить?",...t,options:mr,...e(t?.name??"")}))),hr=d((({field:e,input:t})=>o(ea,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),pr=d((({field:e,input:t})=>o(ea,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0})));function gr(e,t){i((()=>{const t=e();return()=>{t.then((e=>{e instanceof Function&&e()}))}}),t)}const fr=e=>({value:e?.value||""}),yr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=fr,responseFilter:l}=e,s=((e,t)=>n=>{const a=n?.suggestions||[];return(t?a.filter(t):a).map((t=>{const n=e(t);return{...t,processedValue:n.value,additionalValue:n.additionalValue}}))})(r,l),o=`${a?`${a}, `:""}${n}`;return 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(s)},br=async e=>(await yr({url:"suggest/party",query:e})).map((e=>({fullName:e?.value,address:e?.data?.address?.value,inn:e?.data?.inn}))),xr={dadataPartyInnSelect:{fieldValue:"inn",linkedFieldName:"dadataPartyNameSelect",linkedFieldValue:"fullName"},dadataPartyNameSelect:{fieldValue:"fullName",linkedFieldName:"dadataPartyInnSelect",linkedFieldValue:"inn"}},vr={dadataPartyInnSelect:{label:"ИНН",inputProps:{isInteger:!0,maxLength:12}},dadataPartyNameSelect:{label:"Полное наименование"}},Nr=d((({field:e,input:t={}})=>{const n=t.name??"",i=xr[n].linkedFieldName,r=e(i).value,s=r?.data;gr((async()=>{if(s?.fullName&&s?.fullName!==e(n)?.value?.data?.fullName){const t=wr(r),{fullName:a,address:l,inn:s}=t,o=Sr(t,i),c=br(o);u(o),d(await c),e(n)?.onChange?.({key:s,text:o,data:{fullName:a,address:l}})}}),[s]);const[c,d]=a([]),[m,u]=a("");gr((async()=>{const e=br(m);return d(await e),c}),[m]);const h=l((()=>(c||[]).map(((e={})=>({key:e.inn??"",text:e[xr[n].fieldValue],data:{fullName:e.fullName,address:e.address}})))),[c]);return o(ua,{...vr[n],options:h,...e(t.name??""),isSearch:!0,isManualInput:!0,disableFilterOptions:!0,onSearchQuery:u,renderOptions:Cr})})),wr=e=>({inn:e?.key,fullName:e?.data?.fullName,address:e?.data?.address}),Cr=e=>c("span",{children:[o(ze,{size:"text-s",children:e?.data?.fullName}),c("div",{className:"space-x-2",children:[o(ze,{size:"text-s",font:"font-light",children:e?.key}),o(ze,{size:"text-s",font:"font-light",children:e?.data?.address})]})]}),Sr=(e,t)=>e?.[xr[t].linkedFieldValue],kr=d((({field:e,input:t})=>o(cr,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Ir=d((({field:e,input:t})=>o(ea,{label:"Электронная почта",...e(t?.name??""),...t}))),Tr=d((({field:e,input:t})=>o(ua,{label:"Способ получения ответа",options:La,...e(t?.name??"")}))),Rr=d((({field:e,input:t})=>o(ea,{label:"ФИО",...e(t?.name??""),...t}))),Er=d((({field:e,input:t,params:n})=>{const a=n?.isPremium,i=wi(a),r=l((()=>i?.map((({region:e})=>({key:e,text:e})))),[i]);return o(ua,{label:"Регион",placeholder:"Выберите регион",options:r,...e(t?.name??"")})})),Dr=d((({field:e,input:t})=>o(ea,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),_r=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(ba,{text:t,value:n,disabled:i,onChange:l},a),jn(r)]}))),Or=d((({field:e,input:t})=>o(_r,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Pr=`${$a}/outservice`,Br=[];async function Mr(){const e=await zt(`${Pr}/outserviceregions`);return e&&Array.isArray(e)?e:Br}const Ar=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=yi("outServiceRegions",Mr),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(ua,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),Fr=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,Lr=d((({field:e,input:t})=>o(ea,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:Fr(e,t),...e(t?.name??""),...t}))),zr=d((({field:e,input:t})=>o(ea,{label:"Имя",maxLength:60,disabled:Fr(e,t),...e(t?.name??""),...t}))),Vr=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),$r=d((({field:e,input:t})=>Ea(e("acquiringType")?.value?.key)?o(Vr,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),jr=d((({field:e,input:t})=>o(ea,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),Wr=Kt((({field:e,input:t={},source:n})=>{const a=e("partnerSymbolCode")?.value;return i((()=>{const t=qr(n?.agentsList,a)||"Неизвестный партнёр";t&&e("partnerName")?.onChange?.(t)}),[a]),o(ea,{...e(t.name??""),...t,type:"hidden"})})),qr=(e=[],t="")=>e.find((({symbolCode:e})=>e===t))?.agentName??"",Ur=Kt((({field:e,input:t,source:n})=>{const i=n?.agentsList??[],[r,l]=a(""),[s,c]=a("");return o(ea,{label:"Идентификатор партнёра",...e(t?.name??""),...t,isInteger:!0,value:s,error:r??e("partnerSymbolCode")?.error,errors:[r??e("partnerSymbolCode")?.error],onChange:t=>{var n;c(t),e("partnerSymbolCode")?.onChange?.(t),l(t&&(n=t,!i.some((({symbolCode:e})=>e===n)))?"ID партнера не найден. Обратитесь к своему менеджеру":"")}})})),Hr=e=>"_"===e,Kr=e=>/\d/.test(e),Yr=e=>Hr(e)||Kr(e),Gr=[..."+7 (___) ___-__-__"],Xr=Gr.findIndex(Hr),Jr=Gr.map(((e,t)=>Yr(e)?Gr.slice(0,t).filter(Yr).length:-1));function Qr(e){const t=e.replace(/\D/g,""),n=Gr.map(((e,n)=>Kr(e)?e:t.charAt(Jr[n])||e)),a=Jr.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Xr,a)):n).join("")}const Zr=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(Qr(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Gn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),el=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Zr,{"aria-label":t,label:$n({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),jn(a)]}))),tl=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(el,{label:"Телефон",disabled:Fr(e,t,n),...e(n),...t})})),nl=d((({field:e})=>Ea(e("acquiringType")?.value?.key)?o(Vr,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),al=Kt((({field:e,input:t,source:n})=>o(ua,{placeholder:"Выберите продукт",label:"Продукт",options:il(n?.productList),...e(t?.name??"")}))),il=e=>(e??[]).map((e=>({key:e,value:e}))),rl=[{key:"Вопрос по действующему продукту",text:"Вопрос по действующему продукту"},{key:"Оформление нового продукта",text:"Оформление нового продукта"}],ll=d((({field:e,input:t})=>o(ua,{label:"Какой у вас вопрос?",options:rl,...e(t?.name??"")}))),sl=`${$a}/regions`,ol=[];function cl(e=sl){const{data:t}=yi(e,Vt);return Array.isArray(t)?t:ol}const dl=`${$a}/outservice/outserviceregions`,ml=d((({field:e,input:t,params:n})=>{var a;const i=cl((a=n?.typeForm,"OUTSERVICE"===a?dl:void 0));return o(ua,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),ul=d((({field:e,input:t})=>o(ea,{label:"ФИО представителя",...t,...e("representativeName")}))),hl=d((({field:e})=>{const t=e("secondaryPhone");return o(el,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ri(t,In.secondaryPhone):t})})),pl=d((({field:e,input:t})=>o(ua,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Fa,...e(t?.name??"")}))),gl=d((({field:e,input:t})=>o(ea,{label:"Описание ситуации",...t,...e("situationDescription")}))),fl=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],yl=d((({field:e,input:t})=>o(ua,{label:"Пострадал в",...t,options:fl,...e("sufferedFrom")}))),bl=d((({field:e,input:t})=>o(ea,{label:"Фамилия",maxLength:60,disabled:Fr(e,t),...e(t?.name??""),...t}))),xl=["От 1 мес","До 15 лет"],vl=d((({field:e})=>o(_i,{title:"Срок, месяцев",items:xl,min:1,max:180,...e("term")}))),Nl=d((({field:e,input:t})=>o(ua,{label:"Тип обслуживания",options:Aa,...e(t?.name??"")}))),wl=d((({field:e,input:t})=>o(ba,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")}))),Cl=d((({onFieldRef:e=_n,children:t})=>{const n=s(null);return i((()=>{n.current&&e(n.current)}),[]),o("div",{ref:n,children:t})}));const Sl={$ref:"/wcms-resources/outservice-productlist.json"},kl={$ref:"/wcms-resources/agenty-dlya-rko.json"},Il={fullName:Rr,addressBranch:Si,desiredMeetingDate:kr,product:e=>o(al,{...e,source:Sl}),localities:Ar,isClient:Or,partnerComments:jr,collectionCount:hr,acquiringType:Ra,onlineCheckout:$r,posTerminal:nl,serviceType:Nl,term:vl,amount:Mi,annualRevenue:Ai,vedTypes:Ia,feedbackMethod:Tr,serviceDirection:pl,bankEmpolee:Li,secondaryPhone:hl,applicationDate:Fi,region:e=>Ci(e?.params?.typeForm)?o(Er,{...e}):o(ml,{...e}),consentToReceiveMaterials:wl,sufferedFrom:yl,situationDescription:gl,representativeName:ul,applierType:ga,surname:bl,name:zr,middleName:Lr,birthday:dr,phone:tl,email:Ir,inn:Dr,comment:pr,fullRegion:Er,partnerSymbolCode:e=>o(Ur,{...e,source:kl}),partnerName:e=>o(Wr,{...e,source:kl}),dadataPartyNameSelect:Nr,dadataPartyInnSelect:Nr,questionProduct:ll,callbackTime:ur,russianPhone:tl},Tl=(e,t,n={})=>(a,i)=>{const r={...Il,...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})&&r?o(Cl,{onFieldRef:e(a.name??"").setFieldRef,children:o(r,{field:e,input:a,params:t})},String(i)):null},Rl=e=>2===e?"@xl:grid-cols-2 gap-x-m":"@xl:grid-cols-1 gap-x-0",El=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(ze,{size:"text-h6",children:e})}):null,Dl=(e,t,{typeForm:n,additionalParams:a})=>e.map(((e,i)=>c("div",{className:u(Rl(e.columns),"grid"),children:[El(e.title),(e?.inputs||[])?.map(Tl(t,{typeForm:n,...a}))]},`section-${i}`))),_l=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function Ol({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((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}=_l(l,t);return r((e=>{i.current=e,o()}),[])}const Pl=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),p=r((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=r((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:Bl(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),Bl=(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 ${Yn(!n||!a)} rounded-md caret-transparent outline-none`},Ml=d((({disabled:e=!1,onClick:t,text:n})=>o(Mn,{type:"button",onClick:t,disabled:e,children:o(ze,{font:"font-normal",children:n})}))),Al=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}))),Fl=d((({className:e,seconds:t})=>o("span",{className:e,children:Ll(t)}))),Ll=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),zl=d((({children:e,isLoading:t,isSubmitButtonDisabled:n,timeNextReq:a,onSubmit:i,onSendCode:r,values:l,onChange:s,errorText:d,hasError:m,phone:u,onClose:h})=>o(zn,{maxWidth:"lg",onClose:h,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[Vl(u),o(Pl,{values:l,setValues:s,errorText:d,hasError:m}),jl(a,r),e,$l(n,i),t?o(ai,{blur:!1}):null]})}))),Vl=e=>o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),$l=(e,t)=>o(Ml,{text:"Далее",disabled:e,onClick:t}),jl=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base gap-2xs",children:[o("span",{children:" Получить новый код можно через"}),o(Fl,{seconds:e})]}):o(Mn,{embedded:!0,onClick:t,children:o(Al,{children:"Получить новый код"})}),Wl=e=>180-Math.floor((Date.now()-e)/1e3),ql=Qa(),Ul=Qa(),Hl=d((({phone:e,onSuccess:t=_n,onClose:n=_n,formatData:i={},reqId:l})=>{const[s,c]=a(Array(4).fill("")),[d,m]=a(l),{handleSubmit:u,hasError:h,errorText:p,isLoading:g,timeNextReq:f,isSubmitButtonDisabled:y,setTimeNextReq:b,setErrorText:x}=(({values:e,onSuccess:t,formatData:n,reqId:i})=>{const l=Math.max(Wl(Date.now()),0),[s,o]=a(""),[c,{setTrue:d,setFalse:m}]=nn(!1),[u,h]=a(l),p=r((()=>o("")),[]),g=!e.every(Boolean);return{handleSubmit:r((async()=>{try{d();const a=await ql.checkCode({code:e.join(""),body:n,reqId:i});if(a?.errorDesc)return void o(a?.errorDesc);h(0),p(),t?.(e.join(""))}catch{o("Неверный код")}finally{m()}}),[e]),hasError:Boolean(s),errorText:s,isLoading:c,timeNextReq:u,isSubmitButtonDisabled:g,setTimeNextReq:h,setErrorText:o}})({values:s,onSuccess:t,formatData:i,reqId:d??""}),v=Wa(e),N=Ol({seconds:f,onTick:b}),w=r((async()=>{const e=await Ul.sendCode({phone:v});e&&(b(180),N(180),x(""),m(String(e)))}),[v,N,n]);return o(zl,{isSubmitButtonDisabled:y,onSubmit:u,onSendCode:w,timeNextReq:f,values:s,onChange:c,phone:e,isLoading:g,errorText:p,hasError:h,onClose:n})})),Kl={initcorporatelead:async({formatData:e={},typeForm:t,responseTypeDialog:n,verifyPhoneDialog:a,data:i=[],aspects:r={},ev:l})=>{const{phone:s}=e,o=await ni.sendCode({phone:String(s)});o?a.open({phone:s,formatData:e,reqId:String(o),onSuccess:()=>{a.close(),n.open({ok:!0,typeForm:t}),ti({aspectsAttributes:i,aspects:r,ev:l})}}):n.open({ok:Boolean(o),typeForm:t})},callback:async({formatData:e,data:t,aspects:n={},ev:a,typeForm:i,responseTypeDialog:r,onSuccess:l=_n})=>{const s=await ni.sendPhoneCallRequest(e);l(),"success"===s?.status?(r.open({ok:!0,typeForm:i}),ti({aspectsAttributes:t,aspects:n,ev:a})):"error"===s?.status?r.open({ok:!1,errorMessage:"Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка"}):(r.open({ok:Boolean(s)}),s&&ti({aspectsAttributes:t,aspects:n,ev:a}))},default:async({formatData:e,data:t,aspects:n={},ev:a,router:i,responseTypeDialog:r,endpoint:l})=>{const s=Boolean(await ni.send(e,i,"lead"===l));r.open({ok:s}),s&&ti({aspectsAttributes:t,aspects:n,ev:a})}},Yl=Kt((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,onSuccess:g,...f})=>{const y=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),b=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||za[e.name||""]]))),typeForm:{key:t,text:""}}))(y,n)),[y,n]),x=_(),v=tn(),w=l((()=>Rn(y)),[y]),C=pn(Vn),S=pn(Hl),k=r((async(e,t)=>{const a=Da({...e,...m});await Gl(d??"default",{formatData:a,ev:t,typeForm:n,data:p,aspects:v,router:x,responseTypeDialog:C,verifyPhoneDialog:S,onSuccess:g,endpoint:d})}),[n]),[,{field:I,onSubmit:T}]=dn(b,{resetOnSubmit:!0,formValidator:w,onSubmit:k}),R=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(y)?.name,E=R?I("consentDataProcessing"):void 0;return c(hn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:T,children:[Dl(a,I,{typeForm:n,additionalParams:m}),di({consentDataProcessing:E,link:s,button:i,typeForm:n})]}),h?c("div",{className:"space-y-m",children:[o(N,{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]})})),Gl=async(e,t)=>{const n=Kl[e]||Kl.default;await n(t)},Xl=d((({attempts:e,onClose:t=_n})=>{const n=Jt(),a=e>1,i=r((()=>{n.assign("/natural")}),[]),l=r((()=>{a?i():t()}),[a]);return o(zn,{onClose:l,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{align:"text-center",children:"Уважаемый клиент!"}),o(w,{align:"text-center",children:"Для получения кредита Вам необходимо обратиться в офис Банка"}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(Mn,{type:"button",version:"secondary",onClick:i,children:"Завершить"}),a?null:o(Mn,{type:"button",onClick:t,children:"Продолжить"})]})]})})}));function Jl(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Ql(e,t){return Jl(e,t),Jl(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Zl{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 es{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 ts={};function ns(e,t=ts){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>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 as=new es;function is(){return ns(as)}Ql(as,new Zl(globalThis?.sessionStorage));const rs=e=>globalThis[e];function ls(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=rs(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(rs(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(rs(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(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),l(void 0)}}}),[e,t,n]),r}const ss=()=>globalThis.location!==globalThis?.top?.location,os=()=>{const e=ss(),t=globalThis.document?.body?.scrollHeight,n=is(),a=new URLSearchParams(decodeURIComponent(globalThis.location?.search)).get("styles");a&&((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)}})(a),i((()=>{e&&globalThis.parent.postMessage({height:document.body.scrollHeight},"*")}),[t,e]),i((()=>{const t=e=>{e.data?.location&&(n.frameLocation=e.data?.location)};return e&&globalThis.addEventListener("message",t),()=>{e&&globalThis.removeEventListener("message",t)}}),[e])},cs="Некорректно заполненное поле",ds="Укажите регион, город/населенный пункт, улицу, дом",ms=/^[0-9а-яё]*$/i,us=/^[\u0400-\u04FF-\s]+$/u,hs=/^(?!\s*$)[^\p{Script=Cyrillic}]+$/u,ps=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),gs=()=>ln(ps)(ds),fs=e=>ln((e=>"string"==typeof e&&e.length>1&&us.test(e)))(e??cs),ys=e=>ln((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??cs),bs=(e,t,n=!1)=>ln((t=>"string"==typeof t&&t.length>=1&&(n?t.length===e:t.length<=e)))(t??cs),xs=e=>ln((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),vs=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length&&"00000000000"!==t){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},Ns=e=>Cs(18,e)("Укажите дату заключения трудового договора"),ws=e=>Cs(0,e)("Укажите дату регистрации"),Cs=(e,t)=>ln((n=>{if(n&&t){const a=n.getTime(),i=new Date(t?.getFullYear()+e,t?.getMonth(),t?.getDate()).getTime(),r=(new Date).getTime();return a>=i&&a<=r}return!1})),Ss=(e=!1)=>ln((t=>Boolean(t)&&Boolean(e)))("Укажите наименование организации"),ks=(e=!1)=>ln((t=>kn(t)&&Boolean(e)))("Укажите ИНН"),Is={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,maxAge:73,errorMessage:"Допустимый возраст заёмщика - от 21 до 73 лет"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},Ts=e=>xs(Is[e]),Rs={processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentInformFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentFATCA:Sn},Es={addressCourier:gs(),paymentSystem:bn("Укажите тип платежной системы"),currency:bn("Укажите валюту"),cardCategory:bn("Укажите категорию карты"),codeWord:(e=>ln((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ms.test(e)))(e??cs))("Необходимо ввести кодовое слово"),confirmationIncome:xn(),methodObtain:bn(),deliveryDate:(e=>ln((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},Ds={organization:xn("Выберите тип организации"),organizationAddress:ln((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(ds),organizationPhone:Cn("Укажите номер телефона"),organizationName:bn("Укажите наименование организации"),legalForm:bn("Укажите ОПФ"),lastJobExperience:ys("Укажите стаж на последнем месте работы"),experience5Years:ys("Укажите общий стаж за последние 5 лет"),jobsNumber:ys("Укажите количество мест работы за последние 5 лет"),addressFact:gs(),addressRegistration:gs(),addressRetail:xn("Выберите адрес банка"),addressMatch:bn(),sex:bn("Укажите свой пол"),birthPlace:bn("Укажите место рождения"),education:xn("Выберите ваше образование"),housing:xn("Выберите тип жилья"),amountWorkers:xn("Выберите информацию о количестве сотрудников"),employment:xn("Выберите информацию о трудоустройстве"),employerActivities:xn("Выберите вид деятельности организации"),employerOrganization:xn("Выберите вид организации"),positionOrganization:xn("Выберите вашу должность"),familyStatus:xn("Выберите семейное положение"),familyMembers:bs(2,"Укажите количество членов семьи"),children:bs(2,"Укажите количество детей"),dependents:bs(2,"Укажите количество иждивенцев"),snils:(e=>ln(vs)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,dulSerie:bs(4,"Укажите серию паспорта",!0),dulNumber:bs(6,"Укажите номер паспорта",!0),dulSubdivisionCode:bs(7,"Укажите код подразделения",!0),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),retirementIncome:bn(),otherIncome:bn(),wages:bn(),mandatoryPayments:bs(10,"Укажите сумму обязательных выплат"),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),regionRetail:xn("Выберите регион"),latinSurname:bn("Укажите фамилию"),surname:fs("Укажите свою фамилию на кириллице"),name:fs("Укажите своё имя на кириллице"),middleName:fs("Укажите своё отчество на кириллице")},_s={...Ds,...Es,...Rs},Os={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в CФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var Ps;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(Ps||(Ps={}));const Bs=()=>{const e=globalThis.sessionStorage?.getItem("isNewMicroservice");return Boolean(e)},Ms="/light-api-cash/v1",As="/api/credit-application",Fs=async(e,t,n)=>{try{return(await Ls(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ls(e,t,n){const a=Bs(),i=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`${a?As:Ms}${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":i,"X-B3-Traceid":i,...zs()},credentials:"include",body:n?JSON.stringify(n):null})}const zs=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Vs=d((({onChangeEsiaStatus:e,productType:t})=>{const n=Jt(),a=is().frameLocation,i=r((async()=>{try{const e=await(async e=>{const t=Bs();return await Fs((t?"/user-data":"")+"/esia/getLink","POST",e)})({redirectUri:a||globalThis.location.origin+globalThis.location.pathname});e?.link&&(a?window.parent.postMessage({redirectUri:e?.link},"*"):n.assign(e.link))}catch{e(Ps.Error)}}),[a]);return c("div",{className:"flex items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex gap-m flex-col justify-around w-full",children:[o("p",{className:"text-xl",children:"Заполните данные через Госуслуги"+("debitCard"===t?" - это значительно сократит время оформления заявки":"")}),"debitCard"===t?null:c("ul",{className:"list-disc list-inside",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Mn,{type:"button",onClick:i,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),$s={url:"suggest/address",responseFilter:e=>Boolean(e?.data?.postal_code)},js={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=>({value:e?.data?.code||"",additionalValue:e?.data?.name})},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party",responseItemHandler:e=>{const t=e?.data?.inn,n=e?.data?.address?.value||"",a=n?`${t} ${n}`:t;return{value:e?.value||"",additionalValue:a}}},inn:{url:"suggest/party",responseItemHandler:e=>({value:e?.data?.inn||""})},addressRegistration:$s,addressFact:$s,organizationAddress:$s,addressCourier:$s},Ws=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>c("div",{className:u("px-m py-xs cursor-pointer hover:bg-main-divider relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:[o("p",{children:e.processedValue}),e.additionalValue?o("p",{className:"text-xs text-secondary-text",children:e.additionalValue}):null]},t.toString())))})}));const qs=d((({value:e="",onChange:t=_n,onDaDataChange:n,name:c="",daDataQueryPrefix:d,dadata:m=!1,type:u,...h})=>{const[p,{setFalse:g,setTrue:f}]=nn(),y=function({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=sa(),y=js[n],b=r((()=>{h.current=t,f.close()}),[t]),x=r((e=>{b(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[b,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await yr({url:y.url,responseItemHandler:y.responseItemHandler,responseFilter:y.responseFilter,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>Wn(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Ws,{options:p,container:n,value:t,onChange:x}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,p,t,x]),v}({isOpen:p&&m,name:c,value:e,daDataQueryPrefix:d,onChange:t,onDaDataChange:n}),b=r((e=>{let n=e??"";"number"===u&&(n=n.replace(/^0+(?=\d)/,"")),t?.(n)}),[t]);return o(Jn,{value:e,onChange:b,inputRef:y,isOpen:p,onOpen:f,onClose:g,...h})})),Us=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(Hs(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(qs,{disabled:Fr(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),Hs=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,...Ks(e)}),Ks=e=>{const t=e?.data?.block,n=e?.data?.block_type;if(!t)return{building:null,block:null};switch(n){case"литера":case"стр":return{building:t,block:null};case"к":{const e=Ys(t),[n,a]=t.split(e);return e?{building:a,block:n}:{building:null,block:n}}default:return{building:null,block:null}}},Ys=e=>e.includes("стр")?" стр ":e.includes("литера")?" литера ":"",Gs=Kt((({field:e,input:t,source:n})=>{const[l,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=r((t=>{e?.("addressCourier")?.onChange?.(Hs(t))}),[]),h=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(qs,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),Xs=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((t=>{e?.(n)?.onChange?.(Hs(t))}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(qs,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Js=d((({field:e,input:t})=>o(_r,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),Qs=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:Zs({textItems:r,subText:t,children:n,isPhone:a,...i})})),Zs=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(ze,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||eo(n,s),i?o(ze,{color:a,size:"text-m",children:i}):null]}),eo=(e,t)=>e.filter(Boolean).map(((e,n)=>o(ze,{size:"text-l",children:t?o("a",{href:`tel:${to(e)}`,children:e.trim()}):e.trim()},String(n)))),to=e=>e.replace(/\D/g,""),no=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}))),ao=d((({isUnfolded:e,...t})=>o(Y,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),io=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(Mn,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(Al,{children:a}),o(ao,{isUnfolded:t,iconVersion:i?"color":""})]}))),ro=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const lo=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=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=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),so=d((({children:e})=>{const[t,{toggle:n}]=nn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(ro,{className:"block sm:hidden",children:[o(lo,{isUnfolded:t,children:e}),o(io,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),oo=e=>{const t=mo(e);return o(Qs,{label:"Режим работы",value:t,className:"max-w-none"})},co=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",mo=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[co({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),co({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},uo=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ho=e=>uo.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??"")}}))),po=e=>{if(!e)return null;const t=go(e);return c(no,{className:"border-none",children:[o(Qs,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(fo)})}),o(Qs,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]})},go=e=>{const t=uo.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},fo=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(ze,{size:"text-xs",children:e})},String(n)),yo=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Qs,{label:"Валюта",value:e.currency}):null,t?o(Qs,{label:"Купить",value:String(t)}):null,n?o(Qs,{label:"Продать",value:String(n)}):null]},String(a)),bo={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"}},xo=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",bo[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(ze,{size:"text-m",color:bo[n].text,children:t})]}))),vo=(new Date).getDay(),No=e=>{const[t]=e?.slice(vo-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(xo,{color:"green",children:i}):null,n&&r?o(xo,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(xo,{color:"red",children:"Выходной"})},wo=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Co=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(Qs,{label:e,value:t&&n?n:"",subText:wo({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),So=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,ko=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Io=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,To=(e,t)=>{if(!e.workSchedule)return null;const n=ho(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e.address})]}):null]}),No(n)]}),o(so,{children:Ro(e)})]},String(t))},Ro=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=ho(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(no,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Qs,{label:"Факс",value:t,isPhone:!0}),o(Qs,{label:"Телефон филиала",value:e,isPhone:!0}),o(Qs,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Qs,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Qs,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(Qs,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(no,{children:o(Qs,{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(Co)})})}):c(no,{children:[o(Qs,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(fo)})}),oo(d)]}),l?.businessScheduleVisibleTag?po(l?.businessScheduleDescription):null,s?.currencies?.length?o(no,{className:"flex-wrap",children:s?.currencies?.map(yo)}):null]})},Eo=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=ho(e),n=e?mo(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?So(n):Io(n,a):ko(n):""})(n)}`;return{header:a,body:r}},Do={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,barrierFree:!1,equippedWithRamp:!1,equippedWithLift:!1,equippedWithElevator:!1,equippedWithStairclimber:!1,hasHelpMeButton:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},_o={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам",barrierFree:"Без барьеров",equippedWithRamp:"Есть пандус",equippedWithLift:"Есть подъёмник",equippedWithElevator:"Есть лифт",equippedWithStairclimber:"Есть лестницеход",hasHelpMeButton:"Есть кнопка «HELP ME»"},Oo={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},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),barrierFree:e=>Boolean("barrierFree"in e&&e.barrierFree),equippedWithRamp:e=>Boolean("equippedWithRamp"in e&&e.equippedWithRamp),equippedWithLift:e=>Boolean("equippedWithLift"in e&&e.equippedWithLift),equippedWithElevator:e=>Boolean("equippedWithElevator"in e&&e.equippedWithElevator),equippedWithStairclimber:e=>Boolean("equippedWithStairclimber"in e&&e.equippedWithStairclimber),hasHelpMeButton:e=>Boolean("hasHelpMeButton"in e&&e.hasHelpMeButton)},Po=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Oo[t](e)))))},Bo=()=>{},Mo=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Bo,getBalloonRemoteWorkplaces:i=Bo})=>{const[r,s,o,c]=l((()=>{const r=Po(e,n),l=Po(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.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[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Ao=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Fo=d((({children:e})=>Ao?e:null)),Lo="/icons/MapMarkerClusterIcon.svg",zo="/icons/MapMarkerClusterYellowIcon.svg";function Vo({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>'),r=$o("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=$o("workplaces",e,i),l=jo(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=jo(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=jo(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const $o=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Lo:zo,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),jo=(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?Lo:zo,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Wo={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},qo={...Wo,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Uo=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(qo).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Ho={...Wo,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ko=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(Ho).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:n,width:"20",height:"16"})})})),Yo=[55.753995,37.614069],Go=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=ls("ymaps","https://api-maps.yandex.ru/2.1/?lang=ru_RU",!1);if(i((()=>{l.current?Vo({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:Xo(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Vo({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(ai,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ko,{yandexMaps:l}),o(Ko,{yandexMaps:l,direction:"out"})]}),Uo(l,m,u("right-2 top-80",h))]})})),Xo=e=>{const t=[Qo(Jo(e,0)),Qo(Jo(e,1))];return t.every((e=>e))?t:Yo},Jo=(e,t)=>e.map((e=>e.coords?.[t])),Qo=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Zo=e=>Number(e.toString().replace(",",".")),ec=e=>{const t=Bs(),{data:n,error:a}=yi(`${t?`${As}/public-data`:Ms}/dictionary?dictionaryType=${encodeURIComponent(e)}`,tc);return n&&"errorMessage"in n?{error:a}:{data:n,error:a}},tc=async e=>await zt(e,{method:"POST"})||[],nc=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=ec("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await Fs("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Zo(e.latitude??Yo[0]),gpsLongitude:Zo(e.longitude??Yo[1])})))||[]})(s?.key??"");r(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=Mo({data:n,filtrationState:{},getBalloon:Eo});return c("div",{children:[o(ua,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(Fo,{children:o(Go,{points:m,isLoad:!l,className:"h-full",selectedAddress:d?.value?.text})})})]})})),ac=new es;function ic(e){return ns(ac,e)}Ql(ac,new Zl(globalThis?.localStorage));const rc=()=>ic(),lc=Kt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...r})=>{const l=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(ua,{placeholder:a,options:l,...e(n),...r})})),sc=d((({field:e,input:t})=>{const n=rc();return o(lc,{field:e,source:n.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),oc=d((({field:e,input:t})=>o(_r,{text:"Наличие военного билета",...e(t?.name??"")}))),cc=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Sa,{label:$n({label:t,errors:a?.errors}),...a}),jn(n)]}))),dc=[{id:"true",text:"Да"},{id:"false",text:"Нет"}],mc=d((({field:e,input:t})=>{const[n,i]=a(""),l=r((t=>{i(t),"false"===t&&e("bankEmployeeCode")?.onChange?.(null)}),[]);return c("div",{className:"flex flex-col md:flex-row",children:[o(cc,{label:"Мне помог сотрудник Банка",orientation:"horizontal",items:dc,value:n,onChange:l}),"true"===n?o(qs,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,maxLength:8,...e(t?.name??""),...t}):null]})})),uc=d((({field:e,input:t})=>o(_r,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),hc=d((({field:e,input:t})=>o(cr,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:Fr(e,t),maxDate:new Date}))),pc=d((({field:e,input:t})=>o(qs,{label:"Место рождения",maxLength:100,...e(t?.name??""),...t,disabled:Fr(e,t)})));function gc(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,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const fc=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",image:a})=>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:a?o(ie,{image:a,className:"block w-max"}):o(Y,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Fe,{__html:e})})]}))),yc=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=gc("programId"),{value:m,onChange:u}=e("cardCategory"),h=e("paymentSystem")?.value?.key,p=r((e=>1===e.length?{key:e[0].key,text:e[0].value}:null),[]);i((()=>{h&&d&&(async()=>{const e=await(async(e,t)=>{const n=await Fs("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(h,d);s(e),bc(e,m)||u?.(p(e))})()}),[h,p]);const g=l((()=>n?.find((e=>e.key===m?.key))?.description),[n,m]);return c("div",{children:[o(lc,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),g?o(fc,{__html:g}):null]})})),bc=(e,t)=>e.some((e=>e.key===t?.key)),xc=d((({field:e,input:t})=>o(qs,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,type:"number",...e(t?.name??""),...t}))),vc=d((({field:e,input:t})=>o(qs,{label:"Кодовое слово",maxLength:20,...e(t?.name??""),...t}))),Nc=d((({field:e,input:t})=>{const{data:n}=ec("INCOME_CERT_UNITED"),a=Fr(e,t);return c("div",{className:"space-y-xl",children:[a?o(fc,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(lc,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t,disabled:a})]})})),wc=d((({field:e,input:t})=>{const{data:n}=ec("MILITARY_STATUS");return o(lc,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Cc=()=>ic(),Sc=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Ee();return c(zn,{onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Mn,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),kc=(e,t)=>{const[n,{setTrue:a,setFalse:i}]=nn(!1),{open:l}=pn(Sc),s=Ee();return{openDocument:r((async()=>{if(e&&!n){a();const n=URL.createObjectURL(await(async(e,t=!1)=>{const n=await Ls(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?n.blob():new Blob})(e,s));l({src:n,onDocumentRead:t}),i()}}),[l,e,s,n]),isLoading:n}},Ic=d((({className:e,error:t,docId:n,...a})=>{const{openDocument:i,isLoading:r}=kc(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ba,{...a}),n?c(Mn,{embedded:!0,onClick:i,children:[o(Al,{children:"Ознакомиться"}),r?o(ai,{blur:!1,size:"extraSmall",position:"static"}):null]}):null]}),jn(t)]})})),Tc=d((({field:e,input:t})=>{const{productType:n}=Cc(),a=Os[n??""];return t&&t.name?o(Ic,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),Rc=Math.round(29.5),Ec=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),Dc="flex flex-col justify-between lg:flex-row gap-4xl",_c="flex flex-col lg:w-1/2 gap-2xl",Oc="flex flex-col gap-y-xl min-w-52",Pc=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(ze,{size:"text-h3",children:"number"==typeof e?[a,Je(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),Bc=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(ze,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Pc,{value:n,...i}):o(ze,{size:"text-h3",children:"-"})]}))),Mc=e=>Fc([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),Ac=(e=[],t=!1,n=[])=>({...Fc([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),Fc=(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]},Lc=(e,t=0)=>e?.sum?e.sum:t,zc=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Vc=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,$c=({min:e=0,max:t=0,availableMonths:n,...a})=>o(_i,{items:[`От ${jc(e)}`,`До ${jc(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),jc=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Wc=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(ze,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(Sa,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),qc=e=>Wc({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Uc=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(_i,{items:e?[`От ${Je(1)(a.min||0)} ${n}`,`До ${Je(1)(a.max||0)} ${n}`]:[],step:t,...a}),Hc=({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?.(Ii(t?.[i],n.minMonths,n.maxMonths))},Kc=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(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)},Yc=e=>e,Gc=(e=Yc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Xc=Gc(),Jc=(e=Yc)=>Gc((t=>-e(t))),Qc=Jc(),Zc=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:ed([e,t],a),ed=([e,t],n=[])=>({[e]:n.length?Qc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Xc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),td=(e,[t,n],a)=>e>=a[t]&&e<=a[n],nd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},ad=e=>id({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&id({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&id({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&id({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),id=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],rd=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[nd],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ad({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Zc(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=Zc(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>ad({row:e,userInputParams:t,paramsViewSettings:n})&&td(a,["minSum","maxSum"],e)&&td(i,["minMonths","maxMonths"],e)))||nd)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Kc(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},ld=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),sd={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},od=Kt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=Mc(n?.rateRows),g=r((e=>{const t=rd(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:y}]=dn({moneyValue:Lc(d,2e5),monthsValue:zc(d,Rc),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}),b=rd(f,n,s),x=qc({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(Ii(f.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),i((()=>{N&&N(Ii(f.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),i((()=>{!ld(d)&&p&&Hc({field:y,defParams:p,calcParams:b,map:sd,monthsValue:"minMonths"})}),[n,d]),o(Ec,{className:e,title:t,...h,children:c("section",{className:u(Dc,e),children:[c("div",{className:_c,children:[Uc({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...y("moneyValue"),value:b.moneyValue}),$c({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...y("monthsValue"),value:b.monthsValue}),cd({...b,...s},y),o("div",{className:"sm:hidden",children:x})]}),c("div",{className:u(Oc,"@4xl:w-1/2"),children:[o(Bc,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bc,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(Bc,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:x}),Ke(a,{isVertical:!0}),Vc(l)]})]})})})),cd=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ba,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ba,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ba,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ba,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),dd="calculator",md=d((({field:e,params:t})=>{const n=r((t=>{e(dd).onChange?.(t)}),[]);return o(od,{...t?.calcData,padding:"p-0",defaultParams:hd(e(dd).value),onChange:n})})),ud={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},hd=(e,t=!1)=>{const n=t?pd(ud):ud;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},pd=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),gd=d((({field:e,input:t})=>{const{data:n}=ec("CREDIT_IN_RSHB");return o(lc,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),fd={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",46:"owner_debit_card_plus",47:"owner_debit_card_pens_plus"},yd=[{id:"810",text:"Рубли"}],bd=d((({field:e,input:t})=>{const{data:n}=ec("CURRENCY"),{programId:a}=Cc(),i=l((()=>!Object.keys(fd).includes(a||"")||"38"===a),[]),r=l((()=>i?yd:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(cc,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??"")})})),xd=(e,t)=>{if(!t)return null;const n=Cd(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")}},vd=(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},Nd=(e,t)=>{const n=Cd(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},wd=(e,t,n)=>{const a=Cd(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},Cd=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Sd={amountWorkers:"EMPLOYEES_NUMBER",employerOrganization:"ORGANIZATION_KIND",employerActivities:"ORGANIZATION_ACTIVITY_TYPE",organization:"ORGANIZATION_TYPE"},kd=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=Id(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Hs(n.data?.address));const s={amountWorkers:vd(e?.amountWorkers,n.data?.employee_count),employerActivities:xd(e?.employerActivities??[],a),organization:wd(e?.organization??[],i,r),employerOrganization:Nd(e?.employerOrganization??[],i),organizationName:l,inn:r,isDadataOrganization:!0};for(const e in s)t?.(e)?.onChange?.(s[e])},Id=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),Td=d((({field:e,input:t})=>{const n=rc(),[l,s]=a(""),{employerActivities:c,employerOrganization:d,organization:m,amountWorkers:u}=n,h=e?.("esiaAccountTypeCd")?.value,p=e?.("inn")?.value,g=e?.("organizationName")?.error,f=e("isDadataOrganization")?.value;i((()=>{s(g&&!f?"Необходимо выбрать ИНН из выпадающего списка":"")}),[f,g]);const y=r((t=>{kd(n,e,t)}),[]);i((()=>{(async()=>{await(async(e,t)=>{const n=Bs();await Promise.all(Object.entries(e).map((e=>{const[a,i]=e;Fs(`${n?"/public-data":""}/dictionary?dictionaryType=${encodeURIComponent(i)}`,"POST").then((e=>{t[a]=e}))})))})(Sd,n)})()}),[]),i((()=>{h&&p&&Rd(n)&&(async()=>{const t=await(async e=>{const t=await yr({url:"suggest/party",query:e});return t?.[0]})(p);t&&kd(n,e,t)})()}),[c,d,m,u]);const b=r((t=>{e?.("inn")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(qs,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:y,disabled:Fr(e,t),onChange:b,error:l||e("inn")?.error})})),Rd=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i}=e;return[n,a,i,t].every(Boolean)},Ed=d((({field:e,input:t})=>o(cr,{label:"Дата доставки",...e(t?.name??""),minDate:new Date}))),Dd=d((({field:e,input:t})=>{const{data:n}=ec("COURIER_DELIVERY_TIME"),a=l((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(cc,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),_d=d((({field:e,input:t})=>o(qs,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,type:"number",...e(t?.name??""),...t}))),Od=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(cr,{label:"Дата выдачи",...e(t?.name??""),disabled:Fr(e,t),minDate:a,maxDate:new Date})})),Pd=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code)}),[]);return o(qs,{disabled:Fr(e,t),label:"Кем выдан",maxLength:200,...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),Bd=d((({field:e,input:t})=>o(qs,{disabled:Fr(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),Md=d((({field:e,input:t})=>o(qs,{disabled:Fr(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),Ad=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]),a=r((t=>{const n=t.replace(/[^\d-]/g,"");n.length<=7&&e?.("dulSubdivisionCode")?.onChange?.(Hi(n,"___-___"))}),[]);return i((()=>{const t=e?.("dulSubdivisionCode")?.value;t&&a(t)}),[]),o(qs,{disabled:Fr(e,t),label:"Код подразделения",...t,...e(t?.name??""),placeholder:"___-___",onChange:a,onDaDataChange:n})})),Fd=d((({field:e,input:t})=>{const{data:n}=ec("EDUCATION_LEVEL");return o(lc,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Ld=d((({field:e,input:t})=>{const n=r((t=>{(hs.test(t)||0===t.length)&&e("email")?.onChange?.(t)}),[e]);return o(qs,{label:"Электронная почта",maxLength:50,...e(t?.name??""),...t,onChange:n})})),zd=d((({field:e,input:t})=>{const n=rc();return o(lc,{field:e,source:n.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Vd=d((({field:e,input:t})=>{const n=rc();return o(lc,{field:e,source:n.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),$d=d((({field:e,input:t})=>{const{data:n}=ec("EMPLOYMENT_INFO_UNITED");return o(lc,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),jd=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Ii(Number(n),0,5)))),[]);return o(qs,{label:"Стаж за последние 5 лет",placeholder:"Количество лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:Fr(e,t)})})),Wd=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value||0),c=Number(e("dependents")?.value||0),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(qs,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),qd=d((({field:e,input:t})=>{const{data:n}=ec("MARITAL_STATUS");return o(lc,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Ud=d((({field:e,input:t})=>{const[n,r]=a(""),l=Number(e("lastJobExperience")?.value),s=Number(e("generalSeniority")?.value);return i((()=>{r(s&&s<l?"Укажите не меньше, чем число в поле «Стаж на последнем рабочем месте»":"")}),[l,s]),o(qs,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",isInteger:!0,...e(t?.name??""),...t,error:n||e("generalSeniority")?.error,disabled:Fr(e,t)})})),Hd=d((({field:e,input:t})=>{const{data:n}=ec("HOUSE_TYPE");return o(lc,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Kd=d((({input:e})=>o(fc,{__html:e?.label}))),Yd=d((({field:e,input:t})=>o(_r,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),Gd=d((({field:e,input:t})=>o(qs,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:Fr(e,t)}))),Xd=d((({field:e,input:t})=>o(qs,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,isInteger:!0,...e(t?.name??""),...t,disabled:Fr(e,t)}))),Jd=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Qd=(e="",t="")=>Jd.test(e)&&t.length<20&&e.length+t.length<=20,Zd={"А":"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",".":".",",":",","-":"-"," ":" "},em=e=>e.replace(/[А-ЯЁа-яё,. -]/g,(e=>Zd[e.toLowerCase()].toUpperCase()||"")),tm=(e,t)=>{let n=em(e);const a=em(t).substring(0,20);return 20===a.length?n="":n.length+a.length>20&&(n=n.substring(0,1)),{translatedName:n,translatedSurame:a}},nm=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinName")?.onChange;i((()=>{const{translatedName:e}=tm(a,l);s?.(e)}),[]);const c=r((e=>{(Qd(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ea,{label:"Имя",placeholder:"Имя латинскими буквами",...e(t?.name??""),onChange:c,...t})})),am=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinSurname")?.onChange;i((()=>{const{translatedSurame:e}=tm(a,l);s?.(e)}),[]);const c=r((e=>{(Qd(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ea,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",...e(t?.name??""),onChange:c,...t})})),im=d((({field:e,input:t})=>o(qs,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),rm=d((({field:e,input:t})=>o(qs,{label:"ОПФ",maxLength:20,placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),lm=d((({field:e,input:t})=>o(cr,{label:"Дата рождения",...e(t?.name??""),disabled:Fr(e,t)}))),sm=d((({field:e,input:t})=>o(qs,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),om=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],cm=d((({field:e,input:t})=>o(cc,{orientation:"horizontal",items:om,...e(t?.name??"")}))),dm=d((({field:e,input:t})=>{const n=r((t=>{(us.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o(qs,{label:"Отчество (Обязательно, при наличии)",maxLength:40,disabled:Fr(e,t),...e(t?.name??""),...t,onChange:n})})),mm=d((({field:e,input:t})=>{const n=r((t=>{(us.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o(qs,{label:"Имя",maxLength:40,disabled:Fr(e,t),...e(t?.name??""),...t,onChange:n})})),um=d((({field:e,input:t})=>{const n=rc();return o(lc,{field:e,source:n.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),hm=d((({field:e,input:t})=>{const n=rc(),[l,s]=a(""),c=e?.("organizationName")?.error,d=e("isDadataOrganization")?.value;i((()=>{s(c&&!d?"Необходимо выбрать организацию из выпадающего списка":"")}),[d,c]);const m=r((t=>{kd(n,e,t)}),[]),u=r((t=>{e?.("organizationName")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(qs,{label:"Наименование организации",...t,...e(t?.name??""),disabled:Fr(e,t),onDaDataChange:m,onChange:u,error:l||e("organizationName")?.error})})),pm=d((({field:e,input:t})=>o(qs,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),gm=d((({field:e,input:t})=>o(cr,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date}))),fm=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Ii(Number(n),0,100)))),[]);return o(qs,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})})),ym=e=>e.map((e=>({key:e.type,text:e.name}))),bm=e=>e?.key,xm=d((({field:e,input:t})=>{const[n,i]=a([]),r=ic();gr((async()=>{const{programId:e}=r;if(e){const t=await(async e=>{const t=await Fs("/public-data/creditProgramConditions","POST",{creditProgramId:e});return ym(t?.paymentSystems||[])})(e);i(t??[])}}),[]);const s=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(cc,{label:"Платежная система",orientation:"horizontal",items:s,...e(t?.name??"",{format:bm,parse:e=>n?.find((t=>t.key===e))})})})),vm=d((({field:e,input:t})=>{const{data:n}=ec("POSITION");return o(lc,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Nm=async()=>await Fs("/public-data/regionsCardDelivery","GET")||void 0,wm=d((({field:e,input:t})=>{const{programId:n,productType:a}=rc(),{data:i}=ec("REGION_RF"),{data:l}=yi("regionsDelivery",Nm),{data:s}=ec(Cm(a)),c="38"===n,d=i?.map((({key:e,value:t})=>({key:e,text:t}))),m="true"===s?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,u=e("regionRetail")?.onChange,h=e("regionHasDelivery")?.onChange,p=e("methodObtain")?.onChange,g=r((e=>{const t=m&&l?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!c;h?.(t),p?.(t?"courier":"office"),u?.(e)}),[l,m]);return o(ua,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:d,...e(t?.name??""),onChange:g})})),Cm=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",Sm=d((({field:e,input:t})=>o(qs,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),km=["male","female"],Im=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Tm=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await yr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return km.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(cc,{label:"Пол",orientation:"horizontal",items:Im,...e(t?.name??"")})})),Rm=d((({field:e,input:t})=>o(_r,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),Em=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(Hi(e,"___-___-___ __")):t?.(Hi(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Gn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),Dm=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:r,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Em,{"aria-label":t,label:$n({label:t,errors:l?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:r,placeholder:"___-___-___ __",...l}),jn(a)]}))),_m=d((({field:e,input:t})=>o(Dm,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),Om=d((({field:e,input:t})=>{const n=r((t=>{(us.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o(qs,{label:"Фамилия",maxLength:40,disabled:Fr(e,t),...e(t?.name??""),...t,onChange:n})})),Pm=d((({field:e,input:t})=>o(qs,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t,disabled:Fr(e,t)}))),Bm={$ref:"/wcms-resources/delivery-cities-data.json"},Mm={limitedBirthday:lm,name:mm,surname:Om,middleName:dm,email:Ld},Am={processPersonalDataFlg:Tc,consentProviderFlg:Tc,consentOthersFlg:Tc,consentInformFlg:Tc,consentPfrFlg:Tc,consentInformMaterialsFlg:Tc,consentFATCA:Tc},Fm={organization:um,organizationAddress:Us,organizationPhone:tl,organizationName:hm,legalForm:rm,generalSeniority:Ud,lastJobExperience:Xd,experience5Years:jd,jobsNumber:Gd,beginDate:hc,addressFact:Xs,addressRegistration:Us,addressRetail:nc,addressMatch:Js,sex:Tm,birthPlace:pc,education:Fd,housing:Hd,amountWorkers:sc,employment:$d,employerActivities:zd,employerOrganization:Vd,positionOrganization:vm,familyStatus:qd,familyMembers:Wd,children:xc,dependents:_d,snils:_m,conscription:wc,armyIdFlg:oc,dulSerie:Md,dulNumber:Bd,dulIssueDate:Od,dulSubdivisionCode:Ad,dulIssuedBy:Pd,participantDateRegistration:gm,retirementIncome:Sm,otherIncome:pm,wages:Pm,mandatoryPayments:sm,bankruptcyFlg:uc,initiateBankruptcyFlg:Yd,shareholderFlg:Rm,legalEntityName:im,creditInRshbCd:gd,bankEmployeeCode:mc,partInBusiness:fm,regionRetail:wm,infoCard:Kd,calculator:md,confirmationIncome:Nc,inn:Td,...Mm},Lm={addressCourier:e=>o(Gs,{...e,source:Bm}),paymentSystem:xm,currency:bd,cardCategory:yc,codeWord:vc,methodObtain:cm,deliveryDate:Ed,latinName:nm,latinSurname:am,deliveryTime:Dd},zm="Согласие на все документы",Vm=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ri(t(e?.name),Sn).error)))),[e]),[d,{toggle:m}]=nn(!0);return o("div",{className:"w-fit",children:c(ro,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ba,{text:zm,value:a,onChange:i},n),jn(s?"Отметьте все обязательные соглашения":"")]}),o(Mn,{embedded:!0,ariaLabel:zm,onClick:m,children:o(ao,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(lo,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(Tl(t,{},Am))})]})})})),$m=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=jm(t||[],n);return a.length>2?c("div",{children:[i.map(Tl(e,{},{...Mm})),o(Vm,{inputs:a,field:e})]}):(t||[])?.map(Tl(e,{},{...Mm}))},jm=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(Os[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(Os[t]).includes(String(e))))}),Wm=(e,t=!1)=>o(ii,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),qm=async e=>await Fs("/user-data/createDraftTask","POST",e)||{},Um=e=>Ls("/referal/saveReferalInfo","POST",e),Hm=e=>Ls("/user-data/updateUserProfile","PUT",e),Km=e=>Ls("/user-data/updateUserTask","PUT",e),Ym={width:"118",height:"24"},Gm={"bg-white":"color",transparent:"white"},Xm={"bg-white":"text-primary-main",transparent:"text-white"},Jm=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Gm[e]},className:Xm[e],width:n?.width,height:n?.height}),Qm={"bg-white":"text-primary-text",transparent:"text-white"},Zm=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!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??"Россельхозбанк",...ve(s),children:[Jm(r,n?.image,Ym),l?a??o("div",{className:"ml-s",children:o(ze,{font:"font-medium",color:Qm[r],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),eu=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=nn(!1),{closeAll:y}=ge(),b=r((async()=>{g();await(async e=>{const t=Bs();return await Ls((t?"/user-data":"")+"/sms/checkCaptcha","POST",{captchaText:e.captchaText,...t&&{phoneNumber:e?.phoneNumber}}).then((e=>e.text())).then((e=>"ERROR"!==e))})({captchaText:d,phoneNumber:e})?(n?.(),t?.()):h(!0),f()}),[d,t]),x=r((()=>{(async()=>{s(URL.createObjectURL(await(async e=>{const t=Bs();return await Ls(`${t?"/user-data":""}/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob))})(e)))})()}),[]);return i(x,[]),o(zn,{head:o(Zm,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(Mn,{className:"w-8",embedded:!0,onClick:x,children:o(Y,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Gn,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(Mn,{version:"secondary",onClick:y,children:"Вернуться"}),o(ii,{version:"secondary",disabled:!d,onClick:b,children:"Отправить"})]}),p?o(ai,{blur:!1}):null]})})})),tu=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},nu=({values:e,phoneNumber:t,onSuccess:n,onFail:l})=>{const s=is(),o=s.smsCode?.attempts||0,c=Math.max(Wl(s.smsCode?.sendTime||Date.now()),0),[d,m]=a(""),[u,{setTrue:h,setFalse:p}]=nn(!1),[g,f]=a(c),y=r((()=>m("")),[]),b=Boolean(0===g&&s.smsCode?.sendTime),x=o>2||b||!e.every(Boolean),v=r((async()=>{s.smsCode={...s.smsCode,attempts:o+1},h();const a=await(async e=>{const t=Bs();return await Ls((t?"/user-data":"")+"/sms/checkCode","POST",{smsText:e.smsText,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName,...t&&{phoneNumber:e?.phoneNumber}})})({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"},phoneNumber:t});if(a.ok){const t=await a.json();tu(t),f(0),y(),s.smsCode=null,n?.(e.join(""))}else 403===a.status?m(o>1?"Исчерпан лимит ввода смс-кода":"Неверный код"):l();p()}),[e,o]);return i((()=>{b?m("Код просрочен"):o>2&&m("Исчерпан лимит ввода смс-кода")}),[b]),{handleSubmit:v,hasError:Boolean(d),errorText:d,isLoading:u,timeNextReq:g,isSubmitButtonDisabled:x,setTimeNextReq:f,setErrorText:m}},au=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=_n,onClose:s=_n,onFail:c=_n})=>{const[d,m]=a(Array(4).fill("")),u=is(),h=Wa(e),{handleSubmit:p,hasError:g,errorText:f,isLoading:y,timeNextReq:b,isSubmitButtonDisabled:x,setTimeNextReq:v,setErrorText:N}=nu({values:d,phoneNumber:h,onSuccess:l,onFail:c}),w=pn(eu),C=Ol({seconds:b,onTick:v}),S=r((async()=>{const e=await(async e=>{const t=Bs();return await Ls((t?"/user-data":"")+"/sms/sendCode","POST",{phoneNumber:e.phoneNumber,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName})})({phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}});e.ok?(v(180),C(180),N(""),u.smsCode={sendTime:Date.now(),attempts:0}):429===e.status?w.open({phoneNumber:h,sendCode:S}):c()}),[h,C]);return i((()=>{u.smsCode?.sendTime||S()}),[]),o(zl,{isSubmitButtonDisabled:x,onSubmit:p,onSendCode:S,timeNextReq:b,values:d,onChange:m,phone:e,isLoading:y,errorText:f,hasError:g,onClose:s,children:iu(n,t)})})),iu=(e,t=!1)=>t?c(Fe,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:e?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,ru={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},lu={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},su=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],ou=d((({onSubmit:e=_n,onClose:t=_n})=>{const[n,i]=a(""),[l,s]=a(!1),{openDocument:d}=kc(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),h=l?lu:ru;return o(zn,{onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(N,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(w,{align:"text-center",children:h.description}),o(Sa,{className:"whitespace-normal",orientation:"horizontal",items:su,value:n,onChange:u}),o(Mn,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),cu={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"},du={...cu,amur_card:"14",owner_card:"13",travel_card:"15",amur_debit_card:"17",owner_debit_card:"16",pension_debit_card:"18",salary_debit_card:"38",vordi_debit_card:"40",eco_debit_card:"42",junior_debit_card:"43",appetit_debit_card:"44",owner_debit_card_plus:"46",owner_debit_card_pens_plus:"47"},mu=d((({title:e,icon:t,description:n,onClick:a=_n})=>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:[e?o(ze,{font:"font-medium",size:"text-s",children:e}):null,n?o(ze,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),uu={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},hu={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},pu={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},gu=e=>Object.entries(e).reduce(((e,[t,n])=>t in uu?[...e,{contactTypeCd:{key:uu[t]},value:n}]:e),[]),fu=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in hu){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{...a,addressType:{key:hu[t]}}]}return e}),[]),yu=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:bu(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in pu?[...e,{incomeTypeCd:{key:pu[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p,initiateBankruptcyFlg:f};var y},bu=(e,t)=>(Number(e??0)+Number(t??0)).toString(),xu={WORK:"Работаю",RETIREE:"Пенсионер"},vu=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,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=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:bu(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},Nu=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}},wu=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}},Cu=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,Su=(e=!1,t=!1)=>e?{nextStepLink:"/debit-card-lead",newTaskLink:"/natural/debetcards",description:"На дебетовую карту"}:t?{nextStepLink:"/credit-lead",newTaskLink:"/natural/loans/all-goals",description:"На получение кредита"}:{nextStepLink:"/credit-card-lead",newTaskLink:"/natural/creditcards/svoya",description:"На получение кредитной карты"},ku=d((function({task:e,isFromLead:t=!1,isDebit:n=!1,sendAspects:a=_n,onClose:i=_n}){const l=rc(),s=Jt(),{participants:d,creditProgram:m,createdDate:u="",id:h}=e,p=du[m.code],g=Boolean(cu[m.code]),f=Su(n,g),{id:y,profile:b}=d[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,educationLevelCd:x,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:E,organizationTypeCd:D,organizationKindCd:_,employeesNumberCd:O,opf:P,seniority:B,generalSeniority:M,jobsNumber:A,lastWorkDuration:F,positionCd:L,maritalStatusCd:z,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:W,participantIncomes:q,snils:U,armyIdFlg:H,bankruptcyFlg:K,shareholderFlg:Y,nameLegalEntity:G,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Q}=t;return{currency:r?.key,paymentSystem:Cu(i),cardCategory:Cu(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,education:Cu(x),participantDateRegistration:v,housing:Cu(N),beginDate:k,employment:Cu(I,xu),organizationName:T,inn:R,isDadataOrganization:Boolean(R),employerActivities:Cu(E),organization:Cu(D),employerOrganization:Cu(_),amountWorkers:Cu(O),legalForm:P,generalSeniority:B?.toString(),experience5Years:M?.toString(),jobsNumber:A?.toString(),lastJobExperience:F?.toString(),positionOrganization:Cu(L),familyStatus:Cu(z),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:Cu(W),snils:U,armyIdFlg:H,bankruptcyFlg:K,shareholderFlg:Y,legalEntityName:G,creditInRshbCd:Cu(X),calculator:{isInsurance:J,isSalaryClient:Q,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...vu(q),...Nu(S),...wu(C),...(Z=w,Z?.key?{sex:"MAN"===Z.key?"male":"female"}:null)};var Z})(e);l.participantId=y??null,l.taskId=h,l.profileId=b?.id??null,l.programId=p,l.leadForm=t,b?.id&&a(b.id,h),s.assign(f.nextStepLink)}),[]),v=r((()=>{s.assign(f.newTaskLink)}),[]);return o(zn,{onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(N,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(mu,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:u?`Черновик от ${ja(new Date(u))}`:"",onClick:x}),o(mu,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:f.description,onClick:t?i:v})]})]})})})),Iu=d((function({isDebit:e,onClose:t=_n}){const n=Jt(),a=Su(e),i=r((()=>{n.assign(a.newTaskLink)}),[]),l=r((()=>{n.assign("/")}),[]);return o(zn,{onClose:t,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(w,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Mn,{type:"button",className:"w-full",onClick:i,children:"Заполнить новую заявку"}),o(Mn,{type:"button",version:"secondary",className:"w-full",onClick:l,children:"Вернуться на главную"})]})})})),Tu=({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i,consents:r})=>{const l=Eu(i?.utm_source),s=Ru({participantId:e,profileId:n,formData:a,consents:r});return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:l,id:t,...n?{participants:[s]}:{participant:s},marketingInfo:i}}},Ru=({participantId:e,profileId:t,formData:n,consents:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=n;return{birthDate:s&&ja(s,!0),id:e,midname:l,name:i,surname:r,...t&&{profile:{id:t}},participantContacts:gu({phone:o&&Wa(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"},...a}},Eu=e=>{switch(e){case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},Du=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),_u=({programId:e,nextStepLink:t,productType:n,data:a,changeSubmitFormStatus:i,isNewMicroservice:l})=>{const[s,{setTrue:o,setFalse:c}]=nn(!1),d=(()=>{const e=Cc();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),m=is(),u=Cc(),h=(({data:e})=>{const t=tn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});ti({aspectsAttributes:Du(e,i),aspects:t,ev:{}})}),[e])})({data:a}),p=Jt(),g=r((()=>{p.assign(t)}),[]),f=(e=>{const{open:t}=pn(ou),n=pn(au),a=(t,n,a)=>async i=>{try{t?await Hm({profile:{id:t,consentBkiFlg:!0,smsConsentBki:i}}):n&&a&&await Km({task:{id:n,participant:{id:a,consentBkiFlg:!0,smsConsentBki:i}},sendToBank:!1,taskKind:"SHORT"}),e()}catch(e){console.log(e)}},i=({phone:t,profileId:i,onFail:r,taskId:l,participantId:s})=>async o=>{"SIGNED"===o&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i,l,s),onFail:r}):e()};return{open:({phone:n,profileId:a,onFail:r,taskId:l,participantId:s})=>t({onSubmit:i({phone:n,profileId:a,onFail:r,taskId:l,participantId:s}),onClose:e})}})(g),y=pn(au),b=(()=>{const{open:e}=pn(ku),{open:t}=pn(Iu);return{open:({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l})=>{n?e({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l}):t({isDebit:i})}}})(),x=()=>{y.close(),i(!1)},v=r((async t=>{try{o();const i=Au(t),r=await(a={profile:{phone:Wa(i.phone)}},Fs("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{await Pu({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:s,saveUserData:d,sendAspects:h}),y.close(),"debitCard"===n?g():f.open({phone:i.phone,profileId:r,onFail:x})},p=async()=>{try{const t=await(async e=>{const t=await Fs("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await Fs("/user-data/getTaskById","POST",e)||void 0)({taskId:t});y.close(),b.open({task:e,isFromLead:!0,isDebit:"debitCard"===n,sendAspects:h,onClose:c})}else await c()}catch{x()}},v=Ou(i,n);y.open({phone:i.phone,consents:v,onSuccess:p,onFail:x})}catch{x()}finally{c()}var a}),[]),N=r((async t=>{try{o();const i=Au(t),r=await(a={phone:Wa(i.phone),email:i.email},Fs("/public-data/createParticipant","POST",a).then((e=>e?.participantId||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{const t=await Bu({programId:e,participantId:r,formData:i,referalData:l,productType:n,marketingInfo:s,saveUserData:d,sendAspects:h});y.close(),f.open({phone:i.phone,taskId:t,participantId:r,onFail:x})},p=async()=>{try{await c()}catch{x()}},g=Ou(i,n);y.open({phone:i.phone,consents:g,onSuccess:p,onFail:x})}catch{x()}finally{c()}var a}),[]);return{isSending:s,handleSubmit:l?N:v}},Ou=(e,t)=>{const n=Os[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},Pu=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=Mu(n,a);await Hm(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&ja(l,!0),email:o,phone:Wa(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async e=>await Fs("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t,n)=>{const{name:a,surname:i,middleName:r,limitedBirthday:l,phone:s,email:o}=e;return{task:{taskSource:Eu(n?.utm_source),creditProgram:{code:fd[t]},participants:[{birthDate:l&&ja(l,!0),midname:r,name:a,surname:i,participantContacts:gu({phone:s&&Wa(s),email:o})}],marketingInfo:n}}})(n,e,r));o=t.taskId,c=t.participantId}else{const a=await qm({profileId:t,programId:e});o=a.taskId,c=a.participantId,await Km(Tu({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await Um({taskId:o,...i}),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},Bu=async({programId:e,participantId:t,formData:n,referalData:a,productType:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o;const c=Mu(n,i);try{return o=(await qm({participantId:t,programId:e})).taskId,await Km(Tu({participantId:t,taskId:o,formData:n,marketingInfo:r,consents:c})),a?.referalCode&&await Um({taskId:o,...a}),s(t,o),l({participantId:t,taskId:o,programId:e,formData:n}),o}catch(e){throw console.log(e),new Error}},Mu=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentInformMaterialsFlg:s,consentFATCA:o}=e;let c;return c="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:!1}:{consentFATCA:o,consentPhotoFlg:n},{...c,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},Au=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),Fu=(e=!1)=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),a=globalThis.localStorage.getItem("taskId"),i=Jt();if(!n||!t||!a&&!e)return i.assign("/"),()=>{};const r=async()=>{const e=await Ls("/auth/refresh","POST",{refresh_token:t,access_token:n});if(401===Number(e?.status)&&i.assign("/"),e?.ok){const t=await e.json();globalThis.sessionStorage.setItem("refreshToken",t.refresh_token),globalThis.sessionStorage.setItem("accessToken",t.access_token)}};!e&&r();const l=setInterval(r,24e4);return()=>clearInterval(l)},Lu={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},zu=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,Lu[e.name||""]])))}},Vu=async(e,t,n=!1)=>{const a=new FormData;return a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml")),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...zs()},credentials:"include",body:a}).then((e=>e.json())))},$u=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||r,l?`ул ${l}`: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}},ju=e=>Math.floor(e/12),Wu=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>Vu(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},qu=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},Uu=(e,t)=>{const{esiaAdditionalDocument:n}=e,a=[n?.pdfFilePayout,n?.pdfFileWorkbook,n?.pdfFileSigPayout,n?.xmlFilePayout,n?.xmlFileSigPayout,n?.xmlFileWorkbook];return[n?.inn,n?.averageMonthlyIncome?.toString(),n?.startWorkDate,n?.workLengthInFiveYears?.toString(),n?.workLength?.toString(),n?.workLengthLastJob?.toString(),n?.jobsNumberInFiveYears?.toString()].every(Boolean)&&(t||a.every(Boolean))},Hu=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a,isNewMicroservice:s})=>{const o=Cc(),c=r((e=>{const t=e instanceof Function?e(d[m]):e;null!=t?d[m]=t:delete d[m]}),[d=o,m="leadForm"]);var d,m;const u=is(),h=globalThis.sessionStorage?.getItem(Qt);(()=>{const e=Cc(),t=tn();i((()=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("referalCode"),i=n.get("refererCode"),r=n.get("productId");if(a){e.referalData={refererCode:i,referalCode:a,productId:r};const n=JSON.stringify({refererCode:i,referalCode:a,productId:r});ti({aspectsAttributes:[{aspectName:"snowplowEvent",params:{eventAction:"ownfin_referal_link_attributes",eventJSON:n}}],aspects:t,ev:{}})}}),[])})();const p=l((()=>zu(e,o.leadForm,a)),[e,o.leadForm]),g=r((async(e,a)=>{n(Ps.Pending);try{const i=await(async e=>{const t=Bs();return await Fs((t?"/user-data":"")+"/esia/requestProfile","POST",e).then((e=>(e?.access_token&&e?.refresh_token&&(tu(e),Fu(!0)),e)))})({code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0});if(i){const e=await(async(e,t=!1,n=!1)=>{qu(e);const a=!t&&Uu(e,n),{profile:i,addInfo:r,document:l,addressRegistration:s,addressFact:o,esiaAdditionalDocument:c}=e;let d=[];return a&&!n&&(d=await Wu(c)),{...{name:i.name,surname:i.surname,middleName:i.midname,limitedBirthday:i.birthDate,phone:Qr(i.phone),email:i.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:r.birthPlace,addressRegistration:$u(s),esiaAccountTypeCd:t?i.esiaAccountType:{key:""},...o&&{addressFact:$u(o)}},...a&&{snils:r.snils,inn:c.inn,wages:Math.floor(c.averageMonthlyIncome)?.toString(),beginDate:c.startWorkDate,experience5Years:ju(c.workLengthInFiveYears).toString(),generalSeniority:ju(c.workLength).toString(),lastJobExperience:ju(c.workLengthLastJob).toString(),jobsNumber:c.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:i.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:d}}})(i,"debitCard"===t,s);c((t=>({...t,...e}))),n(Ps.Success)}}catch{n(Ps.Error)}}),[]);return i((()=>{o.productType=t,u.marketingInfo=Ku(h,u),u.isNewMicroservice=s||null}),[h]),i((()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),t=e.get("code"),n=e.get("state");t&&n?g(t,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),p},Ku=(e,t)=>{const n=t.marketingInfo,a=new URLSearchParams(decodeURIComponent(e||""));return a.get("code")?n:{utm_campaign:a.get("utm_campaign"),utm_medium:a.get("utm_medium"),utm_source:a.get("utm_source"),utm_content:a.get("utm_content"),utm_term:a.get("utm_term"),bannerId:a.get("bannerId"),userId:a.get("userId")}},Yu=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:h,isNewMicroservice:p=!1,...g})=>{const[f,y]=a(),[b,x]=a(),[v,N]=a(0),w=s(null),C=l((()=>(e=>{const t=Os[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:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),S=l((()=>Gu(C)),[C]),k=pn(Xl),I=ss();os();const T=l((()=>Xu(m)),[m]),R=l((()=>Rn(S,T)),[S,T]),E=(e=!1)=>{x(e)},D=Hu({inputs:S,nextStepLink:r,productType:m,setEsiaStatus:y,esiaAuthSuccess:f===Ps.Success,isNewMicroservice:p}),{isSending:_,handleSubmit:O}=_u({programId:n,nextStepLink:r,productType:m,data:h,changeSubmitFormStatus:E,isNewMicroservice:p}),[,{field:P,onSubmit:B,reset:M}]=dn(D,{formValidator:R,onSubmit:O}),A=pn(Vn);return i((()=>{!1===b&&A.open({ok:b,onClose:()=>E(!0)})}),[b]),i((()=>{f&&w?.current&&w.current.scrollIntoView({block:"start"}),f===Ps.Success&&M()}),[w?.current,f]),c(hn,{className:u("container space-y-m",e),title:t,...g,children:[f||I?null:o(Vs,{onChangeEsiaStatus:y,productType:m}),c("form",{onSubmit:e=>{P("processPersonalDataFlg")?.value||(N((e=>e+1)),v>0&&k.open({attempts:v})),B?.(e)},className:"space-y-m relative",ref:w,children:[f===Ps.Pending?o(ai,{blur:!1}):null,C.map(((e,t)=>c("div",{className:u(Rl(e.columns),"grid gap-x-m"),children:[El(e.title),$m({field:P,inputs:e?.inputs},m)]},`section-${t}`))),Wm(d,_),f===Ps.Error?o(ze,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),Gu=e=>e?.flatMap((e=>e?.inputs))||[],Xu=e=>({..._s,limitedBirthday:Ts(e)}),Ju=d((({title:e,description:t})=>{const n=Ee();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"})]})})),Qu=e=>e%2!=0,Zu="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",eh=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=nn(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Zu),children:[E(r,{...i.options,parent:n}),Qu(r.length)?o(Gt,{className:"col-span-6",...i}):null]}),c(ro,{children:[c(lo,{className:u(Zu),isUnfolded:s,children:[E(l,{...i.options,parent:n}),Qu(l.length)?o(Gt,{className:"col-span-6",...i}):null]}),o(io,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),th=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",nh=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),ah=10;function ih(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:rh(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}function rh(e=0){const t=Math.round(e*ah);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const lh=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:l,onIntersection:s})=>{const c=ih(r((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),i);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:l})})),sh=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],oh=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},b=s([]),x=r(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(dh(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?ch(c,v):{},...N?nh(h):{},gap:`${l}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(lh,{className:u(m,i?sh[i-1]:"",{"h-full":N},t),style:w?ch(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:x,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),ch=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),dh=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),mh={"horizontal-list":"w-6","vertical-list":"h-6"},uh=({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?mh[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),hh=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=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",l=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",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},ph=e=>t=>e.scrollWidth/t,gh=e=>(t,n)=>{e.scrollBy({left:n*ph(e)(t),behavior:"smooth"})},fh=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((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?[Jc()(i),Gc()(i)]:[-1,-1],m=c>0,u=d<e-1,h=r((()=>{var t;n.current&&(m?gh(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{n.current&&(u?gh(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((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}]},yh={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},bh=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ee(),[h,p]=fh({itemCount:s.length}),g=xh(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(oh,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(hh({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",yh[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(uh({activeIndex:t,onClick:f,listType:a}))}):null})),xh=(e=!1)=>({behavior:e?"auto":"smooth"}),vh=d((({className:e,name:t,...n})=>o(Mn,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(Y,{name:t,iconVersion:"",size:"small"})}))),Nh=d((e=>o(vh,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),wh=d((e=>o(vh,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Ch="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Sh=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?kh(t):null,r?o(Nh,{wcmsIgnore:!0,className:u(Ih(i),m?"left-1":"left-0"),onClick:s}):null,l?o(wh,{wcmsIgnore:!0,className:u(Ih(i),m?"right-1":"right-0"),onClick:d}):null]})})),kh=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Ch,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Ch,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Ih=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Th=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const b=Array.isArray(g)?g.length:0,[x,v]=fh({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(oh,{containerRef:x,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Sh,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(y?.length)}),o(bh,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:r,version:t,navButtons:y,containerRef:x,containerScroll:v})]})})),Rh=({blocksToRender:e,...t})=>o(Th,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:E(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",th(!0)),children:T(e,t)},String(n))})}),Eh=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Dh(n,t),o(eh,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Dh(n,t),Rh({...a,blocksToRender:t})]});default:return null}})),Dh=(e,t)=>e&&!t.length?o(Ju,{...e}):null,_h=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Oh=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(Vr,{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))))),Ph=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,_h(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Bh(a)).filter(Boolean))]}),n?o("div",{children:o(Mn,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Bh=e=>([t,n])=>{const a=n?.type;return"array"===a?Mh(t,e)(n):null},Mh=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Oh,{items:a,multiple:!n?.single,...t(e)})]},e)},Ah=e=>e;function Fh(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Lh=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,zh=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Lh(t[e])||Lh(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Lh(t[e])||Lh(n[e])||Vh(t[e])<=Vh(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Lh(t[e])||Lh(n[e])||Vh(t[e]?.min)>=Vh(n[e]?.min)&&Vh(t[e]?.min)<=Vh(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Lh(t[e])||Lh(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Lh(t[e])||Lh(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Vh=e=>Number(e||0),$h=(e,{block:t,page:n,normalize:a=Ah})=>{const i=t?.blocks||[],[r,s]=dn(e),o=l((()=>Fh(i,i.map((e=>qt(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=Ah)=>e?.filter((([,e])=>zh(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},jh={},Wh={},qh=Kt((({className:e,filtrationSchema:t=jh,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=$h(Wh,{block:i.block,page:i.options?.page}),d=o(ma,{className:"w-64",label:n?.title,options:Uh(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Uh(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Ph,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(Mn,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Eh,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Uh=e=>Fh(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Hh=(e=!1)=>e?"text-left":"text-center",Kh={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Yh=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",Kh[t],e),style:{width:r,height:r},role:"figure",children:o(Y,{name:a,width:"54%",...i})}):null})),Gh=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Ee();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Hh(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(Xh)}):null]})})),Xh=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o(Yh,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(ze,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Fe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),Jh=e=>({icon:t,title:n,description:a},i)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(ze,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ie,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(ze,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(i)),Qh=(e,t,n)=>o("div",{className:`grid gap-2xs ${Zh(t)}`,children:e.map(Jh(n))}),Zh=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},ep=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(S,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?Qh(e,a,t):null]}))),tp={start:"justify-start",center:"justify-center",end:"justify-end"},np=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",tp[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Ke(e)})})),ap=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(ze,{size:"text-l",font:"font-light",color:l,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:Je(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),ip=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),rp=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(ap,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(Bc,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(ip,{title:e,...l}),lp={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},sp={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},op=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=lp.prefMonthsNum,prefTravelBonusRate:r=lp.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||sp,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},cp=Kt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=dn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=op(l,n);return o(Ec,{className:e,title:t,...r,children:c("section",{className:u(Dc,e),children:[c("div",{className:_c,children:[Uc({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Uc({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?rp({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Oc,children:[f>=0?o(Bc,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Ke(a,{isVertical:!0}),Vc(i)]})]})})})),dp=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,mp=e=>Wc({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),up=" (c капитализацией)",hp=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:Oc,children:[o(Bc,{title:`Доход в конце срока${r?up:""}`,value:e,postfix:n,prefix:"+"}),o(Bc,{title:`Сумма в конце срока${r?up:""}`,value:t,postfix:n}),Ke(a,{isVertical:!0}),i?.map(Vc)]}),pp={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const gp={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},fp=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?pp[e?.rateType]:"",{data:n}=yi(t?`${$a}/depositrates/${t}`:null,Vt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&yp(s,e)&&td(a,["minSum","maxSum"],e)&&td(n,["minDays","maxDays"],e)))||gp,{rate:m}=d,u=bp(m,e),h=a+u,p=c||[gp];return{...d,...ed(["minSum","maxSum"],p),...ed(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},yp=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,bp=(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)},xp=Kt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:h}]=dn({moneyValue:Lc(l,1e5),daysValue:zc(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),p=fp(m,s),{income:g,finalSum:f,rate:y,depositeName:b}=p;return o(Ec,{className:e,title:t,...d,children:c("section",{className:u(Dc,e),children:[c("div",{className:_c,children:[Uc({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(x={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(_i,{items:[`От ${dp(x.min||0)}`,`До ${dp(x.max||0)}`],step:1,...x})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[vp(p,h),mp({...h("isMonthlyInterestPayment")})]})]}),rp({rate:y,depositeName:b,isShowDepositeName:r}),hp({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var x})),vp=(e,t)=>c("div",{className:"space-y-s",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ba,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ba,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Np=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},wp={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Cp=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?Ip(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[kp({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),kp({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),kp({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),kp({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,td(a,["minSum","maxSum"],t),td(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||wp,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=Sp(p,e),f=a+g,y=t||[wp];return{...m,...ed(["minSum","maxSum"],y),...ed(["minMonths","maxMonths"],y),availableMonths:Np(y.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:r,income:g,finalSum:f}},Sp=(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)},kp=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Ip=(e,t)=>e+Math.round((t-e)/2),Tp=(e="rub")=>"rub"===e,Rp=(e,t)=>{const{minMonths:n,maxMonths:a}=ed(["minMonths","maxMonths"],Op(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ii(i,n,a)}},Ep=(e,t)=>{const{minSum:n,maxSum:a}=ed(["minSum","maxSum"],Op(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ii(i,n,a)}},Dp=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),_p=e=>{const t=Tp(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Op=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Pp=(e,t=!1)=>t?Wc({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,Bp=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[Mp(t("isReplenish"),e,a),Ap(t("isWithdrawn"),e,a),Fp(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?mp(t("isMonthlyInterestPayment")):null,Pp(t("isRemoteRegistration"),e.isShowRemoteRegistration),Lp(t("extraPercent"),n),e.isShowNewClient?o(ba,{text:"Новый сберегатель",...t("isNewClient")}):null]})},Mp=(e,t,n=!1)=>t.isShowReplenish?Wc({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,Ap=(e,t,n=!1)=>t.isShowWithdrawn?Wc({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,Fp=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,Lp=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(ma,{options:t,...e})]}):null,zp={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},Vp={text:"₽",key:"rub"},$p={text:"Без учета надбавки",key:"0"},jp=Kt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Vp],g=r((e=>t=>e?{...t,..._p(t),...Ep(t,e),...Rp(t,e),...Dp(t,e)}:t)(h),[h]),[f,{field:y}]=dn({moneyValue:Lc(d,2e4),monthsValue:zc(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Vp,extraPercent:d?.extraPercent??$p},{normalizer:g}),b=Kp(y),x=Boolean(y?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=Op(h,b),w=Cp(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=r((()=>{Hc({field:y,defParams:Ac(N,x,v),calcParams:w,monthsValue:"minMonths",map:zp})}),[y,h,v]);i((()=>{!ld(d)&&N&&T()}),[d,h]);const R=y?.("extraPercent")?.value?.key,E=Hp(C,R),D=C===Ac(N,x)?.rate&&R===v?.at(-1)?.key;return o(Ec,{className:e,title:t,...m,children:c("section",{className:u(Dc,e),children:[c("div",{className:_c,children:[c("div",{className:"flex gap-m",children:[Uc({className:"w-full",title:`Сумма, ${b?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:b?.text,step:Wp(b?.key)}),h&&h?.length>1?o(ua,{label:"Валюта",options:p,...y("currency")}):null]}),$c({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),Bp({...w,...s},y,v)]}),rp({rate:E,children:Up(T,D)}),hp({income:S,finalSum:k,buttons:[...a,qp(n?.buttons,I)],footnotes:[l],postfix:b?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),Wp=(e="")=>Tp(e)?1e3:100,qp=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},Up=(e,t=!1)=>t?null:o(Mn,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Hp=(e,t)=>Number(e)+Number(t??0),Kp=e=>e?.("currency")?.value??Vp,Yp=e=>Gp({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Gp({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Gp=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Xp={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Jp=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[Xp],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Yp({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Zc(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Zc(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>Yp({row:e,userInputParams:t,paramsViewSettings:n})&&td(a+l,["minSum","maxSum"],e)&&td(r,["minSumOld","maxSumOld"],e)&&td(l,["minSumExtra","maxSumExtra"],e)&&td(i,["minMonths","maxMonths"],e)))||Xp)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:p}=h,g=Kc(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},Qp=Kt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=dn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=Jp(d,n,r),p=l((()=>Mc(n?.rateRows)?.rate),[n?.rateRows]),g=qc({...m("isAnnuity")});return o(Ec,{className:e,title:t,...s,children:c("section",{className:u(Dc,e),children:[c("div",{className:_c,children:[Uc({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),Uc({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),$c({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),Zp({...h,...r},m),h.isExtraMoney?Uc({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(Oc,"@4xl:w-1/2"),children:[o(Bc,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bc,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(Bc,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(Bc,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),Ke(a,{isVertical:!0}),Vc(i)]})]})})})),Zp=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ba,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ba,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ba,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),eg=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=ki(e,{normalize:(e=i)=>n&&a?String(Ii(Number(tg(e)),n,a)):tg(e),format:Je(l)}),d=r((e=>t&&t(tg(e))),[t]);return o(Gn,{onChange:d,...s,...c})})),tg=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),ng=d((e=>o(eg,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(ze,{size:"text-xl",font:"font-light",children:"₽"})})}))),ag={private:"p2p/registerP2P",business:"b2c/registerB2C"},ig=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(zn,{maxWidth:"lg",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 p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},rg=e=>{const t=pn(ig),n=is(),a=Jt(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=Jt(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${$a}/payment/${ag[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,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},lg={amount:1500},sg=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=rg(i),[{amount:s},{field:d,onSubmit:m}]=dn(lg,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(ng,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o(ii,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),og=({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(Y,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),cg="relative h-full",dg={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},mg=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(pg),l=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...a,renderProps:(n,a,i)=>c("div",{className:ug(n,{someCardsHighlighted:r}),children:[T(n,a,{className:hg(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),pg(n)?og({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},ug=(e,{someCardsHighlighted:t})=>u(cg,t&&(pg(e)?"pt-3xl":"pt-16")),hg=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(cg,"min-w-80",dg[a],t&&(pg(e)?"pt-16":"pt-3xl"),th(n),n&&"h-full"),pg=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,gg=Kt((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Th,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?fg(s?.block?.blocks):[],hasBlur:!0,children:mg({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),fg=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],yg={black:"bg-black",white:"bg-white"},bg=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Oe,{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:Ke([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(ze,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(xg)]}):null,i?c(ze,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),xg=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${yg[e]}`},String(t)),vg=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=be()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...ve(i),children:r})})),Ng=[{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"}}],wg=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>Ng.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=He(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),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},Cg(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:Ke(m,{className:Sg(s??!1,i??!1,n),buttonClassName:h})}),l?o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),Cg=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Sg=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),kg=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:b=true,isImageSecondary:x=!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(vg,{href:i,target:m,className:"h-full",data:Du(v),children:c(Oe,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...ot(He(r)?o(ie,{image:r}):null,y),buttons:d.length?o(wg,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:x,imageAlign:"center",children:[o(Ue,{benefits:f}),s?o(Fe,{__html:s,isDotted:l,itemSize:"list-s"}):null,Ig(a,p)]})})}))),Ig=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Tg=new he,Rg=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(ze,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(ze,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Ke(i)}):null]},String(t))},Eg=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...y})=>{const b=l((()=>h.map(Rg)),[h]),[x,v]=l((()=>m>0?[b.slice(0,m),b.slice(m)]:[b,[]]),[m,b]),[w,C]=a(!1);i((()=>Tg.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=r((()=>{Tg.fire("fold",{type:"fold",isUnfolded:!w,parent:p?.parent})}),[w,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(ke,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(ro,{children:[c("div",{children:[x,o(lo,{isUnfolded:w,children:v})]}),h.length>=m?o(io,{className:"mt-m",label:w?"Скрыть":"Подробнее о тарифе",isUnfolded:w,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:x})]})})),Dg=d((({text:e,value:t})=>c("div",{className:"space-y-xs w-full",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}),o("div",{className:"w-full text-2xl bg-main-gray px-4 py-3 rounded-md",children:Je()(t)})]}))),_g=d((({cashbacks:e})=>{const{mounth:t,year:n}=Og(e);return c("div",{className:"w-full flex flex-col gap-lg",children:[o(N,{className:"text-left",headingType:"h5",as:"h2",title:"Результат расчета"}),o(Fe,{__html:'Категории покупок для расчета баллов предварительные.<br />Подробнее по условиям и начислениям можно узнать во вкладке <a href="#docs">документы</a>'}),c("div",{className:"flex flex-col @xs:flex-row gap-lg",children:[o(Dg,{text:"Баллов в месяц",value:t}),o(Dg,{text:"Баллов в год",value:n})]})]})})),Og=e=>e.reduce(((e,t)=>{const n=Number(t.percent.key)/100*t.sum;return{mounth:Math.min(e.mounth+n,5e3),year:Math.min(e.year+12*n,6e4)}}),{mounth:0,year:0}),Pg=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"},{text:"Категория 5%",key:"5"},{text:"Категория 10%",key:"10"},{text:"Категория 15%",key:"15"}],Bg=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"}],Mg=d((({categories:e,cashback:t,showIncreasedPercents:n,maxInputRange:i,deleteImage:r,onDelete:l,onChange:s})=>{const[d,m]=a(Ag(e)),u=0===t.id;return c("div",{className:"w-full space-y-m",children:[c("div",{className:"space-y-xs",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:"Выберите категорию"}),c("div",{className:"flex gap-m",children:[o(ma,{className:"w-full",isManualInput:u,placeholder:"Выберите категорию",options:Fg(u,n),value:t.percent,onChange:e=>{s({...t,percent:e})}}),u?null:o(Mn,{version:"secondary",onClick:()=>l(t.id),shape:"round",className:"px-4 rounded-md",children:o(ie,{image:r})})]})]}),e?.length&&!u?o(ma,{label:"Выберите категорию покупок",placeholder:"Выберите категорию покупок",options:e,value:d,onChange:m}):null,o(_i,{step:500,title:"Сумма покупок в категории",min:0,max:i,value:t.sum,onChange:e=>{s({...t,sum:e})}})]})})),Ag=e=>e?.[(new Date).getTime().toString().slice(-1)],Fg=(e,t)=>e?[]:t?Pg:Bg,Lg=[{id:0,percent:{text:'Категория 1% "На всё"',key:"1"},sum:5e3}],zg={href:"/natural/debetcards/svoya-plus",text:"Оформить карту",target:"_self"},Vg=["5","10","15"],$g=d((({maxInputRange:e=3e5,image:t,deleteImage:n,infoImage:i,className:r="",button:l=zg,...s})=>{const{cashbacks:d,categories:m,onAddNewCashback:h,onChangeCashback:p,onDeleteCashback:f,onResetCashback:y}=(()=>{const{data:e}=ec("CASHBACK_CATEGORY"),[t,n]=a(Lg);return{cashbacks:t,categories:e?.map((e=>({key:e.key||"",text:e.value})))||[],onAddNewCashback:()=>n((e=>[...e,{id:e[e.length-1].id+1,percent:{text:"Категория 1,5%",key:"1.5"},sum:5e3}])),onChangeCashback:e=>n((t=>t.map((t=>t.id===e.id?e:t)))),onDeleteCashback:e=>n((t=>t.filter((t=>t.id!==e)))),onResetCashback:()=>n(Lg)}})(),b=t?.src?o(ie,{image:t,className:"hidden w-full @xl:block",imageClassName:"justify-self-center"}):null;return c(g,{className:u("flex flex-col justify-center items-center gap-lg",r),defaultPadding:u("p-6xl"),...s,children:[o(S,{title:"Калькулятор расчета баллов",description:"Можно выбрать не более 5 категорий, одна из них из повышенной категории",headlineVersion:"XL",isEmbedded:!0}),c("div",{className:"flex flex-row items-start gap-lg",children:[c("div",{className:"w-full flex flex-col justify-center items-center gap-lg",children:[d.map((t=>o(Mg,{categories:m,cashback:t,showIncreasedPercents:Wg(t,d),maxInputRange:e,deleteImage:n,onDelete:f,onChange:p},String(t.id)))),jg(d.length,h,y),o(_g,{cashbacks:d}),o(fc,{__html:"<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров. Подробнее в <a href='#docs'>документах</a></p>",image:i}),o(ke,{className:"w-full @lg:w-auto self-start",href:l.href,text:l.text,target:l.target,version:"primary"})]}),b]})]})})),jg=(e,t,n)=>c("div",{className:"w-full flex flex-col gap-lg",children:[e<5?o(Mn,{className:"self-start text-primary-main",embedded:!0,version:"secondary",onClick:t,children:"Добавить еще"}):null,e>2?o(Mn,{className:"self-start",version:"secondary",onClick:n,children:"Сбросить все категории"}):null]}),Wg=(e,t)=>Vg.includes(e.percent.key)||!t.some((e=>Vg.includes(e.percent.key))),qg=d((({className:e,contacts:t,info:n,version:a="secondary",...i})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...i,children:[n?.length?Ug(n):null,t?.length?Ug(t):null]}))),Ug=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Hg({column:e,i:t})))}),Hg=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:a},i)=>c("div",{children:[o(S,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(a?.text)}),children:Ke([a])})]},String(i))))},`col-${String(t)}`):null,Kg=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 pr-m text-gray",children:t}):null]})]}))),Yg=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(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(Kg,{step:a,showPercentage:!1})]})})}));var Gg;!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"}(Gg||(Gg={}));const Xg=e=>Fs("/user-data/getTaskStatus","POST",e),Jg=async e=>{const t=await Fs("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},Qg=d((({title:e,interval:t=0,onEnd:n=_n})=>{const[i,r]=a(t);Ol({seconds:t,onTick:r,onEnd:n});const l=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) ${l}%, 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(Fl,{seconds:i})})]})]})})),Zg=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=_n,...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(Qg,{interval:s,onEnd:d}):null]}),o(ef,{title:n,items:a}),o(ef,{title:i,items:r,countColumns:!0}),l?o(si,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),ef=({title:e,items:t,countColumns:n=!1})=>{const a=Ee();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Rl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:tf(e)},t)))}):null]})]}):null},tf=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),nf=d((()=>o(Zg,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),af=d((({onExpire:e})=>{const{statusInfo:t}=rc();return o(Zg,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),rf=d((()=>{const{statusInfo:e}=rc(),t="courier"===e?.methodObtain;return o(Zg,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),lf=d((()=>{const{statusInfo:e}=rc();return o(Zg,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:sf(e),buttonText:"Вернуться на главную"})})),sf=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:ja(e?.deliveryDate)}]):t},of=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],cf=d((()=>{const[e,t]=a(Gg.process),{taskId:n}=rc();i((()=>{(async()=>{for(const e of of)await Jg({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await Xg({taskId:n});a&&a?.statusCd!==Gg.process&&(e(),t(a.statusCd))}),[n]);_l(l,3e4);const s=r((()=>t(Gg.rework)),[]);return df(e,s)})),df=(e,t)=>({IN_PROCESS:o(af,{onExpire:t}),CANCELLED:o(nf,{}),FAILED:o(nf,{}),DRAFT:o(nf,{}),APPROVED:o(lf,{}),PRE_DECISION:o(lf,{}),REVISION:o(rf,{})}[e]||o(rf,{})),mf=e=>t=>t.filter((e=>e)).map((t=>[uf(t,e),ff(t,e),hf(t,e),pf(t,e),gf(t,e)].some(Boolean)?{...t,required:!1}:t)),uf=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,hf=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,pf=({name:e},t)=>"addressFact"===e&&t("addressMatch"),gf=({condition:e},t)=>e?.name&&e?.values?.every((n=>{const a=t(e?.name);return n!==(a?.key??a)})),ff=({name:e},t)=>"snils"===e&&!t("snils")&&yf(t),yf=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,bf={...Fm,...Lm},xf=({field:e,inputs:t,params:n})=>t.map(Tl(e,n,bf)),vf=({sections:e,field:t,params:n})=>e?.map((({inputs:e=[],columns:a,title:i,condition:r},l)=>{const s=mf(Nf(t))(e),c=[gf({condition:r},Nf(t))?null:El(i),...xf({field:t,inputs:s,params:n})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return c.length?o("div",{className:u(Rl(a),"grid gap-x-m"),children:c},`section-${l}`):null})),Nf=e=>t=>e(t)?.value,wf=({formState:e,inputs:t,productType:n})=>{return Rn(mf((t=>e[t]))(t),{..._s,limitedBirthday:Ts(n),dulIssueDate:(i=e.limitedBirthday,Cs(14,i)("Укажите дату выдачи паспорта")),generalSeniority:(a=e.lastJobExperience,ln((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)&&(!a||Number(e)>=Number(a))))("Укажите количество лет стажа")),beginDate:Ns(e.limitedBirthday),participantDateRegistration:ws(e.limitedBirthday),organizationName:Ss(e.isDadataOrganization),inn:ks(e.isDadataOrganization)})(e);var a,i},Cf=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Mn,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(ii,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Sf=(e,t,n)=>({...n[e],...t,limitedBirthday:kf(t?.limitedBirthday),dulIssueDate:kf(t?.dulIssueDate),participantDateRegistration:kf(t?.participantDateRegistration),beginDate:kf(t?.beginDate),deliveryDate:kf(t?.deliveryDate)}),kf=e=>{try{return e?new Date(e):void 0}catch(e){return}},If=(e=!1)=>[{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:"",isDadataOrganization:!1,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:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0}],Tf=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...If(),{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Rf=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Ef=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return"RETIREE"===n?.key?{employmentTypeCd:n}:{employmentContractDate:ja(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:gu({organizationPhone:p&&Wa(p)}),participantAddresses:fu({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},Df=e=>{const{limitedBirthday:t="",sex:n,birthPlace:a,dulIssueDate:i="",dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o,education:c,participantDateRegistration:d,housing:m,addressRegistration:u,addressFact:h,addressMatch:p}=e;return{birthDate:ja(t,!0),birthPlace:a,dulIssueDate:ja(i,!0),dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o?.replace("-",""),educationLevelCd:c,registrationDate:d?ja(d,!0):void 0,homeMatchFlg:p,houseTypeCd:m,participantAddresses:fu({addressRegistration:u,addressFact:p?u:h}),genderCd:n?{key:"male"===n?"MAN":"WOMAN"}:void 0}},_f=e=>e?new Date(e).toISOString().split(".")[0]:"",Of=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:_f(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},Pf=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Bf=(e,t)=>{switch(e){case 0:default:return{};case 1:return Df(t);case 2:return Ef(t);case 3:return yu(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:fu({addressCourier:t})}:{}})(t)}},Mf=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=nn(!1),o=5===e,c=rc(),d=l((()=>Sf(e,c.leadForm,Tf)),[e,c.leadForm]),m=r((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=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await Km((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...Pf(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Bf(i,a)}],...Rf(a),...Of(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Af=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{os();const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((e=>wf({formState:e,inputs:s,productType:"creditCard"})),[s]),[m,u,h]=Mf({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=dn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[vf({sections:t,field:p}),o(Cf,{isSending:h,step:e,onPrevStep:n})]})})),Ff=[{title:"Персональные данные",columns:2,inputs:[{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"sex",required:!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}]}],Lf=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...Ff,{inputs:[{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 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"employerActivities",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"generalSeniority",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"lastJobExperience",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"experience5Years",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"positionOrganization",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{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"}]}],[{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"]}}]},{columns:2,inputs:[{condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode"}]}]],zf=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Vf=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Fu,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=Lf[n],[f,{setTrue:y}]=nn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(Yg,{stepsTitles:zf,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(cf,{}):o(Af,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:y},String(n))})]})})})),$f=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>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(Kg,{step:a,showPercentage:!1})]})})})),jf=async e=>{await Ls("/camunda/send/message","POST",e)},Wf=d((()=>o(Zg,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),qf=d((({onExpire:e})=>{const{statusInfo:t}=rc();return o(Zg,{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})})),Uf=d((()=>{const{statusInfo:e}=rc();return o(Zg,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Hf=d((()=>{const{statusInfo:e}=rc();return o(Zg,{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:"Вернуться на главную"})})),Kf=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Yf=["CREATE_APPLICATION_SHORT_MESSAGE"],Gf=d((()=>{const e=Bs(),[t,n]=a(Gg.process),{taskId:l}=rc();i((()=>{(async()=>{if(e)for(const e of Yf)await jf({messageName:e,taskId:l});else for(const e of Kf)await Jg({signalType:e,taskId:l})})()}),[l]);const s=r((async e=>{const t=await Xg({taskId:l});t&&t?.statusCd!==Gg.process&&(e(),n(t.statusCd))}),[l]);_l(s,3e4);const o=r((()=>n(Gg.rework)),[]);return Xf(t,o)})),Xf=(e,t)=>({IN_PROCESS:o(qf,{onExpire:t}),CANCELLED:o(Wf,{}),FAILED:o(Wf,{}),DRAFT:o(Wf,{}),APPROVED:o(Hf,{}),PRE_DECISION:o(Hf,{}),REVISION:o(Uf,{})}[e]||o(Uf,{})),Jf=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Mn,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(ii,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),Qf={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},Zf=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Qf[a?"annuity":"differential"]}},ey=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},ty=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Df(t);case 2:return Ef(t);case 3:return yu(t);default:return{}}},ny=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...If(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],ay=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=nn(!1),o=4===e,c=rc(),d=l((()=>Sf(e,c.leadForm,ny)),[e,c.leadForm]),m=r((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=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i){const t=await Km((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>{const r=Bs(),l={id:e,...!r&&{profile:{id:n}},roleCd:{key:"BORROWER",value:"Заемщик"},...ty(i,a)};return{sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,...r?{participant:l}:{participants:[l]},...Zf(a),...ey(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}})({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},iy=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=rc();os();const m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=r((e=>wf({formState:e,inputs:u,productType:"credit"})),[u]),[p,g,f]=ay({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:b}]=dn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:b,className:"space-y-m",children:[vf({sections:t,field:y,params:{calcData:m}}),o(Jf,{step:e,isSending:f,onPrevStep:a})]})})),ry=[[{columns:1,inputs:[{name:"calculator"}]}],[...Ff,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{columns:2,inputs:[{name:"bankEmployeeCode"}]}]],ly=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],sy=Kt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(Fu,[]);const h=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),p=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=ry[l],y=0===l,[b,{setTrue:x}]=nn(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o($f,{stepsTitles:ly,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:b?o(Gf,{}):o(iy,{step:l,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:x},String(l))})]})})})),oy=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=e===t?100:85;return c("div",{className:"py-lg px-5xl bg-white col-span-12",children:[n[e]||null,o(Kg,{step:a,showPercentage:!1})]})})),cy=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,...r})=>c(g,{...r,children:[o("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"})}),o(dy,{items:n}),a?o(ke,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(ke,{href:"/natural/debetcards",text:"Заполнить заново",version:"primary",className:"w-full mt-lg"}),o(ke,{href:"https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault",text:"Перейти в интернет банк",version:"primary",className:"w-full mt-lg"})]}):null]}))),dy=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:my(e)},t)))}):null]})]}):null,my=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),uy=d((()=>{const{leadForm:e}=rc();return o(cy,{title:`${e?.name} ${e?.middleName},`,description:"Информация о Вас уже есть в системах Банка, обратите внимание на корректность заполнения паспортных данных",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:ja(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),hy=d((()=>o(cy,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),py=d((()=>o(cy,{title:"Не закрывайте заявку",description:"Идёт проверка данных"}))),gy=d((()=>o(cy,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),fy=d((({isOffice:e})=>o(cy,{title:"Заявка принята",description:e?"Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную"}))),yy=d((()=>{const[e,t]=a(Gg.process),{taskId:n,statusInfo:r,programId:l}=rc(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await Jg({signalType:"FIND_PERSON_SIGNAL",taskId:n});o&&await Jg({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||Gg.notFound)})()}),[n]),by(e,o,s)})),by=(e,t,n)=>({IN_PROCESS:o(py,{}),NOT_FOUND:o(hy,{}),CLIENT_NOT_OK:o(hy,{}),DBO_CLIENT:o(n?gy:uy,{}),PRE_DECISION:o(fy,{isOffice:t})}[e]||o(fy,{isOffice:t})),xy=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Mn,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(ii,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),vy=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressMatch:!0,addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},currency:"810",codeWord:"",latinName:"",latinSurname:""}],Ny=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:_f(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},wy=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},Cy=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:fu({addressCourier:t})}:{}})(t);case 1:return Df(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},Sy=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=nn(!1),o=2===e,c=rc(),d=l((()=>Sf(e,c.leadForm,vy)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:fd[a]},...wy(n),participants:[{id:e,residentOtherCountry:!1,...Cy(i,n)}],...Rf(n),...Ny(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),Ls("/user-data/updateUserTaskDebit","PUT",r)),o||"courier"===a.methodObtain?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},ky=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{os();const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((e=>wf({formState:e,inputs:s,productType:"debitCard"})),[s]),[m,u,h]=Sy({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=dn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[vf({sections:t,field:p}),o(xy,{step:e,isSending:h,onPrevStep:n})]})})),Iy=[[{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}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Ожидайте звонка для согласования даты и времени доставки карты"}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],[...Ff,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[],condition:{name:"addressMatch",values:[!1]}},{inputs:[{name:"addressFact",required:!0,dadata:!0,condition:{name:"addressMatch",values:[!1]}}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[]},{columns:2,inputs:[{name:"latinName"},{name:"latinSurname",required:!0}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения."}]},{inputs:[{name:"codeWord",required:!0}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию."}]}]],Ty=["","Персональные данные","Платежная система"],Ry=Kt((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Fu,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=Iy[n],f=0===n,[y,{setTrue:b}]=nn(!1),x=r((()=>{b(),m()}),[]);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(oy,{stepsTitles:Ty,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(yy,{}):o(ky,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),Ey=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Dy=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),_y=1e9,Oy={sum:{min:1e4,max:_y},period:3},Py=Kt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=$h(Oy,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:By(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=My(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(Ph,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(ng,{label:a?.title,min:500,max:_y,...d("sum",{parse:e=>({min:Number(e),max:_y}),format:({min:e})=>String(e)})}),o(_i,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Eh,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),By=e=>$t((e?.paramsSource?.rateRows||[]).filter(Ey).flatMap((e=>Dy(e.minMonths,e.maxMonths)))),My=e=>$t(e.flatMap((e=>e||[])).filter(Ey).flatMap((e=>Dy(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Ay=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,Fy=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:Ay(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(ke,{version:i?.version,text:i?.text,...i}):null]}))),Ly=`${$a}/region`;function zy(e="Москва"){return ic().location??{name:e}}function Vy(e="Москва"){const t=ic(),n=r((async()=>{if(!t.location){const n=await zt(Ly);t.location=n??{name:e}}}),[t,e]);return yi(Ly,n),t}var $y;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}($y||($y={}));const jy=new Intl.NumberFormat("ru",{style:"currency",currency:$y.RUB}),Wy=e=>e?jy.format(e):"",qy="text-m font-light text-secondary-text ",Uy=`${qy} text-left`,Hy=`${qy} pl-5xl text-center`,Ky=`${qy} pl-5xl text-right`,Yy={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Gy=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Uy,children:o(ze,{size:"text-m",children:"Валюта"})}),o("th",{className:Hy,children:o(ze,{size:"text-m",children:"Купить"})}),o("th",{className:Ky,children:o(ze,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Xy)})]}))),Xy=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:Yy[t]},width:"24",height:"24"}):null,o(ze,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(ze,{size:"text-h6",children:Wy(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(ze,{size:"text-h6",children:Wy(e?.buyExchangeRate)})})]},t)},Jy={icon:"GpsIcon"},Qy=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Yh,{...Jy,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Zy=(e,t,n)=>{const a=Number(eb(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)},eb=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function tb(e){if(!e)throw new Error("Value should be fulfilled");return e}const nb=e=>t=>{const[,n]=tb(e.find((([e])=>e(t))));return n(t)},ab=e=>nb(e.map((([e,t])=>[e,()=>t])));ab.if=e=>new ib(void 0,e);class ib{parent;predicate;unit;get entry(){return[tb(this.predicate),tb(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new ib(this,e)}then(e){return new ib(this.parent,this.predicate,e)}else(e){return nb([...rb(this),[()=>!0,e]])}}const rb=e=>[...e?.parent?rb(e.parent):[],e.entry],lb=e=>ab([[e=>e.value!==$y.RUB&&e.oppositeValue!==$y.RUB,()=>e.handleConvert(e.value,$y.RUB)],[e=>e.value===$y.RUB&&e.oppositeValue===$y.RUB,()=>e.handleConvert(e.value,$y.USD)],[e=>e.value===$y.RUB&&e.oppositeValue===$y.RUB,()=>e.handleConvert(e.value,$y.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function sb(e){const{placeholder:t,rates:n,selected:a,value:i,onChange:r,setSelected:l}=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(Gn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:r}),s.length?o(ma,{className:"absolute right-0",isBorder:!1,onChange:e=>l(e.key),options:s,value:d}):null]})}const ob=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[l,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||$y.RUB,selectBuy:n?.[0]?.currency?.currency||$y.USD}),d=r((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:[sb({placeholder:"Хочу продать",rates:n,selected:l.selectSell,setSelected:cb(l,d,n),value:l.inputSell,onChange:e=>mb(d,n)(e,l.selectSell,l.selectBuy)}),sb({placeholder:"Получу",rates:t,selected:l.selectBuy,setSelected:db(l,d,t),value:l.inputBuy,onChange:e=>ub(d,t)(e,l.selectBuy,l.selectSell)})]}):null,i?.text?o(ke,{text:i.text,version:i?.version,...i}):null]})})),cb=(e,t,n)=>a=>{t({selectSell:a}),lb({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{mb(t,n)(e.inputSell,a,i)}})},db=(e,t,n)=>a=>{t({selectBuy:a}),lb({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>ub(t,n)(e.inputBuy,a,i)})},mb=(e,t)=>(n,a,i)=>{e({inputSell:eb(n),selectBuy:i});const r=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;r&&e({inputBuy:String(Zy(n,r,a===$y.RUB)||"")})},ub=(e,t)=>(n,a,i)=>{e({inputBuy:eb(n),selectSell:i});const r=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;r&&e({inputSell:String(Zy(n,r,a===$y.RUB)||"")})},hb=`${$a}/exchangerates`;const pb=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=yi(hb+`?regionCode=${t}`,Vt);return n||{}}(zy()),r=i?.exchangeRate?.currencies?.filter((e=>0!==e.buyExchangeRate||0!==e.saleExchangeRate)),l=gb(r),s=l.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:$y.RUB}});const d=l.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:$y.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Oe,{className:"h-full",title:o(N,{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(Gy,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Qy,{address:i?.address})]}),o(ob,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),gb=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],fb=d((({className:e,items:t})=>{const n=be();return o("ul",{className:u("w-full",e),children:t?.map(yb(n))})})),yb=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...ve(t),children:i||null})},String(a)):null},bb=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),xb=["all","footer"],vb=Boolean(J.SINGLE_SEARCH_INDEX),Nb=d((({className:e,navigationItems:t,isSearchPanel:n=!1})=>{const a=be(),i=t?.filter(bb(xb))?.map(a)??[],[r]=i;return o("div",{className:"space-y-2 lg:order-2",children:o("div",vb&&n?{children:o(fb,{className:"block columns-3 space-y-3 gap-x-6xl",items:r?.items})}:{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-m",e),children:i?.map(wb)})})})),wb=(e,t)=>{const{text:n,items:a=[],href:i,target:r="_self",onClick:l,dataFooter:s}=e,d=a.filter(bb(xb));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:i,target:r,onClick:l,...ve(s),children:n}),d?o(fb,{className:"flex flex-col gap-s",items:d}):null]},String(t))},Cb=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Sb)}):null)),Sb=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(ze,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(kb)})]},String(t)),kb=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Ib(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Ib=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Tb(t)}`,children:o(ze,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Tb=e=>e.replaceAll(/\D/g,""),Rb=d((({className:e="",index:t,text:n,...a})=>{const i=be(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),Eb=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(ze,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Rb,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),Db="w-full lg:w-52";function _b(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Ob=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 r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const Pb=(e,t)=>(n,a)=>{for(const[i,r]of a)n.set(i,e(n.get(i)||t,r));return n},Bb=(e=[])=>e.reduce(((e,t)=>e+t),0),Mb=J.SEARCH_LANG,Ab=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&("en"===Mb?!/[а-яА-ЯёЁ0-9]/.test(e):!/[0-9a-z]/.test(e)))),Fb=e=>t=>e.map((([e,n])=>[Ob(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>zb(t,e))).reduce(Pb(Math.max,0),new Map),Lb=e=>t=>{return Fh(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Ab(t||"");return n.length?Bb(e.map((e=>Xc(n.map(Ob(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},zb=(e,t)=>new Map(e.map((e=>[e,t]))),Vb=({basePathList:e,initialQuery:t=""})=>{const[n,r]=a(t||""),l=_();i((()=>{null!=t&&r(t)}),[t]);const{data:s}=yi(e?.length?e:null,$b(l)),[o,c]=a(null);return _b((()=>{s&&c(s.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Ab(e);if(!i.length)return[];const r=Object.entries(a),l=[...i.map(Fb(r)).reduce(Pb(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Lb(i)(l)})(n)))}),[s,n]),[o,{value:n,onChange:r}]},$b=e=>async(...t)=>(await Promise.allSettled(t.map((async e=>[e,await zt(L(e,"search.index.json"))])))).map((e=>"fulfilled"===e.status?e.value:[])).map(jb(e)),jb=e=>([t,n])=>n?{...n,corpus:n.corpus?.map((n=>({...n,uri:"index"===n.uri?t:q(e)(n.uri,t)})))}:{},Wb=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:l="Поиск по сайту"})=>{const s=r((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:l,autoFocus:n,onChange:s,onFocus:i})]})})),qb=Boolean(J.SINGLE_SEARCH_INDEX),Ub=d((({initialQuery:e,navigationItems:t,onClose:n})=>{const a=Q(J.SITE_URL),i=l((()=>qb?[a]:t?.map((e=>e.href||"/"))),[t]),[r,s]=Vb({basePathList:i,initialQuery:e}),c=l((()=>Hb(t)(r)),[t,r]);return o(zn,{maxWidth:"none",head:o(Wb,{className:"mt-s",autoFocus:!0,...s}),onClose:n,children:o(Nb,{navigationItems:c,isSearchPanel:!0})})})),Hb=e=>t=>e?.length&&t?.length?Fh(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:L("/",t)})))}))):[],Kb=d((({className:e,search:t,...n})=>{const[i,l]=a(""),s=r((()=>l("")),[]),d=pn(Ub,n),m=r((e=>{l(e),Yb(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Wb,{value:i,placeholder:t?.placeholder,onChange:m}),o(An,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),Yb=e=>e&&e.length>=3,Gb=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...r}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Zm,{className:Db,logo:r,data:i,showTitle:!1}),o(Kb,{className:"grow",navigationItems:t,...e})]})},Xb=d((({className:e="",index:t,...n})=>{const a=be(),{href:i,target:r,text:l,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-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),Jb=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(ze,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(Xb,{index:t,...e},String(t))))}):null]}))),Qb=Kt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},i=n.options?.page?.common??{},{documents:r,relatedEnterprises:l,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[Gb(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Nb,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Db,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Cb,{items:s}),h?o(ke,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(wg,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(si,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Eb,{title:m,links:l}),o(Jb,{links:r,license:p})]})})),Zb=(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=[1,2,3,4],nx={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},ax=Kt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...h})=>{const p=(e=>{const[t,n]=a(e.blocks??[]),r=is(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",ex[n],e),padding:t,version:s,isTheme:c,...h,children:D({...h,block:{...m,blocks:p},renderProps:ix({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>nx,allowRemoveChild:e=>(e?.blocks??[]).length>5}),ix=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>T(n,{...a,blockDecorator:rx(a.blockDecorator,i)},{className:u("w-full",th(t)),...Zb(e)}),rx=(e,t=0)=>(n,a)=>e?.({...n,render:e=>sx(t)({...n,...e},a)},`wrap_${a}`)??sx(t)(n,a),lx=e=>Number(e)<5?"":"hidden",sx=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return tx.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(vg,{...r.content?.link,className:u(lx(e),(l=e,tx.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},ox=Kt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{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",...l,children:c("div",{className:"container space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(ua,{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(si,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:Du(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})}));function cx(e=[]){const t=_(),n=Array.from(e.entries()).filter((([,e])=>dx(t)(e)));return n.find((([,e])=>dx(t,!0)(e)))??n[n.length-1]??[]}const dx=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(mx(e)(n));return t?a===F(n):a.startsWith(F(n))},mx=e=>t=>{const n=Q(J.SITE_URL);return B(t)?globalThis?.location?.href:L(n,e.pathname)},ux={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},hx=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:h="",ref:p})=>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":`${ux[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...px(h),...ve(s),ref:p,children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),px=e=>e?{"data-test-id":e}:null,gx=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=nn(!1),d=tn(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(hx,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),fx=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a,renderDropdownItem:i=bx,handlers:r,onItemClick:l})=>{const s=Ee();return o("div",{ref:e,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{"max-w-max":s}),"aria-label":a,children:t?.map(((e,t)=>i({item:e,i:t,activeItem:n,handlers:r,closeDropdown:l})))})},yx=d((({isActive:e,...t})=>{const n=be(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...ve(t?.data),children:a})})),bx=({item:e,i:t,activeItem:n})=>o(yx,{isActive:e===n,...e},e?.text??String(t));function xx({items:e,activeItem:t,onClose:n,isOpen:a,onHover:l=!1,renderDropdownItem:c,handlers:d}){const m=sa();i((()=>{a&&(m.close(),n?.())}),[a]);const u=r((()=>{m.close(),n?.()}),[n]),h=s(null),p=s(null),g=Hn(u),f=l?p:g;return i((()=>{if(!a||!h.current||!e?.length)return;const n=h.current,{top:i,left:r,width:l,height:s}=n.getBoundingClientRect();m.open({popup:o(fx,{dropdownRef:f,items:e,activeItem:t,renderDropdownItem:c,handlers:d,onItemClick:u}),top:i+window.scrollY+s,left:r,width:l})}),[a,e,u]),i((()=>(l&&f.current?.addEventListener("mouseleave",u),()=>{f.current?.removeEventListener("mouseleave",u)})),[l,f.current,a]),h}const vx=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[i,{setFalse:r,toggle:l}]=nn(!1),s=xx({items:t,onClose:r,isOpen:i,activeItem:n});return o("div",{className:u(i?"rounded-md shadow-blue-gray":"",e),ref:s,role:"navigation",children:o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:l,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))})})})),Nx={text:"Отправить заявку",version:"primary"},wx={text:"Согласен на обработку персональных данных",href:"/privacy-policy",target:"_blank"},Cx=({onClose:e=_n})=>o(zn,{onClose:e,position:"corner",children:o("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:o("div",{className:"container grid grid-cols-12",children:o(Yl,{className:"col-span-12 pt-0",endpoint:"callback",title:"Заказать обратный звонок",sections:[{inputs:[{name:"questionProduct",required:!0},{name:"callbackTime",required:!0,label:"Когда перезвонить?"},{name:"russianPhone",required:!0},{name:"consentDataProcessing",required:!0}]}],button:Nx,link:wx,onSuccess:e})})})}),Sx=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:r="large"})=>{const[l,{setFalse:s,toggle:c}]=nn(!1),d=Ix(P.QUICK_ACTIONS??[]),m=Tx(),h=Ee(),p=xx({items:d,onClose:s,isOpen:l,onHover:!h,renderDropdownItem:kx,handlers:m});return i((()=>{if(!h)return p.current?.addEventListener("mouseenter",c),p.current?.addEventListener("mouseleave",s),()=>{p.current?.removeEventListener("mouseenter",c),p.current?.removeEventListener("mouseleave",s)}}),[]),o("div",{ref:p,children:o(hx,{image:{icon:"CallbackIcon",iconVersion:e},ariaLabel:n,buttonSize:r,isGrayBg:!0,version:a,className:u(l?"shadow-blue-gray":"",t),onClick:c})})})),kx=({item:e,handlers:t,closeDropdown:n=_n})=>{const a={call:{handler:()=>{t?.call(),n()},text:"Заказать звонок"},chat:{handler:()=>{t?.chat(),n()},text:"Написать в чат"}};return o("button",{className:u("text-l font-light pb-m hover:text-primary-main text-left"),role:"link",onClick:a[e?.text??""].handler,children:a[e?.text??""].text},e?.text??"")},Ix=e=>e.map((e=>({text:e}))),Tx=()=>{const e=pn(Cx),t=r((()=>{e.open({onClose:()=>e.close()})}),[]),n=tn();return{call:t,chat:r((e=>{const t=n.openChatBot;t&&e&&t(e).finally()}),[])}},Rx=d((({className:e="",active:t,dataItemName:n,children:a,data:i,...r})=>{const l=be(),{href:s,target:d,text:m,onClick:h}=l(r);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...ve(i),children:[o("span",{className:Ex(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Ex=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Dx=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,items:l,activeItem:s,...c})=>{const[d,{setFalse:m,setTrue:u}]=nn(!1),h=ih(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e),p=xx({items:l,onClose:m,isOpen:d,activeItem:s,onHover:!0});return i((()=>(p.current?.addEventListener("mouseenter",u),p.current?.addEventListener("mouseleave",m),()=>{p.current?.removeEventListener("mouseenter",u),p.current?.removeEventListener("mouseleave",m)})),[]),o("div",{className:"inline-block",ref:p,children:o("span",{ref:h,className:a,role:"menuitem",children:o(Rx,{...c,children:n})})})})),_x={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"},Ox=d((({version:e,text:t,mobileText:n,...a})=>{const i=Ee()?n:t;return i?o(ke,{className:u("py-s px-lg font-light whitespace-nowrap",_x["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Px=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:r})=>{const d="transparent"===t?"white":"black",[,m]=cx(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},y=l((()=>e.map(((e,t)=>e=>{h(e?Bx(t):Mx(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(Dx,{className:u-1<t?"invisible":"",active:e===m,activeItem:m,observerOptions:f,onVisibilityChange:y[t],data:e.dataHeader,...e},String(t))))}),p.length?o(vx,{items:p,activeItem:m,ariaLabel:i}):null,o("div",{children:P.QUICK_ACTIONS?o(Sx,{version:t,iconVersion:d,ariaLabel:r}):null}),P.CHAT_BOT&&!P.QUICK_ACTIONS?o(gx,{version:t,iconVersion:d,ariaLabel:r}):null,o(Ox,{version:t,...n})]})})),Bx=e=>t=>Math.max(t,e+1),Mx=e=>t=>Math.min(t,e),Ax=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(Fx,{...e},String(t))))})]}):null,Fx=d((({icon:e,...t})=>{const n=be(),{text:a,target:i,href:r,onClick:l}=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:r,target:i,onClick:l,children:o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Lx=(e,t)=>n=>n.name?o(vg,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Du(e,n.name),children:o(ze,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,zx=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"})]}))),Vx=d((({defaultLocation:e})=>{const t=zy(e),n=be(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(vg,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),$x=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Vy(t?.default),[s,d]=a(""),m=cl(),u=l((()=>qx(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=l((()=>((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,Wx)),[u]),p=r((e=>{i.location=e,n?.()}),[i,n]);return c(zn,{maxWidth:"none",head:jx(s,d,t),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Ob(e.toLowerCase())(s.toLowerCase())>=.8)).map(Lx(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(ze,{size:"text-h6",children:e})}),t.map(Lx(f,g))]},e)))}),Ax(e)]});var g,f})),jx=(e,t,n)=>c("div",{children:[o(ze,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Vx,{defaultLocation:n?.default}),o(zx,{onSearch:t,searchTerm:e})]}),Wx=e=>e.name?.charAt(0)??"",qx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Ux=d((({className:e="",active:t,flat:n,children:a,data:i,...r})=>{const l=be(),{href:s,target:c,text:d,onClick:m}=l(r);return o("a",{className:u(Hx(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...ve(i),children:o("span",{suppressHydrationWarning:!0,className:Kx(t,n),children:d||a})})})),Hx=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),Kx=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Yx=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",i=zy(n?.branches?.default),l=pn(Ub,n),s=pn($x,n),d=r((()=>l.open({})),[l]),m=r((()=>s.open({})),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[i?.name&&n?.branches?.visible?o(Ux,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:Du(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Ux,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(hx,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Gx=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const l=ih(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:l,className:a,role:"menuitem",children:o(Ux,{...i,children:n})})})),Xx=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:i,headerData:r,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),y={rootRef:f},b=l((()=>e.map(((e,t)=>e=>{p(e?Jx(t):Qx(t))}))),[e]),{dataFooter:x,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Zm,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-40 pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(Gx,{className:h-1<n?"invisible":"",active:e===t,observerOptions:y,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(vx,{className:"mx-xs rounded-md shadow-blue-gray",items:g,activeItem:t,ariaLabel:n}):null,o(Yx,{version:i,className:"ml-auto",search:d,navigationItems:e,...r})]})})),Jx=e=>t=>Math.max(t,e+1),Qx=e=>t=>Math.min(t,e),Zx={"bg-white":"primary",transparent:"transparent"},ev=["all","header"],tv=Kt((({className:e,bgColor:t="bg-white",logo:n={},version:a=Zx[t],portal:i,header:r={},...l})=>{const{common:s,navigation:d}=av(l?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=cx(m),{internetBankButton:f}=i||{},y=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:a,...l,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Xx,{activeTopItem:p,navigationItems:m?.filter(bb(ev)),version:a,headerData:{...r,...d},search:s.search,bgColor:t,logo:y})}),o("div",{className:u("mt-s h-px bg-main-divider",nv(a))}),p?.items?.length&&o(Px,{subItems:p?.items?.filter(bb(ev)),version:a,internetBankButton:f})]})})})),nv=e=>"transparent"===e?"opacity-30":"",av=e=>({navigation:e?.navigation??{},common:e?.common??{}}),iv=Kt((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l,...s})=>o(g,{className:u("relative","grid grid-cols-12",ex[n],e),padding:t,version:i,isTheme:r,...s,children:D({...s,extraProps:{...Zb(a),className:th(l)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),rv=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",tp[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),lv=["байт","Кб","Мб","Гб","Тб","Пб"],sv=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",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,...ve(r),children:[e,t?c(ze,{size:"text-l",font:"font-light",children:[t," ",ov(d,m),o(ze,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),ov=(e,t)=>e||t?o("span",{children:", "}):"",cv=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="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))} ${lv[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?mv(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(sv,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:dv(t),data:n?.data}),o(Fe,{__html:n?.__html})]},String(a))},dv=e=>e?o(ie,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,mv=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},uv=d((({href:e,__html:t,target:n,onClose:a})=>c(zn,{maxWidth:"lg",onClose:a,children:[t?o(Fe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(si,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Mn,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),hv=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=pn(uv),s=r((()=>l({__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:[dv(i),o(ze,{font:"font-light",children:e})]}):null})),pv={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},gv=Kt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const 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"===l?"@md:grid-cols-2":"grid-cols-1",pv[l]),role:"list",children:i.map(fv(d,r))}):null]})})),fv=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?yv(t)(n,a):cv(e,t)(n,a)},yv=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(hv,{...a,icon:e,href:bv(t)?t?.href:t?.attachment?.src}),o(Fe,{__html:t?.__html})]},String(n)):null},bv=e=>"href"in e,xv=Kt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const y="secondary"===p?"p-m min-w-32":"min-w-24",b=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Oe,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Ke(a,{className:"flex-wrap"}),children:[i?o(ze,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Fe,{__html:l,itemSize:"list-m"}):null,o(ze,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),vv="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Nv=["workingSaturday","premiumService","privateBanking","remoteWorkplace","serviceDisabledPeople","transferringDataToBiometricSystem"],wv=["sellingCoins","buyingCoins","bullionOperations","preciousMetalsOperations"],Cv=["barrierFree","equippedWithRamp","equippedWithLift","equippedWithElevator","equippedWithStairclimber","hasHelpMeButton"],Sv=d((({filters:e=[],field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=e.map((e=>o(ba,{text:i[e],...t(e)},e))),[l,s,d]=kv({onlyOffice:a,filtersCheckbox:r}),[m,{toggle:u}]=nn(!1);return o("div",{children:e?.length?o("div",{children:c(ro,{children:[o("div",{children:o("div",{className:vv,children:l})}),c("div",{className:"flex space-x-lg pb-2xl",children:[a?o(io,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Mn,{embedded:!0,onClick:n,children:[o(Al,{children:"Очистить фильтр"}),o(Y,{name:"CloseIcon",size:"small"})]})]}),o("div",{children:c(lo,{isUnfolded:m,children:[Rv("Драгоценные металлы",s),Rv("Специальные возможности",d)]})})]})}):null})})),kv=({onlyOffice:e=!1,filtersCheckbox:t=[]})=>e?Iv(t):Tv(t),Iv=e=>{const t=[],n=[],a=[];for(const i of e)Nv.includes(i.key)&&t.push(i),wv.includes(i.key)&&n.push(i),Cv.includes(i.key)&&a.push(i);return[t,n,a]},Tv=e=>[e.slice(0,6),e.slice(6)],Rv=(e,t=[])=>o("div",{children:t.length>0?c("div",{className:"space-y-s",children:[o(ze,{children:e}),o("div",{className:vv,children:t})]}):null}),Ev=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Dv=(e,t,n)=>{const a=Ev("all"===t),i=Ev("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(Mn,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(Mn,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},_v=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Fe,{__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(Ov)}):null]}):null,Ov=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(ze,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),Pv=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(ze,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,Bv=()=>{},Mv=e=>"all"===e?"block":"hidden",Av=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=Bv,renderRemoteWorkplaceCard:l=Bv,getBalloon:s=Bv,initFilterState:d=Do,getBalloonRemoteWorkplaces:m=Bv,descriptionData:h,title:p})=>{const g=p?.includes("Офис"),[f,{field:y,reset:b}]=dn(d),{filteredItems:x,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=Mo({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,S]=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 grid gap-xl",children:[Pv(p,w),h?_v(h):null,g&&Dv(t,C,S),o("div",{className:u("pb-3xl",Mv(C)),children:o(Sv,{filters:Fv([...t,...i]),field:{field:y,reset:b},onlyOffice:g,labels:_o})})]}),o("div",{className:"h-[600px]",children:o(Fo,{children:o(Go,{points:v,isLoad:n,className:"h-full"})})})]}),c(Fo,{children:[x.map(r),N.map(l)]})]})})),Fv=e=>Object.keys(Do).filter((t=>e.filter((e=>Oo[t](e))).length)),Lv=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",zv=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:Lv(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:Lv(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(xo,{color:"green",children:Lv(s)})})]}),o(so,{children:o(no,{className:"flex-wrap",children:m?.map(((e,t)=>o(Qs,{...e},String(t))))})})]},String(d))},Vv=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Lv(t)} №${n}`,body:e.toUpperCase()}),$v=[];const jv=async e=>{const t=await zt(e,{method:"GET"});return Array.isArray(t)?t:$v},Wv={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},qv=d((({descriptionData:e,className:t})=>{const n=zy(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=yi(`${$a}/atms?regionCode=${e}`,jv);return{data:t||$v,isLoad:!t&&!n}}(a);return o(Av,{className:t,data:i,isLoad:r,initFilterState:Wv,renderCard:zv,getBalloon:Vv,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Uv=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(ze,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e})]}):null]})}),o(so,{children:Hv(t)})]},String(n)):null,Hv=e=>c("div",{children:[c(no,{className:"flex",children:[o(Qs,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Qs,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание банковских карт"})}),o(Qs,{label:"Операции для физических лиц",children:o(ze,{children:"Инвестиционное и накопительное страхование"})}),o(Qs,{label:"Операции для физических лиц",children:o(ze,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Qs,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]}),Kv=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Yv={branches:[],remoteWorkplaces:[]};const Gv=async e=>await zt(e,{method:"GET"})||Yv,Xv=d((({className:e})=>{const t=zy(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=yi(`${$a}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Gv);return{data:t||Yv,isLoad:!t&&!n}}(n);return o(Av,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:To,renderRemoteWorkplaceCard:Uv,getBalloon:Eo,getBalloonRemoteWorkplaces:Kv,title:`Офисы филиала ${t?.name}`})})),Jv=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(Xv,{}):o(qv,{descriptionData:e})})})),Qv=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Fe,{__html:t,richVersion:n})})})),Zv=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",eN=Kt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Ee(),[m,{toggle:h}]=nn(t),p=o(lo,{className:u("gap-lg",Zv(d)),isUnfolded:m,children:D({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(io,{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:l,...s,children:c(ro,{children:[n?y:p,n?p:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),tN=e=>e<4?"w-72":"w-52",nN={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"},aN=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:i=[],stepVersion:r="gray",title:l,version:s="primary",...d})=>{const m=i.length>3,h=nN,p=(e=>e?"":"opacity-0")(a),f=Ee();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(S,{headlineVersion:"S",title:l,description:n,isEmbedded:!0,className:"w-full",align:Hh(f)}),i?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:_h(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(iN(h,m,r)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:i.map((y={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:i}=y,{label:r,description:l,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",tN(n.length)),children:[c("div",{className:"space-y-xs",children:[r?o(ze,{size:"text-h6",align:"text-center",children:r}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[l?o("div",{className:a.description,children:l}):null,o(Fe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ke,{className:"box-border py-s w-full mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,Ke(e)]});var y})),iN=(e,t,n)=>({icon:a},i)=>{const r="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${rN(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:He(a)?o(ie,{image:{...a,iconVersion:a?.iconVersion||r},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(l=n,"secondary"===l?"group-data-primary:text-white":"text-secondary-text")),children:i+1})},String(i));var l},rN=e=>e?"h-16 w-16":"h-24 w-24",lN=d((()=>o("div",{className:"hidden",role:"none"}))),sN={primary:"bg-white/30",secondary:"bg-main-divider"},oN={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},cN=d((({count:e,version:t="secondary"})=>{const n=Ee(),a=n?"bg-main-divider":sN[t],i=oN[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(ze,{size:"text-xs",color:i,children:e})})})),dN=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(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",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},mN={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},uN={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},hN={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},pN={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},gN=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:h,...p}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer","rounded-none",mN[a],n?pN[a]:hN[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?uN[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[dN({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(cN,{count:m,version:Ev(n,a)})}):null]})})})),fN=d((e=>o(e?.item?.href?yN:bN,{...e}))),yN=d((e=>{const t=be(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(gN,{...e,tag:"a",item:i,onClick:a})})),bN=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(gN,{item:e,onClick:a,...n})})),xN="hidden sm:flex absolute z-40",vN={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},NN=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=fh({itemCount:t?.length||0});return i((()=>wN(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(oh,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:vN[r].item,gap:vN[r].gap,children:t.map((d=n,m=a,h=r,(e,t)=>o(fN,{isActive:e===d,onClick:m,type:h,item:e},String(t))))}),s.canScrollLeft?o(Nh,{wcmsIgnore:!0,className:u("left-6",xN,vN[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(wh,{wcmsIgnore:!0,className:u("right-6",xN,vN[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,h})),wN=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},CN={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},SN=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(CN[t].wrapper,e),children:o(NN,{className:CN[t].component,tabsType:t,...n})}):null,kN="sticky top-1 z-20",IN=Kt((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=RN(n||{}),h=_(),p=ss(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),b=_N(m),x=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,v=x.findIndex((e=>Boolean(e?.selected))),N=x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===b)),w=b?N:v,[C,S]=a(TN(w)),k=x[C],I=DN(x[C],C),T=r((e=>{const t=x.indexOf(e),n=x[t];S(t),"group"===n.type&&((e,t)=>{e.text?y.set(m,e?.tabName??String(t)):y.delete(m),h.replace(`${h.pathname}?${y}`,{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({[kN]:[s,f,!p].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[SN({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[kN]:[s,!f,!p].every(Boolean)}),items:EN(t,x),activeItem:k,tabsType:i,onChange:T}),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])=>E(t,{...d?.options,slotName:I,parent:n,extraProps:{className:e===I?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(DN)?.filter(Boolean)||[]}),TN=e=>e&&-1!==e?e:0,RN=({__id:e,anchor:t})=>t??e??"tabs",EN=(e,t)=>t?.length?t:e,DN=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",_N=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),ON=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),PN={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},BN=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:PN[t],children:e})}))),MN=d((({className:e="",isOpen:t,onClick:n})=>o(io,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),AN=e=>e?o("div",{children:o(ze,{size:"text-h6",children:e})}):null,FN=e=>e?o("div",{className:"text-l font-light",children:o(ze,{color:"text-secondary-text",children:e})}):null,LN=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Fe,{__html:e,isDotted:t,itemSize:"list-m"})}):null,zN=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(MN,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[AN(e),FN(t),LN({__html:n,isDotted:a}),Ke(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),VN=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:r})=>n||a?c("div",{children:[n?o(Nh,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(wh,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:r}):null]}):null,$N=(e,t)=>140*Bb(e.slice(0,t).map((e=>e?.cols?.length??1))),jN=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(ze,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,WN=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,i]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[l,s]=a(t),o=r((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=r((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&l<n-i:l<n-1,m=l>0;return[l,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((l=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(ze,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${$N(a,l)}px)`},children:a?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(ze,{size:"text-xl",children:e.data}):null,e?.cols?jN(e.cols,l):null]},`row${t}`)))})})]},String(t))})),VN({...i,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var l})),qN=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 px-m bg-white @4xl:bg-gray relative",children:o(ze,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(WN,{rows:t.rowsData})})})]},a)}))}))),UN=(e=!1)=>""+(e?"text-white":"text-secondary-text"),HN=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(ze,{size:"text-xl",font:"font-light",color:UN(t===n),children:e||t+1})},e)))}):null,t?o(ke,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),KN=Kt((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(HN,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(qN,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(ze,{size:"text-h6",children:"Данных нет"})})})),YN=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl","border-main-divider lg:border-b w-full py-s lg:py-xl"),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(KN,{...t,onClick:n})}):null]}))),GN=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(YN,{tableInner:i,...n,children:[ON(e),t?.length?o(BN,{version:"tariff",children:t.map(((e,t)=>o(zN,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),XN=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),JN=Kt((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o(GN,{row:e,...l},String(t)))),[h,p]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=nn(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(ro,{children:[c(XN,{children:[h,o(lo,{isUnfolded:f,isOverflowVisible:!0,children:p})]}),o(io,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(XN,{children:m})})]})})),QN=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?ZN():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(ze,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ew(n):null,i?o(Fe,{richVersion:r,__html:i}):null]})]}))),ZN=()=>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"}),ew=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),tw=Kt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!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(${Z(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:D({...c,extraProps:{className:u("w-full",th(l)),...Zb(a)}})})}),{childrenTypes:[]}),nw=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(9),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",aw=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const r=_();return c(g,{className:e,defaultPadding:nw(e),...i,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:q(r)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:q(r)(n)})}):null]})})),iw={AdTile:Gt,ApplicationForm:Yl,BankAccountFiltration:qh,BenefitsBlock:Gh,BonusBenefitsBlock:ep,ButtonsBlock:np,CalculatorBonus:cp,CalculatorBusinessDeposit:xp,CalculatorCredit:od,CalculatorDeposit:jp,CalculatorRefinancing:Qp,CardTransfer:sg,Carousel:gg,CarouselCatalogCard:bg,CarouselRecommendationCard:kg,CarouselTariffsCard:Eg,ContactsBlock:qg,DepositFiltration:Py,ErrorBlock:Fy,Footer:Qb,GalleryLayout:ax,ExchangeRateTile:pb,GrantSupport:ox,Header:tv,Headline:S,HorizontalLayout:iv,ImgBlock:rv,LinkDocs:gv,MobileAppTile:xv,OfficesAtmsMap:Jv,ProductBlock:Yt,RichTextBlock:Qv,RollupItem:eN,StepsBlock:aN,StickyBottomMenu:lN,TabsLayout:IN,TariffsTable:JN,TextBlock:QN,VerticalLayout:tw,Video:aw,ApplicationLeadForm:Yu,CreditCardForm:Vf,CreditForm:sy,DebitForm:Ry,CashbackCalculator:$g},rw=me((()=>{i((()=>{Zt()}),[]);const e=tn();Un(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");ti({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),lw="cookie",sw=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=nn();_b((()=>{globalThis.localStorage?.getItem(lw)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(lw,"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(Fe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(An,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function ow(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);Un(globalThis.document,"keydown",t)}function cw(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 dw=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return cw(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},mw=d((()=>{const[e,{close:t}]=dw(),n=Boolean(e.length);return ow(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})),uw=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return cw(pe.observable,"popup",{open:t,close:n}),ow(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})),hw="header",pw="footer",gw="sticky-footer",fw={},yw=d((({className:e,data:t=fw,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=Ut(s,l),m=ss();rw(),Vy();const h={key:"",page:{slots:i,blocks:r,fallback:l,...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?.[hw]?.length?o("div",{className:u({hidden:m},"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]"),children:E(i?.[hw],{...h,slotName:hw})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:h,extraProps:{className:"scroll-mt-12"}}),!m&&E(i?.[pw],{...h,slotName:pw})]})]}),i?.[gw]?.length?o("div",{className:u({hidden:m},"fixed w-full bottom-0 left-0 z-[100]"),children:E(i?.[gw],{...h,slotName:gw})}):null,o(mw,{}),o(uw,{}),m?null:o(sw,{__html:d?.cookieContent?.__html})]})}));Object.assign(yw,{childrenTypes:[],slots:()=>[hw,pw,gw]});e.Blocks=iw,e.ContentPage=yw,e.handlerDecorator=me,e.joinList=_h,e.locationNavigator=Jt,e.packageVersion="0.14.952",e.projectSettings=P,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=_,Object.defineProperty(e,"__esModule",{value:!0})}));
|